CPSC 411 - Lab Notes - 02-12 (Grammars, cont'd)

In this lab, we transformed the grammar and determined it was not LL(1) by filling out the predictive parsing table.

As discussed in this and the previous lab, I have prepared a python example that will read in a grammar definition file and print out the nullable, first and follow set calculations.

Download the file pygrammar.tgz if you wish to try it out. Run it with the command:

               python grammar.py <somegrmmr.grm | more

(You will need to put both lex.py and yacc.py from http://systems.cs.uchicago.edu/ply either in the same directory or in your PYTHONPATH.)

You may also view the documented version at pygrammar.pdf

Last modified by Brett Giles
Last modified: Fri Feb 28 12:46:24 MST 2003

Valid XHTML 1.0!