Index of /~csci410/espresso/examples/aFewParserSubsets
Name Last modified Size Description
Parent Directory 20-Sep-2006 10:43 -
Test.esp 21-Sep-2005 09:37 1k
Test2.esp 21-Sep-2005 12:42 1k
TestB.esp 13-Feb-2006 10:40 1k
Test3.esp 21-Sep-2005 12:46 1k
TestC.esp 21-Sep-2005 12:45 1k
Test4.esp 13-Feb-2006 10:29 1k
Here are a few example espresso programs which only test small subsets
of the grammar. You could add pieces of the grammar incrementally
which would work on each of these subsets one by one. E.g., you
compile and run a bison-produced parser that works on Test2.esp
*before* you add any code to do anything else. These are not a
complete set of subsets you might use, but only show a few constructs
you can add in your first few go-arounds. Also, for each subset you
build you will probably want multiple test files. E.g., for the empty-
classes subset you would want to test it on Test.esp (0 classes),
Test2,esp (>1 class), and also on a file that has exactly 1 class in
it (not counting the main class).
I showed two possible development paths you could go down here,
assuming we're starting with the code we already gave you to recognize
a main class with an empty main body.
TestB and TestC go down the path of adding stuff to the inside of a method
first.
Test2-4 go down the path of adding more classes and fields and empty methods
first.
All of these except Test4.esp should also work with your final parser
(see comments in Test4.esp for details).