1. Automatic Construction of Formal Syntax Tree Based on Regular Expressions.
- Author
-
Zafar, Nazir Ahmad
- Subjects
TREE graphs ,FORMAL languages ,AUTOMATION ,COMPUTATIONAL complexity ,SOURCE code ,SOFTWARE verification ,CODING theory ,SYNTAX (Grammar) - Abstract
The main functionality of a compiler is to translate source code to an executable machine code correctly and efficiently. Compiler construction is an advanced research area due to size and complexity of the code generated from the source program. Design and construction of error-free and verified compiler will remain a challenge of the current century. Verification of a source program does not assure that the generated code is correct because the compiler may lead to an incorrect target program due to bugs and errors in itself. Hence verification of a compiler is more important than verifying the source program. Lexical analyzer is a main part of compiler used for scanning input stream of characters and grouping into tokens. In this paper, formal construction of syntax tree is described directly from the regular expression to verify the lexical analyzer. At first, augmented regular expression is described then an abstract syntax tree is defined based on the regular expression. Finally formal description of some important operators checking null-ability and computing first and last positions of the internal nodes of the tree are formalized. The specification is described using Z notation then validated using Z/Eves toolset. Formal model is analyzed using powerful techniques of reduction and rewriting available in the Z/Eves toolset. [ABSTRACT FROM AUTHOR]
- Published
- 2012