at.dms.compiler.tools.antlr.extra
Class Parser

java.lang.Object
  extended by at.dms.compiler.tools.antlr.runtime.Parser
      extended by at.dms.compiler.tools.antlr.runtime.LLkParser
          extended by at.dms.compiler.tools.antlr.extra.Parser

public abstract class Parser
extends LLkParser

This class describes the capabilities of parsers.


Field Summary
 
Fields inherited from class at.dms.compiler.tools.antlr.runtime.Parser
inputState, tokenNames
 
Constructor Summary
protected Parser(Compiler compiler, Scanner scanner, int lookahead)
          Constructs a new parser instance.
 
Method Summary
 PositionedError beautifyParseError(ParserException e)
          Generate an human readable error message
protected  TokenReference buildTokenReference()
          Returns a reference to the current position in the source file.
 InputBuffer getBuffer()
          Returns the input buffer.
protected  Vector getComment()
           
 Compiler getCompiler()
          Returns the compiler driver which invoked the parser.
protected  JavadocComment getJavadocComment()
           
protected  JavaStyleComment[] getStatementComment()
           
protected  void reportTrouble(PositionedError trouble)
          Reports that an error has been detected in the lexical analyser.
 
Methods inherited from class at.dms.compiler.tools.antlr.runtime.LLkParser
consume, LA, LT
 
Methods inherited from class at.dms.compiler.tools.antlr.runtime.Parser
consumeUntil, consumeUntil, defaultDebuggingSetup, getFilename, getInputState, getTokenName, getTokenNames, mark, match, match, matchNot, panic, reportError, reportError, reportWarning, rewind, setFilename, setInputState, setTokenBuffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parser

protected Parser(Compiler compiler,
                 Scanner scanner,
                 int lookahead)
Constructs a new parser instance.

Parameters:
compiler - the invoking compiler.
scanner - the token stream generator
lookahead - lookahead
Method Detail

getCompiler

public Compiler getCompiler()
Returns the compiler driver which invoked the parser.


getBuffer

public final InputBuffer getBuffer()
Returns the input buffer.


buildTokenReference

protected final TokenReference buildTokenReference()
Returns a reference to the current position in the source file.


getStatementComment

protected final JavaStyleComment[] getStatementComment()

getJavadocComment

protected final JavadocComment getJavadocComment()

getComment

protected Vector getComment()

reportTrouble

protected final void reportTrouble(PositionedError trouble)
Reports that an error has been detected in the lexical analyser. The handling is delegated to the compiler driver.

Parameters:
trouble - the error to report

beautifyParseError

public PositionedError beautifyParseError(ParserException e)
Generate an human readable error message