Previous    Next

TOOLS AND SOFTWARE

Two of the most useful abstractions used in modern compilers are contextfree grammars, for parsing, and regular expressions, for lexical analysis. To make the best use of these abstractions it is helpful to have special tools, such as Yacc (which converts a grammar into a parsing program) and Lex (which converts a declarative specification into a lexical-analysis program). Fortunately, such tools are available for Java, and the project described in this tutorial makes use of them. The coding projects in this tutorial can be compiled using any Java compiler. The parser generators JavaCC and SableCC are freely available on the Internet; for information see the World Wide Web page

http://uk.cambridge.org/resources/052182060X (outside North America);

http://us.cambridge.org/titles/052182060X.html (within North America).

Source code for some modules of the MiniJava compiler, skeleton source code and support code for some of the coding exercises, example MiniJava programs, and other useful files are also available from the same Web address. The coding exercises in this tutorial refer to this directory as $MINIJAVA/ when referring to specific subdirectories and files contained therein.


JaVaScreenshot Previous    Next
Comments