Abstract

The need for fast, efficient and simple scanner generator that has the primary responsibility to perform efficiently gave rise to this paper. This is due to the fact that, on daily basis new technologies arise which brings a great improvement on the design of computer architecture. However, attention was given to speed, run time and resource availability of the design machine to be used since lexical analysis has an impact on how the compiler works. This paper seeks to develop a lexical analyzer (scanner generator) automatically by specifying the lexemes patterns to a lexical analyzer generator and compiling those patterns into a code that functions as a lexical analyzer. The scanner accepts characters as input and breaks them down to produce tokens by grouping the characters and not deviating from specifications. The project employs one of the different methods of lexical analyzer generator to perform pattern-matching on text using regular expression over a global character set. The paper shows how input is matched and specifies what to do when a pattern is matched. This was achieved with the use of regular expressions (RE) which were converted to non-deterministic finite automata (NFA) or deterministic finite automata (DFA). The regular expression and the regular grammar were thus joined together mathematically. Various results are presented and further work on micro compilers was proposed. Keyword: Scanner generator, Regular expression, KnitAutoGen, DFA, NFA. DOI : 10.7176/CTI/8-02

Highlights

  • The world revolves around computing and mankind seeks diverse ways to make computation easy

  • The tool does not attempt to implement the whole of the POSIX specification for LEX, the program moves beyond LEX in some areas, such as support for Unicode

  • The scanners produced by gplex are threading safe, in that all scanner state is carried within the scanner instance

Read more

Summary

INTRODUCTION

The world revolves around computing and mankind seeks diverse ways to make computation easy. The first phase of a compiler is called lexical analyzer or scanner. Developing a language scanner generator to accept language and produce output is very important in the design of a compiler because without accepting inputs, tokens will not be produced and that will affect subsequent phase of the complier. This project deals with analyzing the design of a language scanner generator and coming out with a scanner generator that does the same function of the existing lexical analyzers without deviating from the specifications of a reliable and efficient scanner generator. The program we are going to use in the scanner design, will harness the parallel nature of the computer architecture to deliver high performance to other phases of the complier

OVERVIEW OF LEXICAL ANALYZER
Identifier Keywords Constants Delimiters
This becomes
Keywords and operators
CONVERSION FROM REGULAR GRAMMAR TO FINITE AUTOMATA
Conversion of NFA to DFA
CONCLUSION
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call