csheets.core.formula.compiler
Class FormulaParser

java.lang.Object
  extended by antlr.Parser
      extended by antlr.LLkParser
          extended by csheets.core.formula.compiler.FormulaParser
All Implemented Interfaces:
FormulaParserTokenTypes

public class FormulaParser
extends antlr.LLkParser
implements FormulaParserTokenTypes

A parser that generates expressions from lists of lexical tokens.

Author:
Einar Pehrson

Field Summary
static String[] _tokenNames
           
 
Fields inherited from class antlr.Parser
astFactory, inputState, returnAST, tokenNames, tokenTypeToASTClassMap, traceDepth
 
Fields inherited from interface csheets.core.formula.compiler.FormulaParserTokenTypes
ABS, ALPHABETICAL, AMP, CELL_REF, COLON, COMMA, DIGIT, DIV, EOF, EQ, EXCL, FUNCTION, GT, GTEQ, LETTER, LPAR, LT, LTEQ, MINUS, MULTI, NAME, NEQ, NULL_TREE_LOOKAHEAD, NUMBER, PERCENT, PLUS, POWER, QUOT, RPAR, SEMI, STRING, WS
 
Constructor Summary
  FormulaParser(antlr.ParserSharedInputState state)
           
  FormulaParser(antlr.TokenBuffer tokenBuf)
           
protected FormulaParser(antlr.TokenBuffer tokenBuf, int k)
           
  FormulaParser(antlr.TokenStream lexer)
           
protected FormulaParser(antlr.TokenStream lexer, int k)
           
 
Method Summary
 void arithmetic_high()
           
 void arithmetic_highest()
           
 void arithmetic_low()
           
 void arithmetic_lowest()
           
 void arithmetic_medium()
           
 void atom()
           
protected  void buildTokenTypeASTClassMap()
           
 void comparison()
           
 void concatenation()
           
 void expression()
          The start rule for formula expressions.
 void function_call()
           
 void literal()
           
 void reference()
           
 
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, getTokenTypeToASTClassMap, isDebugMode, mark, match, match, matchNot, panic, recover, 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
 

Field Detail

_tokenNames

public static final String[] _tokenNames
Constructor Detail

FormulaParser

protected FormulaParser(antlr.TokenBuffer tokenBuf,
                        int k)

FormulaParser

public FormulaParser(antlr.TokenBuffer tokenBuf)

FormulaParser

protected FormulaParser(antlr.TokenStream lexer,
                        int k)

FormulaParser

public FormulaParser(antlr.TokenStream lexer)

FormulaParser

public FormulaParser(antlr.ParserSharedInputState state)
Method Detail

expression

public final void expression()
                      throws antlr.RecognitionException,
                             antlr.TokenStreamException
The start rule for formula expressions.

Throws:
antlr.RecognitionException
antlr.TokenStreamException

comparison

public final void comparison()
                      throws antlr.RecognitionException,
                             antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.TokenStreamException

concatenation

public final void concatenation()
                         throws antlr.RecognitionException,
                                antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.TokenStreamException

arithmetic_lowest

public final void arithmetic_lowest()
                             throws antlr.RecognitionException,
                                    antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.TokenStreamException

arithmetic_low

public final void arithmetic_low()
                          throws antlr.RecognitionException,
                                 antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.TokenStreamException

arithmetic_medium

public final void arithmetic_medium()
                             throws antlr.RecognitionException,
                                    antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.TokenStreamException

arithmetic_high

public final void arithmetic_high()
                           throws antlr.RecognitionException,
                                  antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.TokenStreamException

arithmetic_highest

public final void arithmetic_highest()
                              throws antlr.RecognitionException,
                                     antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.TokenStreamException

atom

public final void atom()
                throws antlr.RecognitionException,
                       antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.TokenStreamException

function_call

public final void function_call()
                         throws antlr.RecognitionException,
                                antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.TokenStreamException

reference

public final void reference()
                     throws antlr.RecognitionException,
                            antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.TokenStreamException

literal

public final void literal()
                   throws antlr.RecognitionException,
                          antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.TokenStreamException

buildTokenTypeASTClassMap

protected void buildTokenTypeASTClassMap()