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 class
FormulaParser.AddFormulaContext
static class
FormulaParser.CompFormulaContext
static class
FormulaParser.ConstFormulaContext
static class
FormulaParser.FormulaContext
static class
FormulaParser.PathContext
static class
FormulaParser.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
_ATN
protected static DFA[]
_decisionToDFA
private static String[]
_LITERAL_NAMES
static String
_serializedATN
protected static PredictionContextCache
_sharedContextCache
private static String[]
_SYMBOLIC_NAMES
(package private) Stack<Set<FormulaDecl>>
argsStack
The stack of incompletely parsed levels of formulae.private CClass
cClass
private CClassLoader
classLoader
private int
colnNumber
static int
COMPLEMENT
static int
CONT
static int
COV
static int
END
private boolean
exceptionThrown
(package private) FormulaDecl
fDecl
'Returned by constFormula, varFormula and compFormula.static int
INTERSECT
static int
INV
private int
lineNumber
private ClassLocator
loc
static int
MultiLineComment
static int
NAME
(package private) List<String>
path
Represents a path.static int
RULE_addFormula
static int
RULE_compFormula
static int
RULE_constFormula
static int
RULE_formula
static int
RULE_path
static int
RULE_varFormula
static String[]
ruleNames
static int
SEP
static int
SingleLineComment
static int
T__0
static int
T__1
static int
T__2
static int
T__3
static int
T__4
static int
T__5
static String[]
tokenNames
Deprecated.UseVOCABULARY
instead.static int
UNION
static Vocabulary
VOCABULARY
static int
WS
-
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.AddFormulaContext
addFormula()
FormulaParser.CompFormulaContext
compFormula()
FormulaParser.ConstFormulaContext
constFormula()
FormulaParser.FormulaContext
formula()
ATN
getATN()
(package private) FormulaDecl
getFormulaStart()
Returns the all in all formula invoking rule 'formula'.String
getGrammarFileName()
(package private) 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.String[]
getRuleNames()
String
getSerializedATN()
String[]
getTokenNames()
Deprecated.Vocabulary
getVocabulary()
FormulaParser.PathContext
path()
(package private) void
report(String msg)
Reports an error and also the location where it occurred. **** same as in SClassParser ****(package private) void
setCClass(CClass cClass)
Sets theCClass
for the class currently parsed but without formulae.void
setClassLoader(CClassLoader classLoader)
To set theCClassLoader
.(package private) void
setLineColNum(int lineNumber, int colnNumber)
(package private) void
setLocator(ClassLocator loc)
Sets the locator for the class currently parsed.FormulaParser.VarFormulaContext
varFormula()
-
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.UseVOCABULARY
instead.
-
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 toargsStack
by 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:
getTokenNames
in classRecognizer<Token,ParserATNSimulator>
-
getVocabulary
public Vocabulary getVocabulary()
- Overrides:
getVocabulary
in classRecognizer<Token,ParserATNSimulator>
-
getGrammarFileName
public String getGrammarFileName()
- Specified by:
getGrammarFileName
in classRecognizer<Token,ParserATNSimulator>
-
getRuleNames
public String[] getRuleNames()
- Specified by:
getRuleNames
in classRecognizer<Token,ParserATNSimulator>
-
getSerializedATN
public String getSerializedATN()
- Overrides:
getSerializedATN
in classRecognizer<Token,ParserATNSimulator>
-
getATN
public ATN getATN()
- Specified by:
getATN
in 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 allSClass
declarations are clarified.- Parameters:
loc
- the location of the class currently parsed.
-
setCClass
void setCClass(CClass cClass)
Sets theCClass
for the class currently parsed but without formulae. This is needed to analyze formulae in a second parsing step when allSClass
declarations 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
String
of 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
-
-