|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectparser.DynamicParserFactory
public class DynamicParserFactory
This class takes a filename of a JavaCup-file and creates a Parser from it
| Constructor Summary | |
|---|---|
DynamicParserFactory(java.lang.String filename)
|
|
| Method Summary | |
|---|---|
static void |
cleanup()
|
void |
debug_parse()
|
boolean |
errorsDuringParse()
After parsing, the return value of this method will be valid. |
java.lang.String |
getDumpedAST()
Returns the AST from the parse as dumped into a string. |
Program |
getResultAST()
|
void |
parse()
After setting the lexer, this parse() is the command to parse the stream coming from the lexer, debug_parse() does so in debug mode. |
void |
semant()
Runs the semantic checker on the AST accessible by getResultAST(). |
void |
setLexer(CoolTokenLexer lexer)
This method is used to specify the input to the parser. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DynamicParserFactory(java.lang.String filename)
throws java.lang.Exception
filename - --
JavaCup specification file
java.lang.Exception| Method Detail |
|---|
public static void cleanup()
public void setLexer(CoolTokenLexer lexer)
ParserFactory
setLexer in interface ParserFactorylexer - -- input to parser
public void parse()
throws java.lang.Exception
ParserFactory
parse in interface ParserFactoryjava.lang.Exception - -- if unrecoverable exception occured during parsing.
public void debug_parse()
throws java.lang.Exception
debug_parse in interface ParserFactoryjava.lang.Exceptionpublic boolean errorsDuringParse()
ParserFactory
errorsDuringParse in interface ParserFactorypublic Program getResultAST()
getResultAST in interface ParserFactory
public void semant()
throws SemanticError
ParserFactory
semant in interface ParserFactorySemanticErrorpublic java.lang.String getDumpedAST()
ParserFactory
getDumpedAST in interface ParserFactory
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||