hu.bme.mit.theta.xta.dsl.gen.XtaDslParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of theta-xta Show documentation
Show all versions of theta-xta Show documentation
Xta subproject in the Theta model checking framework
// Generated from XtaDsl.g4 by ANTLR 4.9.2
package hu.bme.mit.theta.xta.dsl.gen;
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 XtaDslParser extends Parser {
static { RuntimeMetaData.checkVersion("4.9.2", RuntimeMetaData.VERSION); }
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
SYSTEM=1, PROCESS=2, STATE=3, COMMIT=4, URGENT=5, INIT=6, TRANS=7, SELECT=8,
GUARD=9, SYNC=10, ASSIGN=11, TYPEDEF=12, VOID=13, INT=14, CLOCK=15, CHAN=16,
BOOL=17, SCALAR=18, STRUCT=19, BROADCAST=20, CONST=21, FOR=22, WHILE=23,
DO=24, IF=25, ELSE=26, RETURN=27, FORALL=28, EXISTS=29, OR=30, IMPLY=31,
AND=32, NOT=33, LOGOROP=34, LOGANDOP=35, SHLOP=36, SHROP=37, EQOP=38,
NEQOP=39, NEWASSIGNOP=40, OLDASSIGNOP=41, ADDASSIGNOP=42, SUBASSIGNOP=43,
MULASSIGNOP=44, DIVASSIGNOP=45, REMASSIGNOP=46, BWORASSIGNOP=47, BWANDASSIGNOP=48,
BWXORASSIGNOP=49, SHLASSIGNOP=50, SHRASSIGNOP=51, LTOP=52, LEQOP=53, GTOP=54,
GEQOP=55, INCOP=56, DECOP=57, TRUE=58, FALSE=59, NAT=60, DOT=61, ID=62,
UNDERSCORE=63, DIGIT=64, LETTER=65, LPAREN=66, RPAREN=67, LBRACK=68, RBRACK=69,
LBRAC=70, RBRAC=71, COMMA=72, COLON=73, SEMICOLON=74, AMP=75, HAT=76,
BAR=77, EXCL=78, QUEST=79, PERCENT=80, PLUS=81, MINUS=82, ASTER=83, SLASH=84,
TILDE=85, LARROW=86, RARROW=87, WS=88, COMMENT=89, LINE_COMMENT=90;
public static final int
RULE_xta = 0, RULE_iteratorDecl = 1, RULE_instantiation = 2, RULE_system = 3,
RULE_parameterList = 4, RULE_parameterDecl = 5, RULE_parameterId = 6,
RULE_functionDecl = 7, RULE_processDecl = 8, RULE_processBody = 9, RULE_states = 10,
RULE_stateDecl = 11, RULE_commit = 12, RULE_urgent = 13, RULE_stateList = 14,
RULE_init = 15, RULE_transitions = 16, RULE_transition = 17, RULE_transitionOpt = 18,
RULE_transitionBody = 19, RULE_select = 20, RULE_guard = 21, RULE_sync = 22,
RULE_assign = 23, RULE_typeDecl = 24, RULE_arrayId = 25, RULE_arrayIndex = 26,
RULE_idIndex = 27, RULE_expressionIndex = 28, RULE_type = 29, RULE_typePrefix = 30,
RULE_basicType = 31, RULE_refType = 32, RULE_voidType = 33, RULE_intType = 34,
RULE_clockType = 35, RULE_chanType = 36, RULE_boolType = 37, RULE_rangeType = 38,
RULE_scalarType = 39, RULE_structType = 40, RULE_fieldDecl = 41, RULE_variableDecl = 42,
RULE_variableId = 43, RULE_initialiser = 44, RULE_simpleInitialiser = 45,
RULE_compoundInitialiser = 46, RULE_block = 47, RULE_statement = 48, RULE_skipStatement = 49,
RULE_expressionStatement = 50, RULE_forStatement = 51, RULE_foreachStatement = 52,
RULE_whileStatement = 53, RULE_doStatement = 54, RULE_ifStatement = 55,
RULE_returnStatement = 56, RULE_expression = 57, RULE_quantifiedExpression = 58,
RULE_forallExpression = 59, RULE_existsExpression = 60, RULE_textOrImplyExpression = 61,
RULE_textAndExpression = 62, RULE_textNotExpression = 63, RULE_assignmentExpression = 64,
RULE_conditionalExpression = 65, RULE_logicalOrExpression = 66, RULE_logicalAndExpression = 67,
RULE_bitwiseOrExpression = 68, RULE_bitwiseXorExpression = 69, RULE_bitwiseAndExpression = 70,
RULE_equalityExpression = 71, RULE_relationalExpression = 72, RULE_shiftExpression = 73,
RULE_additiveExpression = 74, RULE_multiplicativeExpression = 75, RULE_prefixExpression = 76,
RULE_postfixExpression = 77, RULE_primaryExpression = 78, RULE_trueExpression = 79,
RULE_falseExpression = 80, RULE_natExpression = 81, RULE_idExpression = 82,
RULE_parenthesisExpression = 83, RULE_argList = 84, RULE_textOrImplyOp = 85,
RULE_textOrOp = 86, RULE_textImplyOp = 87, RULE_textAndOp = 88, RULE_textNotOp = 89,
RULE_assignmentOp = 90, RULE_assignOp = 91, RULE_addAssignOp = 92, RULE_subAssignOp = 93,
RULE_mulAssignOp = 94, RULE_divAssignOp = 95, RULE_remAssignOp = 96, RULE_bwOrAssignOp = 97,
RULE_bwAndAssignOp = 98, RULE_bwXorAssignOp = 99, RULE_shlAssignOp = 100,
RULE_shrAssignOp = 101, RULE_logOrOp = 102, RULE_logAndOp = 103, RULE_bwOrOp = 104,
RULE_bwXorOp = 105, RULE_bwAndOp = 106, RULE_equalityOp = 107, RULE_eqOp = 108,
RULE_neqOp = 109, RULE_relationalOp = 110, RULE_ltOp = 111, RULE_leqOp = 112,
RULE_gtOp = 113, RULE_geqOp = 114, RULE_shiftOp = 115, RULE_shlOp = 116,
RULE_shrOp = 117, RULE_additiveOp = 118, RULE_addOp = 119, RULE_subOp = 120,
RULE_multiplicativeOp = 121, RULE_mulOp = 122, RULE_divOp = 123, RULE_remOp = 124,
RULE_prefixOp = 125, RULE_preIncOp = 126, RULE_preDecOp = 127, RULE_plusOp = 128,
RULE_minusOp = 129, RULE_logNotOp = 130, RULE_bwNotOp = 131, RULE_postfixOp = 132,
RULE_postIncOp = 133, RULE_postDecOp = 134, RULE_functionCallOp = 135,
RULE_arrayAccessOp = 136, RULE_structSelectOp = 137;
private static String[] makeRuleNames() {
return new String[] {
"xta", "iteratorDecl", "instantiation", "system", "parameterList", "parameterDecl",
"parameterId", "functionDecl", "processDecl", "processBody", "states",
"stateDecl", "commit", "urgent", "stateList", "init", "transitions",
"transition", "transitionOpt", "transitionBody", "select", "guard", "sync",
"assign", "typeDecl", "arrayId", "arrayIndex", "idIndex", "expressionIndex",
"type", "typePrefix", "basicType", "refType", "voidType", "intType",
"clockType", "chanType", "boolType", "rangeType", "scalarType", "structType",
"fieldDecl", "variableDecl", "variableId", "initialiser", "simpleInitialiser",
"compoundInitialiser", "block", "statement", "skipStatement", "expressionStatement",
"forStatement", "foreachStatement", "whileStatement", "doStatement",
"ifStatement", "returnStatement", "expression", "quantifiedExpression",
"forallExpression", "existsExpression", "textOrImplyExpression", "textAndExpression",
"textNotExpression", "assignmentExpression", "conditionalExpression",
"logicalOrExpression", "logicalAndExpression", "bitwiseOrExpression",
"bitwiseXorExpression", "bitwiseAndExpression", "equalityExpression",
"relationalExpression", "shiftExpression", "additiveExpression", "multiplicativeExpression",
"prefixExpression", "postfixExpression", "primaryExpression", "trueExpression",
"falseExpression", "natExpression", "idExpression", "parenthesisExpression",
"argList", "textOrImplyOp", "textOrOp", "textImplyOp", "textAndOp", "textNotOp",
"assignmentOp", "assignOp", "addAssignOp", "subAssignOp", "mulAssignOp",
"divAssignOp", "remAssignOp", "bwOrAssignOp", "bwAndAssignOp", "bwXorAssignOp",
"shlAssignOp", "shrAssignOp", "logOrOp", "logAndOp", "bwOrOp", "bwXorOp",
"bwAndOp", "equalityOp", "eqOp", "neqOp", "relationalOp", "ltOp", "leqOp",
"gtOp", "geqOp", "shiftOp", "shlOp", "shrOp", "additiveOp", "addOp",
"subOp", "multiplicativeOp", "mulOp", "divOp", "remOp", "prefixOp", "preIncOp",
"preDecOp", "plusOp", "minusOp", "logNotOp", "bwNotOp", "postfixOp",
"postIncOp", "postDecOp", "functionCallOp", "arrayAccessOp", "structSelectOp"
};
}
public static final String[] ruleNames = makeRuleNames();
private static String[] makeLiteralNames() {
return new String[] {
null, "'system'", "'process'", "'state'", "'commit'", "'urgent'", "'init'",
"'trans'", "'select'", "'guard'", "'sync'", "'assign'", "'typedef'",
"'void'", "'int'", "'clock'", "'chan'", "'bool'", "'scalar'", "'struct'",
"'broadcast'", "'const'", "'for'", "'while'", "'do'", "'if'", "'else'",
"'return'", "'forall'", "'exists'", "'or'", "'imply'", "'and'", "'not'",
"'||'", "'&&'", "'<<'", "'>>'", "'=='", "'!='", "'='", "':='", "'+='",
"'-='", "'*='", "'/='", "'%='", "'|='", "'&='", "'^='", "'<<='", "'>>='",
"'<'", "'<='", "'>'", "'>='", "'++'", "'--'", "'true'", "'false'", null,
"'.'", null, "'_'", null, null, "'('", "')'", "'['", "']'", "'{'", "'}'",
"','", "':'", "';'", "'&'", "'^'", "'|'", "'!'", "'?'", "'%'", "'+'",
"'-'", "'*'", "'/'", "'~'", "'<-'", "'->'"
};
}
private static final String[] _LITERAL_NAMES = makeLiteralNames();
private static String[] makeSymbolicNames() {
return new String[] {
null, "SYSTEM", "PROCESS", "STATE", "COMMIT", "URGENT", "INIT", "TRANS",
"SELECT", "GUARD", "SYNC", "ASSIGN", "TYPEDEF", "VOID", "INT", "CLOCK",
"CHAN", "BOOL", "SCALAR", "STRUCT", "BROADCAST", "CONST", "FOR", "WHILE",
"DO", "IF", "ELSE", "RETURN", "FORALL", "EXISTS", "OR", "IMPLY", "AND",
"NOT", "LOGOROP", "LOGANDOP", "SHLOP", "SHROP", "EQOP", "NEQOP", "NEWASSIGNOP",
"OLDASSIGNOP", "ADDASSIGNOP", "SUBASSIGNOP", "MULASSIGNOP", "DIVASSIGNOP",
"REMASSIGNOP", "BWORASSIGNOP", "BWANDASSIGNOP", "BWXORASSIGNOP", "SHLASSIGNOP",
"SHRASSIGNOP", "LTOP", "LEQOP", "GTOP", "GEQOP", "INCOP", "DECOP", "TRUE",
"FALSE", "NAT", "DOT", "ID", "UNDERSCORE", "DIGIT", "LETTER", "LPAREN",
"RPAREN", "LBRACK", "RBRACK", "LBRAC", "RBRAC", "COMMA", "COLON", "SEMICOLON",
"AMP", "HAT", "BAR", "EXCL", "QUEST", "PERCENT", "PLUS", "MINUS", "ASTER",
"SLASH", "TILDE", "LARROW", "RARROW", "WS", "COMMENT", "LINE_COMMENT"
};
}
private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
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 "XtaDsl.g4"; }
@Override
public String[] getRuleNames() { return ruleNames; }
@Override
public String getSerializedATN() { return _serializedATN; }
@Override
public ATN getATN() { return _ATN; }
public XtaDslParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
public static class XtaContext extends ParserRuleContext {
public FunctionDeclContext functionDecl;
public List fFunctionDecls = new ArrayList();
public VariableDeclContext variableDecl;
public List fVariableDecls = new ArrayList();
public TypeDeclContext typeDecl;
public List fTypeDecls = new ArrayList();
public ProcessDeclContext processDecl;
public List fProcessDecls = new ArrayList();
public InstantiationContext instantiation;
public List fInstantiations = new ArrayList();
public SystemContext fSystem;
public SystemContext system() {
return getRuleContext(SystemContext.class,0);
}
public List functionDecl() {
return getRuleContexts(FunctionDeclContext.class);
}
public FunctionDeclContext functionDecl(int i) {
return getRuleContext(FunctionDeclContext.class,i);
}
public List variableDecl() {
return getRuleContexts(VariableDeclContext.class);
}
public VariableDeclContext variableDecl(int i) {
return getRuleContext(VariableDeclContext.class,i);
}
public List typeDecl() {
return getRuleContexts(TypeDeclContext.class);
}
public TypeDeclContext typeDecl(int i) {
return getRuleContext(TypeDeclContext.class,i);
}
public List processDecl() {
return getRuleContexts(ProcessDeclContext.class);
}
public ProcessDeclContext processDecl(int i) {
return getRuleContext(ProcessDeclContext.class,i);
}
public List instantiation() {
return getRuleContexts(InstantiationContext.class);
}
public InstantiationContext instantiation(int i) {
return getRuleContext(InstantiationContext.class,i);
}
public XtaContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_xta; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterXta(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitXta(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitXta(this);
else return visitor.visitChildren(this);
}
}
public final XtaContext xta() throws RecognitionException {
XtaContext _localctx = new XtaContext(_ctx, getState());
enterRule(_localctx, 0, RULE_xta);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(282);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,1,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
setState(280);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) {
case 1:
{
setState(276);
((XtaContext)_localctx).functionDecl = functionDecl();
((XtaContext)_localctx).fFunctionDecls.add(((XtaContext)_localctx).functionDecl);
}
break;
case 2:
{
setState(277);
((XtaContext)_localctx).variableDecl = variableDecl();
((XtaContext)_localctx).fVariableDecls.add(((XtaContext)_localctx).variableDecl);
}
break;
case 3:
{
setState(278);
((XtaContext)_localctx).typeDecl = typeDecl();
((XtaContext)_localctx).fTypeDecls.add(((XtaContext)_localctx).typeDecl);
}
break;
case 4:
{
setState(279);
((XtaContext)_localctx).processDecl = processDecl();
((XtaContext)_localctx).fProcessDecls.add(((XtaContext)_localctx).processDecl);
}
break;
}
}
}
setState(284);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,1,_ctx);
}
setState(288);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==ID) {
{
{
setState(285);
((XtaContext)_localctx).instantiation = instantiation();
((XtaContext)_localctx).fInstantiations.add(((XtaContext)_localctx).instantiation);
}
}
setState(290);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(291);
((XtaContext)_localctx).fSystem = system();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class IteratorDeclContext extends ParserRuleContext {
public Token fId;
public TypeContext fType;
public TerminalNode COLON() { return getToken(XtaDslParser.COLON, 0); }
public TerminalNode ID() { return getToken(XtaDslParser.ID, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public IteratorDeclContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_iteratorDecl; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterIteratorDecl(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitIteratorDecl(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitIteratorDecl(this);
else return visitor.visitChildren(this);
}
}
public final IteratorDeclContext iteratorDecl() throws RecognitionException {
IteratorDeclContext _localctx = new IteratorDeclContext(_ctx, getState());
enterRule(_localctx, 2, RULE_iteratorDecl);
try {
enterOuterAlt(_localctx, 1);
{
setState(293);
((IteratorDeclContext)_localctx).fId = match(ID);
setState(294);
match(COLON);
setState(295);
((IteratorDeclContext)_localctx).fType = type();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class InstantiationContext extends ParserRuleContext {
public Token fId;
public Token fProcId;
public ArgListContext fArgList;
public AssignOpContext assignOp() {
return getRuleContext(AssignOpContext.class,0);
}
public TerminalNode LPAREN() { return getToken(XtaDslParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(XtaDslParser.RPAREN, 0); }
public TerminalNode SEMICOLON() { return getToken(XtaDslParser.SEMICOLON, 0); }
public List ID() { return getTokens(XtaDslParser.ID); }
public TerminalNode ID(int i) {
return getToken(XtaDslParser.ID, i);
}
public ArgListContext argList() {
return getRuleContext(ArgListContext.class,0);
}
public InstantiationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_instantiation; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterInstantiation(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitInstantiation(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitInstantiation(this);
else return visitor.visitChildren(this);
}
}
public final InstantiationContext instantiation() throws RecognitionException {
InstantiationContext _localctx = new InstantiationContext(_ctx, getState());
enterRule(_localctx, 4, RULE_instantiation);
try {
enterOuterAlt(_localctx, 1);
{
setState(297);
((InstantiationContext)_localctx).fId = match(ID);
setState(298);
assignOp();
setState(299);
((InstantiationContext)_localctx).fProcId = match(ID);
setState(300);
match(LPAREN);
setState(301);
((InstantiationContext)_localctx).fArgList = argList();
setState(302);
match(RPAREN);
setState(303);
match(SEMICOLON);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class SystemContext extends ParserRuleContext {
public Token ID;
public List fIds = new ArrayList();
public TerminalNode SYSTEM() { return getToken(XtaDslParser.SYSTEM, 0); }
public TerminalNode SEMICOLON() { return getToken(XtaDslParser.SEMICOLON, 0); }
public List ID() { return getTokens(XtaDslParser.ID); }
public TerminalNode ID(int i) {
return getToken(XtaDslParser.ID, i);
}
public List COMMA() { return getTokens(XtaDslParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(XtaDslParser.COMMA, i);
}
public SystemContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_system; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterSystem(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitSystem(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitSystem(this);
else return visitor.visitChildren(this);
}
}
public final SystemContext system() throws RecognitionException {
SystemContext _localctx = new SystemContext(_ctx, getState());
enterRule(_localctx, 6, RULE_system);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(305);
match(SYSTEM);
setState(306);
((SystemContext)_localctx).ID = match(ID);
((SystemContext)_localctx).fIds.add(((SystemContext)_localctx).ID);
setState(311);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(307);
match(COMMA);
setState(308);
((SystemContext)_localctx).ID = match(ID);
((SystemContext)_localctx).fIds.add(((SystemContext)_localctx).ID);
}
}
setState(313);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(314);
match(SEMICOLON);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ParameterListContext extends ParserRuleContext {
public ParameterDeclContext parameterDecl;
public List fParameterDecls = new ArrayList();
public TerminalNode LPAREN() { return getToken(XtaDslParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(XtaDslParser.RPAREN, 0); }
public List parameterDecl() {
return getRuleContexts(ParameterDeclContext.class);
}
public ParameterDeclContext parameterDecl(int i) {
return getRuleContext(ParameterDeclContext.class,i);
}
public List COMMA() { return getTokens(XtaDslParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(XtaDslParser.COMMA, i);
}
public ParameterListContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_parameterList; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterParameterList(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitParameterList(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitParameterList(this);
else return visitor.visitChildren(this);
}
}
public final ParameterListContext parameterList() throws RecognitionException {
ParameterListContext _localctx = new ParameterListContext(_ctx, getState());
enterRule(_localctx, 8, RULE_parameterList);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(316);
match(LPAREN);
setState(325);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << URGENT) | (1L << VOID) | (1L << INT) | (1L << CLOCK) | (1L << CHAN) | (1L << BOOL) | (1L << SCALAR) | (1L << STRUCT) | (1L << BROADCAST) | (1L << CONST) | (1L << ID))) != 0)) {
{
setState(317);
((ParameterListContext)_localctx).parameterDecl = parameterDecl();
((ParameterListContext)_localctx).fParameterDecls.add(((ParameterListContext)_localctx).parameterDecl);
setState(322);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(318);
match(COMMA);
setState(319);
((ParameterListContext)_localctx).parameterDecl = parameterDecl();
((ParameterListContext)_localctx).fParameterDecls.add(((ParameterListContext)_localctx).parameterDecl);
}
}
setState(324);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(327);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ParameterDeclContext extends ParserRuleContext {
public TypeContext fType;
public ParameterIdContext parameterId;
public List fparameterIds = new ArrayList();
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public List parameterId() {
return getRuleContexts(ParameterIdContext.class);
}
public ParameterIdContext parameterId(int i) {
return getRuleContext(ParameterIdContext.class,i);
}
public List COMMA() { return getTokens(XtaDslParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(XtaDslParser.COMMA, i);
}
public ParameterDeclContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_parameterDecl; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterParameterDecl(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitParameterDecl(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitParameterDecl(this);
else return visitor.visitChildren(this);
}
}
public final ParameterDeclContext parameterDecl() throws RecognitionException {
ParameterDeclContext _localctx = new ParameterDeclContext(_ctx, getState());
enterRule(_localctx, 10, RULE_parameterDecl);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(329);
((ParameterDeclContext)_localctx).fType = type();
setState(330);
((ParameterDeclContext)_localctx).parameterId = parameterId();
((ParameterDeclContext)_localctx).fparameterIds.add(((ParameterDeclContext)_localctx).parameterId);
setState(335);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,6,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(331);
match(COMMA);
setState(332);
((ParameterDeclContext)_localctx).parameterId = parameterId();
((ParameterDeclContext)_localctx).fparameterIds.add(((ParameterDeclContext)_localctx).parameterId);
}
}
}
setState(337);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,6,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ParameterIdContext extends ParserRuleContext {
public Token fRef;
public ArrayIdContext fArrayId;
public ArrayIdContext arrayId() {
return getRuleContext(ArrayIdContext.class,0);
}
public TerminalNode AMP() { return getToken(XtaDslParser.AMP, 0); }
public ParameterIdContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_parameterId; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterParameterId(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitParameterId(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitParameterId(this);
else return visitor.visitChildren(this);
}
}
public final ParameterIdContext parameterId() throws RecognitionException {
ParameterIdContext _localctx = new ParameterIdContext(_ctx, getState());
enterRule(_localctx, 12, RULE_parameterId);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(339);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AMP) {
{
setState(338);
((ParameterIdContext)_localctx).fRef = match(AMP);
}
}
setState(341);
((ParameterIdContext)_localctx).fArrayId = arrayId();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class FunctionDeclContext extends ParserRuleContext {
public TypeContext fType;
public Token fId;
public ParameterListContext fParameterList;
public BlockContext fBlock;
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public TerminalNode ID() { return getToken(XtaDslParser.ID, 0); }
public ParameterListContext parameterList() {
return getRuleContext(ParameterListContext.class,0);
}
public BlockContext block() {
return getRuleContext(BlockContext.class,0);
}
public FunctionDeclContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_functionDecl; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterFunctionDecl(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitFunctionDecl(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitFunctionDecl(this);
else return visitor.visitChildren(this);
}
}
public final FunctionDeclContext functionDecl() throws RecognitionException {
FunctionDeclContext _localctx = new FunctionDeclContext(_ctx, getState());
enterRule(_localctx, 14, RULE_functionDecl);
try {
enterOuterAlt(_localctx, 1);
{
setState(343);
((FunctionDeclContext)_localctx).fType = type();
setState(344);
((FunctionDeclContext)_localctx).fId = match(ID);
setState(345);
((FunctionDeclContext)_localctx).fParameterList = parameterList();
setState(346);
((FunctionDeclContext)_localctx).fBlock = block();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ProcessDeclContext extends ParserRuleContext {
public Token fId;
public ParameterListContext fParameterList;
public ProcessBodyContext fProcessBody;
public TerminalNode PROCESS() { return getToken(XtaDslParser.PROCESS, 0); }
public TerminalNode LBRAC() { return getToken(XtaDslParser.LBRAC, 0); }
public TerminalNode RBRAC() { return getToken(XtaDslParser.RBRAC, 0); }
public TerminalNode ID() { return getToken(XtaDslParser.ID, 0); }
public ParameterListContext parameterList() {
return getRuleContext(ParameterListContext.class,0);
}
public ProcessBodyContext processBody() {
return getRuleContext(ProcessBodyContext.class,0);
}
public ProcessDeclContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_processDecl; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterProcessDecl(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitProcessDecl(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitProcessDecl(this);
else return visitor.visitChildren(this);
}
}
public final ProcessDeclContext processDecl() throws RecognitionException {
ProcessDeclContext _localctx = new ProcessDeclContext(_ctx, getState());
enterRule(_localctx, 16, RULE_processDecl);
try {
enterOuterAlt(_localctx, 1);
{
setState(348);
match(PROCESS);
setState(349);
((ProcessDeclContext)_localctx).fId = match(ID);
setState(350);
((ProcessDeclContext)_localctx).fParameterList = parameterList();
setState(351);
match(LBRAC);
setState(352);
((ProcessDeclContext)_localctx).fProcessBody = processBody();
setState(353);
match(RBRAC);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ProcessBodyContext extends ParserRuleContext {
public FunctionDeclContext functionDecl;
public List fFunctionDecls = new ArrayList();
public VariableDeclContext variableDecl;
public List fVariableDecls = new ArrayList();
public TypeDeclContext typeDecl;
public List fTypeDecls = new ArrayList();
public StatesContext fStates;
public CommitContext fCommit;
public UrgentContext fUrgent;
public InitContext fInit;
public TransitionsContext fTransitions;
public StatesContext states() {
return getRuleContext(StatesContext.class,0);
}
public InitContext init() {
return getRuleContext(InitContext.class,0);
}
public List functionDecl() {
return getRuleContexts(FunctionDeclContext.class);
}
public FunctionDeclContext functionDecl(int i) {
return getRuleContext(FunctionDeclContext.class,i);
}
public List variableDecl() {
return getRuleContexts(VariableDeclContext.class);
}
public VariableDeclContext variableDecl(int i) {
return getRuleContext(VariableDeclContext.class,i);
}
public List typeDecl() {
return getRuleContexts(TypeDeclContext.class);
}
public TypeDeclContext typeDecl(int i) {
return getRuleContext(TypeDeclContext.class,i);
}
public CommitContext commit() {
return getRuleContext(CommitContext.class,0);
}
public UrgentContext urgent() {
return getRuleContext(UrgentContext.class,0);
}
public TransitionsContext transitions() {
return getRuleContext(TransitionsContext.class,0);
}
public ProcessBodyContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_processBody; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterProcessBody(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitProcessBody(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitProcessBody(this);
else return visitor.visitChildren(this);
}
}
public final ProcessBodyContext processBody() throws RecognitionException {
ProcessBodyContext _localctx = new ProcessBodyContext(_ctx, getState());
enterRule(_localctx, 18, RULE_processBody);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(360);
_errHandler.sync(this);
_la = _input.LA(1);
while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << URGENT) | (1L << TYPEDEF) | (1L << VOID) | (1L << INT) | (1L << CLOCK) | (1L << CHAN) | (1L << BOOL) | (1L << SCALAR) | (1L << STRUCT) | (1L << BROADCAST) | (1L << CONST) | (1L << ID))) != 0)) {
{
setState(358);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,8,_ctx) ) {
case 1:
{
setState(355);
((ProcessBodyContext)_localctx).functionDecl = functionDecl();
((ProcessBodyContext)_localctx).fFunctionDecls.add(((ProcessBodyContext)_localctx).functionDecl);
}
break;
case 2:
{
setState(356);
((ProcessBodyContext)_localctx).variableDecl = variableDecl();
((ProcessBodyContext)_localctx).fVariableDecls.add(((ProcessBodyContext)_localctx).variableDecl);
}
break;
case 3:
{
setState(357);
((ProcessBodyContext)_localctx).typeDecl = typeDecl();
((ProcessBodyContext)_localctx).fTypeDecls.add(((ProcessBodyContext)_localctx).typeDecl);
}
break;
}
}
setState(362);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(363);
((ProcessBodyContext)_localctx).fStates = states();
setState(365);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMIT) {
{
setState(364);
((ProcessBodyContext)_localctx).fCommit = commit();
}
}
setState(368);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==URGENT) {
{
setState(367);
((ProcessBodyContext)_localctx).fUrgent = urgent();
}
}
setState(370);
((ProcessBodyContext)_localctx).fInit = init();
setState(372);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==TRANS) {
{
setState(371);
((ProcessBodyContext)_localctx).fTransitions = transitions();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class StatesContext extends ParserRuleContext {
public StateDeclContext stateDecl;
public List fStateDecls = new ArrayList();
public TerminalNode STATE() { return getToken(XtaDslParser.STATE, 0); }
public TerminalNode SEMICOLON() { return getToken(XtaDslParser.SEMICOLON, 0); }
public List stateDecl() {
return getRuleContexts(StateDeclContext.class);
}
public StateDeclContext stateDecl(int i) {
return getRuleContext(StateDeclContext.class,i);
}
public List COMMA() { return getTokens(XtaDslParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(XtaDslParser.COMMA, i);
}
public StatesContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_states; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterStates(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitStates(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitStates(this);
else return visitor.visitChildren(this);
}
}
public final StatesContext states() throws RecognitionException {
StatesContext _localctx = new StatesContext(_ctx, getState());
enterRule(_localctx, 20, RULE_states);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(374);
match(STATE);
setState(375);
((StatesContext)_localctx).stateDecl = stateDecl();
((StatesContext)_localctx).fStateDecls.add(((StatesContext)_localctx).stateDecl);
setState(380);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(376);
match(COMMA);
setState(377);
((StatesContext)_localctx).stateDecl = stateDecl();
((StatesContext)_localctx).fStateDecls.add(((StatesContext)_localctx).stateDecl);
}
}
setState(382);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(383);
match(SEMICOLON);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class StateDeclContext extends ParserRuleContext {
public Token fId;
public ExpressionContext fExpression;
public TerminalNode ID() { return getToken(XtaDslParser.ID, 0); }
public TerminalNode LBRAC() { return getToken(XtaDslParser.LBRAC, 0); }
public TerminalNode RBRAC() { return getToken(XtaDslParser.RBRAC, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public StateDeclContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_stateDecl; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterStateDecl(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitStateDecl(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitStateDecl(this);
else return visitor.visitChildren(this);
}
}
public final StateDeclContext stateDecl() throws RecognitionException {
StateDeclContext _localctx = new StateDeclContext(_ctx, getState());
enterRule(_localctx, 22, RULE_stateDecl);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(385);
((StateDeclContext)_localctx).fId = match(ID);
setState(390);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LBRAC) {
{
setState(386);
match(LBRAC);
setState(387);
((StateDeclContext)_localctx).fExpression = expression();
setState(388);
match(RBRAC);
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class CommitContext extends ParserRuleContext {
public StateListContext fStateList;
public TerminalNode COMMIT() { return getToken(XtaDslParser.COMMIT, 0); }
public TerminalNode SEMICOLON() { return getToken(XtaDslParser.SEMICOLON, 0); }
public StateListContext stateList() {
return getRuleContext(StateListContext.class,0);
}
public CommitContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_commit; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterCommit(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitCommit(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitCommit(this);
else return visitor.visitChildren(this);
}
}
public final CommitContext commit() throws RecognitionException {
CommitContext _localctx = new CommitContext(_ctx, getState());
enterRule(_localctx, 24, RULE_commit);
try {
enterOuterAlt(_localctx, 1);
{
setState(392);
match(COMMIT);
setState(393);
((CommitContext)_localctx).fStateList = stateList();
setState(394);
match(SEMICOLON);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class UrgentContext extends ParserRuleContext {
public StateListContext fStateList;
public TerminalNode URGENT() { return getToken(XtaDslParser.URGENT, 0); }
public TerminalNode SEMICOLON() { return getToken(XtaDslParser.SEMICOLON, 0); }
public StateListContext stateList() {
return getRuleContext(StateListContext.class,0);
}
public UrgentContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_urgent; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterUrgent(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitUrgent(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitUrgent(this);
else return visitor.visitChildren(this);
}
}
public final UrgentContext urgent() throws RecognitionException {
UrgentContext _localctx = new UrgentContext(_ctx, getState());
enterRule(_localctx, 26, RULE_urgent);
try {
enterOuterAlt(_localctx, 1);
{
setState(396);
match(URGENT);
setState(397);
((UrgentContext)_localctx).fStateList = stateList();
setState(398);
match(SEMICOLON);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class StateListContext extends ParserRuleContext {
public Token ID;
public List fIds = new ArrayList();
public List ID() { return getTokens(XtaDslParser.ID); }
public TerminalNode ID(int i) {
return getToken(XtaDslParser.ID, i);
}
public List COMMA() { return getTokens(XtaDslParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(XtaDslParser.COMMA, i);
}
public StateListContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_stateList; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterStateList(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitStateList(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitStateList(this);
else return visitor.visitChildren(this);
}
}
public final StateListContext stateList() throws RecognitionException {
StateListContext _localctx = new StateListContext(_ctx, getState());
enterRule(_localctx, 28, RULE_stateList);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(400);
((StateListContext)_localctx).ID = match(ID);
((StateListContext)_localctx).fIds.add(((StateListContext)_localctx).ID);
setState(405);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(401);
match(COMMA);
setState(402);
((StateListContext)_localctx).ID = match(ID);
((StateListContext)_localctx).fIds.add(((StateListContext)_localctx).ID);
}
}
setState(407);
_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 InitContext extends ParserRuleContext {
public Token fId;
public TerminalNode INIT() { return getToken(XtaDslParser.INIT, 0); }
public TerminalNode SEMICOLON() { return getToken(XtaDslParser.SEMICOLON, 0); }
public TerminalNode ID() { return getToken(XtaDslParser.ID, 0); }
public InitContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_init; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterInit(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitInit(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitInit(this);
else return visitor.visitChildren(this);
}
}
public final InitContext init() throws RecognitionException {
InitContext _localctx = new InitContext(_ctx, getState());
enterRule(_localctx, 30, RULE_init);
try {
enterOuterAlt(_localctx, 1);
{
setState(408);
match(INIT);
setState(409);
((InitContext)_localctx).fId = match(ID);
setState(410);
match(SEMICOLON);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class TransitionsContext extends ParserRuleContext {
public TransitionContext transition;
public List fTransitions = new ArrayList();
public TerminalNode TRANS() { return getToken(XtaDslParser.TRANS, 0); }
public TerminalNode SEMICOLON() { return getToken(XtaDslParser.SEMICOLON, 0); }
public List transition() {
return getRuleContexts(TransitionContext.class);
}
public TransitionContext transition(int i) {
return getRuleContext(TransitionContext.class,i);
}
public List COMMA() { return getTokens(XtaDslParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(XtaDslParser.COMMA, i);
}
public TransitionsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_transitions; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterTransitions(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitTransitions(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitTransitions(this);
else return visitor.visitChildren(this);
}
}
public final TransitionsContext transitions() throws RecognitionException {
TransitionsContext _localctx = new TransitionsContext(_ctx, getState());
enterRule(_localctx, 32, RULE_transitions);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(412);
match(TRANS);
setState(413);
((TransitionsContext)_localctx).transition = transition();
((TransitionsContext)_localctx).fTransitions.add(((TransitionsContext)_localctx).transition);
setState(418);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(414);
match(COMMA);
setState(415);
((TransitionsContext)_localctx).transition = transition();
((TransitionsContext)_localctx).fTransitions.add(((TransitionsContext)_localctx).transition);
}
}
setState(420);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(421);
match(SEMICOLON);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class TransitionContext extends ParserRuleContext {
public Token fSourceId;
public Token fTargetId;
public TransitionBodyContext fTransitionBody;
public TerminalNode RARROW() { return getToken(XtaDslParser.RARROW, 0); }
public List ID() { return getTokens(XtaDslParser.ID); }
public TerminalNode ID(int i) {
return getToken(XtaDslParser.ID, i);
}
public TransitionBodyContext transitionBody() {
return getRuleContext(TransitionBodyContext.class,0);
}
public TransitionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_transition; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterTransition(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitTransition(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitTransition(this);
else return visitor.visitChildren(this);
}
}
public final TransitionContext transition() throws RecognitionException {
TransitionContext _localctx = new TransitionContext(_ctx, getState());
enterRule(_localctx, 34, RULE_transition);
try {
enterOuterAlt(_localctx, 1);
{
setState(423);
((TransitionContext)_localctx).fSourceId = match(ID);
setState(424);
match(RARROW);
setState(425);
((TransitionContext)_localctx).fTargetId = match(ID);
setState(426);
((TransitionContext)_localctx).fTransitionBody = transitionBody();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class TransitionOptContext extends ParserRuleContext {
public Token fTargetId;
public TransitionBodyContext fTransitionBody;
public TransitionContext transition() {
return getRuleContext(TransitionContext.class,0);
}
public TerminalNode RARROW() { return getToken(XtaDslParser.RARROW, 0); }
public TerminalNode ID() { return getToken(XtaDslParser.ID, 0); }
public TransitionBodyContext transitionBody() {
return getRuleContext(TransitionBodyContext.class,0);
}
public TransitionOptContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_transitionOpt; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterTransitionOpt(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitTransitionOpt(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitTransitionOpt(this);
else return visitor.visitChildren(this);
}
}
public final TransitionOptContext transitionOpt() throws RecognitionException {
TransitionOptContext _localctx = new TransitionOptContext(_ctx, getState());
enterRule(_localctx, 36, RULE_transitionOpt);
try {
setState(432);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ID:
enterOuterAlt(_localctx, 1);
{
setState(428);
transition();
}
break;
case RARROW:
enterOuterAlt(_localctx, 2);
{
setState(429);
match(RARROW);
setState(430);
((TransitionOptContext)_localctx).fTargetId = match(ID);
setState(431);
((TransitionOptContext)_localctx).fTransitionBody = transitionBody();
}
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 TransitionBodyContext extends ParserRuleContext {
public SelectContext fSelect;
public GuardContext fGuard;
public SyncContext fSync;
public AssignContext fAssign;
public TerminalNode LBRAC() { return getToken(XtaDslParser.LBRAC, 0); }
public TerminalNode RBRAC() { return getToken(XtaDslParser.RBRAC, 0); }
public SelectContext select() {
return getRuleContext(SelectContext.class,0);
}
public GuardContext guard() {
return getRuleContext(GuardContext.class,0);
}
public SyncContext sync() {
return getRuleContext(SyncContext.class,0);
}
public AssignContext assign() {
return getRuleContext(AssignContext.class,0);
}
public TransitionBodyContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_transitionBody; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterTransitionBody(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitTransitionBody(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitTransitionBody(this);
else return visitor.visitChildren(this);
}
}
public final TransitionBodyContext transitionBody() throws RecognitionException {
TransitionBodyContext _localctx = new TransitionBodyContext(_ctx, getState());
enterRule(_localctx, 38, RULE_transitionBody);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(434);
match(LBRAC);
setState(436);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==SELECT) {
{
setState(435);
((TransitionBodyContext)_localctx).fSelect = select();
}
}
setState(439);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GUARD) {
{
setState(438);
((TransitionBodyContext)_localctx).fGuard = guard();
}
}
setState(442);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==SYNC) {
{
setState(441);
((TransitionBodyContext)_localctx).fSync = sync();
}
}
setState(445);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ASSIGN) {
{
setState(444);
((TransitionBodyContext)_localctx).fAssign = assign();
}
}
setState(447);
match(RBRAC);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class SelectContext extends ParserRuleContext {
public IteratorDeclContext iteratorDecl;
public List fIteratorDecls = new ArrayList();
public TerminalNode SELECT() { return getToken(XtaDslParser.SELECT, 0); }
public TerminalNode SEMICOLON() { return getToken(XtaDslParser.SEMICOLON, 0); }
public List iteratorDecl() {
return getRuleContexts(IteratorDeclContext.class);
}
public IteratorDeclContext iteratorDecl(int i) {
return getRuleContext(IteratorDeclContext.class,i);
}
public List COMMA() { return getTokens(XtaDslParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(XtaDslParser.COMMA, i);
}
public SelectContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_select; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterSelect(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitSelect(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitSelect(this);
else return visitor.visitChildren(this);
}
}
public final SelectContext select() throws RecognitionException {
SelectContext _localctx = new SelectContext(_ctx, getState());
enterRule(_localctx, 40, RULE_select);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(449);
match(SELECT);
setState(450);
((SelectContext)_localctx).iteratorDecl = iteratorDecl();
((SelectContext)_localctx).fIteratorDecls.add(((SelectContext)_localctx).iteratorDecl);
setState(455);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(451);
match(COMMA);
setState(452);
((SelectContext)_localctx).iteratorDecl = iteratorDecl();
((SelectContext)_localctx).fIteratorDecls.add(((SelectContext)_localctx).iteratorDecl);
}
}
setState(457);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(458);
match(SEMICOLON);
}
}
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 ExpressionContext fExpression;
public TerminalNode GUARD() { return getToken(XtaDslParser.GUARD, 0); }
public TerminalNode SEMICOLON() { return getToken(XtaDslParser.SEMICOLON, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
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 XtaDslListener ) ((XtaDslListener)listener).enterGuard(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitGuard(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitGuard(this);
else return visitor.visitChildren(this);
}
}
public final GuardContext guard() throws RecognitionException {
GuardContext _localctx = new GuardContext(_ctx, getState());
enterRule(_localctx, 42, RULE_guard);
try {
enterOuterAlt(_localctx, 1);
{
setState(460);
match(GUARD);
setState(461);
((GuardContext)_localctx).fExpression = expression();
setState(462);
match(SEMICOLON);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class SyncContext extends ParserRuleContext {
public ExpressionContext fExpression;
public Token fEmit;
public Token fRecv;
public TerminalNode SYNC() { return getToken(XtaDslParser.SYNC, 0); }
public TerminalNode SEMICOLON() { return getToken(XtaDslParser.SEMICOLON, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public TerminalNode EXCL() { return getToken(XtaDslParser.EXCL, 0); }
public TerminalNode QUEST() { return getToken(XtaDslParser.QUEST, 0); }
public SyncContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_sync; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterSync(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitSync(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitSync(this);
else return visitor.visitChildren(this);
}
}
public final SyncContext sync() throws RecognitionException {
SyncContext _localctx = new SyncContext(_ctx, getState());
enterRule(_localctx, 44, RULE_sync);
try {
enterOuterAlt(_localctx, 1);
{
setState(464);
match(SYNC);
setState(465);
((SyncContext)_localctx).fExpression = expression();
setState(468);
_errHandler.sync(this);
switch (_input.LA(1)) {
case EXCL:
{
setState(466);
((SyncContext)_localctx).fEmit = match(EXCL);
}
break;
case QUEST:
{
setState(467);
((SyncContext)_localctx).fRecv = match(QUEST);
}
break;
default:
throw new NoViableAltException(this);
}
setState(470);
match(SEMICOLON);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class AssignContext extends ParserRuleContext {
public ExpressionContext expression;
public List fExpressions = new ArrayList();
public TerminalNode ASSIGN() { return getToken(XtaDslParser.ASSIGN, 0); }
public TerminalNode SEMICOLON() { return getToken(XtaDslParser.SEMICOLON, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public List COMMA() { return getTokens(XtaDslParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(XtaDslParser.COMMA, i);
}
public AssignContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_assign; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterAssign(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitAssign(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitAssign(this);
else return visitor.visitChildren(this);
}
}
public final AssignContext assign() throws RecognitionException {
AssignContext _localctx = new AssignContext(_ctx, getState());
enterRule(_localctx, 46, RULE_assign);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(472);
match(ASSIGN);
{
setState(473);
((AssignContext)_localctx).expression = expression();
((AssignContext)_localctx).fExpressions.add(((AssignContext)_localctx).expression);
}
setState(478);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(474);
match(COMMA);
setState(475);
((AssignContext)_localctx).expression = expression();
((AssignContext)_localctx).fExpressions.add(((AssignContext)_localctx).expression);
}
}
setState(480);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(481);
match(SEMICOLON);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class TypeDeclContext extends ParserRuleContext {
public TypeContext fType;
public ArrayIdContext arrayId;
public List fArrayIds = new ArrayList();
public TerminalNode TYPEDEF() { return getToken(XtaDslParser.TYPEDEF, 0); }
public TerminalNode SEMICOLON() { return getToken(XtaDslParser.SEMICOLON, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public List arrayId() {
return getRuleContexts(ArrayIdContext.class);
}
public ArrayIdContext arrayId(int i) {
return getRuleContext(ArrayIdContext.class,i);
}
public List COMMA() { return getTokens(XtaDslParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(XtaDslParser.COMMA, i);
}
public TypeDeclContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_typeDecl; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterTypeDecl(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitTypeDecl(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitTypeDecl(this);
else return visitor.visitChildren(this);
}
}
public final TypeDeclContext typeDecl() throws RecognitionException {
TypeDeclContext _localctx = new TypeDeclContext(_ctx, getState());
enterRule(_localctx, 48, RULE_typeDecl);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(483);
match(TYPEDEF);
setState(484);
((TypeDeclContext)_localctx).fType = type();
setState(485);
((TypeDeclContext)_localctx).arrayId = arrayId();
((TypeDeclContext)_localctx).fArrayIds.add(((TypeDeclContext)_localctx).arrayId);
setState(490);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(486);
match(COMMA);
setState(487);
((TypeDeclContext)_localctx).arrayId = arrayId();
((TypeDeclContext)_localctx).fArrayIds.add(((TypeDeclContext)_localctx).arrayId);
}
}
setState(492);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(493);
match(SEMICOLON);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ArrayIdContext extends ParserRuleContext {
public Token fId;
public ArrayIndexContext arrayIndex;
public List fArrayIndexes = new ArrayList();
public TerminalNode ID() { return getToken(XtaDslParser.ID, 0); }
public List LBRACK() { return getTokens(XtaDslParser.LBRACK); }
public TerminalNode LBRACK(int i) {
return getToken(XtaDslParser.LBRACK, i);
}
public List RBRACK() { return getTokens(XtaDslParser.RBRACK); }
public TerminalNode RBRACK(int i) {
return getToken(XtaDslParser.RBRACK, i);
}
public List arrayIndex() {
return getRuleContexts(ArrayIndexContext.class);
}
public ArrayIndexContext arrayIndex(int i) {
return getRuleContext(ArrayIndexContext.class,i);
}
public ArrayIdContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_arrayId; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterArrayId(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitArrayId(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitArrayId(this);
else return visitor.visitChildren(this);
}
}
public final ArrayIdContext arrayId() throws RecognitionException {
ArrayIdContext _localctx = new ArrayIdContext(_ctx, getState());
enterRule(_localctx, 50, RULE_arrayId);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(495);
((ArrayIdContext)_localctx).fId = match(ID);
setState(502);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==LBRACK) {
{
{
setState(496);
match(LBRACK);
setState(497);
((ArrayIdContext)_localctx).arrayIndex = arrayIndex();
((ArrayIdContext)_localctx).fArrayIndexes.add(((ArrayIdContext)_localctx).arrayIndex);
setState(498);
match(RBRACK);
}
}
setState(504);
_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 ArrayIndexContext extends ParserRuleContext {
public IdIndexContext idIndex() {
return getRuleContext(IdIndexContext.class,0);
}
public ExpressionIndexContext expressionIndex() {
return getRuleContext(ExpressionIndexContext.class,0);
}
public ArrayIndexContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_arrayIndex; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterArrayIndex(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitArrayIndex(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitArrayIndex(this);
else return visitor.visitChildren(this);
}
}
public final ArrayIndexContext arrayIndex() throws RecognitionException {
ArrayIndexContext _localctx = new ArrayIndexContext(_ctx, getState());
enterRule(_localctx, 52, RULE_arrayIndex);
try {
setState(507);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,27,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(505);
idIndex();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(506);
expressionIndex();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class IdIndexContext extends ParserRuleContext {
public Token fId;
public TerminalNode ID() { return getToken(XtaDslParser.ID, 0); }
public IdIndexContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_idIndex; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterIdIndex(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitIdIndex(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitIdIndex(this);
else return visitor.visitChildren(this);
}
}
public final IdIndexContext idIndex() throws RecognitionException {
IdIndexContext _localctx = new IdIndexContext(_ctx, getState());
enterRule(_localctx, 54, RULE_idIndex);
try {
enterOuterAlt(_localctx, 1);
{
setState(509);
((IdIndexContext)_localctx).fId = match(ID);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ExpressionIndexContext extends ParserRuleContext {
public ExpressionContext fExpression;
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public ExpressionIndexContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_expressionIndex; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterExpressionIndex(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitExpressionIndex(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitExpressionIndex(this);
else return visitor.visitChildren(this);
}
}
public final ExpressionIndexContext expressionIndex() throws RecognitionException {
ExpressionIndexContext _localctx = new ExpressionIndexContext(_ctx, getState());
enterRule(_localctx, 56, RULE_expressionIndex);
try {
enterOuterAlt(_localctx, 1);
{
setState(511);
((ExpressionIndexContext)_localctx).fExpression = expression();
}
}
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 TypePrefixContext fTypePrefix;
public BasicTypeContext fBasicType;
public TypePrefixContext typePrefix() {
return getRuleContext(TypePrefixContext.class,0);
}
public BasicTypeContext basicType() {
return getRuleContext(BasicTypeContext.class,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 XtaDslListener ) ((XtaDslListener)listener).enterType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitType(this);
else return visitor.visitChildren(this);
}
}
public final TypeContext type() throws RecognitionException {
TypeContext _localctx = new TypeContext(_ctx, getState());
enterRule(_localctx, 58, RULE_type);
try {
enterOuterAlt(_localctx, 1);
{
setState(513);
((TypeContext)_localctx).fTypePrefix = typePrefix();
setState(514);
((TypeContext)_localctx).fBasicType = basicType();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class TypePrefixContext extends ParserRuleContext {
public Token fUrgent;
public Token fBroadcast;
public Token fConst;
public TerminalNode URGENT() { return getToken(XtaDslParser.URGENT, 0); }
public TerminalNode BROADCAST() { return getToken(XtaDslParser.BROADCAST, 0); }
public TerminalNode CONST() { return getToken(XtaDslParser.CONST, 0); }
public TypePrefixContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_typePrefix; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterTypePrefix(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitTypePrefix(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitTypePrefix(this);
else return visitor.visitChildren(this);
}
}
public final TypePrefixContext typePrefix() throws RecognitionException {
TypePrefixContext _localctx = new TypePrefixContext(_ctx, getState());
enterRule(_localctx, 60, RULE_typePrefix);
int _la;
try {
setState(525);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,31,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(517);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==URGENT) {
{
setState(516);
((TypePrefixContext)_localctx).fUrgent = match(URGENT);
}
}
setState(520);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==BROADCAST) {
{
setState(519);
((TypePrefixContext)_localctx).fBroadcast = match(BROADCAST);
}
}
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(523);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==CONST) {
{
setState(522);
((TypePrefixContext)_localctx).fConst = match(CONST);
}
}
}
break;
}
}
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 RefTypeContext refType() {
return getRuleContext(RefTypeContext.class,0);
}
public VoidTypeContext voidType() {
return getRuleContext(VoidTypeContext.class,0);
}
public IntTypeContext intType() {
return getRuleContext(IntTypeContext.class,0);
}
public ClockTypeContext clockType() {
return getRuleContext(ClockTypeContext.class,0);
}
public ChanTypeContext chanType() {
return getRuleContext(ChanTypeContext.class,0);
}
public BoolTypeContext boolType() {
return getRuleContext(BoolTypeContext.class,0);
}
public RangeTypeContext rangeType() {
return getRuleContext(RangeTypeContext.class,0);
}
public ScalarTypeContext scalarType() {
return getRuleContext(ScalarTypeContext.class,0);
}
public StructTypeContext structType() {
return getRuleContext(StructTypeContext.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 XtaDslListener ) ((XtaDslListener)listener).enterBasicType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitBasicType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitBasicType(this);
else return visitor.visitChildren(this);
}
}
public final BasicTypeContext basicType() throws RecognitionException {
BasicTypeContext _localctx = new BasicTypeContext(_ctx, getState());
enterRule(_localctx, 62, RULE_basicType);
try {
setState(536);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,32,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(527);
refType();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(528);
voidType();
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(529);
intType();
}
break;
case 4:
enterOuterAlt(_localctx, 4);
{
setState(530);
clockType();
}
break;
case 5:
enterOuterAlt(_localctx, 5);
{
setState(531);
chanType();
}
break;
case 6:
enterOuterAlt(_localctx, 6);
{
setState(532);
boolType();
}
break;
case 7:
enterOuterAlt(_localctx, 7);
{
setState(533);
rangeType();
}
break;
case 8:
enterOuterAlt(_localctx, 8);
{
setState(534);
scalarType();
}
break;
case 9:
enterOuterAlt(_localctx, 9);
{
setState(535);
structType();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RefTypeContext extends ParserRuleContext {
public Token fId;
public TerminalNode ID() { return getToken(XtaDslParser.ID, 0); }
public RefTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_refType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterRefType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitRefType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitRefType(this);
else return visitor.visitChildren(this);
}
}
public final RefTypeContext refType() throws RecognitionException {
RefTypeContext _localctx = new RefTypeContext(_ctx, getState());
enterRule(_localctx, 64, RULE_refType);
try {
enterOuterAlt(_localctx, 1);
{
setState(538);
((RefTypeContext)_localctx).fId = match(ID);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class VoidTypeContext extends ParserRuleContext {
public TerminalNode VOID() { return getToken(XtaDslParser.VOID, 0); }
public VoidTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_voidType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterVoidType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitVoidType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitVoidType(this);
else return visitor.visitChildren(this);
}
}
public final VoidTypeContext voidType() throws RecognitionException {
VoidTypeContext _localctx = new VoidTypeContext(_ctx, getState());
enterRule(_localctx, 66, RULE_voidType);
try {
enterOuterAlt(_localctx, 1);
{
setState(540);
match(VOID);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class IntTypeContext extends ParserRuleContext {
public TerminalNode INT() { return getToken(XtaDslParser.INT, 0); }
public IntTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_intType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterIntType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitIntType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitIntType(this);
else return visitor.visitChildren(this);
}
}
public final IntTypeContext intType() throws RecognitionException {
IntTypeContext _localctx = new IntTypeContext(_ctx, getState());
enterRule(_localctx, 68, RULE_intType);
try {
enterOuterAlt(_localctx, 1);
{
setState(542);
match(INT);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ClockTypeContext extends ParserRuleContext {
public TerminalNode CLOCK() { return getToken(XtaDslParser.CLOCK, 0); }
public ClockTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_clockType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterClockType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitClockType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitClockType(this);
else return visitor.visitChildren(this);
}
}
public final ClockTypeContext clockType() throws RecognitionException {
ClockTypeContext _localctx = new ClockTypeContext(_ctx, getState());
enterRule(_localctx, 70, RULE_clockType);
try {
enterOuterAlt(_localctx, 1);
{
setState(544);
match(CLOCK);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ChanTypeContext extends ParserRuleContext {
public TerminalNode CHAN() { return getToken(XtaDslParser.CHAN, 0); }
public ChanTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_chanType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterChanType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitChanType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitChanType(this);
else return visitor.visitChildren(this);
}
}
public final ChanTypeContext chanType() throws RecognitionException {
ChanTypeContext _localctx = new ChanTypeContext(_ctx, getState());
enterRule(_localctx, 72, RULE_chanType);
try {
enterOuterAlt(_localctx, 1);
{
setState(546);
match(CHAN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class BoolTypeContext extends ParserRuleContext {
public TerminalNode BOOL() { return getToken(XtaDslParser.BOOL, 0); }
public BoolTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_boolType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterBoolType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitBoolType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitBoolType(this);
else return visitor.visitChildren(this);
}
}
public final BoolTypeContext boolType() throws RecognitionException {
BoolTypeContext _localctx = new BoolTypeContext(_ctx, getState());
enterRule(_localctx, 74, RULE_boolType);
try {
enterOuterAlt(_localctx, 1);
{
setState(548);
match(BOOL);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RangeTypeContext extends ParserRuleContext {
public ExpressionContext fFromExpression;
public ExpressionContext fToExpression;
public TerminalNode INT() { return getToken(XtaDslParser.INT, 0); }
public TerminalNode LBRACK() { return getToken(XtaDslParser.LBRACK, 0); }
public TerminalNode COMMA() { return getToken(XtaDslParser.COMMA, 0); }
public TerminalNode RBRACK() { return getToken(XtaDslParser.RBRACK, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public RangeTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_rangeType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterRangeType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitRangeType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitRangeType(this);
else return visitor.visitChildren(this);
}
}
public final RangeTypeContext rangeType() throws RecognitionException {
RangeTypeContext _localctx = new RangeTypeContext(_ctx, getState());
enterRule(_localctx, 76, RULE_rangeType);
try {
enterOuterAlt(_localctx, 1);
{
setState(550);
match(INT);
setState(551);
match(LBRACK);
setState(552);
((RangeTypeContext)_localctx).fFromExpression = expression();
setState(553);
match(COMMA);
setState(554);
((RangeTypeContext)_localctx).fToExpression = expression();
setState(555);
match(RBRACK);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ScalarTypeContext extends ParserRuleContext {
public ExpressionContext fExpression;
public TerminalNode SCALAR() { return getToken(XtaDslParser.SCALAR, 0); }
public TerminalNode LBRACK() { return getToken(XtaDslParser.LBRACK, 0); }
public TerminalNode RBRACK() { return getToken(XtaDslParser.RBRACK, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public ScalarTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_scalarType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterScalarType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitScalarType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitScalarType(this);
else return visitor.visitChildren(this);
}
}
public final ScalarTypeContext scalarType() throws RecognitionException {
ScalarTypeContext _localctx = new ScalarTypeContext(_ctx, getState());
enterRule(_localctx, 78, RULE_scalarType);
try {
enterOuterAlt(_localctx, 1);
{
setState(557);
match(SCALAR);
setState(558);
match(LBRACK);
setState(559);
((ScalarTypeContext)_localctx).fExpression = expression();
setState(560);
match(RBRACK);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class StructTypeContext extends ParserRuleContext {
public FieldDeclContext fieldDecl;
public List fFieldDecls = new ArrayList();
public TerminalNode STRUCT() { return getToken(XtaDslParser.STRUCT, 0); }
public TerminalNode LBRAC() { return getToken(XtaDslParser.LBRAC, 0); }
public TerminalNode RBRAC() { return getToken(XtaDslParser.RBRAC, 0); }
public List SEMICOLON() { return getTokens(XtaDslParser.SEMICOLON); }
public TerminalNode SEMICOLON(int i) {
return getToken(XtaDslParser.SEMICOLON, i);
}
public List fieldDecl() {
return getRuleContexts(FieldDeclContext.class);
}
public FieldDeclContext fieldDecl(int i) {
return getRuleContext(FieldDeclContext.class,i);
}
public StructTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_structType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterStructType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitStructType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitStructType(this);
else return visitor.visitChildren(this);
}
}
public final StructTypeContext structType() throws RecognitionException {
StructTypeContext _localctx = new StructTypeContext(_ctx, getState());
enterRule(_localctx, 80, RULE_structType);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(562);
match(STRUCT);
setState(563);
match(LBRAC);
setState(567);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(564);
((StructTypeContext)_localctx).fieldDecl = fieldDecl();
((StructTypeContext)_localctx).fFieldDecls.add(((StructTypeContext)_localctx).fieldDecl);
setState(565);
match(SEMICOLON);
}
}
setState(569);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << URGENT) | (1L << VOID) | (1L << INT) | (1L << CLOCK) | (1L << CHAN) | (1L << BOOL) | (1L << SCALAR) | (1L << STRUCT) | (1L << BROADCAST) | (1L << CONST) | (1L << ID))) != 0) );
setState(571);
match(RBRAC);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class FieldDeclContext extends ParserRuleContext {
public TypeContext fType;
public ArrayIdContext arrayId;
public List fArrayIds = new ArrayList();
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public List arrayId() {
return getRuleContexts(ArrayIdContext.class);
}
public ArrayIdContext arrayId(int i) {
return getRuleContext(ArrayIdContext.class,i);
}
public List COMMA() { return getTokens(XtaDslParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(XtaDslParser.COMMA, i);
}
public FieldDeclContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_fieldDecl; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterFieldDecl(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitFieldDecl(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitFieldDecl(this);
else return visitor.visitChildren(this);
}
}
public final FieldDeclContext fieldDecl() throws RecognitionException {
FieldDeclContext _localctx = new FieldDeclContext(_ctx, getState());
enterRule(_localctx, 82, RULE_fieldDecl);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(573);
((FieldDeclContext)_localctx).fType = type();
setState(574);
((FieldDeclContext)_localctx).arrayId = arrayId();
((FieldDeclContext)_localctx).fArrayIds.add(((FieldDeclContext)_localctx).arrayId);
setState(579);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(575);
match(COMMA);
setState(576);
((FieldDeclContext)_localctx).arrayId = arrayId();
((FieldDeclContext)_localctx).fArrayIds.add(((FieldDeclContext)_localctx).arrayId);
}
}
setState(581);
_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 VariableDeclContext extends ParserRuleContext {
public TypeContext fType;
public VariableIdContext variableId;
public List fVariableIds = new ArrayList();
public TerminalNode SEMICOLON() { return getToken(XtaDslParser.SEMICOLON, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public List variableId() {
return getRuleContexts(VariableIdContext.class);
}
public VariableIdContext variableId(int i) {
return getRuleContext(VariableIdContext.class,i);
}
public List COMMA() { return getTokens(XtaDslParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(XtaDslParser.COMMA, i);
}
public VariableDeclContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_variableDecl; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterVariableDecl(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitVariableDecl(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitVariableDecl(this);
else return visitor.visitChildren(this);
}
}
public final VariableDeclContext variableDecl() throws RecognitionException {
VariableDeclContext _localctx = new VariableDeclContext(_ctx, getState());
enterRule(_localctx, 84, RULE_variableDecl);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(582);
((VariableDeclContext)_localctx).fType = type();
setState(583);
((VariableDeclContext)_localctx).variableId = variableId();
((VariableDeclContext)_localctx).fVariableIds.add(((VariableDeclContext)_localctx).variableId);
setState(588);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(584);
match(COMMA);
setState(585);
((VariableDeclContext)_localctx).variableId = variableId();
((VariableDeclContext)_localctx).fVariableIds.add(((VariableDeclContext)_localctx).variableId);
}
}
setState(590);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(591);
match(SEMICOLON);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class VariableIdContext extends ParserRuleContext {
public ArrayIdContext fArrayId;
public InitialiserContext fInitialiser;
public ArrayIdContext arrayId() {
return getRuleContext(ArrayIdContext.class,0);
}
public AssignOpContext assignOp() {
return getRuleContext(AssignOpContext.class,0);
}
public InitialiserContext initialiser() {
return getRuleContext(InitialiserContext.class,0);
}
public VariableIdContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_variableId; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterVariableId(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitVariableId(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitVariableId(this);
else return visitor.visitChildren(this);
}
}
public final VariableIdContext variableId() throws RecognitionException {
VariableIdContext _localctx = new VariableIdContext(_ctx, getState());
enterRule(_localctx, 86, RULE_variableId);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(593);
((VariableIdContext)_localctx).fArrayId = arrayId();
setState(597);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NEWASSIGNOP || _la==OLDASSIGNOP) {
{
setState(594);
assignOp();
setState(595);
((VariableIdContext)_localctx).fInitialiser = initialiser();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class InitialiserContext extends ParserRuleContext {
public SimpleInitialiserContext fSimpleInitialiser;
public CompoundInitialiserContext fCompundInitialiser;
public SimpleInitialiserContext simpleInitialiser() {
return getRuleContext(SimpleInitialiserContext.class,0);
}
public CompoundInitialiserContext compoundInitialiser() {
return getRuleContext(CompoundInitialiserContext.class,0);
}
public InitialiserContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_initialiser; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterInitialiser(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitInitialiser(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitInitialiser(this);
else return visitor.visitChildren(this);
}
}
public final InitialiserContext initialiser() throws RecognitionException {
InitialiserContext _localctx = new InitialiserContext(_ctx, getState());
enterRule(_localctx, 88, RULE_initialiser);
try {
setState(601);
_errHandler.sync(this);
switch (_input.LA(1)) {
case FORALL:
case EXISTS:
case NOT:
case INCOP:
case DECOP:
case TRUE:
case FALSE:
case NAT:
case ID:
case LPAREN:
case EXCL:
case PLUS:
case MINUS:
case TILDE:
enterOuterAlt(_localctx, 1);
{
setState(599);
((InitialiserContext)_localctx).fSimpleInitialiser = simpleInitialiser();
}
break;
case LBRAC:
enterOuterAlt(_localctx, 2);
{
setState(600);
((InitialiserContext)_localctx).fCompundInitialiser = compoundInitialiser();
}
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 SimpleInitialiserContext extends ParserRuleContext {
public ExpressionContext fExpression;
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public SimpleInitialiserContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_simpleInitialiser; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterSimpleInitialiser(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitSimpleInitialiser(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitSimpleInitialiser(this);
else return visitor.visitChildren(this);
}
}
public final SimpleInitialiserContext simpleInitialiser() throws RecognitionException {
SimpleInitialiserContext _localctx = new SimpleInitialiserContext(_ctx, getState());
enterRule(_localctx, 90, RULE_simpleInitialiser);
try {
enterOuterAlt(_localctx, 1);
{
setState(603);
((SimpleInitialiserContext)_localctx).fExpression = expression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class CompoundInitialiserContext extends ParserRuleContext {
public InitialiserContext fInitialiser;
public TerminalNode LBRAC() { return getToken(XtaDslParser.LBRAC, 0); }
public TerminalNode RBRAC() { return getToken(XtaDslParser.RBRAC, 0); }
public List initialiser() {
return getRuleContexts(InitialiserContext.class);
}
public InitialiserContext initialiser(int i) {
return getRuleContext(InitialiserContext.class,i);
}
public List COMMA() { return getTokens(XtaDslParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(XtaDslParser.COMMA, i);
}
public CompoundInitialiserContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_compoundInitialiser; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterCompoundInitialiser(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitCompoundInitialiser(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitCompoundInitialiser(this);
else return visitor.visitChildren(this);
}
}
public final CompoundInitialiserContext compoundInitialiser() throws RecognitionException {
CompoundInitialiserContext _localctx = new CompoundInitialiserContext(_ctx, getState());
enterRule(_localctx, 92, RULE_compoundInitialiser);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(605);
match(LBRAC);
setState(606);
((CompoundInitialiserContext)_localctx).fInitialiser = initialiser();
setState(611);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(607);
match(COMMA);
setState(608);
((CompoundInitialiserContext)_localctx).fInitialiser = initialiser();
}
}
setState(613);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(614);
match(RBRAC);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class BlockContext extends ParserRuleContext {
public VariableDeclContext variableDecl;
public List fVariableDecls = new ArrayList();
public TypeDeclContext typeDecl;
public List fTypeDecls = new ArrayList();
public StatementContext statement;
public List fStatements = new ArrayList();
public TerminalNode LBRAC() { return getToken(XtaDslParser.LBRAC, 0); }
public TerminalNode RBRAC() { return getToken(XtaDslParser.RBRAC, 0); }
public List variableDecl() {
return getRuleContexts(VariableDeclContext.class);
}
public VariableDeclContext variableDecl(int i) {
return getRuleContext(VariableDeclContext.class,i);
}
public List typeDecl() {
return getRuleContexts(TypeDeclContext.class);
}
public TypeDeclContext typeDecl(int i) {
return getRuleContext(TypeDeclContext.class,i);
}
public List statement() {
return getRuleContexts(StatementContext.class);
}
public StatementContext statement(int i) {
return getRuleContext(StatementContext.class,i);
}
public BlockContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_block; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterBlock(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitBlock(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitBlock(this);
else return visitor.visitChildren(this);
}
}
public final BlockContext block() throws RecognitionException {
BlockContext _localctx = new BlockContext(_ctx, getState());
enterRule(_localctx, 94, RULE_block);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(616);
match(LBRAC);
setState(621);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,40,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
setState(619);
_errHandler.sync(this);
switch (_input.LA(1)) {
case URGENT:
case VOID:
case INT:
case CLOCK:
case CHAN:
case BOOL:
case SCALAR:
case STRUCT:
case BROADCAST:
case CONST:
case ID:
{
setState(617);
((BlockContext)_localctx).variableDecl = variableDecl();
((BlockContext)_localctx).fVariableDecls.add(((BlockContext)_localctx).variableDecl);
}
break;
case TYPEDEF:
{
setState(618);
((BlockContext)_localctx).typeDecl = typeDecl();
((BlockContext)_localctx).fTypeDecls.add(((BlockContext)_localctx).typeDecl);
}
break;
default:
throw new NoViableAltException(this);
}
}
}
setState(623);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,40,_ctx);
}
setState(627);
_errHandler.sync(this);
_la = _input.LA(1);
while (((((_la - 22)) & ~0x3f) == 0 && ((1L << (_la - 22)) & ((1L << (FOR - 22)) | (1L << (WHILE - 22)) | (1L << (DO - 22)) | (1L << (IF - 22)) | (1L << (RETURN - 22)) | (1L << (FORALL - 22)) | (1L << (EXISTS - 22)) | (1L << (NOT - 22)) | (1L << (INCOP - 22)) | (1L << (DECOP - 22)) | (1L << (TRUE - 22)) | (1L << (FALSE - 22)) | (1L << (NAT - 22)) | (1L << (ID - 22)) | (1L << (LPAREN - 22)) | (1L << (LBRAC - 22)) | (1L << (SEMICOLON - 22)) | (1L << (EXCL - 22)) | (1L << (PLUS - 22)) | (1L << (MINUS - 22)) | (1L << (TILDE - 22)))) != 0)) {
{
{
setState(624);
((BlockContext)_localctx).statement = statement();
((BlockContext)_localctx).fStatements.add(((BlockContext)_localctx).statement);
}
}
setState(629);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(630);
match(RBRAC);
}
}
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 BlockContext block() {
return getRuleContext(BlockContext.class,0);
}
public SkipStatementContext skipStatement() {
return getRuleContext(SkipStatementContext.class,0);
}
public ExpressionStatementContext expressionStatement() {
return getRuleContext(ExpressionStatementContext.class,0);
}
public ForStatementContext forStatement() {
return getRuleContext(ForStatementContext.class,0);
}
public ForeachStatementContext foreachStatement() {
return getRuleContext(ForeachStatementContext.class,0);
}
public WhileStatementContext whileStatement() {
return getRuleContext(WhileStatementContext.class,0);
}
public DoStatementContext doStatement() {
return getRuleContext(DoStatementContext.class,0);
}
public IfStatementContext ifStatement() {
return getRuleContext(IfStatementContext.class,0);
}
public ReturnStatementContext returnStatement() {
return getRuleContext(ReturnStatementContext.class,0);
}
public StatementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_statement; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitStatement(this);
else return visitor.visitChildren(this);
}
}
public final StatementContext statement() throws RecognitionException {
StatementContext _localctx = new StatementContext(_ctx, getState());
enterRule(_localctx, 96, RULE_statement);
try {
setState(641);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,42,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(632);
block();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(633);
skipStatement();
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(634);
expressionStatement();
}
break;
case 4:
enterOuterAlt(_localctx, 4);
{
setState(635);
forStatement();
}
break;
case 5:
enterOuterAlt(_localctx, 5);
{
setState(636);
foreachStatement();
}
break;
case 6:
enterOuterAlt(_localctx, 6);
{
setState(637);
whileStatement();
}
break;
case 7:
enterOuterAlt(_localctx, 7);
{
setState(638);
doStatement();
}
break;
case 8:
enterOuterAlt(_localctx, 8);
{
setState(639);
ifStatement();
}
break;
case 9:
enterOuterAlt(_localctx, 9);
{
setState(640);
returnStatement();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class SkipStatementContext extends ParserRuleContext {
public TerminalNode SEMICOLON() { return getToken(XtaDslParser.SEMICOLON, 0); }
public SkipStatementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_skipStatement; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterSkipStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitSkipStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitSkipStatement(this);
else return visitor.visitChildren(this);
}
}
public final SkipStatementContext skipStatement() throws RecognitionException {
SkipStatementContext _localctx = new SkipStatementContext(_ctx, getState());
enterRule(_localctx, 98, RULE_skipStatement);
try {
enterOuterAlt(_localctx, 1);
{
setState(643);
match(SEMICOLON);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ExpressionStatementContext extends ParserRuleContext {
public ExpressionContext fExpression;
public TerminalNode SEMICOLON() { return getToken(XtaDslParser.SEMICOLON, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public ExpressionStatementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_expressionStatement; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterExpressionStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitExpressionStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitExpressionStatement(this);
else return visitor.visitChildren(this);
}
}
public final ExpressionStatementContext expressionStatement() throws RecognitionException {
ExpressionStatementContext _localctx = new ExpressionStatementContext(_ctx, getState());
enterRule(_localctx, 100, RULE_expressionStatement);
try {
enterOuterAlt(_localctx, 1);
{
setState(645);
((ExpressionStatementContext)_localctx).fExpression = expression();
setState(646);
match(SEMICOLON);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ForStatementContext extends ParserRuleContext {
public ExpressionContext fInitExpression;
public ExpressionContext fConditionExpression;
public ExpressionContext fIncrementExpression;
public StatementContext fStatement;
public TerminalNode FOR() { return getToken(XtaDslParser.FOR, 0); }
public TerminalNode LPAREN() { return getToken(XtaDslParser.LPAREN, 0); }
public List SEMICOLON() { return getTokens(XtaDslParser.SEMICOLON); }
public TerminalNode SEMICOLON(int i) {
return getToken(XtaDslParser.SEMICOLON, i);
}
public TerminalNode RPAREN() { return getToken(XtaDslParser.RPAREN, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public StatementContext statement() {
return getRuleContext(StatementContext.class,0);
}
public ForStatementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_forStatement; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterForStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitForStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitForStatement(this);
else return visitor.visitChildren(this);
}
}
public final ForStatementContext forStatement() throws RecognitionException {
ForStatementContext _localctx = new ForStatementContext(_ctx, getState());
enterRule(_localctx, 102, RULE_forStatement);
try {
enterOuterAlt(_localctx, 1);
{
setState(648);
match(FOR);
setState(649);
match(LPAREN);
setState(650);
((ForStatementContext)_localctx).fInitExpression = expression();
setState(651);
match(SEMICOLON);
setState(652);
((ForStatementContext)_localctx).fConditionExpression = expression();
setState(653);
match(SEMICOLON);
setState(654);
((ForStatementContext)_localctx).fIncrementExpression = expression();
setState(655);
match(RPAREN);
setState(656);
((ForStatementContext)_localctx).fStatement = statement();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ForeachStatementContext extends ParserRuleContext {
public IteratorDeclContext fIteratorDecl;
public StatementContext fStatement;
public TerminalNode FOR() { return getToken(XtaDslParser.FOR, 0); }
public TerminalNode LPAREN() { return getToken(XtaDslParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(XtaDslParser.RPAREN, 0); }
public IteratorDeclContext iteratorDecl() {
return getRuleContext(IteratorDeclContext.class,0);
}
public StatementContext statement() {
return getRuleContext(StatementContext.class,0);
}
public ForeachStatementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_foreachStatement; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterForeachStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitForeachStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitForeachStatement(this);
else return visitor.visitChildren(this);
}
}
public final ForeachStatementContext foreachStatement() throws RecognitionException {
ForeachStatementContext _localctx = new ForeachStatementContext(_ctx, getState());
enterRule(_localctx, 104, RULE_foreachStatement);
try {
enterOuterAlt(_localctx, 1);
{
setState(658);
match(FOR);
setState(659);
match(LPAREN);
setState(660);
((ForeachStatementContext)_localctx).fIteratorDecl = iteratorDecl();
setState(661);
match(RPAREN);
setState(662);
((ForeachStatementContext)_localctx).fStatement = statement();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class WhileStatementContext extends ParserRuleContext {
public ExpressionContext fConditionExpression;
public StatementContext fStatement;
public TerminalNode WHILE() { return getToken(XtaDslParser.WHILE, 0); }
public TerminalNode LPAREN() { return getToken(XtaDslParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(XtaDslParser.RPAREN, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public StatementContext statement() {
return getRuleContext(StatementContext.class,0);
}
public WhileStatementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_whileStatement; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterWhileStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitWhileStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitWhileStatement(this);
else return visitor.visitChildren(this);
}
}
public final WhileStatementContext whileStatement() throws RecognitionException {
WhileStatementContext _localctx = new WhileStatementContext(_ctx, getState());
enterRule(_localctx, 106, RULE_whileStatement);
try {
enterOuterAlt(_localctx, 1);
{
setState(664);
match(WHILE);
setState(665);
match(LPAREN);
setState(666);
((WhileStatementContext)_localctx).fConditionExpression = expression();
setState(667);
match(RPAREN);
setState(668);
((WhileStatementContext)_localctx).fStatement = statement();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class DoStatementContext extends ParserRuleContext {
public StatementContext fStatement;
public ExpressionContext fConditionExpression;
public TerminalNode DO() { return getToken(XtaDslParser.DO, 0); }
public TerminalNode WHILE() { return getToken(XtaDslParser.WHILE, 0); }
public TerminalNode LPAREN() { return getToken(XtaDslParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(XtaDslParser.RPAREN, 0); }
public StatementContext statement() {
return getRuleContext(StatementContext.class,0);
}
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public DoStatementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_doStatement; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterDoStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitDoStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitDoStatement(this);
else return visitor.visitChildren(this);
}
}
public final DoStatementContext doStatement() throws RecognitionException {
DoStatementContext _localctx = new DoStatementContext(_ctx, getState());
enterRule(_localctx, 108, RULE_doStatement);
try {
enterOuterAlt(_localctx, 1);
{
setState(670);
match(DO);
setState(671);
((DoStatementContext)_localctx).fStatement = statement();
setState(672);
match(WHILE);
setState(673);
match(LPAREN);
setState(674);
((DoStatementContext)_localctx).fConditionExpression = expression();
setState(675);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class IfStatementContext extends ParserRuleContext {
public ExpressionContext fConditionExpression;
public StatementContext fThenStatement;
public StatementContext fElseStatement;
public TerminalNode IF() { return getToken(XtaDslParser.IF, 0); }
public TerminalNode LPAREN() { return getToken(XtaDslParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(XtaDslParser.RPAREN, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public List statement() {
return getRuleContexts(StatementContext.class);
}
public StatementContext statement(int i) {
return getRuleContext(StatementContext.class,i);
}
public TerminalNode ELSE() { return getToken(XtaDslParser.ELSE, 0); }
public IfStatementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_ifStatement; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterIfStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitIfStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitIfStatement(this);
else return visitor.visitChildren(this);
}
}
public final IfStatementContext ifStatement() throws RecognitionException {
IfStatementContext _localctx = new IfStatementContext(_ctx, getState());
enterRule(_localctx, 110, RULE_ifStatement);
try {
enterOuterAlt(_localctx, 1);
{
setState(677);
match(IF);
setState(678);
match(LPAREN);
setState(679);
((IfStatementContext)_localctx).fConditionExpression = expression();
setState(680);
match(RPAREN);
setState(681);
((IfStatementContext)_localctx).fThenStatement = statement();
setState(684);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,43,_ctx) ) {
case 1:
{
setState(682);
match(ELSE);
setState(683);
((IfStatementContext)_localctx).fElseStatement = statement();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ReturnStatementContext extends ParserRuleContext {
public ExpressionContext fExpression;
public TerminalNode RETURN() { return getToken(XtaDslParser.RETURN, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public ReturnStatementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_returnStatement; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterReturnStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitReturnStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitReturnStatement(this);
else return visitor.visitChildren(this);
}
}
public final ReturnStatementContext returnStatement() throws RecognitionException {
ReturnStatementContext _localctx = new ReturnStatementContext(_ctx, getState());
enterRule(_localctx, 112, RULE_returnStatement);
try {
enterOuterAlt(_localctx, 1);
{
setState(686);
match(RETURN);
setState(688);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,44,_ctx) ) {
case 1:
{
setState(687);
((ReturnStatementContext)_localctx).fExpression = expression();
}
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 QuantifiedExpressionContext quantifiedExpression() {
return getRuleContext(QuantifiedExpressionContext.class,0);
}
public ExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_expression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitExpression(this);
else return visitor.visitChildren(this);
}
}
public final ExpressionContext expression() throws RecognitionException {
ExpressionContext _localctx = new ExpressionContext(_ctx, getState());
enterRule(_localctx, 114, RULE_expression);
try {
enterOuterAlt(_localctx, 1);
{
setState(690);
quantifiedExpression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class QuantifiedExpressionContext extends ParserRuleContext {
public TextOrImplyExpressionContext textOrImplyExpression() {
return getRuleContext(TextOrImplyExpressionContext.class,0);
}
public ForallExpressionContext forallExpression() {
return getRuleContext(ForallExpressionContext.class,0);
}
public ExistsExpressionContext existsExpression() {
return getRuleContext(ExistsExpressionContext.class,0);
}
public QuantifiedExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_quantifiedExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterQuantifiedExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitQuantifiedExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitQuantifiedExpression(this);
else return visitor.visitChildren(this);
}
}
public final QuantifiedExpressionContext quantifiedExpression() throws RecognitionException {
QuantifiedExpressionContext _localctx = new QuantifiedExpressionContext(_ctx, getState());
enterRule(_localctx, 116, RULE_quantifiedExpression);
try {
setState(695);
_errHandler.sync(this);
switch (_input.LA(1)) {
case NOT:
case INCOP:
case DECOP:
case TRUE:
case FALSE:
case NAT:
case ID:
case LPAREN:
case EXCL:
case PLUS:
case MINUS:
case TILDE:
enterOuterAlt(_localctx, 1);
{
setState(692);
textOrImplyExpression();
}
break;
case FORALL:
enterOuterAlt(_localctx, 2);
{
setState(693);
forallExpression();
}
break;
case EXISTS:
enterOuterAlt(_localctx, 3);
{
setState(694);
existsExpression();
}
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 ForallExpressionContext extends ParserRuleContext {
public IteratorDeclContext fIteratorDecl;
public QuantifiedExpressionContext fOp;
public TerminalNode FORALL() { return getToken(XtaDslParser.FORALL, 0); }
public TerminalNode LPAREN() { return getToken(XtaDslParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(XtaDslParser.RPAREN, 0); }
public IteratorDeclContext iteratorDecl() {
return getRuleContext(IteratorDeclContext.class,0);
}
public QuantifiedExpressionContext quantifiedExpression() {
return getRuleContext(QuantifiedExpressionContext.class,0);
}
public ForallExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_forallExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterForallExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitForallExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitForallExpression(this);
else return visitor.visitChildren(this);
}
}
public final ForallExpressionContext forallExpression() throws RecognitionException {
ForallExpressionContext _localctx = new ForallExpressionContext(_ctx, getState());
enterRule(_localctx, 118, RULE_forallExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(697);
match(FORALL);
setState(698);
match(LPAREN);
setState(699);
((ForallExpressionContext)_localctx).fIteratorDecl = iteratorDecl();
setState(700);
match(RPAREN);
setState(701);
((ForallExpressionContext)_localctx).fOp = quantifiedExpression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ExistsExpressionContext extends ParserRuleContext {
public IteratorDeclContext fIteratorDecl;
public QuantifiedExpressionContext fOp;
public TerminalNode EXISTS() { return getToken(XtaDslParser.EXISTS, 0); }
public TerminalNode LPAREN() { return getToken(XtaDslParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(XtaDslParser.RPAREN, 0); }
public IteratorDeclContext iteratorDecl() {
return getRuleContext(IteratorDeclContext.class,0);
}
public QuantifiedExpressionContext quantifiedExpression() {
return getRuleContext(QuantifiedExpressionContext.class,0);
}
public ExistsExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_existsExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterExistsExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitExistsExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitExistsExpression(this);
else return visitor.visitChildren(this);
}
}
public final ExistsExpressionContext existsExpression() throws RecognitionException {
ExistsExpressionContext _localctx = new ExistsExpressionContext(_ctx, getState());
enterRule(_localctx, 120, RULE_existsExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(703);
match(EXISTS);
setState(704);
match(LPAREN);
setState(705);
((ExistsExpressionContext)_localctx).fIteratorDecl = iteratorDecl();
setState(706);
match(RPAREN);
setState(707);
((ExistsExpressionContext)_localctx).fOp = quantifiedExpression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class TextOrImplyExpressionContext extends ParserRuleContext {
public TextAndExpressionContext textAndExpression;
public List fOps = new ArrayList();
public TextOrImplyOpContext textOrImplyOp;
public List fOpers = new ArrayList();
public List textAndExpression() {
return getRuleContexts(TextAndExpressionContext.class);
}
public TextAndExpressionContext textAndExpression(int i) {
return getRuleContext(TextAndExpressionContext.class,i);
}
public List textOrImplyOp() {
return getRuleContexts(TextOrImplyOpContext.class);
}
public TextOrImplyOpContext textOrImplyOp(int i) {
return getRuleContext(TextOrImplyOpContext.class,i);
}
public TextOrImplyExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_textOrImplyExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterTextOrImplyExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitTextOrImplyExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitTextOrImplyExpression(this);
else return visitor.visitChildren(this);
}
}
public final TextOrImplyExpressionContext textOrImplyExpression() throws RecognitionException {
TextOrImplyExpressionContext _localctx = new TextOrImplyExpressionContext(_ctx, getState());
enterRule(_localctx, 122, RULE_textOrImplyExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(709);
((TextOrImplyExpressionContext)_localctx).textAndExpression = textAndExpression();
((TextOrImplyExpressionContext)_localctx).fOps.add(((TextOrImplyExpressionContext)_localctx).textAndExpression);
setState(715);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==OR || _la==IMPLY) {
{
{
setState(710);
((TextOrImplyExpressionContext)_localctx).textOrImplyOp = textOrImplyOp();
((TextOrImplyExpressionContext)_localctx).fOpers.add(((TextOrImplyExpressionContext)_localctx).textOrImplyOp);
setState(711);
((TextOrImplyExpressionContext)_localctx).textAndExpression = textAndExpression();
((TextOrImplyExpressionContext)_localctx).fOps.add(((TextOrImplyExpressionContext)_localctx).textAndExpression);
}
}
setState(717);
_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 TextAndExpressionContext extends ParserRuleContext {
public TextNotExpressionContext textNotExpression;
public List fOps = new ArrayList();
public List textNotExpression() {
return getRuleContexts(TextNotExpressionContext.class);
}
public TextNotExpressionContext textNotExpression(int i) {
return getRuleContext(TextNotExpressionContext.class,i);
}
public List textAndOp() {
return getRuleContexts(TextAndOpContext.class);
}
public TextAndOpContext textAndOp(int i) {
return getRuleContext(TextAndOpContext.class,i);
}
public TextAndExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_textAndExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterTextAndExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitTextAndExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitTextAndExpression(this);
else return visitor.visitChildren(this);
}
}
public final TextAndExpressionContext textAndExpression() throws RecognitionException {
TextAndExpressionContext _localctx = new TextAndExpressionContext(_ctx, getState());
enterRule(_localctx, 124, RULE_textAndExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(718);
((TextAndExpressionContext)_localctx).textNotExpression = textNotExpression();
((TextAndExpressionContext)_localctx).fOps.add(((TextAndExpressionContext)_localctx).textNotExpression);
setState(724);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==AND) {
{
{
setState(719);
textAndOp();
setState(720);
((TextAndExpressionContext)_localctx).textNotExpression = textNotExpression();
((TextAndExpressionContext)_localctx).fOps.add(((TextAndExpressionContext)_localctx).textNotExpression);
}
}
setState(726);
_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 TextNotExpressionContext extends ParserRuleContext {
public TextNotExpressionContext fOp;
public AssignmentExpressionContext assignmentExpression() {
return getRuleContext(AssignmentExpressionContext.class,0);
}
public TextNotOpContext textNotOp() {
return getRuleContext(TextNotOpContext.class,0);
}
public TextNotExpressionContext textNotExpression() {
return getRuleContext(TextNotExpressionContext.class,0);
}
public TextNotExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_textNotExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterTextNotExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitTextNotExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitTextNotExpression(this);
else return visitor.visitChildren(this);
}
}
public final TextNotExpressionContext textNotExpression() throws RecognitionException {
TextNotExpressionContext _localctx = new TextNotExpressionContext(_ctx, getState());
enterRule(_localctx, 126, RULE_textNotExpression);
try {
setState(731);
_errHandler.sync(this);
switch (_input.LA(1)) {
case INCOP:
case DECOP:
case TRUE:
case FALSE:
case NAT:
case ID:
case LPAREN:
case EXCL:
case PLUS:
case MINUS:
case TILDE:
enterOuterAlt(_localctx, 1);
{
setState(727);
assignmentExpression();
}
break;
case NOT:
enterOuterAlt(_localctx, 2);
{
setState(728);
textNotOp();
setState(729);
((TextNotExpressionContext)_localctx).fOp = textNotExpression();
}
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 AssignmentExpressionContext extends ParserRuleContext {
public ConditionalExpressionContext fLeftOp;
public AssignmentOpContext fOper;
public AssignmentExpressionContext fRightOp;
public ConditionalExpressionContext conditionalExpression() {
return getRuleContext(ConditionalExpressionContext.class,0);
}
public AssignmentOpContext assignmentOp() {
return getRuleContext(AssignmentOpContext.class,0);
}
public AssignmentExpressionContext assignmentExpression() {
return getRuleContext(AssignmentExpressionContext.class,0);
}
public AssignmentExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_assignmentExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterAssignmentExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitAssignmentExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitAssignmentExpression(this);
else return visitor.visitChildren(this);
}
}
public final AssignmentExpressionContext assignmentExpression() throws RecognitionException {
AssignmentExpressionContext _localctx = new AssignmentExpressionContext(_ctx, getState());
enterRule(_localctx, 128, RULE_assignmentExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(733);
((AssignmentExpressionContext)_localctx).fLeftOp = conditionalExpression();
setState(737);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NEWASSIGNOP) | (1L << OLDASSIGNOP) | (1L << ADDASSIGNOP) | (1L << SUBASSIGNOP) | (1L << MULASSIGNOP) | (1L << DIVASSIGNOP) | (1L << REMASSIGNOP) | (1L << BWORASSIGNOP) | (1L << BWANDASSIGNOP) | (1L << BWXORASSIGNOP) | (1L << SHLASSIGNOP) | (1L << SHRASSIGNOP))) != 0)) {
{
setState(734);
((AssignmentExpressionContext)_localctx).fOper = assignmentOp();
setState(735);
((AssignmentExpressionContext)_localctx).fRightOp = assignmentExpression();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ConditionalExpressionContext extends ParserRuleContext {
public LogicalOrExpressionContext fCondOp;
public ExpressionContext fThenOp;
public ConditionalExpressionContext fElseOp;
public LogicalOrExpressionContext logicalOrExpression() {
return getRuleContext(LogicalOrExpressionContext.class,0);
}
public TerminalNode QUEST() { return getToken(XtaDslParser.QUEST, 0); }
public TerminalNode COLON() { return getToken(XtaDslParser.COLON, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public ConditionalExpressionContext conditionalExpression() {
return getRuleContext(ConditionalExpressionContext.class,0);
}
public ConditionalExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_conditionalExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterConditionalExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitConditionalExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitConditionalExpression(this);
else return visitor.visitChildren(this);
}
}
public final ConditionalExpressionContext conditionalExpression() throws RecognitionException {
ConditionalExpressionContext _localctx = new ConditionalExpressionContext(_ctx, getState());
enterRule(_localctx, 130, RULE_conditionalExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(739);
((ConditionalExpressionContext)_localctx).fCondOp = logicalOrExpression();
setState(745);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,50,_ctx) ) {
case 1:
{
setState(740);
match(QUEST);
setState(741);
((ConditionalExpressionContext)_localctx).fThenOp = expression();
setState(742);
match(COLON);
setState(743);
((ConditionalExpressionContext)_localctx).fElseOp = conditionalExpression();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class LogicalOrExpressionContext extends ParserRuleContext {
public LogicalAndExpressionContext logicalAndExpression;
public List fOps = new ArrayList();
public List logicalAndExpression() {
return getRuleContexts(LogicalAndExpressionContext.class);
}
public LogicalAndExpressionContext logicalAndExpression(int i) {
return getRuleContext(LogicalAndExpressionContext.class,i);
}
public List logOrOp() {
return getRuleContexts(LogOrOpContext.class);
}
public LogOrOpContext logOrOp(int i) {
return getRuleContext(LogOrOpContext.class,i);
}
public LogicalOrExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_logicalOrExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterLogicalOrExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitLogicalOrExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitLogicalOrExpression(this);
else return visitor.visitChildren(this);
}
}
public final LogicalOrExpressionContext logicalOrExpression() throws RecognitionException {
LogicalOrExpressionContext _localctx = new LogicalOrExpressionContext(_ctx, getState());
enterRule(_localctx, 132, RULE_logicalOrExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(747);
((LogicalOrExpressionContext)_localctx).logicalAndExpression = logicalAndExpression();
((LogicalOrExpressionContext)_localctx).fOps.add(((LogicalOrExpressionContext)_localctx).logicalAndExpression);
setState(753);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==LOGOROP) {
{
{
setState(748);
logOrOp();
setState(749);
((LogicalOrExpressionContext)_localctx).logicalAndExpression = logicalAndExpression();
((LogicalOrExpressionContext)_localctx).fOps.add(((LogicalOrExpressionContext)_localctx).logicalAndExpression);
}
}
setState(755);
_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 LogicalAndExpressionContext extends ParserRuleContext {
public BitwiseOrExpressionContext bitwiseOrExpression;
public List fOps = new ArrayList();
public List bitwiseOrExpression() {
return getRuleContexts(BitwiseOrExpressionContext.class);
}
public BitwiseOrExpressionContext bitwiseOrExpression(int i) {
return getRuleContext(BitwiseOrExpressionContext.class,i);
}
public List logAndOp() {
return getRuleContexts(LogAndOpContext.class);
}
public LogAndOpContext logAndOp(int i) {
return getRuleContext(LogAndOpContext.class,i);
}
public LogicalAndExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_logicalAndExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterLogicalAndExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitLogicalAndExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitLogicalAndExpression(this);
else return visitor.visitChildren(this);
}
}
public final LogicalAndExpressionContext logicalAndExpression() throws RecognitionException {
LogicalAndExpressionContext _localctx = new LogicalAndExpressionContext(_ctx, getState());
enterRule(_localctx, 134, RULE_logicalAndExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(756);
((LogicalAndExpressionContext)_localctx).bitwiseOrExpression = bitwiseOrExpression();
((LogicalAndExpressionContext)_localctx).fOps.add(((LogicalAndExpressionContext)_localctx).bitwiseOrExpression);
setState(762);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==LOGANDOP) {
{
{
setState(757);
logAndOp();
setState(758);
((LogicalAndExpressionContext)_localctx).bitwiseOrExpression = bitwiseOrExpression();
((LogicalAndExpressionContext)_localctx).fOps.add(((LogicalAndExpressionContext)_localctx).bitwiseOrExpression);
}
}
setState(764);
_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 BitwiseOrExpressionContext extends ParserRuleContext {
public BitwiseXorExpressionContext bitwiseXorExpression;
public List fOps = new ArrayList();
public List bitwiseXorExpression() {
return getRuleContexts(BitwiseXorExpressionContext.class);
}
public BitwiseXorExpressionContext bitwiseXorExpression(int i) {
return getRuleContext(BitwiseXorExpressionContext.class,i);
}
public List bwOrOp() {
return getRuleContexts(BwOrOpContext.class);
}
public BwOrOpContext bwOrOp(int i) {
return getRuleContext(BwOrOpContext.class,i);
}
public BitwiseOrExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_bitwiseOrExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterBitwiseOrExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitBitwiseOrExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitBitwiseOrExpression(this);
else return visitor.visitChildren(this);
}
}
public final BitwiseOrExpressionContext bitwiseOrExpression() throws RecognitionException {
BitwiseOrExpressionContext _localctx = new BitwiseOrExpressionContext(_ctx, getState());
enterRule(_localctx, 136, RULE_bitwiseOrExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(765);
((BitwiseOrExpressionContext)_localctx).bitwiseXorExpression = bitwiseXorExpression();
((BitwiseOrExpressionContext)_localctx).fOps.add(((BitwiseOrExpressionContext)_localctx).bitwiseXorExpression);
setState(771);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==BAR) {
{
{
setState(766);
bwOrOp();
setState(767);
((BitwiseOrExpressionContext)_localctx).bitwiseXorExpression = bitwiseXorExpression();
((BitwiseOrExpressionContext)_localctx).fOps.add(((BitwiseOrExpressionContext)_localctx).bitwiseXorExpression);
}
}
setState(773);
_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 BitwiseXorExpressionContext extends ParserRuleContext {
public BitwiseAndExpressionContext bitwiseAndExpression;
public List fOps = new ArrayList();
public List bitwiseAndExpression() {
return getRuleContexts(BitwiseAndExpressionContext.class);
}
public BitwiseAndExpressionContext bitwiseAndExpression(int i) {
return getRuleContext(BitwiseAndExpressionContext.class,i);
}
public List bwXorOp() {
return getRuleContexts(BwXorOpContext.class);
}
public BwXorOpContext bwXorOp(int i) {
return getRuleContext(BwXorOpContext.class,i);
}
public BitwiseXorExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_bitwiseXorExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterBitwiseXorExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitBitwiseXorExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitBitwiseXorExpression(this);
else return visitor.visitChildren(this);
}
}
public final BitwiseXorExpressionContext bitwiseXorExpression() throws RecognitionException {
BitwiseXorExpressionContext _localctx = new BitwiseXorExpressionContext(_ctx, getState());
enterRule(_localctx, 138, RULE_bitwiseXorExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(774);
((BitwiseXorExpressionContext)_localctx).bitwiseAndExpression = bitwiseAndExpression();
((BitwiseXorExpressionContext)_localctx).fOps.add(((BitwiseXorExpressionContext)_localctx).bitwiseAndExpression);
setState(780);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==HAT) {
{
{
setState(775);
bwXorOp();
setState(776);
((BitwiseXorExpressionContext)_localctx).bitwiseAndExpression = bitwiseAndExpression();
((BitwiseXorExpressionContext)_localctx).fOps.add(((BitwiseXorExpressionContext)_localctx).bitwiseAndExpression);
}
}
setState(782);
_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 BitwiseAndExpressionContext extends ParserRuleContext {
public EqualityExpressionContext equalityExpression;
public List fOps = new ArrayList();
public List equalityExpression() {
return getRuleContexts(EqualityExpressionContext.class);
}
public EqualityExpressionContext equalityExpression(int i) {
return getRuleContext(EqualityExpressionContext.class,i);
}
public List bwAndOp() {
return getRuleContexts(BwAndOpContext.class);
}
public BwAndOpContext bwAndOp(int i) {
return getRuleContext(BwAndOpContext.class,i);
}
public BitwiseAndExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_bitwiseAndExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterBitwiseAndExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitBitwiseAndExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitBitwiseAndExpression(this);
else return visitor.visitChildren(this);
}
}
public final BitwiseAndExpressionContext bitwiseAndExpression() throws RecognitionException {
BitwiseAndExpressionContext _localctx = new BitwiseAndExpressionContext(_ctx, getState());
enterRule(_localctx, 140, RULE_bitwiseAndExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(783);
((BitwiseAndExpressionContext)_localctx).equalityExpression = equalityExpression();
((BitwiseAndExpressionContext)_localctx).fOps.add(((BitwiseAndExpressionContext)_localctx).equalityExpression);
setState(789);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==AMP) {
{
{
setState(784);
bwAndOp();
setState(785);
((BitwiseAndExpressionContext)_localctx).equalityExpression = equalityExpression();
((BitwiseAndExpressionContext)_localctx).fOps.add(((BitwiseAndExpressionContext)_localctx).equalityExpression);
}
}
setState(791);
_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 EqualityExpressionContext extends ParserRuleContext {
public RelationalExpressionContext relationalExpression;
public List fOps = new ArrayList();
public EqualityOpContext equalityOp;
public List fOpers = new ArrayList();
public List relationalExpression() {
return getRuleContexts(RelationalExpressionContext.class);
}
public RelationalExpressionContext relationalExpression(int i) {
return getRuleContext(RelationalExpressionContext.class,i);
}
public List equalityOp() {
return getRuleContexts(EqualityOpContext.class);
}
public EqualityOpContext equalityOp(int i) {
return getRuleContext(EqualityOpContext.class,i);
}
public EqualityExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_equalityExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterEqualityExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitEqualityExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitEqualityExpression(this);
else return visitor.visitChildren(this);
}
}
public final EqualityExpressionContext equalityExpression() throws RecognitionException {
EqualityExpressionContext _localctx = new EqualityExpressionContext(_ctx, getState());
enterRule(_localctx, 142, RULE_equalityExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(792);
((EqualityExpressionContext)_localctx).relationalExpression = relationalExpression();
((EqualityExpressionContext)_localctx).fOps.add(((EqualityExpressionContext)_localctx).relationalExpression);
setState(798);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==EQOP || _la==NEQOP) {
{
{
setState(793);
((EqualityExpressionContext)_localctx).equalityOp = equalityOp();
((EqualityExpressionContext)_localctx).fOpers.add(((EqualityExpressionContext)_localctx).equalityOp);
setState(794);
((EqualityExpressionContext)_localctx).relationalExpression = relationalExpression();
((EqualityExpressionContext)_localctx).fOps.add(((EqualityExpressionContext)_localctx).relationalExpression);
}
}
setState(800);
_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 RelationalExpressionContext extends ParserRuleContext {
public ShiftExpressionContext shiftExpression;
public List fOps = new ArrayList();
public RelationalOpContext relationalOp;
public List fOpers = new ArrayList();
public List shiftExpression() {
return getRuleContexts(ShiftExpressionContext.class);
}
public ShiftExpressionContext shiftExpression(int i) {
return getRuleContext(ShiftExpressionContext.class,i);
}
public List relationalOp() {
return getRuleContexts(RelationalOpContext.class);
}
public RelationalOpContext relationalOp(int i) {
return getRuleContext(RelationalOpContext.class,i);
}
public RelationalExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_relationalExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterRelationalExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitRelationalExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitRelationalExpression(this);
else return visitor.visitChildren(this);
}
}
public final RelationalExpressionContext relationalExpression() throws RecognitionException {
RelationalExpressionContext _localctx = new RelationalExpressionContext(_ctx, getState());
enterRule(_localctx, 144, RULE_relationalExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(801);
((RelationalExpressionContext)_localctx).shiftExpression = shiftExpression();
((RelationalExpressionContext)_localctx).fOps.add(((RelationalExpressionContext)_localctx).shiftExpression);
setState(807);
_errHandler.sync(this);
_la = _input.LA(1);
while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LTOP) | (1L << LEQOP) | (1L << GTOP) | (1L << GEQOP))) != 0)) {
{
{
setState(802);
((RelationalExpressionContext)_localctx).relationalOp = relationalOp();
((RelationalExpressionContext)_localctx).fOpers.add(((RelationalExpressionContext)_localctx).relationalOp);
setState(803);
((RelationalExpressionContext)_localctx).shiftExpression = shiftExpression();
((RelationalExpressionContext)_localctx).fOps.add(((RelationalExpressionContext)_localctx).shiftExpression);
}
}
setState(809);
_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 ShiftExpressionContext extends ParserRuleContext {
public AdditiveExpressionContext additiveExpression;
public List fOps = new ArrayList();
public ShiftOpContext shiftOp;
public List fOpers = new ArrayList();
public List additiveExpression() {
return getRuleContexts(AdditiveExpressionContext.class);
}
public AdditiveExpressionContext additiveExpression(int i) {
return getRuleContext(AdditiveExpressionContext.class,i);
}
public List shiftOp() {
return getRuleContexts(ShiftOpContext.class);
}
public ShiftOpContext shiftOp(int i) {
return getRuleContext(ShiftOpContext.class,i);
}
public ShiftExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_shiftExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterShiftExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitShiftExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitShiftExpression(this);
else return visitor.visitChildren(this);
}
}
public final ShiftExpressionContext shiftExpression() throws RecognitionException {
ShiftExpressionContext _localctx = new ShiftExpressionContext(_ctx, getState());
enterRule(_localctx, 146, RULE_shiftExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(810);
((ShiftExpressionContext)_localctx).additiveExpression = additiveExpression();
((ShiftExpressionContext)_localctx).fOps.add(((ShiftExpressionContext)_localctx).additiveExpression);
setState(816);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==SHLOP || _la==SHROP) {
{
{
setState(811);
((ShiftExpressionContext)_localctx).shiftOp = shiftOp();
((ShiftExpressionContext)_localctx).fOpers.add(((ShiftExpressionContext)_localctx).shiftOp);
setState(812);
((ShiftExpressionContext)_localctx).additiveExpression = additiveExpression();
((ShiftExpressionContext)_localctx).fOps.add(((ShiftExpressionContext)_localctx).additiveExpression);
}
}
setState(818);
_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 AdditiveExpressionContext extends ParserRuleContext {
public MultiplicativeExpressionContext multiplicativeExpression;
public List fOps = new ArrayList();
public AdditiveOpContext additiveOp;
public List fOpers = new ArrayList();
public List multiplicativeExpression() {
return getRuleContexts(MultiplicativeExpressionContext.class);
}
public MultiplicativeExpressionContext multiplicativeExpression(int i) {
return getRuleContext(MultiplicativeExpressionContext.class,i);
}
public List additiveOp() {
return getRuleContexts(AdditiveOpContext.class);
}
public AdditiveOpContext additiveOp(int i) {
return getRuleContext(AdditiveOpContext.class,i);
}
public AdditiveExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_additiveExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterAdditiveExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitAdditiveExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitAdditiveExpression(this);
else return visitor.visitChildren(this);
}
}
public final AdditiveExpressionContext additiveExpression() throws RecognitionException {
AdditiveExpressionContext _localctx = new AdditiveExpressionContext(_ctx, getState());
enterRule(_localctx, 148, RULE_additiveExpression);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(819);
((AdditiveExpressionContext)_localctx).multiplicativeExpression = multiplicativeExpression();
((AdditiveExpressionContext)_localctx).fOps.add(((AdditiveExpressionContext)_localctx).multiplicativeExpression);
setState(825);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,59,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(820);
((AdditiveExpressionContext)_localctx).additiveOp = additiveOp();
((AdditiveExpressionContext)_localctx).fOpers.add(((AdditiveExpressionContext)_localctx).additiveOp);
setState(821);
((AdditiveExpressionContext)_localctx).multiplicativeExpression = multiplicativeExpression();
((AdditiveExpressionContext)_localctx).fOps.add(((AdditiveExpressionContext)_localctx).multiplicativeExpression);
}
}
}
setState(827);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,59,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class MultiplicativeExpressionContext extends ParserRuleContext {
public PrefixExpressionContext prefixExpression;
public List fOps = new ArrayList();
public MultiplicativeOpContext multiplicativeOp;
public List fOpers = new ArrayList();
public List prefixExpression() {
return getRuleContexts(PrefixExpressionContext.class);
}
public PrefixExpressionContext prefixExpression(int i) {
return getRuleContext(PrefixExpressionContext.class,i);
}
public List multiplicativeOp() {
return getRuleContexts(MultiplicativeOpContext.class);
}
public MultiplicativeOpContext multiplicativeOp(int i) {
return getRuleContext(MultiplicativeOpContext.class,i);
}
public MultiplicativeExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_multiplicativeExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterMultiplicativeExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitMultiplicativeExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitMultiplicativeExpression(this);
else return visitor.visitChildren(this);
}
}
public final MultiplicativeExpressionContext multiplicativeExpression() throws RecognitionException {
MultiplicativeExpressionContext _localctx = new MultiplicativeExpressionContext(_ctx, getState());
enterRule(_localctx, 150, RULE_multiplicativeExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(828);
((MultiplicativeExpressionContext)_localctx).prefixExpression = prefixExpression();
((MultiplicativeExpressionContext)_localctx).fOps.add(((MultiplicativeExpressionContext)_localctx).prefixExpression);
setState(834);
_errHandler.sync(this);
_la = _input.LA(1);
while (((((_la - 80)) & ~0x3f) == 0 && ((1L << (_la - 80)) & ((1L << (PERCENT - 80)) | (1L << (ASTER - 80)) | (1L << (SLASH - 80)))) != 0)) {
{
{
setState(829);
((MultiplicativeExpressionContext)_localctx).multiplicativeOp = multiplicativeOp();
((MultiplicativeExpressionContext)_localctx).fOpers.add(((MultiplicativeExpressionContext)_localctx).multiplicativeOp);
setState(830);
((MultiplicativeExpressionContext)_localctx).prefixExpression = prefixExpression();
((MultiplicativeExpressionContext)_localctx).fOps.add(((MultiplicativeExpressionContext)_localctx).prefixExpression);
}
}
setState(836);
_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 PrefixExpressionContext extends ParserRuleContext {
public PrefixOpContext fOper;
public PrefixExpressionContext fOp;
public PostfixExpressionContext postfixExpression() {
return getRuleContext(PostfixExpressionContext.class,0);
}
public PrefixOpContext prefixOp() {
return getRuleContext(PrefixOpContext.class,0);
}
public PrefixExpressionContext prefixExpression() {
return getRuleContext(PrefixExpressionContext.class,0);
}
public PrefixExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_prefixExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterPrefixExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitPrefixExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitPrefixExpression(this);
else return visitor.visitChildren(this);
}
}
public final PrefixExpressionContext prefixExpression() throws RecognitionException {
PrefixExpressionContext _localctx = new PrefixExpressionContext(_ctx, getState());
enterRule(_localctx, 152, RULE_prefixExpression);
try {
setState(841);
_errHandler.sync(this);
switch (_input.LA(1)) {
case TRUE:
case FALSE:
case NAT:
case ID:
case LPAREN:
enterOuterAlt(_localctx, 1);
{
setState(837);
postfixExpression();
}
break;
case INCOP:
case DECOP:
case EXCL:
case PLUS:
case MINUS:
case TILDE:
enterOuterAlt(_localctx, 2);
{
setState(838);
((PrefixExpressionContext)_localctx).fOper = prefixOp();
setState(839);
((PrefixExpressionContext)_localctx).fOp = prefixExpression();
}
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 PostfixExpressionContext extends ParserRuleContext {
public PrimaryExpressionContext fOp;
public PostfixOpContext postfixOp;
public List fOpers = new ArrayList();
public PrimaryExpressionContext primaryExpression() {
return getRuleContext(PrimaryExpressionContext.class,0);
}
public List postfixOp() {
return getRuleContexts(PostfixOpContext.class);
}
public PostfixOpContext postfixOp(int i) {
return getRuleContext(PostfixOpContext.class,i);
}
public PostfixExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_postfixExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterPostfixExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitPostfixExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitPostfixExpression(this);
else return visitor.visitChildren(this);
}
}
public final PostfixExpressionContext postfixExpression() throws RecognitionException {
PostfixExpressionContext _localctx = new PostfixExpressionContext(_ctx, getState());
enterRule(_localctx, 154, RULE_postfixExpression);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(843);
((PostfixExpressionContext)_localctx).fOp = primaryExpression();
setState(847);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,62,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(844);
((PostfixExpressionContext)_localctx).postfixOp = postfixOp();
((PostfixExpressionContext)_localctx).fOpers.add(((PostfixExpressionContext)_localctx).postfixOp);
}
}
}
setState(849);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,62,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class PrimaryExpressionContext extends ParserRuleContext {
public TrueExpressionContext trueExpression() {
return getRuleContext(TrueExpressionContext.class,0);
}
public FalseExpressionContext falseExpression() {
return getRuleContext(FalseExpressionContext.class,0);
}
public NatExpressionContext natExpression() {
return getRuleContext(NatExpressionContext.class,0);
}
public IdExpressionContext idExpression() {
return getRuleContext(IdExpressionContext.class,0);
}
public ParenthesisExpressionContext parenthesisExpression() {
return getRuleContext(ParenthesisExpressionContext.class,0);
}
public PrimaryExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_primaryExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterPrimaryExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitPrimaryExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitPrimaryExpression(this);
else return visitor.visitChildren(this);
}
}
public final PrimaryExpressionContext primaryExpression() throws RecognitionException {
PrimaryExpressionContext _localctx = new PrimaryExpressionContext(_ctx, getState());
enterRule(_localctx, 156, RULE_primaryExpression);
try {
setState(855);
_errHandler.sync(this);
switch (_input.LA(1)) {
case TRUE:
enterOuterAlt(_localctx, 1);
{
setState(850);
trueExpression();
}
break;
case FALSE:
enterOuterAlt(_localctx, 2);
{
setState(851);
falseExpression();
}
break;
case NAT:
enterOuterAlt(_localctx, 3);
{
setState(852);
natExpression();
}
break;
case ID:
enterOuterAlt(_localctx, 4);
{
setState(853);
idExpression();
}
break;
case LPAREN:
enterOuterAlt(_localctx, 5);
{
setState(854);
parenthesisExpression();
}
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 TrueExpressionContext extends ParserRuleContext {
public TerminalNode TRUE() { return getToken(XtaDslParser.TRUE, 0); }
public TrueExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_trueExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterTrueExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitTrueExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitTrueExpression(this);
else return visitor.visitChildren(this);
}
}
public final TrueExpressionContext trueExpression() throws RecognitionException {
TrueExpressionContext _localctx = new TrueExpressionContext(_ctx, getState());
enterRule(_localctx, 158, RULE_trueExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(857);
match(TRUE);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class FalseExpressionContext extends ParserRuleContext {
public TerminalNode FALSE() { return getToken(XtaDslParser.FALSE, 0); }
public FalseExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_falseExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterFalseExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitFalseExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitFalseExpression(this);
else return visitor.visitChildren(this);
}
}
public final FalseExpressionContext falseExpression() throws RecognitionException {
FalseExpressionContext _localctx = new FalseExpressionContext(_ctx, getState());
enterRule(_localctx, 160, RULE_falseExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(859);
match(FALSE);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class NatExpressionContext extends ParserRuleContext {
public Token fValue;
public TerminalNode NAT() { return getToken(XtaDslParser.NAT, 0); }
public NatExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_natExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterNatExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitNatExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitNatExpression(this);
else return visitor.visitChildren(this);
}
}
public final NatExpressionContext natExpression() throws RecognitionException {
NatExpressionContext _localctx = new NatExpressionContext(_ctx, getState());
enterRule(_localctx, 162, RULE_natExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(861);
((NatExpressionContext)_localctx).fValue = match(NAT);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class IdExpressionContext extends ParserRuleContext {
public Token fId;
public TerminalNode ID() { return getToken(XtaDslParser.ID, 0); }
public IdExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_idExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterIdExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitIdExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitIdExpression(this);
else return visitor.visitChildren(this);
}
}
public final IdExpressionContext idExpression() throws RecognitionException {
IdExpressionContext _localctx = new IdExpressionContext(_ctx, getState());
enterRule(_localctx, 164, RULE_idExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(863);
((IdExpressionContext)_localctx).fId = match(ID);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ParenthesisExpressionContext extends ParserRuleContext {
public ExpressionContext fOp;
public TerminalNode LPAREN() { return getToken(XtaDslParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(XtaDslParser.RPAREN, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public ParenthesisExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_parenthesisExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterParenthesisExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitParenthesisExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitParenthesisExpression(this);
else return visitor.visitChildren(this);
}
}
public final ParenthesisExpressionContext parenthesisExpression() throws RecognitionException {
ParenthesisExpressionContext _localctx = new ParenthesisExpressionContext(_ctx, getState());
enterRule(_localctx, 166, RULE_parenthesisExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(865);
match(LPAREN);
setState(866);
((ParenthesisExpressionContext)_localctx).fOp = expression();
setState(867);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ArgListContext extends ParserRuleContext {
public ExpressionContext expression;
public List fExpressions = new ArrayList();
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public List COMMA() { return getTokens(XtaDslParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(XtaDslParser.COMMA, i);
}
public ArgListContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_argList; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterArgList(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitArgList(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitArgList(this);
else return visitor.visitChildren(this);
}
}
public final ArgListContext argList() throws RecognitionException {
ArgListContext _localctx = new ArgListContext(_ctx, getState());
enterRule(_localctx, 168, RULE_argList);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(877);
_errHandler.sync(this);
_la = _input.LA(1);
if (((((_la - 28)) & ~0x3f) == 0 && ((1L << (_la - 28)) & ((1L << (FORALL - 28)) | (1L << (EXISTS - 28)) | (1L << (NOT - 28)) | (1L << (INCOP - 28)) | (1L << (DECOP - 28)) | (1L << (TRUE - 28)) | (1L << (FALSE - 28)) | (1L << (NAT - 28)) | (1L << (ID - 28)) | (1L << (LPAREN - 28)) | (1L << (EXCL - 28)) | (1L << (PLUS - 28)) | (1L << (MINUS - 28)) | (1L << (TILDE - 28)))) != 0)) {
{
setState(869);
((ArgListContext)_localctx).expression = expression();
((ArgListContext)_localctx).fExpressions.add(((ArgListContext)_localctx).expression);
setState(874);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(870);
match(COMMA);
setState(871);
((ArgListContext)_localctx).expression = expression();
((ArgListContext)_localctx).fExpressions.add(((ArgListContext)_localctx).expression);
}
}
setState(876);
_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 TextOrImplyOpContext extends ParserRuleContext {
public TextOrOpContext textOrOp() {
return getRuleContext(TextOrOpContext.class,0);
}
public TextImplyOpContext textImplyOp() {
return getRuleContext(TextImplyOpContext.class,0);
}
public TextOrImplyOpContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_textOrImplyOp; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterTextOrImplyOp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitTextOrImplyOp(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitTextOrImplyOp(this);
else return visitor.visitChildren(this);
}
}
public final TextOrImplyOpContext textOrImplyOp() throws RecognitionException {
TextOrImplyOpContext _localctx = new TextOrImplyOpContext(_ctx, getState());
enterRule(_localctx, 170, RULE_textOrImplyOp);
try {
setState(881);
_errHandler.sync(this);
switch (_input.LA(1)) {
case OR:
enterOuterAlt(_localctx, 1);
{
setState(879);
textOrOp();
}
break;
case IMPLY:
enterOuterAlt(_localctx, 2);
{
setState(880);
textImplyOp();
}
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 TextOrOpContext extends ParserRuleContext {
public TerminalNode OR() { return getToken(XtaDslParser.OR, 0); }
public TextOrOpContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_textOrOp; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterTextOrOp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitTextOrOp(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitTextOrOp(this);
else return visitor.visitChildren(this);
}
}
public final TextOrOpContext textOrOp() throws RecognitionException {
TextOrOpContext _localctx = new TextOrOpContext(_ctx, getState());
enterRule(_localctx, 172, RULE_textOrOp);
try {
enterOuterAlt(_localctx, 1);
{
setState(883);
match(OR);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class TextImplyOpContext extends ParserRuleContext {
public TerminalNode IMPLY() { return getToken(XtaDslParser.IMPLY, 0); }
public TextImplyOpContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_textImplyOp; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterTextImplyOp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitTextImplyOp(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof XtaDslVisitor ) return ((XtaDslVisitor extends T>)visitor).visitTextImplyOp(this);
else return visitor.visitChildren(this);
}
}
public final TextImplyOpContext textImplyOp() throws RecognitionException {
TextImplyOpContext _localctx = new TextImplyOpContext(_ctx, getState());
enterRule(_localctx, 174, RULE_textImplyOp);
try {
enterOuterAlt(_localctx, 1);
{
setState(885);
match(IMPLY);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class TextAndOpContext extends ParserRuleContext {
public TerminalNode AND() { return getToken(XtaDslParser.AND, 0); }
public TextAndOpContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_textAndOp; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).enterTextAndOp(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof XtaDslListener ) ((XtaDslListener)listener).exitTextAndOp(this);
}
@Override
public