Package eu.simuline.relana.parser
Class SClassParser
- java.lang.Object
-
- org.antlr.v4.runtime.Recognizer<Token,ParserATNSimulator>
-
- org.antlr.v4.runtime.Parser
-
- eu.simuline.relana.parser.SClassParser
-
public class SClassParser extends Parser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SClassParser.AddDeficiencyContext
static class
SClassParser.AddMapContext
static class
SClassParser.AddPathContext
static class
SClassParser.AddRelationContext
static class
SClassParser.AddRelationsContext
static class
SClassParser.GetCheckedDeficienciesContext
static class
SClassParser.GetDeficienciesContext
static class
SClassParser.GetInnerClsContext
static class
SClassParser.GetPathContext
static class
SClassParser.GetSuperClassContext
static class
SClassParser.SClassContext
-
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
private SClassLoader
classLoader
static int
END
static int
EXTENDS
static int
IMPLIES
private ClassLocator
loc
static int
MAP
static int
MultiLineComment
static int
NAME
static int
PACKAGE
static int
PROPERTIES
static int
RELATIONS
static int
REPLACE
static int
RULE_addDeficiency
static int
RULE_addMap
static int
RULE_addPath
static int
RULE_addRelation
static int
RULE_addRelations
static int
RULE_getCheckedDeficiencies
static int
RULE_getDeficiencies
static int
RULE_getInnerCls
static int
RULE_getPath
static int
RULE_getSuperClass
static int
RULE_sClass
static String[]
ruleNames
static int
SCLASS
static int
SEP
static int
SingleLineComment
private Map<ClassLocator,ClassLocator>
subclassDep
static int
T__0
static int
T__1
static int
T__2
static int
T__3
static int
T__4
static String[]
tokenNames
Deprecated.UseVOCABULARY
instead.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 SClassParser(InputStream str)
SClassParser(TokenStream input)
-
Method Summary
-
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
-
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
-
PACKAGE
public static final int PACKAGE
- See Also:
- Constant Field Values
-
SCLASS
public static final int SCLASS
- See Also:
- Constant Field Values
-
EXTENDS
public static final int EXTENDS
- See Also:
- Constant Field Values
-
PROPERTIES
public static final int PROPERTIES
- See Also:
- Constant Field Values
-
MAP
public static final int MAP
- See Also:
- Constant Field Values
-
REPLACE
public static final int REPLACE
- See Also:
- Constant Field Values
-
RELATIONS
public static final int RELATIONS
- See Also:
- Constant Field Values
-
IMPLIES
public static final int IMPLIES
- 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
-
NAME
public static final int NAME
- See Also:
- Constant Field Values
-
RULE_sClass
public static final int RULE_sClass
- See Also:
- Constant Field Values
-
RULE_getPath
public static final int RULE_getPath
- See Also:
- Constant Field Values
-
RULE_addPath
public static final int RULE_addPath
- See Also:
- Constant Field Values
-
RULE_getSuperClass
public static final int RULE_getSuperClass
- See Also:
- Constant Field Values
-
RULE_getDeficiencies
public static final int RULE_getDeficiencies
- See Also:
- Constant Field Values
-
RULE_addDeficiency
public static final int RULE_addDeficiency
- See Also:
- Constant Field Values
-
RULE_getInnerCls
public static final int RULE_getInnerCls
- See Also:
- Constant Field Values
-
RULE_addMap
public static final int RULE_addMap
- See Also:
- Constant Field Values
-
RULE_getCheckedDeficiencies
public static final int RULE_getCheckedDeficiencies
- See Also:
- Constant Field Values
-
RULE_addRelations
public static final int RULE_addRelations
- See Also:
- Constant Field Values
-
RULE_addRelation
public static final int RULE_addRelation
- 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 SClassLoader classLoader
-
loc
private ClassLocator loc
-
subclassDep
private Map<ClassLocator,ClassLocator> subclassDep
-
_serializedATN
public static final String _serializedATN
- See Also:
- Constant Field Values
-
_ATN
public static final ATN _ATN
-
-
Constructor Detail
-
SClassParser
public SClassParser(InputStream str) throws IOException
- Throws:
IOException
-
SClassParser
public SClassParser(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>
-
inputStream2tokenStream
private static CommonTokenStream inputStream2tokenStream(InputStream str) throws IOException
- Throws:
IOException
-
report
void report(String msg) throws RuntimeException
Reports an error and also the location where it occurred.- Parameters:
msg
- the message to be displayed.- Throws:
RuntimeException
-
setClassLoader
public void setClassLoader(SClassLoader classLoader)
To set theSClassLoader
. 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
.
-
getSClass
public SClass getSClass(ClassLocator loc, Map<ClassLocator,ClassLocator> subclassDep)
-
checkDependencies
private void checkDependencies(ClassLocator needed) throws RuntimeException
Throws an exception if the class currently parsed is involved in a cyclic definition.- Parameters:
needed
- points to a class to be loaded byclassLoader
.- Throws:
RuntimeException
- if this class is parsed in order to declare a classC
andC
in turn is adressed in this class.
-
sClass
public final SClassParser.SClassContext sClass(ClassLocator loc, Map<ClassLocator,ClassLocator> subclassDep) throws RecognitionException
- Throws:
RecognitionException
-
getPath
public final SClassParser.GetPathContext getPath() throws RecognitionException
- Throws:
RecognitionException
-
addPath
public final SClassParser.AddPathContext addPath(Set<List<String>> innerPaths) throws RecognitionException
- Throws:
RecognitionException
-
getSuperClass
public final SClassParser.GetSuperClassContext getSuperClass(Map<List<String>,SClass> paths2innerCls) throws RecognitionException
- Throws:
RecognitionException
-
getDeficiencies
public final SClassParser.GetDeficienciesContext getDeficiencies() throws RecognitionException
- Throws:
RecognitionException
-
addDeficiency
public final SClassParser.AddDeficiencyContext addDeficiency(Map<Deficiency,DeficiencyNode> deficiency2ordering) throws RecognitionException
- Throws:
RecognitionException
-
getInnerCls
public final SClassParser.GetInnerClsContext getInnerCls(SClass superclass, Set<Deficiency> newDefs) throws RecognitionException
- Throws:
RecognitionException
-
addMap
public final SClassParser.AddMapContext addMap(Set<Deficiency> oldDefs, Map<Deficiency,SClass> old2innerCls, Set<Deficiency> newDefs) throws RecognitionException
- Throws:
RecognitionException
-
getCheckedDeficiencies
public final SClassParser.GetCheckedDeficienciesContext getCheckedDeficiencies(Set<Deficiency> newDefs) throws RecognitionException
- Throws:
RecognitionException
-
addRelations
public final SClassParser.AddRelationsContext addRelations(Map<Deficiency,DeficiencyNode> deficiency2ordering) throws RecognitionException
- Throws:
RecognitionException
-
addRelation
public final SClassParser.AddRelationContext addRelation(Map<Deficiency,DeficiencyNode> deficiency2ordering) throws RecognitionException
- Throws:
RecognitionException
-
-