Package eu.simuline.relana.parser
Class FormulaParser
- java.lang.Object
-
- org.antlr.v4.runtime.Recognizer<Token,ParserATNSimulator>
-
- org.antlr.v4.runtime.Parser
-
- eu.simuline.relana.parser.FormulaParser
-
public class FormulaParser extends Parser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFormulaParser.AddFormulaContextstatic classFormulaParser.CompFormulaContextstatic classFormulaParser.ConstFormulaContextstatic classFormulaParser.FormulaContextstatic classFormulaParser.PathContextstatic classFormulaParser.VarFormulaContext-
Nested classes/interfaces inherited from class org.antlr.v4.runtime.Parser
Parser.TraceListener, Parser.TrimToSizeListener
-
-
Field Summary
Fields Modifier and Type Field Description static ATN_ATNprotected static DFA[]_decisionToDFAprivate static String[]_LITERAL_NAMESstatic String_serializedATNprotected static PredictionContextCache_sharedContextCacheprivate static String[]_SYMBOLIC_NAMES(package private) Stack<Set<FormulaDecl>>argsStackThe stack of incompletely parsed levels of formulae.private CClasscClassprivate CClassLoaderclassLoaderprivate intcolnNumberstatic intCOMPLEMENTstatic intCONTstatic intCOVstatic intENDprivate booleanexceptionThrown(package private) FormulaDeclfDecl'Returned by constFormula, varFormula and compFormula.static intINTERSECTstatic intINVprivate intlineNumberprivate ClassLocatorlocstatic intMultiLineCommentstatic intNAME(package private) List<String>pathRepresents a path.static intRULE_addFormulastatic intRULE_compFormulastatic intRULE_constFormulastatic intRULE_formulastatic intRULE_pathstatic intRULE_varFormulastatic String[]ruleNamesstatic intSEPstatic intSingleLineCommentstatic intT__0static intT__1static intT__2static intT__3static intT__4static intT__5static String[]tokenNamesDeprecated.UseVOCABULARYinstead.static intUNIONstatic VocabularyVOCABULARYstatic intWS-
Fields inherited from class org.antlr.v4.runtime.Parser
_buildParseTrees, _ctx, _errHandler, _input, _parseListeners, _precedenceStack, _syntaxErrors, matchedEOF
-
Fields inherited from class org.antlr.v4.runtime.Recognizer
_interp, EOF
-
-
Constructor Summary
Constructors Constructor Description FormulaParser(TokenStream input)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description FormulaParser.AddFormulaContextaddFormula()FormulaParser.CompFormulaContextcompFormula()FormulaParser.ConstFormulaContextconstFormula()FormulaParser.FormulaContextformula()ATNgetATN()(package private) FormulaDeclgetFormulaStart()Returns the all in all formula invoking rule 'formula'.StringgetGrammarFileName()(package private) StringgetLocation()Returns a string comprising the current class, the number of the current line and column, the last token successfully read and the token tp be read next.String[]getRuleNames()StringgetSerializedATN()String[]getTokenNames()Deprecated.VocabularygetVocabulary()FormulaParser.PathContextpath()(package private) voidreport(String msg)Reports an error and also the location where it occurred. **** same as in SClassParser ****(package private) voidsetCClass(CClass cClass)Sets theCClassfor the class currently parsed but without formulae.voidsetClassLoader(CClassLoader classLoader)To set theCClassLoader.(package private) voidsetLineColNum(int lineNumber, int colnNumber)(package private) voidsetLocator(ClassLocator loc)Sets the locator for the class currently parsed.FormulaParser.VarFormulaContextvarFormula()-
Methods inherited from class org.antlr.v4.runtime.Parser
addContextToParseTree, addParseListener, compileParseTreePattern, compileParseTreePattern, consume, createErrorNode, createTerminalNode, dumpDFA, enterOuterAlt, enterRecursionRule, enterRecursionRule, enterRule, exitRule, getATNWithBypassAlts, getBuildParseTree, getContext, getCurrentToken, getDFAStrings, getErrorHandler, getExpectedTokens, getExpectedTokensWithinCurrentRule, getInputStream, getInvokingContext, getNumberOfSyntaxErrors, getParseInfo, getParseListeners, getPrecedence, getRuleContext, getRuleIndex, getRuleInvocationStack, getRuleInvocationStack, getSourceName, getTokenFactory, getTokenStream, getTrimParseTree, inContext, isExpectedToken, isMatchedEOF, isTrace, match, matchWildcard, notifyErrorListeners, notifyErrorListeners, precpred, pushNewRecursionContext, removeParseListener, removeParseListeners, reset, setBuildParseTree, setContext, setErrorHandler, setInputStream, setProfile, setTokenFactory, setTokenStream, setTrace, setTrimParseTree, triggerEnterRuleEvent, triggerExitRuleEvent, unrollRecursionContexts
-
Methods inherited from class org.antlr.v4.runtime.Recognizer
action, addErrorListener, getErrorHeader, getErrorListenerDispatch, getErrorListeners, getInterpreter, getRuleIndexMap, getState, getTokenErrorDisplay, getTokenType, getTokenTypeMap, removeErrorListener, removeErrorListeners, sempred, setInterpreter, setState
-
-
-
-
Field Detail
-
_decisionToDFA
protected static final DFA[] _decisionToDFA
-
_sharedContextCache
protected static final PredictionContextCache _sharedContextCache
-
T__0
public static final int T__0
- See Also:
- Constant Field Values
-
T__1
public static final int T__1
- See Also:
- Constant Field Values
-
T__2
public static final int T__2
- See Also:
- Constant Field Values
-
T__3
public static final int T__3
- See Also:
- Constant Field Values
-
T__4
public static final int T__4
- See Also:
- Constant Field Values
-
T__5
public static final int T__5
- See Also:
- Constant Field Values
-
WS
public static final int WS
- See Also:
- Constant Field Values
-
SingleLineComment
public static final int SingleLineComment
- See Also:
- Constant Field Values
-
MultiLineComment
public static final int MultiLineComment
- See Also:
- Constant Field Values
-
INV
public static final int INV
- See Also:
- Constant Field Values
-
COV
public static final int COV
- See Also:
- Constant Field Values
-
CONT
public static final int CONT
- See Also:
- Constant Field Values
-
END
public static final int END
- See Also:
- Constant Field Values
-
SEP
public static final int SEP
- See Also:
- Constant Field Values
-
UNION
public static final int UNION
- See Also:
- Constant Field Values
-
INTERSECT
public static final int INTERSECT
- See Also:
- Constant Field Values
-
COMPLEMENT
public static final int COMPLEMENT
- See Also:
- Constant Field Values
-
NAME
public static final int NAME
- See Also:
- Constant Field Values
-
RULE_formula
public static final int RULE_formula
- See Also:
- Constant Field Values
-
RULE_constFormula
public static final int RULE_constFormula
- See Also:
- Constant Field Values
-
RULE_varFormula
public static final int RULE_varFormula
- See Also:
- Constant Field Values
-
RULE_compFormula
public static final int RULE_compFormula
- See Also:
- Constant Field Values
-
RULE_addFormula
public static final int RULE_addFormula
- See Also:
- Constant Field Values
-
RULE_path
public static final int RULE_path
- See Also:
- Constant Field Values
-
ruleNames
public static final String[] ruleNames
-
_LITERAL_NAMES
private static final String[] _LITERAL_NAMES
-
_SYMBOLIC_NAMES
private static final String[] _SYMBOLIC_NAMES
-
VOCABULARY
public static final Vocabulary VOCABULARY
-
tokenNames
@Deprecated public static final String[] tokenNames
Deprecated.UseVOCABULARYinstead.
-
classLoader
private CClassLoader classLoader
-
cClass
private CClass cClass
-
loc
private ClassLocator loc
-
exceptionThrown
private boolean exceptionThrown
-
lineNumber
private int lineNumber
-
colnNumber
private int colnNumber
-
argsStack
Stack<Set<FormulaDecl>> argsStack
The stack of incompletely parsed levels of formulae. Created by getCompFormula, populated by addFormula
-
fDecl
FormulaDecl fDecl
'Returned by constFormula, varFormula and compFormula. For recursive parsing of nested formulae: Added as an argument of an enclosing formula toargsStackby rule addFormula.
-
_serializedATN
public static final String _serializedATN
- See Also:
- Constant Field Values
-
_ATN
public static final ATN _ATN
-
-
Constructor Detail
-
FormulaParser
public FormulaParser(TokenStream input)
-
-
Method Detail
-
getTokenNames
@Deprecated public String[] getTokenNames()
Deprecated.- Specified by:
getTokenNamesin classRecognizer<Token,ParserATNSimulator>
-
getVocabulary
public Vocabulary getVocabulary()
- Overrides:
getVocabularyin classRecognizer<Token,ParserATNSimulator>
-
getGrammarFileName
public String getGrammarFileName()
- Specified by:
getGrammarFileNamein classRecognizer<Token,ParserATNSimulator>
-
getRuleNames
public String[] getRuleNames()
- Specified by:
getRuleNamesin classRecognizer<Token,ParserATNSimulator>
-
getSerializedATN
public String getSerializedATN()
- Overrides:
getSerializedATNin classRecognizer<Token,ParserATNSimulator>
-
getATN
public ATN getATN()
- Specified by:
getATNin classRecognizer<Token,ParserATNSimulator>
-
setLineColNum
void setLineColNum(int lineNumber, int colnNumber)
-
setClassLoader
public void setClassLoader(CClassLoader classLoader)
To set theCClassLoader. This is needed whenever the definition of the class currently read relies on definitions of other classes such as the superclass if it is given explicitly.- Parameters:
classLoader- the currentSClassLoader.
-
setLocator
void setLocator(ClassLocator loc)
Sets the locator for the class currently parsed. This is needed to analyze formulae in a second parsing step when allSClassdeclarations are clarified.- Parameters:
loc- the location of the class currently parsed.
-
setCClass
void setCClass(CClass cClass)
Sets theCClassfor the class currently parsed but without formulae. This is needed to analyze formulae in a second parsing step when allSClassdeclarations are clarified.- Parameters:
cClass-
-
getFormulaStart
FormulaDecl getFormulaStart()
Returns the all in all formula invoking rule 'formula'.
-
getLocation
String getLocation()
Returns a string comprising the current class, the number of the current line and column, the last token successfully read and the token tp be read next.- Returns:
- a
Stringof the form[.loc] line ##, column ## between tokenRead and tokenToBeRead
-
report
void report(String msg) throws RuntimeException
Reports an error and also the location where it occurred. **** same as in SClassParser ****- Parameters:
msg- the message to be displayed.- Throws:
RuntimeException
-
formula
public final FormulaParser.FormulaContext formula() throws RecognitionException
- Throws:
RecognitionException
-
constFormula
public final FormulaParser.ConstFormulaContext constFormula() throws RecognitionException
- Throws:
RecognitionException
-
varFormula
public final FormulaParser.VarFormulaContext varFormula() throws RecognitionException
- Throws:
RecognitionException
-
compFormula
public final FormulaParser.CompFormulaContext compFormula() throws RecognitionException
- Throws:
RecognitionException
-
addFormula
public final FormulaParser.AddFormulaContext addFormula() throws RecognitionException
- Throws:
RecognitionException
-
path
public final FormulaParser.PathContext path() throws RecognitionException
- Throws:
RecognitionException
-
-