Class J2P
java.lang.Object
J2P
public class J2P
- extends java.lang.Object
This class is an entry point to the minijava-to-piglet translator
functionality testing unit. The program's interface is as required by
Homework 3 specification.
Sample usage (where input
is a file containing the input
expression string):
java J2P < input
The driver program first parses the source file to create an abstract
syntax tree. A SymbolTableBuilder
then visits the
tree to build a symbol table. This symbol table, in turn, is referenced
by a TypeChecker
visitor as it traverses statements
and expressions in the syntax tree and applies type checking constraints and
rules to it.
Finally, a PigletTranslator
visitor
then visits the AST again and generates along the way a translated Piglet
AST. A formatter and dumper visitors then visit this Piglet AST and
pretty-print the resulting Piglet code to standard output. The output of the
program is a formatted Piglet code.
- Author:
- Santoso Wijaya
- See Also:
SymbolTableBuilder
,
PigletTranslator
Constructor Summary |
J2P()
|
Method Summary |
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
J2P
public J2P()
main
public static void main(java.lang.String[] args)
throws java.io.IOException,
ParseException,
TypeException
- Throws:
java.io.IOException
ParseException
TypeException