A syntax analysis and manipulation tool
Abstract
A software system for analysing and manipulating an LL(1) grammar of a programming language is described. An extended form of BNF notation is presented for the specification of the syntax. The transformations which can be performed upon the defined grammar are described. The system is particularly designed for the processing of LL(1) grammars, although many of the analysis and manipulation functions will be applicable to a wide range of grammar types. The software system (called LL1) performs various transformations upon the input grammar; to translate it into standard BNF, to remove useless productions and direct left recursion, and to attempt to arrive at an LL(1) definition. LL1 also provides various analyses of the grammar and will output the final syntax in human/machine readable form. A facility is provided to generate a recursive descent parser, incorporating a simple lexical analyser, which will recognise valid sentences of the defined language. A justification for these transformations and analyses is given and this is put in the context of the overall language design process. A definition and description of LL(1) grammars and the recursive descent compiling technique is made together with a description of the structure and operation of LL1.
Type
Thesis, MSc Master of Science
Collections
Items in the St Andrews Research Repository are protected by copyright, with all rights reserved, unless otherwise indicated.