Author : Andrew J. Miller
Publisher :
ISBN 13 :
Total Pages : 308 pages
Book Rating : 4.:/5 (614 download)
Book Synopsis Constructing a Compiler Using the UNIX Tools Lex and Yacc by : Andrew J. Miller
Download or read book Constructing a Compiler Using the UNIX Tools Lex and Yacc written by Andrew J. Miller and published by . This book was released on 1996 with total page 308 pages. Available in PDF, EPUB and Kindle. Book excerpt: "The project described in this paper concentrates on how to design a compiler using the UNIX tools lex and yacc. In particular, this compiler is used to translate the NPM programming language into assembly code for an IBM PC. This assembly code is then shipped to the IBM PC and compiled to create a DOS executable file. Lex creates a lexical analyzer in 'C' using regular expressions to describe the tokens of the language. Similarly, yacc creates a parser in 'C' using the syntax of the language which needs to be in Backus-Naur Form, a context free grammar. The parser created by yacc is a shift-reduce parser which is based on the bottom-up parsing method. This project will show how lex and yacc are used to help automate the lexical analysis phase and the syntactical analysis phase of the NPM compiler that was designed in the class, 'Compiler Design.' In addition, the paper explains what regular expressions are and how a shift-reduce parser works, which are necessary to understand the usage of lex and yacc."--Author's abstract.