parser
Class SolutionParserFactory

java.lang.Object
  extended by parser.SolutionParserFactory
All Implemented Interfaces:
ParserFactory

public class SolutionParserFactory
extends java.lang.Object
implements ParserFactory

This class works as an interface for the parsing with the solution AST.


Constructor Summary
SolutionParserFactory()
           
 
Method Summary
 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.
 treeNodesSolution.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

SolutionParserFactory

public SolutionParserFactory()
Method Detail

setLexer

public void setLexer(CoolTokenLexer lexer)
Description copied from interface: ParserFactory
This method is used to specify the input to the parser.

Specified by:
setLexer in interface ParserFactory
Parameters:
lexer - -- input to parser

parse

public void parse()
           throws java.lang.Exception
Description copied from interface: ParserFactory
After setting the lexer, this parse() is the command to parse the stream coming from the lexer, debug_parse() does so in debug mode.

Specified by:
parse in interface ParserFactory
Throws:
java.lang.Exception - -- if unrecoverable exception occured during parsing.

debug_parse

public void debug_parse()
                 throws java.lang.Exception
Specified by:
debug_parse in interface ParserFactory
Throws:
java.lang.Exception

errorsDuringParse

public boolean errorsDuringParse()
Description copied from interface: ParserFactory
After parsing, the return value of this method will be valid.

Specified by:
errorsDuringParse in interface ParserFactory

getResultAST

public treeNodesSolution.Program getResultAST()
Specified by:
getResultAST in interface ParserFactory

semant

public void semant()
            throws semanticAnalyzerSolution.SemanticError
Description copied from interface: ParserFactory
Runs the semantic checker on the AST accessible by getResultAST().

Specified by:
semant in interface ParserFactory
Throws:
semanticAnalyzerSolution.SemanticError

getDumpedAST

public java.lang.String getDumpedAST()
Description copied from interface: ParserFactory
Returns the AST from the parse as dumped into a string.

Specified by:
getDumpedAST in interface ParserFactory