University Final Year Project

 

Contents

  1. Background
  2. Documentation
  3. Source Code
  4. Demonstration
 

Background

All information is taken from the website that used to contain my final year project. Unfortunately some files have been lost or corrupted. I have provided this new index page to provide links to the most important documents. I have not attempted to correct any problems with the original pages.

Most of the following information in this section is original.

Welcome to my Third Year Computer Science Project. My project is the design and implementation of a Generic Source Code Formatter.

What this actually involves is writing an interpreted version of lex and yacc or JavaCC; that is one of these packages/package which instead of producing C or Java code produces an LR1 parse table which can then be used by my driver routine and combined with embedded instrcutions in the grammar, before the source code is applied to the grammar, via. the parse table.

A better overview might be found in my Summary Document. There is also a document on the structure of the project and the tasks that different packages have to perform

 

 

Documentation

The documentation is available as either a complete MS Word document with appendixes (appendix 1, appendix 2, appendix 3 and appendix 4) or as a set of PostScript documents:

Title Page

The title page of the Report

Chapter 1: Preface

The Preface

Chapter 2: Introduction

This chapter contains information required to read the report as well as background and motivational material. It is intended that this section be read before continuing with the rest of the report.

Chapter 3: Methodology

This chapter examines the methodology that will be used in the analysis, design, implementation, and testing of this project together with the justification of these selections.

Chapter 4: Analysis

This section contains a detailed analysis of the aims of the project and presents a precise specification of the problem and the solution. This chapter looks carefully at similar packages and outlines the differences.

Chapter 5: Design

This chapter is a necessary prerequisite for the following six chapters. It outlines the modular approach taking the decomposition of the project into a number of smaller packages. It also examines the use of Java as the language of choice for the implementation and the use of JavaCC as an important tool in the development.

The precise order of reading of the following four chapters is not important, though the order they are presented in is the order in which they were actually designed, implemented and tested. Accordingly is recommended that they be read in the given order, though this is not strictly necessary. Where the reader already has a detailed knowledge of the topic being discussed the chapter may be skipped, though the Summary section of each should be read, as a bare minimum to associate the reader with any acronyms used or particular problems raised by this project.

Chapter 6: The Lexical Analyser

Examines the design, implementation, and testing of the lexical analyser.

Chapter 7: The LR1 Parser Generator

Examines the design, implementation, and testing of the LR1 parser generator.

Chapter 8: The Syntax Analyser

Examines the design, implementation, and testing of the syntax analyser.

Chapter 9: The Action Language

Examines the design, implementation, and testing of the action language. Includes information it its place as the language of the Embedded Action language and as the Language used as the output Definition language. The previous chapter is a prerequisite for this chapter.

Chapter 10: The Output Section

Examines the method best used to convert the output format independent output of the previous sections into a format dependant format, such as HTML, LaTeX or plain text.

Chapter 11: The Interface

Examines the design, implementation, and testing of the interface.

Chapter 12: The Complete Package

As the different sections were drawn together as they were developed this sections only contains the briefest overview of the completed project together with details of the form of this finished project, i.e. a JAR containing an Applet and an Application. Although each section was unit tested when it was implemented this section also contains some additional information on the testing of the completed project.

Chapter 13: Review

This section reviews the implementation of the project. Many of the points raised here will be discussed in more detail under Extensions.

Chapter 14: Conclusions and Extensions

This chapter focuses on the project as a whole and draws together conclusions arrived at from each stage in the process. This chapter also discusses any future enhancements, improvements or extensions that could be made to this project.

Chapter 15: User Manual

This chapter contains the user manual for the finished application.

Chapter 16: Glossary

A list of terms used in this project.

Chapter 17: Bibliography and References

A list of books and other sources of information used in the construction of this project, together with related projects and references.

Chapter 18: Acknowledgements

This section details all those who have helped and contributed.

The Appendixes currently seem to be missing from my collection of files.

 

Source Code

The source code can be downloaded from this JAR.
 
 

Demonstration

The 'load from server' feature currently doesn't work. As an alternative please use these files to fill in information as requested by the wizard:

SCDL

Use the enter SCDL option and then use one of the files below (I recommend PL0) to provide the input. Make sure it copied correctly with a single return at the end of the document. Use next to continue.

ODL

Use the enter ODL option and then use one of the files below (I recommend 'indent using plain text') to provide the input. Make sure it copied correctly with a single return at the end of the document. Use next to continue.

Choose 'next' and then 'real time' before entering any text that conforms to the chosen grammar.

Examples

For example if the grammar was calc then:

(100*5-6*7)/4

or if it was PL0 then:

const m = 45;
var X, Z;

procedure messyGCD(x,y; var z);
var f,g;
begin
f:=x;
g:=y;
while f<>g do
begin
if f<g then g:=g- f;
if g<f then f:=f-g;
end;
z:=f;
end;

begin
X:=84; call messyGCD(X,m,Z);
call writeln(X,m,Z)
end.

You do not have the Java support required to run this applet

 

Page created by Leo Crawford
last updated in December 2001