l3.0.2.2.source-code.ML3Parser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ml3 Show documentation
Show all versions of ml3 Show documentation
The Modeling Language for Linked Lives, a domain specific modeling language for agent-based
computational demography.
// Generated from ML3.g4 by ANTLR 4.7.1
package org.jamesii.ml3.parser.antlr4;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.misc.*;
import org.antlr.v4.runtime.tree.*;
import java.util.List;
import java.util.Iterator;
import java.util.ArrayList;
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class ML3Parser extends Parser {
static { RuntimeMetaData.checkVersion("4.7.1", RuntimeMetaData.VERSION); }
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
T__0=1, T__1=2, Age=3, All=4, Alter=5, Do=6, Each=7, Ego=8, Else=9, End=10,
Every=11, For=12, If=13, In=14, Instantly=15, New=16, Now=17, Synchronized=18,
Then=19, Where=20, Singleton=21, ArrowOS=22, ArrowTS=23, Dots=24, Dot=25,
QMark=26, Colon=27, Semicolon=28, At=29, Bar=30, Comma=31, Equals=32,
NotEquals=33, GreaterThanEquals=34, SmallerThanEquals=35, GreaterThan=36,
SmallerThan=37, Add=38, Sub=39, Mul=40, Div=41, Mod=42, Pow=43, And=44,
Or=45, Not=46, Assign=47, AddAssign=48, SubAssign=49, OParen=50, CParen=51,
OBracket=52, CBracket=53, OBrace=54, CBrace=55, TypeString=56, TypeInt=57,
TypeBool=58, TypeReal=59, Bool=60, Nat=61, Real=62, String=63, AgentIdentifier=64,
Identifier=65, LocalIdentifier=66, WS=67, COMMENT=68, LINE_COMMENT=69,
UNMATCHED=70;
public static final int
RULE_model = 0, RULE_constDec = 1, RULE_mapDec = 2, RULE_agentDec = 3,
RULE_linkDec = 4, RULE_funcDec = 5, RULE_procDec = 6, RULE_ruleBlock = 7,
RULE_ruleDec = 8, RULE_guard = 9, RULE_forEach = 10, RULE_rate = 11, RULE_effect = 12,
RULE_cardinality = 13, RULE_constant = 14, RULE_attrDec = 15, RULE_paramDec = 16,
RULE_where = 17, RULE_constantType = 18, RULE_basicType = 19, RULE_type = 20,
RULE_statement = 21, RULE_ifClause = 22, RULE_elseClause = 23, RULE_assignLeftSide = 24,
RULE_expression = 25, RULE_enumType = 26, RULE_agentCreationArgument = 27,
RULE_ageRate = 28, RULE_everyRate = 29;
public static final String[] ruleNames = {
"model", "constDec", "mapDec", "agentDec", "linkDec", "funcDec", "procDec",
"ruleBlock", "ruleDec", "guard", "forEach", "rate", "effect", "cardinality",
"constant", "attrDec", "paramDec", "where", "constantType", "basicType",
"type", "statement", "ifClause", "elseClause", "assignLeftSide", "expression",
"enumType", "agentCreationArgument", "ageRate", "everyRate"
};
private static final String[] _LITERAL_NAMES = {
null, "'[1]'", "'[n]'", "'age'", "'all'", "'alter'", "'do'", "'each'",
"'ego'", "'else'", "'end'", "'every'", "'for'", "'if'", "'in'", "'instantly'",
"'new'", "'now'", "'synchronized'", "'then'", "'where'", "'singleton'",
"'->'", "'<->'", "'..'", "'.'", "'?'", "':'", "';'", "'@'", "'|'", "','",
"'='", "'!='", "'>='", "'<='", "'>'", "'<'", "'+'", "'-'", "'*'", "'/'",
"'%'", "'^'", "'&&'", "'||'", "'!'", "':='", "'+='", "'-='", "'('", "')'",
"'['", "']'", "'{'", "'}'", "'string'", "'int'", "'bool'", "'real'"
};
private static final String[] _SYMBOLIC_NAMES = {
null, null, null, "Age", "All", "Alter", "Do", "Each", "Ego", "Else",
"End", "Every", "For", "If", "In", "Instantly", "New", "Now", "Synchronized",
"Then", "Where", "Singleton", "ArrowOS", "ArrowTS", "Dots", "Dot", "QMark",
"Colon", "Semicolon", "At", "Bar", "Comma", "Equals", "NotEquals", "GreaterThanEquals",
"SmallerThanEquals", "GreaterThan", "SmallerThan", "Add", "Sub", "Mul",
"Div", "Mod", "Pow", "And", "Or", "Not", "Assign", "AddAssign", "SubAssign",
"OParen", "CParen", "OBracket", "CBracket", "OBrace", "CBrace", "TypeString",
"TypeInt", "TypeBool", "TypeReal", "Bool", "Nat", "Real", "String", "AgentIdentifier",
"Identifier", "LocalIdentifier", "WS", "COMMENT", "LINE_COMMENT", "UNMATCHED"
};
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
/**
* @deprecated Use {@link #VOCABULARY} instead.
*/
@Deprecated
public static final String[] tokenNames;
static {
tokenNames = new String[_SYMBOLIC_NAMES.length];
for (int i = 0; i < tokenNames.length; i++) {
tokenNames[i] = VOCABULARY.getLiteralName(i);
if (tokenNames[i] == null) {
tokenNames[i] = VOCABULARY.getSymbolicName(i);
}
if (tokenNames[i] == null) {
tokenNames[i] = "";
}
}
}
@Override
@Deprecated
public String[] getTokenNames() {
return tokenNames;
}
@Override
public Vocabulary getVocabulary() {
return VOCABULARY;
}
@Override
public String getGrammarFileName() { return "ML3.g4"; }
@Override
public String[] getRuleNames() { return ruleNames; }
@Override
public String getSerializedATN() { return _serializedATN; }
@Override
public ATN getATN() { return _ATN; }
public ML3Parser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
public static class ModelContext extends ParserRuleContext {
public TerminalNode EOF() { return getToken(ML3Parser.EOF, 0); }
public List constDec() {
return getRuleContexts(ConstDecContext.class);
}
public ConstDecContext constDec(int i) {
return getRuleContext(ConstDecContext.class,i);
}
public List mapDec() {
return getRuleContexts(MapDecContext.class);
}
public MapDecContext mapDec(int i) {
return getRuleContext(MapDecContext.class,i);
}
public List agentDec() {
return getRuleContexts(AgentDecContext.class);
}
public AgentDecContext agentDec(int i) {
return getRuleContext(AgentDecContext.class,i);
}
public List linkDec() {
return getRuleContexts(LinkDecContext.class);
}
public LinkDecContext linkDec(int i) {
return getRuleContext(LinkDecContext.class,i);
}
public List funcDec() {
return getRuleContexts(FuncDecContext.class);
}
public FuncDecContext funcDec(int i) {
return getRuleContext(FuncDecContext.class,i);
}
public List procDec() {
return getRuleContexts(ProcDecContext.class);
}
public ProcDecContext procDec(int i) {
return getRuleContext(ProcDecContext.class,i);
}
public List ruleBlock() {
return getRuleContexts(RuleBlockContext.class);
}
public RuleBlockContext ruleBlock(int i) {
return getRuleContext(RuleBlockContext.class,i);
}
public ModelContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_model; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterModel(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitModel(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitModel(this);
else return visitor.visitChildren(this);
}
}
public final ModelContext model() throws RecognitionException {
ModelContext _localctx = new ModelContext(_ctx, getState());
enterRule(_localctx, 0, RULE_model);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(69);
_errHandler.sync(this);
_la = _input.LA(1);
while (((((_la - 21)) & ~0x3f) == 0 && ((1L << (_la - 21)) & ((1L << (Singleton - 21)) | (1L << (AgentIdentifier - 21)) | (1L << (Identifier - 21)))) != 0)) {
{
setState(67);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) {
case 1:
{
setState(60);
constDec();
}
break;
case 2:
{
setState(61);
mapDec();
}
break;
case 3:
{
setState(62);
agentDec();
}
break;
case 4:
{
setState(63);
linkDec();
}
break;
case 5:
{
setState(64);
funcDec();
}
break;
case 6:
{
setState(65);
procDec();
}
break;
case 7:
{
setState(66);
ruleBlock();
}
break;
}
}
setState(71);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(72);
match(EOF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ConstDecContext extends ParserRuleContext {
public TerminalNode Identifier() { return getToken(ML3Parser.Identifier, 0); }
public TerminalNode Colon() { return getToken(ML3Parser.Colon, 0); }
public ConstantTypeContext constantType() {
return getRuleContext(ConstantTypeContext.class,0);
}
public TerminalNode Assign() { return getToken(ML3Parser.Assign, 0); }
public ConstantContext constant() {
return getRuleContext(ConstantContext.class,0);
}
public ConstDecContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_constDec; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterConstDec(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitConstDec(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitConstDec(this);
else return visitor.visitChildren(this);
}
}
public final ConstDecContext constDec() throws RecognitionException {
ConstDecContext _localctx = new ConstDecContext(_ctx, getState());
enterRule(_localctx, 2, RULE_constDec);
int _la;
try {
setState(84);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(74);
match(Identifier);
setState(75);
match(Colon);
setState(76);
constantType();
setState(79);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==Assign) {
{
setState(77);
match(Assign);
setState(78);
constant();
}
}
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(81);
match(Identifier);
setState(82);
match(Assign);
setState(83);
constant();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class MapDecContext extends ParserRuleContext {
public TerminalNode Identifier() { return getToken(ML3Parser.Identifier, 0); }
public TerminalNode OBracket() { return getToken(ML3Parser.OBracket, 0); }
public List constantType() {
return getRuleContexts(ConstantTypeContext.class);
}
public ConstantTypeContext constantType(int i) {
return getRuleContext(ConstantTypeContext.class,i);
}
public TerminalNode CBracket() { return getToken(ML3Parser.CBracket, 0); }
public TerminalNode Colon() { return getToken(ML3Parser.Colon, 0); }
public MapDecContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_mapDec; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterMapDec(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitMapDec(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitMapDec(this);
else return visitor.visitChildren(this);
}
}
public final MapDecContext mapDec() throws RecognitionException {
MapDecContext _localctx = new MapDecContext(_ctx, getState());
enterRule(_localctx, 4, RULE_mapDec);
try {
enterOuterAlt(_localctx, 1);
{
setState(86);
match(Identifier);
setState(87);
match(OBracket);
setState(88);
constantType();
setState(89);
match(CBracket);
setState(90);
match(Colon);
setState(91);
constantType();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class AgentDecContext extends ParserRuleContext {
public TerminalNode AgentIdentifier() { return getToken(ML3Parser.AgentIdentifier, 0); }
public TerminalNode OParen() { return getToken(ML3Parser.OParen, 0); }
public TerminalNode CParen() { return getToken(ML3Parser.CParen, 0); }
public TerminalNode Singleton() { return getToken(ML3Parser.Singleton, 0); }
public List attrDec() {
return getRuleContexts(AttrDecContext.class);
}
public AttrDecContext attrDec(int i) {
return getRuleContext(AttrDecContext.class,i);
}
public List Comma() { return getTokens(ML3Parser.Comma); }
public TerminalNode Comma(int i) {
return getToken(ML3Parser.Comma, i);
}
public AgentDecContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_agentDec; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterAgentDec(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitAgentDec(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitAgentDec(this);
else return visitor.visitChildren(this);
}
}
public final AgentDecContext agentDec() throws RecognitionException {
AgentDecContext _localctx = new AgentDecContext(_ctx, getState());
enterRule(_localctx, 6, RULE_agentDec);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(94);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==Singleton) {
{
setState(93);
match(Singleton);
}
}
setState(96);
match(AgentIdentifier);
setState(97);
match(OParen);
setState(106);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==Identifier) {
{
setState(98);
attrDec();
setState(103);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==Comma) {
{
{
setState(99);
match(Comma);
setState(100);
attrDec();
}
}
setState(105);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(108);
match(CParen);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class LinkDecContext extends ParserRuleContext {
public Token i_l;
public Token ai_l;
public CardinalityContext c_l;
public CardinalityContext c_r;
public Token ai_r;
public Token i_r;
public List Colon() { return getTokens(ML3Parser.Colon); }
public TerminalNode Colon(int i) {
return getToken(ML3Parser.Colon, i);
}
public TerminalNode ArrowTS() { return getToken(ML3Parser.ArrowTS, 0); }
public List Identifier() { return getTokens(ML3Parser.Identifier); }
public TerminalNode Identifier(int i) {
return getToken(ML3Parser.Identifier, i);
}
public List AgentIdentifier() { return getTokens(ML3Parser.AgentIdentifier); }
public TerminalNode AgentIdentifier(int i) {
return getToken(ML3Parser.AgentIdentifier, i);
}
public List cardinality() {
return getRuleContexts(CardinalityContext.class);
}
public CardinalityContext cardinality(int i) {
return getRuleContext(CardinalityContext.class,i);
}
public LinkDecContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_linkDec; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterLinkDec(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitLinkDec(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitLinkDec(this);
else return visitor.visitChildren(this);
}
}
public final LinkDecContext linkDec() throws RecognitionException {
LinkDecContext _localctx = new LinkDecContext(_ctx, getState());
enterRule(_localctx, 8, RULE_linkDec);
try {
enterOuterAlt(_localctx, 1);
{
setState(110);
((LinkDecContext)_localctx).i_l = match(Identifier);
setState(111);
match(Colon);
setState(112);
((LinkDecContext)_localctx).ai_l = match(AgentIdentifier);
setState(113);
((LinkDecContext)_localctx).c_l = cardinality();
setState(114);
match(ArrowTS);
setState(115);
((LinkDecContext)_localctx).c_r = cardinality();
setState(116);
((LinkDecContext)_localctx).ai_r = match(AgentIdentifier);
setState(117);
match(Colon);
setState(118);
((LinkDecContext)_localctx).i_r = match(Identifier);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class FuncDecContext extends ParserRuleContext {
public TerminalNode AgentIdentifier() { return getToken(ML3Parser.AgentIdentifier, 0); }
public TerminalNode Dot() { return getToken(ML3Parser.Dot, 0); }
public TerminalNode Identifier() { return getToken(ML3Parser.Identifier, 0); }
public TerminalNode OParen() { return getToken(ML3Parser.OParen, 0); }
public TerminalNode CParen() { return getToken(ML3Parser.CParen, 0); }
public TerminalNode Colon() { return getToken(ML3Parser.Colon, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public TerminalNode Assign() { return getToken(ML3Parser.Assign, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public List paramDec() {
return getRuleContexts(ParamDecContext.class);
}
public ParamDecContext paramDec(int i) {
return getRuleContext(ParamDecContext.class,i);
}
public WhereContext where() {
return getRuleContext(WhereContext.class,0);
}
public List Comma() { return getTokens(ML3Parser.Comma); }
public TerminalNode Comma(int i) {
return getToken(ML3Parser.Comma, i);
}
public FuncDecContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_funcDec; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterFuncDec(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitFuncDec(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitFuncDec(this);
else return visitor.visitChildren(this);
}
}
public final FuncDecContext funcDec() throws RecognitionException {
FuncDecContext _localctx = new FuncDecContext(_ctx, getState());
enterRule(_localctx, 10, RULE_funcDec);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(120);
match(AgentIdentifier);
setState(121);
match(Dot);
setState(122);
match(Identifier);
setState(123);
match(OParen);
setState(132);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LocalIdentifier) {
{
setState(124);
paramDec();
setState(129);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==Comma) {
{
{
setState(125);
match(Comma);
setState(126);
paramDec();
}
}
setState(131);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(134);
match(CParen);
setState(135);
match(Colon);
setState(136);
type();
setState(137);
match(Assign);
setState(138);
expression(0);
setState(140);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==Where) {
{
setState(139);
where();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ProcDecContext extends ParserRuleContext {
public TerminalNode AgentIdentifier() { return getToken(ML3Parser.AgentIdentifier, 0); }
public TerminalNode Dot() { return getToken(ML3Parser.Dot, 0); }
public TerminalNode Identifier() { return getToken(ML3Parser.Identifier, 0); }
public TerminalNode OParen() { return getToken(ML3Parser.OParen, 0); }
public TerminalNode CParen() { return getToken(ML3Parser.CParen, 0); }
public TerminalNode ArrowOS() { return getToken(ML3Parser.ArrowOS, 0); }
public StatementContext statement() {
return getRuleContext(StatementContext.class,0);
}
public List paramDec() {
return getRuleContexts(ParamDecContext.class);
}
public ParamDecContext paramDec(int i) {
return getRuleContext(ParamDecContext.class,i);
}
public WhereContext where() {
return getRuleContext(WhereContext.class,0);
}
public List Comma() { return getTokens(ML3Parser.Comma); }
public TerminalNode Comma(int i) {
return getToken(ML3Parser.Comma, i);
}
public ProcDecContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_procDec; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterProcDec(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitProcDec(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitProcDec(this);
else return visitor.visitChildren(this);
}
}
public final ProcDecContext procDec() throws RecognitionException {
ProcDecContext _localctx = new ProcDecContext(_ctx, getState());
enterRule(_localctx, 12, RULE_procDec);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(142);
match(AgentIdentifier);
setState(143);
match(Dot);
setState(144);
match(Identifier);
setState(145);
match(OParen);
setState(154);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LocalIdentifier) {
{
setState(146);
paramDec();
setState(151);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==Comma) {
{
{
setState(147);
match(Comma);
setState(148);
paramDec();
}
}
setState(153);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(156);
match(CParen);
setState(157);
match(ArrowOS);
setState(158);
statement(0);
setState(160);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==Where) {
{
setState(159);
where();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RuleBlockContext extends ParserRuleContext {
public TerminalNode AgentIdentifier() { return getToken(ML3Parser.AgentIdentifier, 0); }
public List ruleDec() {
return getRuleContexts(RuleDecContext.class);
}
public RuleDecContext ruleDec(int i) {
return getRuleContext(RuleDecContext.class,i);
}
public RuleBlockContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_ruleBlock; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterRuleBlock(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitRuleBlock(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitRuleBlock(this);
else return visitor.visitChildren(this);
}
}
public final RuleBlockContext ruleBlock() throws RecognitionException {
RuleBlockContext _localctx = new RuleBlockContext(_ctx, getState());
enterRule(_localctx, 14, RULE_ruleBlock);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(162);
match(AgentIdentifier);
setState(164);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(163);
ruleDec();
}
}
setState(166);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==At || _la==Bar );
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RuleDecContext extends ParserRuleContext {
public RateContext rate() {
return getRuleContext(RateContext.class,0);
}
public EffectContext effect() {
return getRuleContext(EffectContext.class,0);
}
public GuardContext guard() {
return getRuleContext(GuardContext.class,0);
}
public List forEach() {
return getRuleContexts(ForEachContext.class);
}
public ForEachContext forEach(int i) {
return getRuleContext(ForEachContext.class,i);
}
public WhereContext where() {
return getRuleContext(WhereContext.class,0);
}
public RuleDecContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_ruleDec; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterRuleDec(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitRuleDec(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitRuleDec(this);
else return visitor.visitChildren(this);
}
}
public final RuleDecContext ruleDec() throws RecognitionException {
RuleDecContext _localctx = new RuleDecContext(_ctx, getState());
enterRule(_localctx, 16, RULE_ruleDec);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(169);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==Bar) {
{
setState(168);
guard();
}
}
setState(171);
rate();
setState(175);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==For) {
{
{
setState(172);
forEach();
}
}
setState(177);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(178);
effect();
setState(180);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==Where) {
{
setState(179);
where();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class GuardContext extends ParserRuleContext {
public TerminalNode Bar() { return getToken(ML3Parser.Bar, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public List Comma() { return getTokens(ML3Parser.Comma); }
public TerminalNode Comma(int i) {
return getToken(ML3Parser.Comma, i);
}
public GuardContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_guard; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterGuard(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitGuard(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitGuard(this);
else return visitor.visitChildren(this);
}
}
public final GuardContext guard() throws RecognitionException {
GuardContext _localctx = new GuardContext(_ctx, getState());
enterRule(_localctx, 18, RULE_guard);
int _la;
try {
setState(192);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(182);
match(Bar);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(183);
match(Bar);
setState(184);
expression(0);
setState(189);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==Comma) {
{
{
setState(185);
match(Comma);
setState(186);
expression(0);
}
}
setState(191);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ForEachContext extends ParserRuleContext {
public TerminalNode For() { return getToken(ML3Parser.For, 0); }
public TerminalNode Each() { return getToken(ML3Parser.Each, 0); }
public TerminalNode LocalIdentifier() { return getToken(ML3Parser.LocalIdentifier, 0); }
public TerminalNode In() { return getToken(ML3Parser.In, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public ForEachContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_forEach; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterForEach(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitForEach(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitForEach(this);
else return visitor.visitChildren(this);
}
}
public final ForEachContext forEach() throws RecognitionException {
ForEachContext _localctx = new ForEachContext(_ctx, getState());
enterRule(_localctx, 20, RULE_forEach);
try {
enterOuterAlt(_localctx, 1);
{
setState(194);
match(For);
setState(195);
match(Each);
setState(196);
match(LocalIdentifier);
setState(197);
match(In);
setState(198);
expression(0);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RateContext extends ParserRuleContext {
public TerminalNode At() { return getToken(ML3Parser.At, 0); }
public TerminalNode Instantly() { return getToken(ML3Parser.Instantly, 0); }
public AgeRateContext ageRate() {
return getRuleContext(AgeRateContext.class,0);
}
public EveryRateContext everyRate() {
return getRuleContext(EveryRateContext.class,0);
}
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public RateContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_rate; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterRate(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitRate(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitRate(this);
else return visitor.visitChildren(this);
}
}
public final RateContext rate() throws RecognitionException {
RateContext _localctx = new RateContext(_ctx, getState());
enterRule(_localctx, 22, RULE_rate);
try {
setState(208);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,19,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(200);
match(At);
setState(201);
match(Instantly);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(202);
match(At);
setState(203);
ageRate();
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(204);
match(At);
setState(205);
everyRate();
}
break;
case 4:
enterOuterAlt(_localctx, 4);
{
setState(206);
match(At);
setState(207);
expression(0);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class EffectContext extends ParserRuleContext {
public TerminalNode ArrowOS() { return getToken(ML3Parser.ArrowOS, 0); }
public StatementContext statement() {
return getRuleContext(StatementContext.class,0);
}
public EffectContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_effect; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterEffect(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitEffect(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitEffect(this);
else return visitor.visitChildren(this);
}
}
public final EffectContext effect() throws RecognitionException {
EffectContext _localctx = new EffectContext(_ctx, getState());
enterRule(_localctx, 24, RULE_effect);
try {
enterOuterAlt(_localctx, 1);
{
setState(210);
match(ArrowOS);
setState(211);
statement(0);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class CardinalityContext extends ParserRuleContext {
public Token one;
public Token many;
public CardinalityContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_cardinality; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterCardinality(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitCardinality(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitCardinality(this);
else return visitor.visitChildren(this);
}
}
public final CardinalityContext cardinality() throws RecognitionException {
CardinalityContext _localctx = new CardinalityContext(_ctx, getState());
enterRule(_localctx, 26, RULE_cardinality);
try {
setState(215);
_errHandler.sync(this);
switch (_input.LA(1)) {
case T__0:
enterOuterAlt(_localctx, 1);
{
setState(213);
((CardinalityContext)_localctx).one = match(T__0);
}
break;
case T__1:
enterOuterAlt(_localctx, 2);
{
setState(214);
((CardinalityContext)_localctx).many = match(T__1);
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ConstantContext extends ParserRuleContext {
public TerminalNode Nat() { return getToken(ML3Parser.Nat, 0); }
public TerminalNode Real() { return getToken(ML3Parser.Real, 0); }
public TerminalNode Bool() { return getToken(ML3Parser.Bool, 0); }
public TerminalNode String() { return getToken(ML3Parser.String, 0); }
public ConstantContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_constant; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterConstant(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitConstant(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitConstant(this);
else return visitor.visitChildren(this);
}
}
public final ConstantContext constant() throws RecognitionException {
ConstantContext _localctx = new ConstantContext(_ctx, getState());
enterRule(_localctx, 28, RULE_constant);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(227);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) {
case 1:
{
setState(218);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==Add || _la==Sub) {
{
setState(217);
_la = _input.LA(1);
if ( !(_la==Add || _la==Sub) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
setState(220);
match(Nat);
}
break;
case 2:
{
setState(222);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==Add || _la==Sub) {
{
setState(221);
_la = _input.LA(1);
if ( !(_la==Add || _la==Sub) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
setState(224);
match(Real);
}
break;
case 3:
{
setState(225);
match(Bool);
}
break;
case 4:
{
setState(226);
match(String);
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class AttrDecContext extends ParserRuleContext {
public TerminalNode Identifier() { return getToken(ML3Parser.Identifier, 0); }
public TerminalNode Colon() { return getToken(ML3Parser.Colon, 0); }
public BasicTypeContext basicType() {
return getRuleContext(BasicTypeContext.class,0);
}
public TerminalNode Assign() { return getToken(ML3Parser.Assign, 0); }
public ConstantContext constant() {
return getRuleContext(ConstantContext.class,0);
}
public AttrDecContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_attrDec; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterAttrDec(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitAttrDec(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitAttrDec(this);
else return visitor.visitChildren(this);
}
}
public final AttrDecContext attrDec() throws RecognitionException {
AttrDecContext _localctx = new AttrDecContext(_ctx, getState());
enterRule(_localctx, 30, RULE_attrDec);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(229);
match(Identifier);
setState(230);
match(Colon);
setState(231);
basicType();
setState(234);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==Assign) {
{
setState(232);
match(Assign);
setState(233);
constant();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ParamDecContext extends ParserRuleContext {
public TerminalNode LocalIdentifier() { return getToken(ML3Parser.LocalIdentifier, 0); }
public TerminalNode Colon() { return getToken(ML3Parser.Colon, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public ParamDecContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_paramDec; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterParamDec(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitParamDec(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitParamDec(this);
else return visitor.visitChildren(this);
}
}
public final ParamDecContext paramDec() throws RecognitionException {
ParamDecContext _localctx = new ParamDecContext(_ctx, getState());
enterRule(_localctx, 32, RULE_paramDec);
try {
enterOuterAlt(_localctx, 1);
{
setState(236);
match(LocalIdentifier);
setState(237);
match(Colon);
setState(238);
type();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class WhereContext extends ParserRuleContext {
public TerminalNode Where() { return getToken(ML3Parser.Where, 0); }
public List LocalIdentifier() { return getTokens(ML3Parser.LocalIdentifier); }
public TerminalNode LocalIdentifier(int i) {
return getToken(ML3Parser.LocalIdentifier, i);
}
public List Assign() { return getTokens(ML3Parser.Assign); }
public TerminalNode Assign(int i) {
return getToken(ML3Parser.Assign, i);
}
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public List Semicolon() { return getTokens(ML3Parser.Semicolon); }
public TerminalNode Semicolon(int i) {
return getToken(ML3Parser.Semicolon, i);
}
public WhereContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_where; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterWhere(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitWhere(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitWhere(this);
else return visitor.visitChildren(this);
}
}
public final WhereContext where() throws RecognitionException {
WhereContext _localctx = new WhereContext(_ctx, getState());
enterRule(_localctx, 34, RULE_where);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(240);
match(Where);
setState(241);
match(LocalIdentifier);
setState(242);
match(Assign);
setState(243);
expression(0);
setState(252);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==Semicolon || _la==LocalIdentifier) {
{
{
setState(245);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==Semicolon) {
{
setState(244);
match(Semicolon);
}
}
setState(247);
match(LocalIdentifier);
setState(248);
match(Assign);
setState(249);
expression(0);
}
}
setState(254);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ConstantTypeContext extends ParserRuleContext {
public TerminalNode TypeString() { return getToken(ML3Parser.TypeString, 0); }
public TerminalNode TypeBool() { return getToken(ML3Parser.TypeBool, 0); }
public TerminalNode TypeInt() { return getToken(ML3Parser.TypeInt, 0); }
public TerminalNode TypeReal() { return getToken(ML3Parser.TypeReal, 0); }
public ConstantTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_constantType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterConstantType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitConstantType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitConstantType(this);
else return visitor.visitChildren(this);
}
}
public final ConstantTypeContext constantType() throws RecognitionException {
ConstantTypeContext _localctx = new ConstantTypeContext(_ctx, getState());
enterRule(_localctx, 36, RULE_constantType);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(255);
_la = _input.LA(1);
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << TypeString) | (1L << TypeInt) | (1L << TypeBool) | (1L << TypeReal))) != 0)) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class BasicTypeContext extends ParserRuleContext {
public ConstantTypeContext constantType() {
return getRuleContext(ConstantTypeContext.class,0);
}
public EnumTypeContext enumType() {
return getRuleContext(EnumTypeContext.class,0);
}
public BasicTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_basicType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterBasicType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitBasicType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitBasicType(this);
else return visitor.visitChildren(this);
}
}
public final BasicTypeContext basicType() throws RecognitionException {
BasicTypeContext _localctx = new BasicTypeContext(_ctx, getState());
enterRule(_localctx, 38, RULE_basicType);
try {
setState(259);
_errHandler.sync(this);
switch (_input.LA(1)) {
case TypeString:
case TypeInt:
case TypeBool:
case TypeReal:
enterOuterAlt(_localctx, 1);
{
setState(257);
constantType();
}
break;
case OBrace:
enterOuterAlt(_localctx, 2);
{
setState(258);
enumType();
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class TypeContext extends ParserRuleContext {
public BasicTypeContext basicType() {
return getRuleContext(BasicTypeContext.class,0);
}
public TerminalNode AgentIdentifier() { return getToken(ML3Parser.AgentIdentifier, 0); }
public TerminalNode OBracket() { return getToken(ML3Parser.OBracket, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public TerminalNode CBracket() { return getToken(ML3Parser.CBracket, 0); }
public TypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_type; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitType(this);
else return visitor.visitChildren(this);
}
}
public final TypeContext type() throws RecognitionException {
TypeContext _localctx = new TypeContext(_ctx, getState());
enterRule(_localctx, 40, RULE_type);
try {
setState(267);
_errHandler.sync(this);
switch (_input.LA(1)) {
case OBrace:
case TypeString:
case TypeInt:
case TypeBool:
case TypeReal:
enterOuterAlt(_localctx, 1);
{
setState(261);
basicType();
}
break;
case AgentIdentifier:
enterOuterAlt(_localctx, 2);
{
setState(262);
match(AgentIdentifier);
}
break;
case OBracket:
enterOuterAlt(_localctx, 3);
{
{
setState(263);
match(OBracket);
setState(264);
type();
setState(265);
match(CBracket);
}
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class StatementContext extends ParserRuleContext {
public StatementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_statement; }
public StatementContext() { }
public void copyFrom(StatementContext ctx) {
super.copyFrom(ctx);
}
}
public static class NewStatementContext extends StatementContext {
public TerminalNode New() { return getToken(ML3Parser.New, 0); }
public TerminalNode AgentIdentifier() { return getToken(ML3Parser.AgentIdentifier, 0); }
public TerminalNode OParen() { return getToken(ML3Parser.OParen, 0); }
public TerminalNode CParen() { return getToken(ML3Parser.CParen, 0); }
public TerminalNode LocalIdentifier() { return getToken(ML3Parser.LocalIdentifier, 0); }
public TerminalNode Assign() { return getToken(ML3Parser.Assign, 0); }
public List agentCreationArgument() {
return getRuleContexts(AgentCreationArgumentContext.class);
}
public AgentCreationArgumentContext agentCreationArgument(int i) {
return getRuleContext(AgentCreationArgumentContext.class,i);
}
public List Comma() { return getTokens(ML3Parser.Comma); }
public TerminalNode Comma(int i) {
return getToken(ML3Parser.Comma, i);
}
public NewStatementContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterNewStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitNewStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitNewStatement(this);
else return visitor.visitChildren(this);
}
}
public static class ProcCallStatementContext extends StatementContext {
public ExpressionContext base;
public TerminalNode Dot() { return getToken(ML3Parser.Dot, 0); }
public TerminalNode Identifier() { return getToken(ML3Parser.Identifier, 0); }
public TerminalNode OParen() { return getToken(ML3Parser.OParen, 0); }
public TerminalNode CParen() { return getToken(ML3Parser.CParen, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public List Comma() { return getTokens(ML3Parser.Comma); }
public TerminalNode Comma(int i) {
return getToken(ML3Parser.Comma, i);
}
public ProcCallStatementContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterProcCallStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitProcCallStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitProcCallStatement(this);
else return visitor.visitChildren(this);
}
}
public static class AddAssignStatementContext extends StatementContext {
public AssignLeftSideContext assignLeftSide() {
return getRuleContext(AssignLeftSideContext.class,0);
}
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public TerminalNode AddAssign() { return getToken(ML3Parser.AddAssign, 0); }
public TerminalNode SubAssign() { return getToken(ML3Parser.SubAssign, 0); }
public AddAssignStatementContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterAddAssignStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitAddAssignStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitAddAssignStatement(this);
else return visitor.visitChildren(this);
}
}
public static class ForStatementContext extends StatementContext {
public TerminalNode For() { return getToken(ML3Parser.For, 0); }
public TerminalNode Each() { return getToken(ML3Parser.Each, 0); }
public TerminalNode LocalIdentifier() { return getToken(ML3Parser.LocalIdentifier, 0); }
public TerminalNode In() { return getToken(ML3Parser.In, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public StatementContext statement() {
return getRuleContext(StatementContext.class,0);
}
public TerminalNode End() { return getToken(ML3Parser.End, 0); }
public ForStatementContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterForStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitForStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitForStatement(this);
else return visitor.visitChildren(this);
}
}
public static class AssignStatementContext extends StatementContext {
public AssignLeftSideContext assignLeftSide() {
return getRuleContext(AssignLeftSideContext.class,0);
}
public TerminalNode Assign() { return getToken(ML3Parser.Assign, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public AssignStatementContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterAssignStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitAssignStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitAssignStatement(this);
else return visitor.visitChildren(this);
}
}
public static class IfStatementContext extends StatementContext {
public IfClauseContext ifClause() {
return getRuleContext(IfClauseContext.class,0);
}
public IfStatementContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterIfStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitIfStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitIfStatement(this);
else return visitor.visitChildren(this);
}
}
public static class CompStatementContext extends StatementContext {
public StatementContext l;
public StatementContext r;
public List statement() {
return getRuleContexts(StatementContext.class);
}
public StatementContext statement(int i) {
return getRuleContext(StatementContext.class,i);
}
public TerminalNode Semicolon() { return getToken(ML3Parser.Semicolon, 0); }
public CompStatementContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterCompStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitCompStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitCompStatement(this);
else return visitor.visitChildren(this);
}
}
public final StatementContext statement() throws RecognitionException {
return statement(0);
}
private StatementContext statement(int _p) throws RecognitionException {
ParserRuleContext _parentctx = _ctx;
int _parentState = getState();
StatementContext _localctx = new StatementContext(_ctx, _parentState);
StatementContext _prevctx = _localctx;
int _startState = 42;
enterRecursionRule(_localctx, 42, RULE_statement, _p);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(321);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,34,_ctx) ) {
case 1:
{
_localctx = new IfStatementContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(270);
ifClause();
}
break;
case 2:
{
_localctx = new ForStatementContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(271);
match(For);
setState(272);
match(Each);
setState(273);
match(LocalIdentifier);
setState(274);
match(In);
setState(275);
expression(0);
setState(276);
statement(0);
setState(277);
match(End);
}
break;
case 3:
{
_localctx = new AssignStatementContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(279);
assignLeftSide();
setState(280);
match(Assign);
setState(281);
expression(0);
}
break;
case 4:
{
_localctx = new AddAssignStatementContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(283);
assignLeftSide();
setState(284);
_la = _input.LA(1);
if ( !(_la==AddAssign || _la==SubAssign) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(285);
expression(0);
}
break;
case 5:
{
_localctx = new NewStatementContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(289);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LocalIdentifier) {
{
setState(287);
match(LocalIdentifier);
setState(288);
match(Assign);
}
}
setState(291);
match(New);
setState(292);
match(AgentIdentifier);
setState(293);
match(OParen);
setState(302);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==Age || _la==Identifier) {
{
setState(294);
agentCreationArgument();
setState(299);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==Comma) {
{
{
setState(295);
match(Comma);
setState(296);
agentCreationArgument();
}
}
setState(301);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(304);
match(CParen);
}
break;
case 6:
{
_localctx = new ProcCallStatementContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(305);
((ProcCallStatementContext)_localctx).base = expression(0);
setState(306);
match(Dot);
setState(307);
match(Identifier);
setState(308);
match(OParen);
setState(317);
_errHandler.sync(this);
_la = _input.LA(1);
if (((((_la - 5)) & ~0x3f) == 0 && ((1L << (_la - 5)) & ((1L << (Alter - 5)) | (1L << (Ego - 5)) | (1L << (If - 5)) | (1L << (Now - 5)) | (1L << (Add - 5)) | (1L << (Sub - 5)) | (1L << (Not - 5)) | (1L << (OParen - 5)) | (1L << (OBracket - 5)) | (1L << (Bool - 5)) | (1L << (Nat - 5)) | (1L << (Real - 5)) | (1L << (String - 5)) | (1L << (AgentIdentifier - 5)) | (1L << (Identifier - 5)) | (1L << (LocalIdentifier - 5)))) != 0)) {
{
setState(309);
expression(0);
setState(314);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==Comma) {
{
{
setState(310);
match(Comma);
setState(311);
expression(0);
}
}
setState(316);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(319);
match(CParen);
}
break;
}
_ctx.stop = _input.LT(-1);
setState(330);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,36,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
{
_localctx = new CompStatementContext(new StatementContext(_parentctx, _parentState));
((CompStatementContext)_localctx).l = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_statement);
setState(323);
if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)");
setState(325);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==Semicolon) {
{
setState(324);
match(Semicolon);
}
}
setState(327);
((CompStatementContext)_localctx).r = statement(6);
}
}
}
setState(332);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,36,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
unrollRecursionContexts(_parentctx);
}
return _localctx;
}
public static class IfClauseContext extends ParserRuleContext {
public ExpressionContext c;
public StatementContext t;
public TerminalNode If() { return getToken(ML3Parser.If, 0); }
public TerminalNode Then() { return getToken(ML3Parser.Then, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public StatementContext statement() {
return getRuleContext(StatementContext.class,0);
}
public ElseClauseContext elseClause() {
return getRuleContext(ElseClauseContext.class,0);
}
public TerminalNode End() { return getToken(ML3Parser.End, 0); }
public IfClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_ifClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterIfClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitIfClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitIfClause(this);
else return visitor.visitChildren(this);
}
}
public final IfClauseContext ifClause() throws RecognitionException {
IfClauseContext _localctx = new IfClauseContext(_ctx, getState());
enterRule(_localctx, 44, RULE_ifClause);
try {
enterOuterAlt(_localctx, 1);
{
setState(333);
match(If);
setState(334);
((IfClauseContext)_localctx).c = expression(0);
setState(335);
match(Then);
setState(336);
((IfClauseContext)_localctx).t = statement(0);
setState(339);
_errHandler.sync(this);
switch (_input.LA(1)) {
case Else:
{
setState(337);
elseClause();
}
break;
case End:
{
setState(338);
match(End);
}
break;
default:
throw new NoViableAltException(this);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ElseClauseContext extends ParserRuleContext {
public StatementContext f;
public TerminalNode Else() { return getToken(ML3Parser.Else, 0); }
public IfClauseContext ifClause() {
return getRuleContext(IfClauseContext.class,0);
}
public TerminalNode End() { return getToken(ML3Parser.End, 0); }
public StatementContext statement() {
return getRuleContext(StatementContext.class,0);
}
public ElseClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_elseClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterElseClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitElseClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitElseClause(this);
else return visitor.visitChildren(this);
}
}
public final ElseClauseContext elseClause() throws RecognitionException {
ElseClauseContext _localctx = new ElseClauseContext(_ctx, getState());
enterRule(_localctx, 46, RULE_elseClause);
try {
enterOuterAlt(_localctx, 1);
{
setState(341);
match(Else);
setState(346);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,38,_ctx) ) {
case 1:
{
setState(342);
ifClause();
}
break;
case 2:
{
setState(343);
((ElseClauseContext)_localctx).f = statement(0);
setState(344);
match(End);
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class AssignLeftSideContext extends ParserRuleContext {
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public TerminalNode Dot() { return getToken(ML3Parser.Dot, 0); }
public TerminalNode Identifier() { return getToken(ML3Parser.Identifier, 0); }
public TerminalNode LocalIdentifier() { return getToken(ML3Parser.LocalIdentifier, 0); }
public AssignLeftSideContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_assignLeftSide; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterAssignLeftSide(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitAssignLeftSide(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitAssignLeftSide(this);
else return visitor.visitChildren(this);
}
}
public final AssignLeftSideContext assignLeftSide() throws RecognitionException {
AssignLeftSideContext _localctx = new AssignLeftSideContext(_ctx, getState());
enterRule(_localctx, 48, RULE_assignLeftSide);
try {
setState(353);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,39,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(348);
expression(0);
setState(349);
match(Dot);
setState(350);
match(Identifier);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(352);
match(LocalIdentifier);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ExpressionContext extends ParserRuleContext {
public ExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_expression; }
public ExpressionContext() { }
public void copyFrom(ExpressionContext ctx) {
super.copyFrom(ctx);
}
}
public static class AlterExpressionContext extends ExpressionContext {
public TerminalNode Alter() { return getToken(ML3Parser.Alter, 0); }
public AlterExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterAlterExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitAlterExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitAlterExpression(this);
else return visitor.visitChildren(this);
}
}
public static class ConstantExpressionContext extends ExpressionContext {
public ConstantContext constant() {
return getRuleContext(ConstantContext.class,0);
}
public ConstantExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterConstantExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitConstantExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitConstantExpression(this);
else return visitor.visitChildren(this);
}
}
public static class RelationalExpressionContext extends ExpressionContext {
public ExpressionContext l;
public ExpressionContext r;
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public TerminalNode GreaterThan() { return getToken(ML3Parser.GreaterThan, 0); }
public TerminalNode SmallerThan() { return getToken(ML3Parser.SmallerThan, 0); }
public TerminalNode GreaterThanEquals() { return getToken(ML3Parser.GreaterThanEquals, 0); }
public TerminalNode SmallerThanEquals() { return getToken(ML3Parser.SmallerThanEquals, 0); }
public RelationalExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterRelationalExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitRelationalExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitRelationalExpression(this);
else return visitor.visitChildren(this);
}
}
public static class GlobalConstantAccessExpressionContext extends ExpressionContext {
public TerminalNode Identifier() { return getToken(ML3Parser.Identifier, 0); }
public GlobalConstantAccessExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterGlobalConstantAccessExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitGlobalConstantAccessExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitGlobalConstantAccessExpression(this);
else return visitor.visitChildren(this);
}
}
public static class EgoExpressionContext extends ExpressionContext {
public TerminalNode Ego() { return getToken(ML3Parser.Ego, 0); }
public EgoExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterEgoExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitEgoExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitEgoExpression(this);
else return visitor.visitChildren(this);
}
}
public static class MathFuncCallExpressionContext extends ExpressionContext {
public TerminalNode Identifier() { return getToken(ML3Parser.Identifier, 0); }
public TerminalNode OParen() { return getToken(ML3Parser.OParen, 0); }
public TerminalNode CParen() { return getToken(ML3Parser.CParen, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public List Comma() { return getTokens(ML3Parser.Comma); }
public TerminalNode Comma(int i) {
return getToken(ML3Parser.Comma, i);
}
public MathFuncCallExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterMathFuncCallExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitMathFuncCallExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitMathFuncCallExpression(this);
else return visitor.visitChildren(this);
}
}
public static class ParenExpressionContext extends ExpressionContext {
public ExpressionContext e;
public TerminalNode OParen() { return getToken(ML3Parser.OParen, 0); }
public TerminalNode CParen() { return getToken(ML3Parser.CParen, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public ParenExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterParenExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitParenExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitParenExpression(this);
else return visitor.visitChildren(this);
}
}
public static class MultiplyExpressionContext extends ExpressionContext {
public ExpressionContext l;
public ExpressionContext r;
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public TerminalNode Mul() { return getToken(ML3Parser.Mul, 0); }
public TerminalNode Div() { return getToken(ML3Parser.Div, 0); }
public TerminalNode Mod() { return getToken(ML3Parser.Mod, 0); }
public MultiplyExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterMultiplyExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitMultiplyExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitMultiplyExpression(this);
else return visitor.visitChildren(this);
}
}
public static class MapAccessExpressionContext extends ExpressionContext {
public TerminalNode Identifier() { return getToken(ML3Parser.Identifier, 0); }
public TerminalNode OBracket() { return getToken(ML3Parser.OBracket, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public TerminalNode CBracket() { return getToken(ML3Parser.CBracket, 0); }
public MapAccessExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterMapAccessExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitMapAccessExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitMapAccessExpression(this);
else return visitor.visitChildren(this);
}
}
public static class IfElseExpressionContext extends ExpressionContext {
public ExpressionContext c;
public ExpressionContext t;
public ExpressionContext f;
public TerminalNode If() { return getToken(ML3Parser.If, 0); }
public TerminalNode Then() { return getToken(ML3Parser.Then, 0); }
public TerminalNode Else() { return getToken(ML3Parser.Else, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public IfElseExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterIfElseExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitIfElseExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitIfElseExpression(this);
else return visitor.visitChildren(this);
}
}
public static class FuncCallExpressionContext extends ExpressionContext {
public ExpressionContext l;
public TerminalNode Dot() { return getToken(ML3Parser.Dot, 0); }
public TerminalNode Identifier() { return getToken(ML3Parser.Identifier, 0); }
public TerminalNode OParen() { return getToken(ML3Parser.OParen, 0); }
public TerminalNode CParen() { return getToken(ML3Parser.CParen, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public List Comma() { return getTokens(ML3Parser.Comma); }
public TerminalNode Comma(int i) {
return getToken(ML3Parser.Comma, i);
}
public FuncCallExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterFuncCallExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitFuncCallExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitFuncCallExpression(this);
else return visitor.visitChildren(this);
}
}
public static class OrExpressionContext extends ExpressionContext {
public ExpressionContext l;
public ExpressionContext r;
public TerminalNode Or() { return getToken(ML3Parser.Or, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public OrExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterOrExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitOrExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitOrExpression(this);
else return visitor.visitChildren(this);
}
}
public static class AndExpressionContext extends ExpressionContext {
public ExpressionContext l;
public ExpressionContext r;
public TerminalNode And() { return getToken(ML3Parser.And, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public AndExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterAndExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitAndExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitAndExpression(this);
else return visitor.visitChildren(this);
}
}
public static class InExpressionContext extends ExpressionContext {
public ExpressionContext l;
public ExpressionContext r;
public TerminalNode In() { return getToken(ML3Parser.In, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public InExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterInExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitInExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitInExpression(this);
else return visitor.visitChildren(this);
}
}
public static class EqualsExpressionContext extends ExpressionContext {
public ExpressionContext l;
public ExpressionContext r;
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public TerminalNode Equals() { return getToken(ML3Parser.Equals, 0); }
public TerminalNode NotEquals() { return getToken(ML3Parser.NotEquals, 0); }
public EqualsExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterEqualsExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitEqualsExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitEqualsExpression(this);
else return visitor.visitChildren(this);
}
}
public static class AddExpressionContext extends ExpressionContext {
public ExpressionContext l;
public ExpressionContext r;
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public TerminalNode Add() { return getToken(ML3Parser.Add, 0); }
public TerminalNode Sub() { return getToken(ML3Parser.Sub, 0); }
public AddExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterAddExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitAddExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitAddExpression(this);
else return visitor.visitChildren(this);
}
}
public static class SingletonExpressionContext extends ExpressionContext {
public TerminalNode AgentIdentifier() { return getToken(ML3Parser.AgentIdentifier, 0); }
public SingletonExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterSingletonExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitSingletonExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitSingletonExpression(this);
else return visitor.visitChildren(this);
}
}
public static class ExponentialExpressionContext extends ExpressionContext {
public ExpressionContext l;
public ExpressionContext r;
public TerminalNode Pow() { return getToken(ML3Parser.Pow, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public ExponentialExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterExponentialExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitExponentialExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitExponentialExpression(this);
else return visitor.visitChildren(this);
}
}
public static class LocalConstantAccessExpressionContext extends ExpressionContext {
public TerminalNode LocalIdentifier() { return getToken(ML3Parser.LocalIdentifier, 0); }
public LocalConstantAccessExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterLocalConstantAccessExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitLocalConstantAccessExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitLocalConstantAccessExpression(this);
else return visitor.visitChildren(this);
}
}
public static class SetExpressionContext extends ExpressionContext {
public TerminalNode OBracket() { return getToken(ML3Parser.OBracket, 0); }
public TerminalNode CBracket() { return getToken(ML3Parser.CBracket, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public List Comma() { return getTokens(ML3Parser.Comma); }
public TerminalNode Comma(int i) {
return getToken(ML3Parser.Comma, i);
}
public SetExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterSetExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitSetExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitSetExpression(this);
else return visitor.visitChildren(this);
}
}
public static class AllAgentsContext extends ExpressionContext {
public TerminalNode AgentIdentifier() { return getToken(ML3Parser.AgentIdentifier, 0); }
public TerminalNode Dot() { return getToken(ML3Parser.Dot, 0); }
public TerminalNode All() { return getToken(ML3Parser.All, 0); }
public AllAgentsContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterAllAgents(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitAllAgents(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitAllAgents(this);
else return visitor.visitChildren(this);
}
}
public static class AttrAccessExpressionContext extends ExpressionContext {
public ExpressionContext l;
public Token id;
public TerminalNode Dot() { return getToken(ML3Parser.Dot, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public TerminalNode Identifier() { return getToken(ML3Parser.Identifier, 0); }
public TerminalNode Age() { return getToken(ML3Parser.Age, 0); }
public AttrAccessExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterAttrAccessExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitAttrAccessExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitAttrAccessExpression(this);
else return visitor.visitChildren(this);
}
}
public static class UnaryExpressionContext extends ExpressionContext {
public ExpressionContext e;
public TerminalNode Sub() { return getToken(ML3Parser.Sub, 0); }
public TerminalNode Not() { return getToken(ML3Parser.Not, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public UnaryExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterUnaryExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitUnaryExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitUnaryExpression(this);
else return visitor.visitChildren(this);
}
}
public static class NowExpressionContext extends ExpressionContext {
public TerminalNode Now() { return getToken(ML3Parser.Now, 0); }
public NowExpressionContext(ExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterNowExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitNowExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitNowExpression(this);
else return visitor.visitChildren(this);
}
}
public final ExpressionContext expression() throws RecognitionException {
return expression(0);
}
private ExpressionContext expression(int _p) throws RecognitionException {
ParserRuleContext _parentctx = _ctx;
int _parentState = getState();
ExpressionContext _localctx = new ExpressionContext(_ctx, _parentState);
ExpressionContext _prevctx = _localctx;
int _startState = 50;
enterRecursionRule(_localctx, 50, RULE_expression, _p);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(409);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,44,_ctx) ) {
case 1:
{
_localctx = new MathFuncCallExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(356);
match(Identifier);
setState(357);
match(OParen);
setState(366);
_errHandler.sync(this);
_la = _input.LA(1);
if (((((_la - 5)) & ~0x3f) == 0 && ((1L << (_la - 5)) & ((1L << (Alter - 5)) | (1L << (Ego - 5)) | (1L << (If - 5)) | (1L << (Now - 5)) | (1L << (Add - 5)) | (1L << (Sub - 5)) | (1L << (Not - 5)) | (1L << (OParen - 5)) | (1L << (OBracket - 5)) | (1L << (Bool - 5)) | (1L << (Nat - 5)) | (1L << (Real - 5)) | (1L << (String - 5)) | (1L << (AgentIdentifier - 5)) | (1L << (Identifier - 5)) | (1L << (LocalIdentifier - 5)))) != 0)) {
{
setState(358);
expression(0);
setState(363);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==Comma) {
{
{
setState(359);
match(Comma);
setState(360);
expression(0);
}
}
setState(365);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(368);
match(CParen);
}
break;
case 2:
{
_localctx = new UnaryExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(369);
_la = _input.LA(1);
if ( !(_la==Sub || _la==Not) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(370);
((UnaryExpressionContext)_localctx).e = expression(20);
}
break;
case 3:
{
_localctx = new IfElseExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(371);
match(If);
setState(372);
((IfElseExpressionContext)_localctx).c = expression(0);
setState(373);
match(Then);
setState(374);
((IfElseExpressionContext)_localctx).t = expression(0);
setState(375);
match(Else);
setState(376);
((IfElseExpressionContext)_localctx).f = expression(13);
}
break;
case 4:
{
_localctx = new GlobalConstantAccessExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(378);
match(Identifier);
}
break;
case 5:
{
_localctx = new LocalConstantAccessExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(379);
match(LocalIdentifier);
}
break;
case 6:
{
_localctx = new AllAgentsContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(380);
match(AgentIdentifier);
setState(381);
match(Dot);
setState(382);
match(All);
}
break;
case 7:
{
_localctx = new ParenExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(383);
match(OParen);
setState(384);
((ParenExpressionContext)_localctx).e = expression(0);
setState(385);
match(CParen);
}
break;
case 8:
{
_localctx = new EgoExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(387);
match(Ego);
}
break;
case 9:
{
_localctx = new SingletonExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(388);
match(AgentIdentifier);
}
break;
case 10:
{
_localctx = new AlterExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(389);
match(Alter);
}
break;
case 11:
{
_localctx = new SetExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(390);
match(OBracket);
setState(399);
_errHandler.sync(this);
_la = _input.LA(1);
if (((((_la - 5)) & ~0x3f) == 0 && ((1L << (_la - 5)) & ((1L << (Alter - 5)) | (1L << (Ego - 5)) | (1L << (If - 5)) | (1L << (Now - 5)) | (1L << (Add - 5)) | (1L << (Sub - 5)) | (1L << (Not - 5)) | (1L << (OParen - 5)) | (1L << (OBracket - 5)) | (1L << (Bool - 5)) | (1L << (Nat - 5)) | (1L << (Real - 5)) | (1L << (String - 5)) | (1L << (AgentIdentifier - 5)) | (1L << (Identifier - 5)) | (1L << (LocalIdentifier - 5)))) != 0)) {
{
setState(391);
expression(0);
setState(396);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==Comma) {
{
{
setState(392);
match(Comma);
setState(393);
expression(0);
}
}
setState(398);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(401);
match(CBracket);
}
break;
case 12:
{
_localctx = new ConstantExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(402);
constant();
}
break;
case 13:
{
_localctx = new NowExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(403);
match(Now);
}
break;
case 14:
{
_localctx = new MapAccessExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(404);
match(Identifier);
setState(405);
match(OBracket);
setState(406);
expression(0);
setState(407);
match(CBracket);
}
break;
}
_ctx.stop = _input.LT(-1);
setState(458);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,49,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
setState(456);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,48,_ctx) ) {
case 1:
{
_localctx = new ExponentialExpressionContext(new ExpressionContext(_parentctx, _parentState));
((ExponentialExpressionContext)_localctx).l = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expression);
setState(411);
if (!(precpred(_ctx, 21))) throw new FailedPredicateException(this, "precpred(_ctx, 21)");
setState(412);
match(Pow);
setState(413);
((ExponentialExpressionContext)_localctx).r = expression(21);
}
break;
case 2:
{
_localctx = new MultiplyExpressionContext(new ExpressionContext(_parentctx, _parentState));
((MultiplyExpressionContext)_localctx).l = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expression);
setState(414);
if (!(precpred(_ctx, 19))) throw new FailedPredicateException(this, "precpred(_ctx, 19)");
setState(415);
_la = _input.LA(1);
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << Mul) | (1L << Div) | (1L << Mod))) != 0)) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(416);
((MultiplyExpressionContext)_localctx).r = expression(20);
}
break;
case 3:
{
_localctx = new AddExpressionContext(new ExpressionContext(_parentctx, _parentState));
((AddExpressionContext)_localctx).l = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expression);
setState(417);
if (!(precpred(_ctx, 18))) throw new FailedPredicateException(this, "precpred(_ctx, 18)");
setState(418);
_la = _input.LA(1);
if ( !(_la==Add || _la==Sub) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(419);
((AddExpressionContext)_localctx).r = expression(19);
}
break;
case 4:
{
_localctx = new RelationalExpressionContext(new ExpressionContext(_parentctx, _parentState));
((RelationalExpressionContext)_localctx).l = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expression);
setState(420);
if (!(precpred(_ctx, 17))) throw new FailedPredicateException(this, "precpred(_ctx, 17)");
setState(421);
_la = _input.LA(1);
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << GreaterThanEquals) | (1L << SmallerThanEquals) | (1L << GreaterThan) | (1L << SmallerThan))) != 0)) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(422);
((RelationalExpressionContext)_localctx).r = expression(18);
}
break;
case 5:
{
_localctx = new EqualsExpressionContext(new ExpressionContext(_parentctx, _parentState));
((EqualsExpressionContext)_localctx).l = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expression);
setState(423);
if (!(precpred(_ctx, 16))) throw new FailedPredicateException(this, "precpred(_ctx, 16)");
setState(424);
_la = _input.LA(1);
if ( !(_la==Equals || _la==NotEquals) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(425);
((EqualsExpressionContext)_localctx).r = expression(17);
}
break;
case 6:
{
_localctx = new AndExpressionContext(new ExpressionContext(_parentctx, _parentState));
((AndExpressionContext)_localctx).l = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expression);
setState(426);
if (!(precpred(_ctx, 15))) throw new FailedPredicateException(this, "precpred(_ctx, 15)");
setState(427);
match(And);
setState(428);
((AndExpressionContext)_localctx).r = expression(16);
}
break;
case 7:
{
_localctx = new OrExpressionContext(new ExpressionContext(_parentctx, _parentState));
((OrExpressionContext)_localctx).l = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expression);
setState(429);
if (!(precpred(_ctx, 14))) throw new FailedPredicateException(this, "precpred(_ctx, 14)");
setState(430);
match(Or);
setState(431);
((OrExpressionContext)_localctx).r = expression(15);
}
break;
case 8:
{
_localctx = new InExpressionContext(new ExpressionContext(_parentctx, _parentState));
((InExpressionContext)_localctx).l = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expression);
setState(432);
if (!(precpred(_ctx, 12))) throw new FailedPredicateException(this, "precpred(_ctx, 12)");
setState(433);
match(In);
setState(434);
((InExpressionContext)_localctx).r = expression(13);
}
break;
case 9:
{
_localctx = new FuncCallExpressionContext(new ExpressionContext(_parentctx, _parentState));
((FuncCallExpressionContext)_localctx).l = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expression);
setState(435);
if (!(precpred(_ctx, 24))) throw new FailedPredicateException(this, "precpred(_ctx, 24)");
setState(436);
match(Dot);
setState(437);
match(Identifier);
setState(438);
match(OParen);
setState(447);
_errHandler.sync(this);
_la = _input.LA(1);
if (((((_la - 5)) & ~0x3f) == 0 && ((1L << (_la - 5)) & ((1L << (Alter - 5)) | (1L << (Ego - 5)) | (1L << (If - 5)) | (1L << (Now - 5)) | (1L << (Add - 5)) | (1L << (Sub - 5)) | (1L << (Not - 5)) | (1L << (OParen - 5)) | (1L << (OBracket - 5)) | (1L << (Bool - 5)) | (1L << (Nat - 5)) | (1L << (Real - 5)) | (1L << (String - 5)) | (1L << (AgentIdentifier - 5)) | (1L << (Identifier - 5)) | (1L << (LocalIdentifier - 5)))) != 0)) {
{
setState(439);
expression(0);
setState(444);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==Comma) {
{
{
setState(440);
match(Comma);
setState(441);
expression(0);
}
}
setState(446);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(449);
match(CParen);
}
break;
case 10:
{
_localctx = new AttrAccessExpressionContext(new ExpressionContext(_parentctx, _parentState));
((AttrAccessExpressionContext)_localctx).l = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expression);
setState(450);
if (!(precpred(_ctx, 23))) throw new FailedPredicateException(this, "precpred(_ctx, 23)");
setState(451);
match(Dot);
setState(454);
_errHandler.sync(this);
switch (_input.LA(1)) {
case Identifier:
{
setState(452);
((AttrAccessExpressionContext)_localctx).id = match(Identifier);
}
break;
case Age:
{
setState(453);
((AttrAccessExpressionContext)_localctx).id = match(Age);
}
break;
default:
throw new NoViableAltException(this);
}
}
break;
}
}
}
setState(460);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,49,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
unrollRecursionContexts(_parentctx);
}
return _localctx;
}
public static class EnumTypeContext extends ParserRuleContext {
public TerminalNode OBrace() { return getToken(ML3Parser.OBrace, 0); }
public List String() { return getTokens(ML3Parser.String); }
public TerminalNode String(int i) {
return getToken(ML3Parser.String, i);
}
public TerminalNode CBrace() { return getToken(ML3Parser.CBrace, 0); }
public List Comma() { return getTokens(ML3Parser.Comma); }
public TerminalNode Comma(int i) {
return getToken(ML3Parser.Comma, i);
}
public EnumTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_enumType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterEnumType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitEnumType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitEnumType(this);
else return visitor.visitChildren(this);
}
}
public final EnumTypeContext enumType() throws RecognitionException {
EnumTypeContext _localctx = new EnumTypeContext(_ctx, getState());
enterRule(_localctx, 52, RULE_enumType);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(461);
match(OBrace);
setState(462);
match(String);
setState(467);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==Comma) {
{
{
setState(463);
match(Comma);
setState(464);
match(String);
}
}
setState(469);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(470);
match(CBrace);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class AgentCreationArgumentContext extends ParserRuleContext {
public TerminalNode Assign() { return getToken(ML3Parser.Assign, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public TerminalNode Age() { return getToken(ML3Parser.Age, 0); }
public TerminalNode Identifier() { return getToken(ML3Parser.Identifier, 0); }
public AgentCreationArgumentContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_agentCreationArgument; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterAgentCreationArgument(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitAgentCreationArgument(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitAgentCreationArgument(this);
else return visitor.visitChildren(this);
}
}
public final AgentCreationArgumentContext agentCreationArgument() throws RecognitionException {
AgentCreationArgumentContext _localctx = new AgentCreationArgumentContext(_ctx, getState());
enterRule(_localctx, 54, RULE_agentCreationArgument);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(472);
_la = _input.LA(1);
if ( !(_la==Age || _la==Identifier) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(473);
match(Assign);
setState(474);
expression(0);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class AgeRateContext extends ParserRuleContext {
public TerminalNode Age() { return getToken(ML3Parser.Age, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public AgeRateContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_ageRate; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterAgeRate(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitAgeRate(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitAgeRate(this);
else return visitor.visitChildren(this);
}
}
public final AgeRateContext ageRate() throws RecognitionException {
AgeRateContext _localctx = new AgeRateContext(_ctx, getState());
enterRule(_localctx, 56, RULE_ageRate);
try {
enterOuterAlt(_localctx, 1);
{
setState(476);
match(Age);
setState(477);
expression(0);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class EveryRateContext extends ParserRuleContext {
public TerminalNode Every() { return getToken(ML3Parser.Every, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public TerminalNode Synchronized() { return getToken(ML3Parser.Synchronized, 0); }
public EveryRateContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_everyRate; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).enterEveryRate(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof ML3Listener ) ((ML3Listener)listener).exitEveryRate(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof ML3Visitor ) return ((ML3Visitor extends T>)visitor).visitEveryRate(this);
else return visitor.visitChildren(this);
}
}
public final EveryRateContext everyRate() throws RecognitionException {
EveryRateContext _localctx = new EveryRateContext(_ctx, getState());
enterRule(_localctx, 58, RULE_everyRate);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(479);
match(Every);
setState(480);
expression(0);
setState(482);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==Synchronized) {
{
setState(481);
match(Synchronized);
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
switch (ruleIndex) {
case 21:
return statement_sempred((StatementContext)_localctx, predIndex);
case 25:
return expression_sempred((ExpressionContext)_localctx, predIndex);
}
return true;
}
private boolean statement_sempred(StatementContext _localctx, int predIndex) {
switch (predIndex) {
case 0:
return precpred(_ctx, 5);
}
return true;
}
private boolean expression_sempred(ExpressionContext _localctx, int predIndex) {
switch (predIndex) {
case 1:
return precpred(_ctx, 21);
case 2:
return precpred(_ctx, 19);
case 3:
return precpred(_ctx, 18);
case 4:
return precpred(_ctx, 17);
case 5:
return precpred(_ctx, 16);
case 6:
return precpred(_ctx, 15);
case 7:
return precpred(_ctx, 14);
case 8:
return precpred(_ctx, 12);
case 9:
return precpred(_ctx, 24);
case 10:
return precpred(_ctx, 23);
}
return true;
}
public static final String _serializedATN =
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3H\u01e7\4\2\t\2\4"+
"\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t"+
"\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+
"\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+
"\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\3\2\3\2\3"+
"\2\3\2\3\2\3\2\3\2\7\2F\n\2\f\2\16\2I\13\2\3\2\3\2\3\3\3\3\3\3\3\3\3\3"+
"\5\3R\n\3\3\3\3\3\3\3\5\3W\n\3\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\5\5\5a\n"+
"\5\3\5\3\5\3\5\3\5\3\5\7\5h\n\5\f\5\16\5k\13\5\5\5m\n\5\3\5\3\5\3\6\3"+
"\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7\7\7\u0082"+
"\n\7\f\7\16\7\u0085\13\7\5\7\u0087\n\7\3\7\3\7\3\7\3\7\3\7\3\7\5\7\u008f"+
"\n\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\7\b\u0098\n\b\f\b\16\b\u009b\13\b\5\b"+
"\u009d\n\b\3\b\3\b\3\b\3\b\5\b\u00a3\n\b\3\t\3\t\6\t\u00a7\n\t\r\t\16"+
"\t\u00a8\3\n\5\n\u00ac\n\n\3\n\3\n\7\n\u00b0\n\n\f\n\16\n\u00b3\13\n\3"+
"\n\3\n\5\n\u00b7\n\n\3\13\3\13\3\13\3\13\3\13\7\13\u00be\n\13\f\13\16"+
"\13\u00c1\13\13\5\13\u00c3\n\13\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3"+
"\r\3\r\3\r\3\r\3\r\5\r\u00d3\n\r\3\16\3\16\3\16\3\17\3\17\5\17\u00da\n"+
"\17\3\20\5\20\u00dd\n\20\3\20\3\20\5\20\u00e1\n\20\3\20\3\20\3\20\5\20"+
"\u00e6\n\20\3\21\3\21\3\21\3\21\3\21\5\21\u00ed\n\21\3\22\3\22\3\22\3"+
"\22\3\23\3\23\3\23\3\23\3\23\5\23\u00f8\n\23\3\23\3\23\3\23\7\23\u00fd"+
"\n\23\f\23\16\23\u0100\13\23\3\24\3\24\3\25\3\25\5\25\u0106\n\25\3\26"+
"\3\26\3\26\3\26\3\26\3\26\5\26\u010e\n\26\3\27\3\27\3\27\3\27\3\27\3\27"+
"\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27"+
"\5\27\u0124\n\27\3\27\3\27\3\27\3\27\3\27\3\27\7\27\u012c\n\27\f\27\16"+
"\27\u012f\13\27\5\27\u0131\n\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27"+
"\7\27\u013b\n\27\f\27\16\27\u013e\13\27\5\27\u0140\n\27\3\27\3\27\5\27"+
"\u0144\n\27\3\27\3\27\5\27\u0148\n\27\3\27\7\27\u014b\n\27\f\27\16\27"+
"\u014e\13\27\3\30\3\30\3\30\3\30\3\30\3\30\5\30\u0156\n\30\3\31\3\31\3"+
"\31\3\31\3\31\5\31\u015d\n\31\3\32\3\32\3\32\3\32\3\32\5\32\u0164\n\32"+
"\3\33\3\33\3\33\3\33\3\33\3\33\7\33\u016c\n\33\f\33\16\33\u016f\13\33"+
"\5\33\u0171\n\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33"+
"\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33"+
"\3\33\7\33\u018d\n\33\f\33\16\33\u0190\13\33\5\33\u0192\n\33\3\33\3\33"+
"\3\33\3\33\3\33\3\33\3\33\3\33\5\33\u019c\n\33\3\33\3\33\3\33\3\33\3\33"+
"\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33"+
"\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\7\33\u01bd"+
"\n\33\f\33\16\33\u01c0\13\33\5\33\u01c2\n\33\3\33\3\33\3\33\3\33\3\33"+
"\5\33\u01c9\n\33\7\33\u01cb\n\33\f\33\16\33\u01ce\13\33\3\34\3\34\3\34"+
"\3\34\7\34\u01d4\n\34\f\34\16\34\u01d7\13\34\3\34\3\34\3\35\3\35\3\35"+
"\3\35\3\36\3\36\3\36\3\37\3\37\3\37\5\37\u01e5\n\37\3\37\2\4,\64 \2\4"+
"\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<\2\n\3\2()"+
"\3\2:=\3\2\62\63\4\2))\60\60\3\2*,\3\2$\'\3\2\"#\4\2\5\5CC\2\u021e\2G"+
"\3\2\2\2\4V\3\2\2\2\6X\3\2\2\2\b`\3\2\2\2\np\3\2\2\2\fz\3\2\2\2\16\u0090"+
"\3\2\2\2\20\u00a4\3\2\2\2\22\u00ab\3\2\2\2\24\u00c2\3\2\2\2\26\u00c4\3"+
"\2\2\2\30\u00d2\3\2\2\2\32\u00d4\3\2\2\2\34\u00d9\3\2\2\2\36\u00e5\3\2"+
"\2\2 \u00e7\3\2\2\2\"\u00ee\3\2\2\2$\u00f2\3\2\2\2&\u0101\3\2\2\2(\u0105"+
"\3\2\2\2*\u010d\3\2\2\2,\u0143\3\2\2\2.\u014f\3\2\2\2\60\u0157\3\2\2\2"+
"\62\u0163\3\2\2\2\64\u019b\3\2\2\2\66\u01cf\3\2\2\28\u01da\3\2\2\2:\u01de"+
"\3\2\2\2<\u01e1\3\2\2\2>F\5\4\3\2?F\5\6\4\2@F\5\b\5\2AF\5\n\6\2BF\5\f"+
"\7\2CF\5\16\b\2DF\5\20\t\2E>\3\2\2\2E?\3\2\2\2E@\3\2\2\2EA\3\2\2\2EB\3"+
"\2\2\2EC\3\2\2\2ED\3\2\2\2FI\3\2\2\2GE\3\2\2\2GH\3\2\2\2HJ\3\2\2\2IG\3"+
"\2\2\2JK\7\2\2\3K\3\3\2\2\2LM\7C\2\2MN\7\35\2\2NQ\5&\24\2OP\7\61\2\2P"+
"R\5\36\20\2QO\3\2\2\2QR\3\2\2\2RW\3\2\2\2ST\7C\2\2TU\7\61\2\2UW\5\36\20"+
"\2VL\3\2\2\2VS\3\2\2\2W\5\3\2\2\2XY\7C\2\2YZ\7\66\2\2Z[\5&\24\2[\\\7\67"+
"\2\2\\]\7\35\2\2]^\5&\24\2^\7\3\2\2\2_a\7\27\2\2`_\3\2\2\2`a\3\2\2\2a"+
"b\3\2\2\2bc\7B\2\2cl\7\64\2\2di\5 \21\2ef\7!\2\2fh\5 \21\2ge\3\2\2\2h"+
"k\3\2\2\2ig\3\2\2\2ij\3\2\2\2jm\3\2\2\2ki\3\2\2\2ld\3\2\2\2lm\3\2\2\2"+
"mn\3\2\2\2no\7\65\2\2o\t\3\2\2\2pq\7C\2\2qr\7\35\2\2rs\7B\2\2st\5\34\17"+
"\2tu\7\31\2\2uv\5\34\17\2vw\7B\2\2wx\7\35\2\2xy\7C\2\2y\13\3\2\2\2z{\7"+
"B\2\2{|\7\33\2\2|}\7C\2\2}\u0086\7\64\2\2~\u0083\5\"\22\2\177\u0080\7"+
"!\2\2\u0080\u0082\5\"\22\2\u0081\177\3\2\2\2\u0082\u0085\3\2\2\2\u0083"+
"\u0081\3\2\2\2\u0083\u0084\3\2\2\2\u0084\u0087\3\2\2\2\u0085\u0083\3\2"+
"\2\2\u0086~\3\2\2\2\u0086\u0087\3\2\2\2\u0087\u0088\3\2\2\2\u0088\u0089"+
"\7\65\2\2\u0089\u008a\7\35\2\2\u008a\u008b\5*\26\2\u008b\u008c\7\61\2"+
"\2\u008c\u008e\5\64\33\2\u008d\u008f\5$\23\2\u008e\u008d\3\2\2\2\u008e"+
"\u008f\3\2\2\2\u008f\r\3\2\2\2\u0090\u0091\7B\2\2\u0091\u0092\7\33\2\2"+
"\u0092\u0093\7C\2\2\u0093\u009c\7\64\2\2\u0094\u0099\5\"\22\2\u0095\u0096"+
"\7!\2\2\u0096\u0098\5\"\22\2\u0097\u0095\3\2\2\2\u0098\u009b\3\2\2\2\u0099"+
"\u0097\3\2\2\2\u0099\u009a\3\2\2\2\u009a\u009d\3\2\2\2\u009b\u0099\3\2"+
"\2\2\u009c\u0094\3\2\2\2\u009c\u009d\3\2\2\2\u009d\u009e\3\2\2\2\u009e"+
"\u009f\7\65\2\2\u009f\u00a0\7\30\2\2\u00a0\u00a2\5,\27\2\u00a1\u00a3\5"+
"$\23\2\u00a2\u00a1\3\2\2\2\u00a2\u00a3\3\2\2\2\u00a3\17\3\2\2\2\u00a4"+
"\u00a6\7B\2\2\u00a5\u00a7\5\22\n\2\u00a6\u00a5\3\2\2\2\u00a7\u00a8\3\2"+
"\2\2\u00a8\u00a6\3\2\2\2\u00a8\u00a9\3\2\2\2\u00a9\21\3\2\2\2\u00aa\u00ac"+
"\5\24\13\2\u00ab\u00aa\3\2\2\2\u00ab\u00ac\3\2\2\2\u00ac\u00ad\3\2\2\2"+
"\u00ad\u00b1\5\30\r\2\u00ae\u00b0\5\26\f\2\u00af\u00ae\3\2\2\2\u00b0\u00b3"+
"\3\2\2\2\u00b1\u00af\3\2\2\2\u00b1\u00b2\3\2\2\2\u00b2\u00b4\3\2\2\2\u00b3"+
"\u00b1\3\2\2\2\u00b4\u00b6\5\32\16\2\u00b5\u00b7\5$\23\2\u00b6\u00b5\3"+
"\2\2\2\u00b6\u00b7\3\2\2\2\u00b7\23\3\2\2\2\u00b8\u00c3\7 \2\2\u00b9\u00ba"+
"\7 \2\2\u00ba\u00bf\5\64\33\2\u00bb\u00bc\7!\2\2\u00bc\u00be\5\64\33\2"+
"\u00bd\u00bb\3\2\2\2\u00be\u00c1\3\2\2\2\u00bf\u00bd\3\2\2\2\u00bf\u00c0"+
"\3\2\2\2\u00c0\u00c3\3\2\2\2\u00c1\u00bf\3\2\2\2\u00c2\u00b8\3\2\2\2\u00c2"+
"\u00b9\3\2\2\2\u00c3\25\3\2\2\2\u00c4\u00c5\7\16\2\2\u00c5\u00c6\7\t\2"+
"\2\u00c6\u00c7\7D\2\2\u00c7\u00c8\7\20\2\2\u00c8\u00c9\5\64\33\2\u00c9"+
"\27\3\2\2\2\u00ca\u00cb\7\37\2\2\u00cb\u00d3\7\21\2\2\u00cc\u00cd\7\37"+
"\2\2\u00cd\u00d3\5:\36\2\u00ce\u00cf\7\37\2\2\u00cf\u00d3\5<\37\2\u00d0"+
"\u00d1\7\37\2\2\u00d1\u00d3\5\64\33\2\u00d2\u00ca\3\2\2\2\u00d2\u00cc"+
"\3\2\2\2\u00d2\u00ce\3\2\2\2\u00d2\u00d0\3\2\2\2\u00d3\31\3\2\2\2\u00d4"+
"\u00d5\7\30\2\2\u00d5\u00d6\5,\27\2\u00d6\33\3\2\2\2\u00d7\u00da\7\3\2"+
"\2\u00d8\u00da\7\4\2\2\u00d9\u00d7\3\2\2\2\u00d9\u00d8\3\2\2\2\u00da\35"+
"\3\2\2\2\u00db\u00dd\t\2\2\2\u00dc\u00db\3\2\2\2\u00dc\u00dd\3\2\2\2\u00dd"+
"\u00de\3\2\2\2\u00de\u00e6\7?\2\2\u00df\u00e1\t\2\2\2\u00e0\u00df\3\2"+
"\2\2\u00e0\u00e1\3\2\2\2\u00e1\u00e2\3\2\2\2\u00e2\u00e6\7@\2\2\u00e3"+
"\u00e6\7>\2\2\u00e4\u00e6\7A\2\2\u00e5\u00dc\3\2\2\2\u00e5\u00e0\3\2\2"+
"\2\u00e5\u00e3\3\2\2\2\u00e5\u00e4\3\2\2\2\u00e6\37\3\2\2\2\u00e7\u00e8"+
"\7C\2\2\u00e8\u00e9\7\35\2\2\u00e9\u00ec\5(\25\2\u00ea\u00eb\7\61\2\2"+
"\u00eb\u00ed\5\36\20\2\u00ec\u00ea\3\2\2\2\u00ec\u00ed\3\2\2\2\u00ed!"+
"\3\2\2\2\u00ee\u00ef\7D\2\2\u00ef\u00f0\7\35\2\2\u00f0\u00f1\5*\26\2\u00f1"+
"#\3\2\2\2\u00f2\u00f3\7\26\2\2\u00f3\u00f4\7D\2\2\u00f4\u00f5\7\61\2\2"+
"\u00f5\u00fe\5\64\33\2\u00f6\u00f8\7\36\2\2\u00f7\u00f6\3\2\2\2\u00f7"+
"\u00f8\3\2\2\2\u00f8\u00f9\3\2\2\2\u00f9\u00fa\7D\2\2\u00fa\u00fb\7\61"+
"\2\2\u00fb\u00fd\5\64\33\2\u00fc\u00f7\3\2\2\2\u00fd\u0100\3\2\2\2\u00fe"+
"\u00fc\3\2\2\2\u00fe\u00ff\3\2\2\2\u00ff%\3\2\2\2\u0100\u00fe\3\2\2\2"+
"\u0101\u0102\t\3\2\2\u0102\'\3\2\2\2\u0103\u0106\5&\24\2\u0104\u0106\5"+
"\66\34\2\u0105\u0103\3\2\2\2\u0105\u0104\3\2\2\2\u0106)\3\2\2\2\u0107"+
"\u010e\5(\25\2\u0108\u010e\7B\2\2\u0109\u010a\7\66\2\2\u010a\u010b\5*"+
"\26\2\u010b\u010c\7\67\2\2\u010c\u010e\3\2\2\2\u010d\u0107\3\2\2\2\u010d"+
"\u0108\3\2\2\2\u010d\u0109\3\2\2\2\u010e+\3\2\2\2\u010f\u0110\b\27\1\2"+
"\u0110\u0144\5.\30\2\u0111\u0112\7\16\2\2\u0112\u0113\7\t\2\2\u0113\u0114"+
"\7D\2\2\u0114\u0115\7\20\2\2\u0115\u0116\5\64\33\2\u0116\u0117\5,\27\2"+
"\u0117\u0118\7\f\2\2\u0118\u0144\3\2\2\2\u0119\u011a\5\62\32\2\u011a\u011b"+
"\7\61\2\2\u011b\u011c\5\64\33\2\u011c\u0144\3\2\2\2\u011d\u011e\5\62\32"+
"\2\u011e\u011f\t\4\2\2\u011f\u0120\5\64\33\2\u0120\u0144\3\2\2\2\u0121"+
"\u0122\7D\2\2\u0122\u0124\7\61\2\2\u0123\u0121\3\2\2\2\u0123\u0124\3\2"+
"\2\2\u0124\u0125\3\2\2\2\u0125\u0126\7\22\2\2\u0126\u0127\7B\2\2\u0127"+
"\u0130\7\64\2\2\u0128\u012d\58\35\2\u0129\u012a\7!\2\2\u012a\u012c\58"+
"\35\2\u012b\u0129\3\2\2\2\u012c\u012f\3\2\2\2\u012d\u012b\3\2\2\2\u012d"+
"\u012e\3\2\2\2\u012e\u0131\3\2\2\2\u012f\u012d\3\2\2\2\u0130\u0128\3\2"+
"\2\2\u0130\u0131\3\2\2\2\u0131\u0132\3\2\2\2\u0132\u0144\7\65\2\2\u0133"+
"\u0134\5\64\33\2\u0134\u0135\7\33\2\2\u0135\u0136\7C\2\2\u0136\u013f\7"+
"\64\2\2\u0137\u013c\5\64\33\2\u0138\u0139\7!\2\2\u0139\u013b\5\64\33\2"+
"\u013a\u0138\3\2\2\2\u013b\u013e\3\2\2\2\u013c\u013a\3\2\2\2\u013c\u013d"+
"\3\2\2\2\u013d\u0140\3\2\2\2\u013e\u013c\3\2\2\2\u013f\u0137\3\2\2\2\u013f"+
"\u0140\3\2\2\2\u0140\u0141\3\2\2\2\u0141\u0142\7\65\2\2\u0142\u0144\3"+
"\2\2\2\u0143\u010f\3\2\2\2\u0143\u0111\3\2\2\2\u0143\u0119\3\2\2\2\u0143"+
"\u011d\3\2\2\2\u0143\u0123\3\2\2\2\u0143\u0133\3\2\2\2\u0144\u014c\3\2"+
"\2\2\u0145\u0147\f\7\2\2\u0146\u0148\7\36\2\2\u0147\u0146\3\2\2\2\u0147"+
"\u0148\3\2\2\2\u0148\u0149\3\2\2\2\u0149\u014b\5,\27\b\u014a\u0145\3\2"+
"\2\2\u014b\u014e\3\2\2\2\u014c\u014a\3\2\2\2\u014c\u014d\3\2\2\2\u014d"+
"-\3\2\2\2\u014e\u014c\3\2\2\2\u014f\u0150\7\17\2\2\u0150\u0151\5\64\33"+
"\2\u0151\u0152\7\25\2\2\u0152\u0155\5,\27\2\u0153\u0156\5\60\31\2\u0154"+
"\u0156\7\f\2\2\u0155\u0153\3\2\2\2\u0155\u0154\3\2\2\2\u0156/\3\2\2\2"+
"\u0157\u015c\7\13\2\2\u0158\u015d\5.\30\2\u0159\u015a\5,\27\2\u015a\u015b"+
"\7\f\2\2\u015b\u015d\3\2\2\2\u015c\u0158\3\2\2\2\u015c\u0159\3\2\2\2\u015d"+
"\61\3\2\2\2\u015e\u015f\5\64\33\2\u015f\u0160\7\33\2\2\u0160\u0161\7C"+
"\2\2\u0161\u0164\3\2\2\2\u0162\u0164\7D\2\2\u0163\u015e\3\2\2\2\u0163"+
"\u0162\3\2\2\2\u0164\63\3\2\2\2\u0165\u0166\b\33\1\2\u0166\u0167\7C\2"+
"\2\u0167\u0170\7\64\2\2\u0168\u016d\5\64\33\2\u0169\u016a\7!\2\2\u016a"+
"\u016c\5\64\33\2\u016b\u0169\3\2\2\2\u016c\u016f\3\2\2\2\u016d\u016b\3"+
"\2\2\2\u016d\u016e\3\2\2\2\u016e\u0171\3\2\2\2\u016f\u016d\3\2\2\2\u0170"+
"\u0168\3\2\2\2\u0170\u0171\3\2\2\2\u0171\u0172\3\2\2\2\u0172\u019c\7\65"+
"\2\2\u0173\u0174\t\5\2\2\u0174\u019c\5\64\33\26\u0175\u0176\7\17\2\2\u0176"+
"\u0177\5\64\33\2\u0177\u0178\7\25\2\2\u0178\u0179\5\64\33\2\u0179\u017a"+
"\7\13\2\2\u017a\u017b\5\64\33\17\u017b\u019c\3\2\2\2\u017c\u019c\7C\2"+
"\2\u017d\u019c\7D\2\2\u017e\u017f\7B\2\2\u017f\u0180\7\33\2\2\u0180\u019c"+
"\7\6\2\2\u0181\u0182\7\64\2\2\u0182\u0183\5\64\33\2\u0183\u0184\7\65\2"+
"\2\u0184\u019c\3\2\2\2\u0185\u019c\7\n\2\2\u0186\u019c\7B\2\2\u0187\u019c"+
"\7\7\2\2\u0188\u0191\7\66\2\2\u0189\u018e\5\64\33\2\u018a\u018b\7!\2\2"+
"\u018b\u018d\5\64\33\2\u018c\u018a\3\2\2\2\u018d\u0190\3\2\2\2\u018e\u018c"+
"\3\2\2\2\u018e\u018f\3\2\2\2\u018f\u0192\3\2\2\2\u0190\u018e\3\2\2\2\u0191"+
"\u0189\3\2\2\2\u0191\u0192\3\2\2\2\u0192\u0193\3\2\2\2\u0193\u019c\7\67"+
"\2\2\u0194\u019c\5\36\20\2\u0195\u019c\7\23\2\2\u0196\u0197\7C\2\2\u0197"+
"\u0198\7\66\2\2\u0198\u0199\5\64\33\2\u0199\u019a\7\67\2\2\u019a\u019c"+
"\3\2\2\2\u019b\u0165\3\2\2\2\u019b\u0173\3\2\2\2\u019b\u0175\3\2\2\2\u019b"+
"\u017c\3\2\2\2\u019b\u017d\3\2\2\2\u019b\u017e\3\2\2\2\u019b\u0181\3\2"+
"\2\2\u019b\u0185\3\2\2\2\u019b\u0186\3\2\2\2\u019b\u0187\3\2\2\2\u019b"+
"\u0188\3\2\2\2\u019b\u0194\3\2\2\2\u019b\u0195\3\2\2\2\u019b\u0196\3\2"+
"\2\2\u019c\u01cc\3\2\2\2\u019d\u019e\f\27\2\2\u019e\u019f\7-\2\2\u019f"+
"\u01cb\5\64\33\27\u01a0\u01a1\f\25\2\2\u01a1\u01a2\t\6\2\2\u01a2\u01cb"+
"\5\64\33\26\u01a3\u01a4\f\24\2\2\u01a4\u01a5\t\2\2\2\u01a5\u01cb\5\64"+
"\33\25\u01a6\u01a7\f\23\2\2\u01a7\u01a8\t\7\2\2\u01a8\u01cb\5\64\33\24"+
"\u01a9\u01aa\f\22\2\2\u01aa\u01ab\t\b\2\2\u01ab\u01cb\5\64\33\23\u01ac"+
"\u01ad\f\21\2\2\u01ad\u01ae\7.\2\2\u01ae\u01cb\5\64\33\22\u01af\u01b0"+
"\f\20\2\2\u01b0\u01b1\7/\2\2\u01b1\u01cb\5\64\33\21\u01b2\u01b3\f\16\2"+
"\2\u01b3\u01b4\7\20\2\2\u01b4\u01cb\5\64\33\17\u01b5\u01b6\f\32\2\2\u01b6"+
"\u01b7\7\33\2\2\u01b7\u01b8\7C\2\2\u01b8\u01c1\7\64\2\2\u01b9\u01be\5"+
"\64\33\2\u01ba\u01bb\7!\2\2\u01bb\u01bd\5\64\33\2\u01bc\u01ba\3\2\2\2"+
"\u01bd\u01c0\3\2\2\2\u01be\u01bc\3\2\2\2\u01be\u01bf\3\2\2\2\u01bf\u01c2"+
"\3\2\2\2\u01c0\u01be\3\2\2\2\u01c1\u01b9\3\2\2\2\u01c1\u01c2\3\2\2\2\u01c2"+
"\u01c3\3\2\2\2\u01c3\u01cb\7\65\2\2\u01c4\u01c5\f\31\2\2\u01c5\u01c8\7"+
"\33\2\2\u01c6\u01c9\7C\2\2\u01c7\u01c9\7\5\2\2\u01c8\u01c6\3\2\2\2\u01c8"+
"\u01c7\3\2\2\2\u01c9\u01cb\3\2\2\2\u01ca\u019d\3\2\2\2\u01ca\u01a0\3\2"+
"\2\2\u01ca\u01a3\3\2\2\2\u01ca\u01a6\3\2\2\2\u01ca\u01a9\3\2\2\2\u01ca"+
"\u01ac\3\2\2\2\u01ca\u01af\3\2\2\2\u01ca\u01b2\3\2\2\2\u01ca\u01b5\3\2"+
"\2\2\u01ca\u01c4\3\2\2\2\u01cb\u01ce\3\2\2\2\u01cc\u01ca\3\2\2\2\u01cc"+
"\u01cd\3\2\2\2\u01cd\65\3\2\2\2\u01ce\u01cc\3\2\2\2\u01cf\u01d0\78\2\2"+
"\u01d0\u01d5\7A\2\2\u01d1\u01d2\7!\2\2\u01d2\u01d4\7A\2\2\u01d3\u01d1"+
"\3\2\2\2\u01d4\u01d7\3\2\2\2\u01d5\u01d3\3\2\2\2\u01d5\u01d6\3\2\2\2\u01d6"+
"\u01d8\3\2\2\2\u01d7\u01d5\3\2\2\2\u01d8\u01d9\79\2\2\u01d9\67\3\2\2\2"+
"\u01da\u01db\t\t\2\2\u01db\u01dc\7\61\2\2\u01dc\u01dd\5\64\33\2\u01dd"+
"9\3\2\2\2\u01de\u01df\7\5\2\2\u01df\u01e0\5\64\33\2\u01e0;\3\2\2\2\u01e1"+
"\u01e2\7\r\2\2\u01e2\u01e4\5\64\33\2\u01e3\u01e5\7\24\2\2\u01e4\u01e3"+
"\3\2\2\2\u01e4\u01e5\3\2\2\2\u01e5=\3\2\2\2\66EGQV`il\u0083\u0086\u008e"+
"\u0099\u009c\u00a2\u00a8\u00ab\u00b1\u00b6\u00bf\u00c2\u00d2\u00d9\u00dc"+
"\u00e0\u00e5\u00ec\u00f7\u00fe\u0105\u010d\u0123\u012d\u0130\u013c\u013f"+
"\u0143\u0147\u014c\u0155\u015c\u0163\u016d\u0170\u018e\u0191\u019b\u01be"+
"\u01c1\u01c8\u01ca\u01cc\u01d5\u01e4";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
_decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
}
}
}