CS412/413
Introduction to Compilers and Translators
Spring 2001
Cornell University Computer Science Department

LLAnalyze: An LL(1) Grammar Analyzer


To help you in writing an LL grammar, we have developed a tool to analyze a grammar and determine if it is LL(1).

A jar file containing the class files can be downloaded here. Place this jar file in your class path before running the analyzer. LLAnalyze requires JDK 1.2. In the CSUGLAB, use g:\jdk1.2.2\bin\java (NT) or /usr/local/jdk1.2.1 (Solaris).

You can also look at the source code for LLAnalyze. JLex is required to build it.

You can check your grammar with

    java Iota.util.grammar.LLAnalyze < grammar_file

Additional options let you dump the NULLABLE flags and the FIRST and FOLLOW sets for all nonterminals in the grammar.

    java Iota.util.grammar.LLAnalyze [options] < grammar_file
       where options are:
           -dump_grammar   dump the grammar
           -dump_nullable  dump NULLABLE flags for all nonterminals
           -dump_first     dump FIRST sets for all nonterminals
           -dump_follow    dump FOLLOW sets for all nonterminals
           -help           what?