at.dms.compiler
Class Parser

java.lang.Object
  |
  +--antlr.Parser
        |
        +--antlr.LLkParser
              |
              +--at.dms.compiler.Parser

public abstract class Parser
extends antlr.LLkParser

This class describes the capabilities of parsers.


Fields inherited from class antlr.LLkParser
k
 
Fields inherited from class antlr.Parser
astFactory, inputState, returnAST, tokenNames, traceDepth
 
Constructor Summary
protected Parser(Compiler compiler, Scanner scanner, int lookahead)
          Constructs a new parser instance.
 
Method Summary
 PositionedError beautifyParseError(antlr.RecognitionException 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  java.util.List 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 antlr.LLkParser
consume, LA, LT, traceIn, traceOut
 
Methods inherited from class antlr.Parser
addMessageListener, addParserListener, addParserMatchListener, addParserTokenListener, addSemanticPredicateListener, addSyntacticPredicateListener, addTraceListener, consumeUntil, consumeUntil, defaultDebuggingSetup, getAST, getASTFactory, getFilename, getInputState, getTokenName, getTokenNames, isDebugMode, mark, match, match, matchNot, panic, removeMessageListener, removeParserListener, removeParserMatchListener, removeParserTokenListener, removeSemanticPredicateListener, removeSyntacticPredicateListener, removeTraceListener, reportError, reportError, reportWarning, rewind, setASTFactory, setASTNodeClass, setASTNodeType, setDebugMode, setFilename, setIgnoreInvalidDebugCalls, setInputState, setTokenBuffer, traceIndent
 
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 java.util.List 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:
error - the error to report

beautifyParseError

public PositionedError beautifyParseError(antlr.RecognitionException e)
Generate an human readable error message