You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3105 lines
99 KiB
3105 lines
99 KiB
// Generated from /root/sysy2026/nudt-compiler-cpp/src/antlr4/SysY.g4 by ANTLR 4.13.1
|
|
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", "CheckReturnValue"})
|
|
public class SysYParser extends Parser {
|
|
static { RuntimeMetaData.checkVersion("4.13.1", RuntimeMetaData.VERSION); }
|
|
|
|
protected static final DFA[] _decisionToDFA;
|
|
protected static final PredictionContextCache _sharedContextCache =
|
|
new PredictionContextCache();
|
|
public static final int
|
|
CONST=1, INT=2, FLOAT=3, VOID=4, IF=5, ELSE=6, WHILE=7, BREAK=8, CONTINUE=9,
|
|
RETURN=10, ADD=11, SUB=12, MUL=13, DIV=14, MOD=15, ASSIGN=16, EQ=17, NE=18,
|
|
LT=19, LE=20, GT=21, GE=22, NOT=23, AND=24, OR=25, LPAREN=26, RPAREN=27,
|
|
LBRACK=28, RBRACK=29, LBRACE=30, RBRACE=31, COMMA=32, SEMI=33, Ident=34,
|
|
IntConst=35, FloatConst=36, WS=37, LINE_COMMENT=38, BLOCK_COMMENT=39;
|
|
public static final int
|
|
RULE_compUnit = 0, RULE_decl = 1, RULE_constDecl = 2, RULE_bType = 3,
|
|
RULE_constDef = 4, RULE_constInitVal = 5, RULE_varDecl = 6, RULE_varDef = 7,
|
|
RULE_initVal = 8, RULE_funcDef = 9, RULE_funcType = 10, RULE_funcFParams = 11,
|
|
RULE_funcFParam = 12, RULE_block = 13, RULE_blockItem = 14, RULE_stmt = 15,
|
|
RULE_exp = 16, RULE_cond = 17, RULE_lVal = 18, RULE_primaryExp = 19, RULE_number = 20,
|
|
RULE_unaryExp = 21, RULE_unaryOp = 22, RULE_funcRParams = 23, RULE_mulExp = 24,
|
|
RULE_addExp = 25, RULE_relExp = 26, RULE_eqExp = 27, RULE_lAndExp = 28,
|
|
RULE_lOrExp = 29, RULE_constExp = 30;
|
|
private static String[] makeRuleNames() {
|
|
return new String[] {
|
|
"compUnit", "decl", "constDecl", "bType", "constDef", "constInitVal",
|
|
"varDecl", "varDef", "initVal", "funcDef", "funcType", "funcFParams",
|
|
"funcFParam", "block", "blockItem", "stmt", "exp", "cond", "lVal", "primaryExp",
|
|
"number", "unaryExp", "unaryOp", "funcRParams", "mulExp", "addExp", "relExp",
|
|
"eqExp", "lAndExp", "lOrExp", "constExp"
|
|
};
|
|
}
|
|
public static final String[] ruleNames = makeRuleNames();
|
|
|
|
private static String[] makeLiteralNames() {
|
|
return new String[] {
|
|
null, "'const'", "'int'", "'float'", "'void'", "'if'", "'else'", "'while'",
|
|
"'break'", "'continue'", "'return'", "'+'", "'-'", "'*'", "'/'", "'%'",
|
|
"'='", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'!'", "'&&'", "'||'",
|
|
"'('", "')'", "'['", "']'", "'{'", "'}'", "','", "';'"
|
|
};
|
|
}
|
|
private static final String[] _LITERAL_NAMES = makeLiteralNames();
|
|
private static String[] makeSymbolicNames() {
|
|
return new String[] {
|
|
null, "CONST", "INT", "FLOAT", "VOID", "IF", "ELSE", "WHILE", "BREAK",
|
|
"CONTINUE", "RETURN", "ADD", "SUB", "MUL", "DIV", "MOD", "ASSIGN", "EQ",
|
|
"NE", "LT", "LE", "GT", "GE", "NOT", "AND", "OR", "LPAREN", "RPAREN",
|
|
"LBRACK", "RBRACK", "LBRACE", "RBRACE", "COMMA", "SEMI", "Ident", "IntConst",
|
|
"FloatConst", "WS", "LINE_COMMENT", "BLOCK_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] = "<INVALID>";
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
@Deprecated
|
|
public String[] getTokenNames() {
|
|
return tokenNames;
|
|
}
|
|
|
|
@Override
|
|
|
|
public Vocabulary getVocabulary() {
|
|
return VOCABULARY;
|
|
}
|
|
|
|
@Override
|
|
public String getGrammarFileName() { return "SysY.g4"; }
|
|
|
|
@Override
|
|
public String[] getRuleNames() { return ruleNames; }
|
|
|
|
@Override
|
|
public String getSerializedATN() { return _serializedATN; }
|
|
|
|
@Override
|
|
public ATN getATN() { return _ATN; }
|
|
|
|
public SysYParser(TokenStream input) {
|
|
super(input);
|
|
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class CompUnitContext extends ParserRuleContext {
|
|
public TerminalNode EOF() { return getToken(SysYParser.EOF, 0); }
|
|
public List<DeclContext> decl() {
|
|
return getRuleContexts(DeclContext.class);
|
|
}
|
|
public DeclContext decl(int i) {
|
|
return getRuleContext(DeclContext.class,i);
|
|
}
|
|
public List<FuncDefContext> funcDef() {
|
|
return getRuleContexts(FuncDefContext.class);
|
|
}
|
|
public FuncDefContext funcDef(int i) {
|
|
return getRuleContext(FuncDefContext.class,i);
|
|
}
|
|
public CompUnitContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_compUnit; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterCompUnit(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitCompUnit(this);
|
|
}
|
|
}
|
|
|
|
public final CompUnitContext compUnit() throws RecognitionException {
|
|
CompUnitContext _localctx = new CompUnitContext(_ctx, getState());
|
|
enterRule(_localctx, 0, RULE_compUnit);
|
|
int _la;
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(64);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
do {
|
|
{
|
|
setState(64);
|
|
_errHandler.sync(this);
|
|
switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) {
|
|
case 1:
|
|
{
|
|
setState(62);
|
|
decl();
|
|
}
|
|
break;
|
|
case 2:
|
|
{
|
|
setState(63);
|
|
funcDef();
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
setState(66);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
} while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & 30L) != 0) );
|
|
setState(68);
|
|
match(EOF);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class DeclContext extends ParserRuleContext {
|
|
public ConstDeclContext constDecl() {
|
|
return getRuleContext(ConstDeclContext.class,0);
|
|
}
|
|
public VarDeclContext varDecl() {
|
|
return getRuleContext(VarDeclContext.class,0);
|
|
}
|
|
public DeclContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_decl; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterDecl(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitDecl(this);
|
|
}
|
|
}
|
|
|
|
public final DeclContext decl() throws RecognitionException {
|
|
DeclContext _localctx = new DeclContext(_ctx, getState());
|
|
enterRule(_localctx, 2, RULE_decl);
|
|
try {
|
|
setState(72);
|
|
_errHandler.sync(this);
|
|
switch (_input.LA(1)) {
|
|
case CONST:
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(70);
|
|
constDecl();
|
|
}
|
|
break;
|
|
case INT:
|
|
case FLOAT:
|
|
enterOuterAlt(_localctx, 2);
|
|
{
|
|
setState(71);
|
|
varDecl();
|
|
}
|
|
break;
|
|
default:
|
|
throw new NoViableAltException(this);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class ConstDeclContext extends ParserRuleContext {
|
|
public TerminalNode CONST() { return getToken(SysYParser.CONST, 0); }
|
|
public BTypeContext bType() {
|
|
return getRuleContext(BTypeContext.class,0);
|
|
}
|
|
public List<ConstDefContext> constDef() {
|
|
return getRuleContexts(ConstDefContext.class);
|
|
}
|
|
public ConstDefContext constDef(int i) {
|
|
return getRuleContext(ConstDefContext.class,i);
|
|
}
|
|
public TerminalNode SEMI() { return getToken(SysYParser.SEMI, 0); }
|
|
public List<TerminalNode> COMMA() { return getTokens(SysYParser.COMMA); }
|
|
public TerminalNode COMMA(int i) {
|
|
return getToken(SysYParser.COMMA, i);
|
|
}
|
|
public ConstDeclContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_constDecl; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterConstDecl(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitConstDecl(this);
|
|
}
|
|
}
|
|
|
|
public final ConstDeclContext constDecl() throws RecognitionException {
|
|
ConstDeclContext _localctx = new ConstDeclContext(_ctx, getState());
|
|
enterRule(_localctx, 4, RULE_constDecl);
|
|
int _la;
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(74);
|
|
match(CONST);
|
|
setState(75);
|
|
bType();
|
|
setState(76);
|
|
constDef();
|
|
setState(81);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
while (_la==COMMA) {
|
|
{
|
|
{
|
|
setState(77);
|
|
match(COMMA);
|
|
setState(78);
|
|
constDef();
|
|
}
|
|
}
|
|
setState(83);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
}
|
|
setState(84);
|
|
match(SEMI);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class BTypeContext extends ParserRuleContext {
|
|
public TerminalNode INT() { return getToken(SysYParser.INT, 0); }
|
|
public TerminalNode FLOAT() { return getToken(SysYParser.FLOAT, 0); }
|
|
public BTypeContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_bType; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBType(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBType(this);
|
|
}
|
|
}
|
|
|
|
public final BTypeContext bType() throws RecognitionException {
|
|
BTypeContext _localctx = new BTypeContext(_ctx, getState());
|
|
enterRule(_localctx, 6, RULE_bType);
|
|
int _la;
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(86);
|
|
_la = _input.LA(1);
|
|
if ( !(_la==INT || _la==FLOAT) ) {
|
|
_errHandler.recoverInline(this);
|
|
}
|
|
else {
|
|
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
|
|
_errHandler.reportMatch(this);
|
|
consume();
|
|
}
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class ConstDefContext extends ParserRuleContext {
|
|
public TerminalNode Ident() { return getToken(SysYParser.Ident, 0); }
|
|
public TerminalNode ASSIGN() { return getToken(SysYParser.ASSIGN, 0); }
|
|
public ConstInitValContext constInitVal() {
|
|
return getRuleContext(ConstInitValContext.class,0);
|
|
}
|
|
public List<TerminalNode> LBRACK() { return getTokens(SysYParser.LBRACK); }
|
|
public TerminalNode LBRACK(int i) {
|
|
return getToken(SysYParser.LBRACK, i);
|
|
}
|
|
public List<ConstExpContext> constExp() {
|
|
return getRuleContexts(ConstExpContext.class);
|
|
}
|
|
public ConstExpContext constExp(int i) {
|
|
return getRuleContext(ConstExpContext.class,i);
|
|
}
|
|
public List<TerminalNode> RBRACK() { return getTokens(SysYParser.RBRACK); }
|
|
public TerminalNode RBRACK(int i) {
|
|
return getToken(SysYParser.RBRACK, i);
|
|
}
|
|
public ConstDefContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_constDef; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterConstDef(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitConstDef(this);
|
|
}
|
|
}
|
|
|
|
public final ConstDefContext constDef() throws RecognitionException {
|
|
ConstDefContext _localctx = new ConstDefContext(_ctx, getState());
|
|
enterRule(_localctx, 8, RULE_constDef);
|
|
int _la;
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(88);
|
|
match(Ident);
|
|
setState(95);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
while (_la==LBRACK) {
|
|
{
|
|
{
|
|
setState(89);
|
|
match(LBRACK);
|
|
setState(90);
|
|
constExp();
|
|
setState(91);
|
|
match(RBRACK);
|
|
}
|
|
}
|
|
setState(97);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
}
|
|
setState(98);
|
|
match(ASSIGN);
|
|
setState(99);
|
|
constInitVal();
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class ConstInitValContext extends ParserRuleContext {
|
|
public ConstExpContext constExp() {
|
|
return getRuleContext(ConstExpContext.class,0);
|
|
}
|
|
public TerminalNode LBRACE() { return getToken(SysYParser.LBRACE, 0); }
|
|
public TerminalNode RBRACE() { return getToken(SysYParser.RBRACE, 0); }
|
|
public List<ConstInitValContext> constInitVal() {
|
|
return getRuleContexts(ConstInitValContext.class);
|
|
}
|
|
public ConstInitValContext constInitVal(int i) {
|
|
return getRuleContext(ConstInitValContext.class,i);
|
|
}
|
|
public List<TerminalNode> COMMA() { return getTokens(SysYParser.COMMA); }
|
|
public TerminalNode COMMA(int i) {
|
|
return getToken(SysYParser.COMMA, i);
|
|
}
|
|
public ConstInitValContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_constInitVal; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterConstInitVal(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitConstInitVal(this);
|
|
}
|
|
}
|
|
|
|
public final ConstInitValContext constInitVal() throws RecognitionException {
|
|
ConstInitValContext _localctx = new ConstInitValContext(_ctx, getState());
|
|
enterRule(_localctx, 10, RULE_constInitVal);
|
|
int _la;
|
|
try {
|
|
setState(114);
|
|
_errHandler.sync(this);
|
|
switch (_input.LA(1)) {
|
|
case ADD:
|
|
case SUB:
|
|
case NOT:
|
|
case LPAREN:
|
|
case Ident:
|
|
case IntConst:
|
|
case FloatConst:
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(101);
|
|
constExp();
|
|
}
|
|
break;
|
|
case LBRACE:
|
|
enterOuterAlt(_localctx, 2);
|
|
{
|
|
setState(102);
|
|
match(LBRACE);
|
|
setState(111);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 121408329728L) != 0)) {
|
|
{
|
|
setState(103);
|
|
constInitVal();
|
|
setState(108);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
while (_la==COMMA) {
|
|
{
|
|
{
|
|
setState(104);
|
|
match(COMMA);
|
|
setState(105);
|
|
constInitVal();
|
|
}
|
|
}
|
|
setState(110);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
}
|
|
}
|
|
}
|
|
|
|
setState(113);
|
|
match(RBRACE);
|
|
}
|
|
break;
|
|
default:
|
|
throw new NoViableAltException(this);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class VarDeclContext extends ParserRuleContext {
|
|
public BTypeContext bType() {
|
|
return getRuleContext(BTypeContext.class,0);
|
|
}
|
|
public List<VarDefContext> varDef() {
|
|
return getRuleContexts(VarDefContext.class);
|
|
}
|
|
public VarDefContext varDef(int i) {
|
|
return getRuleContext(VarDefContext.class,i);
|
|
}
|
|
public TerminalNode SEMI() { return getToken(SysYParser.SEMI, 0); }
|
|
public List<TerminalNode> COMMA() { return getTokens(SysYParser.COMMA); }
|
|
public TerminalNode COMMA(int i) {
|
|
return getToken(SysYParser.COMMA, i);
|
|
}
|
|
public VarDeclContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_varDecl; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterVarDecl(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitVarDecl(this);
|
|
}
|
|
}
|
|
|
|
public final VarDeclContext varDecl() throws RecognitionException {
|
|
VarDeclContext _localctx = new VarDeclContext(_ctx, getState());
|
|
enterRule(_localctx, 12, RULE_varDecl);
|
|
int _la;
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(116);
|
|
bType();
|
|
setState(117);
|
|
varDef();
|
|
setState(122);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
while (_la==COMMA) {
|
|
{
|
|
{
|
|
setState(118);
|
|
match(COMMA);
|
|
setState(119);
|
|
varDef();
|
|
}
|
|
}
|
|
setState(124);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
}
|
|
setState(125);
|
|
match(SEMI);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class VarDefContext extends ParserRuleContext {
|
|
public TerminalNode Ident() { return getToken(SysYParser.Ident, 0); }
|
|
public List<TerminalNode> LBRACK() { return getTokens(SysYParser.LBRACK); }
|
|
public TerminalNode LBRACK(int i) {
|
|
return getToken(SysYParser.LBRACK, i);
|
|
}
|
|
public List<ConstExpContext> constExp() {
|
|
return getRuleContexts(ConstExpContext.class);
|
|
}
|
|
public ConstExpContext constExp(int i) {
|
|
return getRuleContext(ConstExpContext.class,i);
|
|
}
|
|
public List<TerminalNode> RBRACK() { return getTokens(SysYParser.RBRACK); }
|
|
public TerminalNode RBRACK(int i) {
|
|
return getToken(SysYParser.RBRACK, i);
|
|
}
|
|
public TerminalNode ASSIGN() { return getToken(SysYParser.ASSIGN, 0); }
|
|
public InitValContext initVal() {
|
|
return getRuleContext(InitValContext.class,0);
|
|
}
|
|
public VarDefContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_varDef; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterVarDef(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitVarDef(this);
|
|
}
|
|
}
|
|
|
|
public final VarDefContext varDef() throws RecognitionException {
|
|
VarDefContext _localctx = new VarDefContext(_ctx, getState());
|
|
enterRule(_localctx, 14, RULE_varDef);
|
|
int _la;
|
|
try {
|
|
setState(149);
|
|
_errHandler.sync(this);
|
|
switch ( getInterpreter().adaptivePredict(_input,11,_ctx) ) {
|
|
case 1:
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(127);
|
|
match(Ident);
|
|
setState(134);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
while (_la==LBRACK) {
|
|
{
|
|
{
|
|
setState(128);
|
|
match(LBRACK);
|
|
setState(129);
|
|
constExp();
|
|
setState(130);
|
|
match(RBRACK);
|
|
}
|
|
}
|
|
setState(136);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
}
|
|
}
|
|
break;
|
|
case 2:
|
|
enterOuterAlt(_localctx, 2);
|
|
{
|
|
setState(137);
|
|
match(Ident);
|
|
setState(144);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
while (_la==LBRACK) {
|
|
{
|
|
{
|
|
setState(138);
|
|
match(LBRACK);
|
|
setState(139);
|
|
constExp();
|
|
setState(140);
|
|
match(RBRACK);
|
|
}
|
|
}
|
|
setState(146);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
}
|
|
setState(147);
|
|
match(ASSIGN);
|
|
setState(148);
|
|
initVal();
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class InitValContext extends ParserRuleContext {
|
|
public ExpContext exp() {
|
|
return getRuleContext(ExpContext.class,0);
|
|
}
|
|
public TerminalNode LBRACE() { return getToken(SysYParser.LBRACE, 0); }
|
|
public TerminalNode RBRACE() { return getToken(SysYParser.RBRACE, 0); }
|
|
public List<InitValContext> initVal() {
|
|
return getRuleContexts(InitValContext.class);
|
|
}
|
|
public InitValContext initVal(int i) {
|
|
return getRuleContext(InitValContext.class,i);
|
|
}
|
|
public List<TerminalNode> COMMA() { return getTokens(SysYParser.COMMA); }
|
|
public TerminalNode COMMA(int i) {
|
|
return getToken(SysYParser.COMMA, i);
|
|
}
|
|
public InitValContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_initVal; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterInitVal(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitInitVal(this);
|
|
}
|
|
}
|
|
|
|
public final InitValContext initVal() throws RecognitionException {
|
|
InitValContext _localctx = new InitValContext(_ctx, getState());
|
|
enterRule(_localctx, 16, RULE_initVal);
|
|
int _la;
|
|
try {
|
|
setState(164);
|
|
_errHandler.sync(this);
|
|
switch (_input.LA(1)) {
|
|
case ADD:
|
|
case SUB:
|
|
case NOT:
|
|
case LPAREN:
|
|
case Ident:
|
|
case IntConst:
|
|
case FloatConst:
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(151);
|
|
exp();
|
|
}
|
|
break;
|
|
case LBRACE:
|
|
enterOuterAlt(_localctx, 2);
|
|
{
|
|
setState(152);
|
|
match(LBRACE);
|
|
setState(161);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 121408329728L) != 0)) {
|
|
{
|
|
setState(153);
|
|
initVal();
|
|
setState(158);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
while (_la==COMMA) {
|
|
{
|
|
{
|
|
setState(154);
|
|
match(COMMA);
|
|
setState(155);
|
|
initVal();
|
|
}
|
|
}
|
|
setState(160);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
}
|
|
}
|
|
}
|
|
|
|
setState(163);
|
|
match(RBRACE);
|
|
}
|
|
break;
|
|
default:
|
|
throw new NoViableAltException(this);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class FuncDefContext extends ParserRuleContext {
|
|
public FuncTypeContext funcType() {
|
|
return getRuleContext(FuncTypeContext.class,0);
|
|
}
|
|
public TerminalNode Ident() { return getToken(SysYParser.Ident, 0); }
|
|
public TerminalNode LPAREN() { return getToken(SysYParser.LPAREN, 0); }
|
|
public TerminalNode RPAREN() { return getToken(SysYParser.RPAREN, 0); }
|
|
public BlockContext block() {
|
|
return getRuleContext(BlockContext.class,0);
|
|
}
|
|
public FuncFParamsContext funcFParams() {
|
|
return getRuleContext(FuncFParamsContext.class,0);
|
|
}
|
|
public FuncDefContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_funcDef; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterFuncDef(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitFuncDef(this);
|
|
}
|
|
}
|
|
|
|
public final FuncDefContext funcDef() throws RecognitionException {
|
|
FuncDefContext _localctx = new FuncDefContext(_ctx, getState());
|
|
enterRule(_localctx, 18, RULE_funcDef);
|
|
int _la;
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(166);
|
|
funcType();
|
|
setState(167);
|
|
match(Ident);
|
|
setState(168);
|
|
match(LPAREN);
|
|
setState(170);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
if (_la==INT || _la==FLOAT) {
|
|
{
|
|
setState(169);
|
|
funcFParams();
|
|
}
|
|
}
|
|
|
|
setState(172);
|
|
match(RPAREN);
|
|
setState(173);
|
|
block();
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class FuncTypeContext extends ParserRuleContext {
|
|
public TerminalNode VOID() { return getToken(SysYParser.VOID, 0); }
|
|
public TerminalNode INT() { return getToken(SysYParser.INT, 0); }
|
|
public TerminalNode FLOAT() { return getToken(SysYParser.FLOAT, 0); }
|
|
public FuncTypeContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_funcType; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterFuncType(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitFuncType(this);
|
|
}
|
|
}
|
|
|
|
public final FuncTypeContext funcType() throws RecognitionException {
|
|
FuncTypeContext _localctx = new FuncTypeContext(_ctx, getState());
|
|
enterRule(_localctx, 20, RULE_funcType);
|
|
int _la;
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(175);
|
|
_la = _input.LA(1);
|
|
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 28L) != 0)) ) {
|
|
_errHandler.recoverInline(this);
|
|
}
|
|
else {
|
|
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
|
|
_errHandler.reportMatch(this);
|
|
consume();
|
|
}
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class FuncFParamsContext extends ParserRuleContext {
|
|
public List<FuncFParamContext> funcFParam() {
|
|
return getRuleContexts(FuncFParamContext.class);
|
|
}
|
|
public FuncFParamContext funcFParam(int i) {
|
|
return getRuleContext(FuncFParamContext.class,i);
|
|
}
|
|
public List<TerminalNode> COMMA() { return getTokens(SysYParser.COMMA); }
|
|
public TerminalNode COMMA(int i) {
|
|
return getToken(SysYParser.COMMA, i);
|
|
}
|
|
public FuncFParamsContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_funcFParams; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterFuncFParams(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitFuncFParams(this);
|
|
}
|
|
}
|
|
|
|
public final FuncFParamsContext funcFParams() throws RecognitionException {
|
|
FuncFParamsContext _localctx = new FuncFParamsContext(_ctx, getState());
|
|
enterRule(_localctx, 22, RULE_funcFParams);
|
|
int _la;
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(177);
|
|
funcFParam();
|
|
setState(182);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
while (_la==COMMA) {
|
|
{
|
|
{
|
|
setState(178);
|
|
match(COMMA);
|
|
setState(179);
|
|
funcFParam();
|
|
}
|
|
}
|
|
setState(184);
|
|
_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;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class FuncFParamContext extends ParserRuleContext {
|
|
public BTypeContext bType() {
|
|
return getRuleContext(BTypeContext.class,0);
|
|
}
|
|
public TerminalNode Ident() { return getToken(SysYParser.Ident, 0); }
|
|
public List<TerminalNode> LBRACK() { return getTokens(SysYParser.LBRACK); }
|
|
public TerminalNode LBRACK(int i) {
|
|
return getToken(SysYParser.LBRACK, i);
|
|
}
|
|
public List<TerminalNode> RBRACK() { return getTokens(SysYParser.RBRACK); }
|
|
public TerminalNode RBRACK(int i) {
|
|
return getToken(SysYParser.RBRACK, i);
|
|
}
|
|
public List<ExpContext> exp() {
|
|
return getRuleContexts(ExpContext.class);
|
|
}
|
|
public ExpContext exp(int i) {
|
|
return getRuleContext(ExpContext.class,i);
|
|
}
|
|
public FuncFParamContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_funcFParam; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterFuncFParam(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitFuncFParam(this);
|
|
}
|
|
}
|
|
|
|
public final FuncFParamContext funcFParam() throws RecognitionException {
|
|
FuncFParamContext _localctx = new FuncFParamContext(_ctx, getState());
|
|
enterRule(_localctx, 24, RULE_funcFParam);
|
|
int _la;
|
|
try {
|
|
setState(201);
|
|
_errHandler.sync(this);
|
|
switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) {
|
|
case 1:
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(185);
|
|
bType();
|
|
setState(186);
|
|
match(Ident);
|
|
}
|
|
break;
|
|
case 2:
|
|
enterOuterAlt(_localctx, 2);
|
|
{
|
|
setState(188);
|
|
bType();
|
|
setState(189);
|
|
match(Ident);
|
|
setState(190);
|
|
match(LBRACK);
|
|
setState(191);
|
|
match(RBRACK);
|
|
setState(198);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
while (_la==LBRACK) {
|
|
{
|
|
{
|
|
setState(192);
|
|
match(LBRACK);
|
|
setState(193);
|
|
exp();
|
|
setState(194);
|
|
match(RBRACK);
|
|
}
|
|
}
|
|
setState(200);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class BlockContext extends ParserRuleContext {
|
|
public TerminalNode LBRACE() { return getToken(SysYParser.LBRACE, 0); }
|
|
public TerminalNode RBRACE() { return getToken(SysYParser.RBRACE, 0); }
|
|
public List<BlockItemContext> blockItem() {
|
|
return getRuleContexts(BlockItemContext.class);
|
|
}
|
|
public BlockItemContext blockItem(int i) {
|
|
return getRuleContext(BlockItemContext.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 SysYListener ) ((SysYListener)listener).enterBlock(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBlock(this);
|
|
}
|
|
}
|
|
|
|
public final BlockContext block() throws RecognitionException {
|
|
BlockContext _localctx = new BlockContext(_ctx, getState());
|
|
enterRule(_localctx, 26, RULE_block);
|
|
int _la;
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(203);
|
|
match(LBRACE);
|
|
setState(207);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 129998266286L) != 0)) {
|
|
{
|
|
{
|
|
setState(204);
|
|
blockItem();
|
|
}
|
|
}
|
|
setState(209);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
}
|
|
setState(210);
|
|
match(RBRACE);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class BlockItemContext extends ParserRuleContext {
|
|
public DeclContext decl() {
|
|
return getRuleContext(DeclContext.class,0);
|
|
}
|
|
public StmtContext stmt() {
|
|
return getRuleContext(StmtContext.class,0);
|
|
}
|
|
public BlockItemContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_blockItem; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBlockItem(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBlockItem(this);
|
|
}
|
|
}
|
|
|
|
public final BlockItemContext blockItem() throws RecognitionException {
|
|
BlockItemContext _localctx = new BlockItemContext(_ctx, getState());
|
|
enterRule(_localctx, 28, RULE_blockItem);
|
|
try {
|
|
setState(214);
|
|
_errHandler.sync(this);
|
|
switch (_input.LA(1)) {
|
|
case CONST:
|
|
case INT:
|
|
case FLOAT:
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(212);
|
|
decl();
|
|
}
|
|
break;
|
|
case IF:
|
|
case WHILE:
|
|
case BREAK:
|
|
case CONTINUE:
|
|
case RETURN:
|
|
case ADD:
|
|
case SUB:
|
|
case NOT:
|
|
case LPAREN:
|
|
case LBRACE:
|
|
case SEMI:
|
|
case Ident:
|
|
case IntConst:
|
|
case FloatConst:
|
|
enterOuterAlt(_localctx, 2);
|
|
{
|
|
setState(213);
|
|
stmt();
|
|
}
|
|
break;
|
|
default:
|
|
throw new NoViableAltException(this);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class StmtContext extends ParserRuleContext {
|
|
public StmtContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_stmt; }
|
|
|
|
public StmtContext() { }
|
|
public void copyFrom(StmtContext ctx) {
|
|
super.copyFrom(ctx);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class WhileStmtContext extends StmtContext {
|
|
public TerminalNode WHILE() { return getToken(SysYParser.WHILE, 0); }
|
|
public TerminalNode LPAREN() { return getToken(SysYParser.LPAREN, 0); }
|
|
public CondContext cond() {
|
|
return getRuleContext(CondContext.class,0);
|
|
}
|
|
public TerminalNode RPAREN() { return getToken(SysYParser.RPAREN, 0); }
|
|
public StmtContext stmt() {
|
|
return getRuleContext(StmtContext.class,0);
|
|
}
|
|
public WhileStmtContext(StmtContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterWhileStmt(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitWhileStmt(this);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class IfStmtContext extends StmtContext {
|
|
public TerminalNode IF() { return getToken(SysYParser.IF, 0); }
|
|
public TerminalNode LPAREN() { return getToken(SysYParser.LPAREN, 0); }
|
|
public CondContext cond() {
|
|
return getRuleContext(CondContext.class,0);
|
|
}
|
|
public TerminalNode RPAREN() { return getToken(SysYParser.RPAREN, 0); }
|
|
public List<StmtContext> stmt() {
|
|
return getRuleContexts(StmtContext.class);
|
|
}
|
|
public StmtContext stmt(int i) {
|
|
return getRuleContext(StmtContext.class,i);
|
|
}
|
|
public TerminalNode ELSE() { return getToken(SysYParser.ELSE, 0); }
|
|
public IfStmtContext(StmtContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterIfStmt(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitIfStmt(this);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class BlockStmtContext extends StmtContext {
|
|
public BlockContext block() {
|
|
return getRuleContext(BlockContext.class,0);
|
|
}
|
|
public BlockStmtContext(StmtContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBlockStmt(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBlockStmt(this);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class AssignStmtContext extends StmtContext {
|
|
public LValContext lVal() {
|
|
return getRuleContext(LValContext.class,0);
|
|
}
|
|
public TerminalNode ASSIGN() { return getToken(SysYParser.ASSIGN, 0); }
|
|
public ExpContext exp() {
|
|
return getRuleContext(ExpContext.class,0);
|
|
}
|
|
public TerminalNode SEMI() { return getToken(SysYParser.SEMI, 0); }
|
|
public AssignStmtContext(StmtContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterAssignStmt(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitAssignStmt(this);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class BreakStmtContext extends StmtContext {
|
|
public TerminalNode BREAK() { return getToken(SysYParser.BREAK, 0); }
|
|
public TerminalNode SEMI() { return getToken(SysYParser.SEMI, 0); }
|
|
public BreakStmtContext(StmtContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBreakStmt(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBreakStmt(this);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class ExpStmtContext extends StmtContext {
|
|
public TerminalNode SEMI() { return getToken(SysYParser.SEMI, 0); }
|
|
public ExpContext exp() {
|
|
return getRuleContext(ExpContext.class,0);
|
|
}
|
|
public ExpStmtContext(StmtContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterExpStmt(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitExpStmt(this);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class ReturnStmtContext extends StmtContext {
|
|
public TerminalNode RETURN() { return getToken(SysYParser.RETURN, 0); }
|
|
public TerminalNode SEMI() { return getToken(SysYParser.SEMI, 0); }
|
|
public ExpContext exp() {
|
|
return getRuleContext(ExpContext.class,0);
|
|
}
|
|
public ReturnStmtContext(StmtContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterReturnStmt(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitReturnStmt(this);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class ContinueStmtContext extends StmtContext {
|
|
public TerminalNode CONTINUE() { return getToken(SysYParser.CONTINUE, 0); }
|
|
public TerminalNode SEMI() { return getToken(SysYParser.SEMI, 0); }
|
|
public ContinueStmtContext(StmtContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterContinueStmt(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitContinueStmt(this);
|
|
}
|
|
}
|
|
|
|
public final StmtContext stmt() throws RecognitionException {
|
|
StmtContext _localctx = new StmtContext(_ctx, getState());
|
|
enterRule(_localctx, 30, RULE_stmt);
|
|
int _la;
|
|
try {
|
|
setState(250);
|
|
_errHandler.sync(this);
|
|
switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) {
|
|
case 1:
|
|
_localctx = new AssignStmtContext(_localctx);
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(216);
|
|
lVal();
|
|
setState(217);
|
|
match(ASSIGN);
|
|
setState(218);
|
|
exp();
|
|
setState(219);
|
|
match(SEMI);
|
|
}
|
|
break;
|
|
case 2:
|
|
_localctx = new ExpStmtContext(_localctx);
|
|
enterOuterAlt(_localctx, 2);
|
|
{
|
|
setState(222);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 120334587904L) != 0)) {
|
|
{
|
|
setState(221);
|
|
exp();
|
|
}
|
|
}
|
|
|
|
setState(224);
|
|
match(SEMI);
|
|
}
|
|
break;
|
|
case 3:
|
|
_localctx = new BlockStmtContext(_localctx);
|
|
enterOuterAlt(_localctx, 3);
|
|
{
|
|
setState(225);
|
|
block();
|
|
}
|
|
break;
|
|
case 4:
|
|
_localctx = new IfStmtContext(_localctx);
|
|
enterOuterAlt(_localctx, 4);
|
|
{
|
|
setState(226);
|
|
match(IF);
|
|
setState(227);
|
|
match(LPAREN);
|
|
setState(228);
|
|
cond();
|
|
setState(229);
|
|
match(RPAREN);
|
|
setState(230);
|
|
stmt();
|
|
setState(233);
|
|
_errHandler.sync(this);
|
|
switch ( getInterpreter().adaptivePredict(_input,22,_ctx) ) {
|
|
case 1:
|
|
{
|
|
setState(231);
|
|
match(ELSE);
|
|
setState(232);
|
|
stmt();
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
break;
|
|
case 5:
|
|
_localctx = new WhileStmtContext(_localctx);
|
|
enterOuterAlt(_localctx, 5);
|
|
{
|
|
setState(235);
|
|
match(WHILE);
|
|
setState(236);
|
|
match(LPAREN);
|
|
setState(237);
|
|
cond();
|
|
setState(238);
|
|
match(RPAREN);
|
|
setState(239);
|
|
stmt();
|
|
}
|
|
break;
|
|
case 6:
|
|
_localctx = new BreakStmtContext(_localctx);
|
|
enterOuterAlt(_localctx, 6);
|
|
{
|
|
setState(241);
|
|
match(BREAK);
|
|
setState(242);
|
|
match(SEMI);
|
|
}
|
|
break;
|
|
case 7:
|
|
_localctx = new ContinueStmtContext(_localctx);
|
|
enterOuterAlt(_localctx, 7);
|
|
{
|
|
setState(243);
|
|
match(CONTINUE);
|
|
setState(244);
|
|
match(SEMI);
|
|
}
|
|
break;
|
|
case 8:
|
|
_localctx = new ReturnStmtContext(_localctx);
|
|
enterOuterAlt(_localctx, 8);
|
|
{
|
|
setState(245);
|
|
match(RETURN);
|
|
setState(247);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 120334587904L) != 0)) {
|
|
{
|
|
setState(246);
|
|
exp();
|
|
}
|
|
}
|
|
|
|
setState(249);
|
|
match(SEMI);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class ExpContext extends ParserRuleContext {
|
|
public AddExpContext addExp() {
|
|
return getRuleContext(AddExpContext.class,0);
|
|
}
|
|
public ExpContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_exp; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitExp(this);
|
|
}
|
|
}
|
|
|
|
public final ExpContext exp() throws RecognitionException {
|
|
ExpContext _localctx = new ExpContext(_ctx, getState());
|
|
enterRule(_localctx, 32, RULE_exp);
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(252);
|
|
addExp(0);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class CondContext extends ParserRuleContext {
|
|
public LOrExpContext lOrExp() {
|
|
return getRuleContext(LOrExpContext.class,0);
|
|
}
|
|
public CondContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_cond; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterCond(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitCond(this);
|
|
}
|
|
}
|
|
|
|
public final CondContext cond() throws RecognitionException {
|
|
CondContext _localctx = new CondContext(_ctx, getState());
|
|
enterRule(_localctx, 34, RULE_cond);
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(254);
|
|
lOrExp(0);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class LValContext extends ParserRuleContext {
|
|
public TerminalNode Ident() { return getToken(SysYParser.Ident, 0); }
|
|
public List<TerminalNode> LBRACK() { return getTokens(SysYParser.LBRACK); }
|
|
public TerminalNode LBRACK(int i) {
|
|
return getToken(SysYParser.LBRACK, i);
|
|
}
|
|
public List<ExpContext> exp() {
|
|
return getRuleContexts(ExpContext.class);
|
|
}
|
|
public ExpContext exp(int i) {
|
|
return getRuleContext(ExpContext.class,i);
|
|
}
|
|
public List<TerminalNode> RBRACK() { return getTokens(SysYParser.RBRACK); }
|
|
public TerminalNode RBRACK(int i) {
|
|
return getToken(SysYParser.RBRACK, i);
|
|
}
|
|
public LValContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_lVal; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterLVal(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitLVal(this);
|
|
}
|
|
}
|
|
|
|
public final LValContext lVal() throws RecognitionException {
|
|
LValContext _localctx = new LValContext(_ctx, getState());
|
|
enterRule(_localctx, 36, RULE_lVal);
|
|
try {
|
|
int _alt;
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(256);
|
|
match(Ident);
|
|
setState(263);
|
|
_errHandler.sync(this);
|
|
_alt = getInterpreter().adaptivePredict(_input,25,_ctx);
|
|
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
|
|
if ( _alt==1 ) {
|
|
{
|
|
{
|
|
setState(257);
|
|
match(LBRACK);
|
|
setState(258);
|
|
exp();
|
|
setState(259);
|
|
match(RBRACK);
|
|
}
|
|
}
|
|
}
|
|
setState(265);
|
|
_errHandler.sync(this);
|
|
_alt = getInterpreter().adaptivePredict(_input,25,_ctx);
|
|
}
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class PrimaryExpContext extends ParserRuleContext {
|
|
public TerminalNode LPAREN() { return getToken(SysYParser.LPAREN, 0); }
|
|
public ExpContext exp() {
|
|
return getRuleContext(ExpContext.class,0);
|
|
}
|
|
public TerminalNode RPAREN() { return getToken(SysYParser.RPAREN, 0); }
|
|
public LValContext lVal() {
|
|
return getRuleContext(LValContext.class,0);
|
|
}
|
|
public NumberContext number() {
|
|
return getRuleContext(NumberContext.class,0);
|
|
}
|
|
public PrimaryExpContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_primaryExp; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterPrimaryExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitPrimaryExp(this);
|
|
}
|
|
}
|
|
|
|
public final PrimaryExpContext primaryExp() throws RecognitionException {
|
|
PrimaryExpContext _localctx = new PrimaryExpContext(_ctx, getState());
|
|
enterRule(_localctx, 38, RULE_primaryExp);
|
|
try {
|
|
setState(272);
|
|
_errHandler.sync(this);
|
|
switch (_input.LA(1)) {
|
|
case LPAREN:
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(266);
|
|
match(LPAREN);
|
|
setState(267);
|
|
exp();
|
|
setState(268);
|
|
match(RPAREN);
|
|
}
|
|
break;
|
|
case Ident:
|
|
enterOuterAlt(_localctx, 2);
|
|
{
|
|
setState(270);
|
|
lVal();
|
|
}
|
|
break;
|
|
case IntConst:
|
|
case FloatConst:
|
|
enterOuterAlt(_localctx, 3);
|
|
{
|
|
setState(271);
|
|
number();
|
|
}
|
|
break;
|
|
default:
|
|
throw new NoViableAltException(this);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class NumberContext extends ParserRuleContext {
|
|
public TerminalNode IntConst() { return getToken(SysYParser.IntConst, 0); }
|
|
public TerminalNode FloatConst() { return getToken(SysYParser.FloatConst, 0); }
|
|
public NumberContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_number; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterNumber(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitNumber(this);
|
|
}
|
|
}
|
|
|
|
public final NumberContext number() throws RecognitionException {
|
|
NumberContext _localctx = new NumberContext(_ctx, getState());
|
|
enterRule(_localctx, 40, RULE_number);
|
|
int _la;
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(274);
|
|
_la = _input.LA(1);
|
|
if ( !(_la==IntConst || _la==FloatConst) ) {
|
|
_errHandler.recoverInline(this);
|
|
}
|
|
else {
|
|
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
|
|
_errHandler.reportMatch(this);
|
|
consume();
|
|
}
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class UnaryExpContext extends ParserRuleContext {
|
|
public UnaryExpContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_unaryExp; }
|
|
|
|
public UnaryExpContext() { }
|
|
public void copyFrom(UnaryExpContext ctx) {
|
|
super.copyFrom(ctx);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class OpUnaryExpContext extends UnaryExpContext {
|
|
public UnaryOpContext unaryOp() {
|
|
return getRuleContext(UnaryOpContext.class,0);
|
|
}
|
|
public UnaryExpContext unaryExp() {
|
|
return getRuleContext(UnaryExpContext.class,0);
|
|
}
|
|
public OpUnaryExpContext(UnaryExpContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterOpUnaryExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitOpUnaryExp(this);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class CallUnaryExpContext extends UnaryExpContext {
|
|
public TerminalNode Ident() { return getToken(SysYParser.Ident, 0); }
|
|
public TerminalNode LPAREN() { return getToken(SysYParser.LPAREN, 0); }
|
|
public TerminalNode RPAREN() { return getToken(SysYParser.RPAREN, 0); }
|
|
public FuncRParamsContext funcRParams() {
|
|
return getRuleContext(FuncRParamsContext.class,0);
|
|
}
|
|
public CallUnaryExpContext(UnaryExpContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterCallUnaryExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitCallUnaryExp(this);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class PrimaryUnaryExpContext extends UnaryExpContext {
|
|
public PrimaryExpContext primaryExp() {
|
|
return getRuleContext(PrimaryExpContext.class,0);
|
|
}
|
|
public PrimaryUnaryExpContext(UnaryExpContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterPrimaryUnaryExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitPrimaryUnaryExp(this);
|
|
}
|
|
}
|
|
|
|
public final UnaryExpContext unaryExp() throws RecognitionException {
|
|
UnaryExpContext _localctx = new UnaryExpContext(_ctx, getState());
|
|
enterRule(_localctx, 42, RULE_unaryExp);
|
|
int _la;
|
|
try {
|
|
setState(286);
|
|
_errHandler.sync(this);
|
|
switch ( getInterpreter().adaptivePredict(_input,28,_ctx) ) {
|
|
case 1:
|
|
_localctx = new PrimaryUnaryExpContext(_localctx);
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(276);
|
|
primaryExp();
|
|
}
|
|
break;
|
|
case 2:
|
|
_localctx = new CallUnaryExpContext(_localctx);
|
|
enterOuterAlt(_localctx, 2);
|
|
{
|
|
setState(277);
|
|
match(Ident);
|
|
setState(278);
|
|
match(LPAREN);
|
|
setState(280);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 120334587904L) != 0)) {
|
|
{
|
|
setState(279);
|
|
funcRParams();
|
|
}
|
|
}
|
|
|
|
setState(282);
|
|
match(RPAREN);
|
|
}
|
|
break;
|
|
case 3:
|
|
_localctx = new OpUnaryExpContext(_localctx);
|
|
enterOuterAlt(_localctx, 3);
|
|
{
|
|
setState(283);
|
|
unaryOp();
|
|
setState(284);
|
|
unaryExp();
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class UnaryOpContext extends ParserRuleContext {
|
|
public TerminalNode ADD() { return getToken(SysYParser.ADD, 0); }
|
|
public TerminalNode SUB() { return getToken(SysYParser.SUB, 0); }
|
|
public TerminalNode NOT() { return getToken(SysYParser.NOT, 0); }
|
|
public UnaryOpContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_unaryOp; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterUnaryOp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitUnaryOp(this);
|
|
}
|
|
}
|
|
|
|
public final UnaryOpContext unaryOp() throws RecognitionException {
|
|
UnaryOpContext _localctx = new UnaryOpContext(_ctx, getState());
|
|
enterRule(_localctx, 44, RULE_unaryOp);
|
|
int _la;
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(288);
|
|
_la = _input.LA(1);
|
|
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 8394752L) != 0)) ) {
|
|
_errHandler.recoverInline(this);
|
|
}
|
|
else {
|
|
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
|
|
_errHandler.reportMatch(this);
|
|
consume();
|
|
}
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class FuncRParamsContext extends ParserRuleContext {
|
|
public List<ExpContext> exp() {
|
|
return getRuleContexts(ExpContext.class);
|
|
}
|
|
public ExpContext exp(int i) {
|
|
return getRuleContext(ExpContext.class,i);
|
|
}
|
|
public List<TerminalNode> COMMA() { return getTokens(SysYParser.COMMA); }
|
|
public TerminalNode COMMA(int i) {
|
|
return getToken(SysYParser.COMMA, i);
|
|
}
|
|
public FuncRParamsContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_funcRParams; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterFuncRParams(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitFuncRParams(this);
|
|
}
|
|
}
|
|
|
|
public final FuncRParamsContext funcRParams() throws RecognitionException {
|
|
FuncRParamsContext _localctx = new FuncRParamsContext(_ctx, getState());
|
|
enterRule(_localctx, 46, RULE_funcRParams);
|
|
int _la;
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(290);
|
|
exp();
|
|
setState(295);
|
|
_errHandler.sync(this);
|
|
_la = _input.LA(1);
|
|
while (_la==COMMA) {
|
|
{
|
|
{
|
|
setState(291);
|
|
match(COMMA);
|
|
setState(292);
|
|
exp();
|
|
}
|
|
}
|
|
setState(297);
|
|
_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;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class MulExpContext extends ParserRuleContext {
|
|
public MulExpContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_mulExp; }
|
|
|
|
public MulExpContext() { }
|
|
public void copyFrom(MulExpContext ctx) {
|
|
super.copyFrom(ctx);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class BinaryMulExpContext extends MulExpContext {
|
|
public Token op;
|
|
public MulExpContext mulExp() {
|
|
return getRuleContext(MulExpContext.class,0);
|
|
}
|
|
public UnaryExpContext unaryExp() {
|
|
return getRuleContext(UnaryExpContext.class,0);
|
|
}
|
|
public TerminalNode MUL() { return getToken(SysYParser.MUL, 0); }
|
|
public TerminalNode DIV() { return getToken(SysYParser.DIV, 0); }
|
|
public TerminalNode MOD() { return getToken(SysYParser.MOD, 0); }
|
|
public BinaryMulExpContext(MulExpContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBinaryMulExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBinaryMulExp(this);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class UnaryMulExpContext extends MulExpContext {
|
|
public UnaryExpContext unaryExp() {
|
|
return getRuleContext(UnaryExpContext.class,0);
|
|
}
|
|
public UnaryMulExpContext(MulExpContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterUnaryMulExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitUnaryMulExp(this);
|
|
}
|
|
}
|
|
|
|
public final MulExpContext mulExp() throws RecognitionException {
|
|
return mulExp(0);
|
|
}
|
|
|
|
private MulExpContext mulExp(int _p) throws RecognitionException {
|
|
ParserRuleContext _parentctx = _ctx;
|
|
int _parentState = getState();
|
|
MulExpContext _localctx = new MulExpContext(_ctx, _parentState);
|
|
MulExpContext _prevctx = _localctx;
|
|
int _startState = 48;
|
|
enterRecursionRule(_localctx, 48, RULE_mulExp, _p);
|
|
int _la;
|
|
try {
|
|
int _alt;
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
{
|
|
_localctx = new UnaryMulExpContext(_localctx);
|
|
_ctx = _localctx;
|
|
_prevctx = _localctx;
|
|
|
|
setState(299);
|
|
unaryExp();
|
|
}
|
|
_ctx.stop = _input.LT(-1);
|
|
setState(306);
|
|
_errHandler.sync(this);
|
|
_alt = getInterpreter().adaptivePredict(_input,30,_ctx);
|
|
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
|
|
if ( _alt==1 ) {
|
|
if ( _parseListeners!=null ) triggerExitRuleEvent();
|
|
_prevctx = _localctx;
|
|
{
|
|
{
|
|
_localctx = new BinaryMulExpContext(new MulExpContext(_parentctx, _parentState));
|
|
pushNewRecursionContext(_localctx, _startState, RULE_mulExp);
|
|
setState(301);
|
|
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
|
|
setState(302);
|
|
((BinaryMulExpContext)_localctx).op = _input.LT(1);
|
|
_la = _input.LA(1);
|
|
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 57344L) != 0)) ) {
|
|
((BinaryMulExpContext)_localctx).op = (Token)_errHandler.recoverInline(this);
|
|
}
|
|
else {
|
|
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
|
|
_errHandler.reportMatch(this);
|
|
consume();
|
|
}
|
|
setState(303);
|
|
unaryExp();
|
|
}
|
|
}
|
|
}
|
|
setState(308);
|
|
_errHandler.sync(this);
|
|
_alt = getInterpreter().adaptivePredict(_input,30,_ctx);
|
|
}
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
unrollRecursionContexts(_parentctx);
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class AddExpContext extends ParserRuleContext {
|
|
public AddExpContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_addExp; }
|
|
|
|
public AddExpContext() { }
|
|
public void copyFrom(AddExpContext ctx) {
|
|
super.copyFrom(ctx);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class BinaryAddExpContext extends AddExpContext {
|
|
public Token op;
|
|
public AddExpContext addExp() {
|
|
return getRuleContext(AddExpContext.class,0);
|
|
}
|
|
public MulExpContext mulExp() {
|
|
return getRuleContext(MulExpContext.class,0);
|
|
}
|
|
public TerminalNode ADD() { return getToken(SysYParser.ADD, 0); }
|
|
public TerminalNode SUB() { return getToken(SysYParser.SUB, 0); }
|
|
public BinaryAddExpContext(AddExpContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBinaryAddExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBinaryAddExp(this);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class MulAddExpContext extends AddExpContext {
|
|
public MulExpContext mulExp() {
|
|
return getRuleContext(MulExpContext.class,0);
|
|
}
|
|
public MulAddExpContext(AddExpContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterMulAddExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitMulAddExp(this);
|
|
}
|
|
}
|
|
|
|
public final AddExpContext addExp() throws RecognitionException {
|
|
return addExp(0);
|
|
}
|
|
|
|
private AddExpContext addExp(int _p) throws RecognitionException {
|
|
ParserRuleContext _parentctx = _ctx;
|
|
int _parentState = getState();
|
|
AddExpContext _localctx = new AddExpContext(_ctx, _parentState);
|
|
AddExpContext _prevctx = _localctx;
|
|
int _startState = 50;
|
|
enterRecursionRule(_localctx, 50, RULE_addExp, _p);
|
|
int _la;
|
|
try {
|
|
int _alt;
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
{
|
|
_localctx = new MulAddExpContext(_localctx);
|
|
_ctx = _localctx;
|
|
_prevctx = _localctx;
|
|
|
|
setState(310);
|
|
mulExp(0);
|
|
}
|
|
_ctx.stop = _input.LT(-1);
|
|
setState(317);
|
|
_errHandler.sync(this);
|
|
_alt = getInterpreter().adaptivePredict(_input,31,_ctx);
|
|
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
|
|
if ( _alt==1 ) {
|
|
if ( _parseListeners!=null ) triggerExitRuleEvent();
|
|
_prevctx = _localctx;
|
|
{
|
|
{
|
|
_localctx = new BinaryAddExpContext(new AddExpContext(_parentctx, _parentState));
|
|
pushNewRecursionContext(_localctx, _startState, RULE_addExp);
|
|
setState(312);
|
|
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
|
|
setState(313);
|
|
((BinaryAddExpContext)_localctx).op = _input.LT(1);
|
|
_la = _input.LA(1);
|
|
if ( !(_la==ADD || _la==SUB) ) {
|
|
((BinaryAddExpContext)_localctx).op = (Token)_errHandler.recoverInline(this);
|
|
}
|
|
else {
|
|
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
|
|
_errHandler.reportMatch(this);
|
|
consume();
|
|
}
|
|
setState(314);
|
|
mulExp(0);
|
|
}
|
|
}
|
|
}
|
|
setState(319);
|
|
_errHandler.sync(this);
|
|
_alt = getInterpreter().adaptivePredict(_input,31,_ctx);
|
|
}
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
unrollRecursionContexts(_parentctx);
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class RelExpContext extends ParserRuleContext {
|
|
public RelExpContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_relExp; }
|
|
|
|
public RelExpContext() { }
|
|
public void copyFrom(RelExpContext ctx) {
|
|
super.copyFrom(ctx);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class AddRelExpContext extends RelExpContext {
|
|
public AddExpContext addExp() {
|
|
return getRuleContext(AddExpContext.class,0);
|
|
}
|
|
public AddRelExpContext(RelExpContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterAddRelExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitAddRelExp(this);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class BinaryRelExpContext extends RelExpContext {
|
|
public Token op;
|
|
public RelExpContext relExp() {
|
|
return getRuleContext(RelExpContext.class,0);
|
|
}
|
|
public AddExpContext addExp() {
|
|
return getRuleContext(AddExpContext.class,0);
|
|
}
|
|
public TerminalNode LT() { return getToken(SysYParser.LT, 0); }
|
|
public TerminalNode GT() { return getToken(SysYParser.GT, 0); }
|
|
public TerminalNode LE() { return getToken(SysYParser.LE, 0); }
|
|
public TerminalNode GE() { return getToken(SysYParser.GE, 0); }
|
|
public BinaryRelExpContext(RelExpContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBinaryRelExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBinaryRelExp(this);
|
|
}
|
|
}
|
|
|
|
public final RelExpContext relExp() throws RecognitionException {
|
|
return relExp(0);
|
|
}
|
|
|
|
private RelExpContext relExp(int _p) throws RecognitionException {
|
|
ParserRuleContext _parentctx = _ctx;
|
|
int _parentState = getState();
|
|
RelExpContext _localctx = new RelExpContext(_ctx, _parentState);
|
|
RelExpContext _prevctx = _localctx;
|
|
int _startState = 52;
|
|
enterRecursionRule(_localctx, 52, RULE_relExp, _p);
|
|
int _la;
|
|
try {
|
|
int _alt;
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
{
|
|
_localctx = new AddRelExpContext(_localctx);
|
|
_ctx = _localctx;
|
|
_prevctx = _localctx;
|
|
|
|
setState(321);
|
|
addExp(0);
|
|
}
|
|
_ctx.stop = _input.LT(-1);
|
|
setState(328);
|
|
_errHandler.sync(this);
|
|
_alt = getInterpreter().adaptivePredict(_input,32,_ctx);
|
|
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
|
|
if ( _alt==1 ) {
|
|
if ( _parseListeners!=null ) triggerExitRuleEvent();
|
|
_prevctx = _localctx;
|
|
{
|
|
{
|
|
_localctx = new BinaryRelExpContext(new RelExpContext(_parentctx, _parentState));
|
|
pushNewRecursionContext(_localctx, _startState, RULE_relExp);
|
|
setState(323);
|
|
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
|
|
setState(324);
|
|
((BinaryRelExpContext)_localctx).op = _input.LT(1);
|
|
_la = _input.LA(1);
|
|
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 7864320L) != 0)) ) {
|
|
((BinaryRelExpContext)_localctx).op = (Token)_errHandler.recoverInline(this);
|
|
}
|
|
else {
|
|
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
|
|
_errHandler.reportMatch(this);
|
|
consume();
|
|
}
|
|
setState(325);
|
|
addExp(0);
|
|
}
|
|
}
|
|
}
|
|
setState(330);
|
|
_errHandler.sync(this);
|
|
_alt = getInterpreter().adaptivePredict(_input,32,_ctx);
|
|
}
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
unrollRecursionContexts(_parentctx);
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class EqExpContext extends ParserRuleContext {
|
|
public EqExpContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_eqExp; }
|
|
|
|
public EqExpContext() { }
|
|
public void copyFrom(EqExpContext ctx) {
|
|
super.copyFrom(ctx);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class BinaryEqExpContext extends EqExpContext {
|
|
public Token op;
|
|
public EqExpContext eqExp() {
|
|
return getRuleContext(EqExpContext.class,0);
|
|
}
|
|
public RelExpContext relExp() {
|
|
return getRuleContext(RelExpContext.class,0);
|
|
}
|
|
public TerminalNode EQ() { return getToken(SysYParser.EQ, 0); }
|
|
public TerminalNode NE() { return getToken(SysYParser.NE, 0); }
|
|
public BinaryEqExpContext(EqExpContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBinaryEqExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBinaryEqExp(this);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class RelEqExpContext extends EqExpContext {
|
|
public RelExpContext relExp() {
|
|
return getRuleContext(RelExpContext.class,0);
|
|
}
|
|
public RelEqExpContext(EqExpContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterRelEqExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitRelEqExp(this);
|
|
}
|
|
}
|
|
|
|
public final EqExpContext eqExp() throws RecognitionException {
|
|
return eqExp(0);
|
|
}
|
|
|
|
private EqExpContext eqExp(int _p) throws RecognitionException {
|
|
ParserRuleContext _parentctx = _ctx;
|
|
int _parentState = getState();
|
|
EqExpContext _localctx = new EqExpContext(_ctx, _parentState);
|
|
EqExpContext _prevctx = _localctx;
|
|
int _startState = 54;
|
|
enterRecursionRule(_localctx, 54, RULE_eqExp, _p);
|
|
int _la;
|
|
try {
|
|
int _alt;
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
{
|
|
_localctx = new RelEqExpContext(_localctx);
|
|
_ctx = _localctx;
|
|
_prevctx = _localctx;
|
|
|
|
setState(332);
|
|
relExp(0);
|
|
}
|
|
_ctx.stop = _input.LT(-1);
|
|
setState(339);
|
|
_errHandler.sync(this);
|
|
_alt = getInterpreter().adaptivePredict(_input,33,_ctx);
|
|
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
|
|
if ( _alt==1 ) {
|
|
if ( _parseListeners!=null ) triggerExitRuleEvent();
|
|
_prevctx = _localctx;
|
|
{
|
|
{
|
|
_localctx = new BinaryEqExpContext(new EqExpContext(_parentctx, _parentState));
|
|
pushNewRecursionContext(_localctx, _startState, RULE_eqExp);
|
|
setState(334);
|
|
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
|
|
setState(335);
|
|
((BinaryEqExpContext)_localctx).op = _input.LT(1);
|
|
_la = _input.LA(1);
|
|
if ( !(_la==EQ || _la==NE) ) {
|
|
((BinaryEqExpContext)_localctx).op = (Token)_errHandler.recoverInline(this);
|
|
}
|
|
else {
|
|
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
|
|
_errHandler.reportMatch(this);
|
|
consume();
|
|
}
|
|
setState(336);
|
|
relExp(0);
|
|
}
|
|
}
|
|
}
|
|
setState(341);
|
|
_errHandler.sync(this);
|
|
_alt = getInterpreter().adaptivePredict(_input,33,_ctx);
|
|
}
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
unrollRecursionContexts(_parentctx);
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class LAndExpContext extends ParserRuleContext {
|
|
public LAndExpContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_lAndExp; }
|
|
|
|
public LAndExpContext() { }
|
|
public void copyFrom(LAndExpContext ctx) {
|
|
super.copyFrom(ctx);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class EqLAndExpContext extends LAndExpContext {
|
|
public EqExpContext eqExp() {
|
|
return getRuleContext(EqExpContext.class,0);
|
|
}
|
|
public EqLAndExpContext(LAndExpContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterEqLAndExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitEqLAndExp(this);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class BinaryLAndExpContext extends LAndExpContext {
|
|
public LAndExpContext lAndExp() {
|
|
return getRuleContext(LAndExpContext.class,0);
|
|
}
|
|
public TerminalNode AND() { return getToken(SysYParser.AND, 0); }
|
|
public EqExpContext eqExp() {
|
|
return getRuleContext(EqExpContext.class,0);
|
|
}
|
|
public BinaryLAndExpContext(LAndExpContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBinaryLAndExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBinaryLAndExp(this);
|
|
}
|
|
}
|
|
|
|
public final LAndExpContext lAndExp() throws RecognitionException {
|
|
return lAndExp(0);
|
|
}
|
|
|
|
private LAndExpContext lAndExp(int _p) throws RecognitionException {
|
|
ParserRuleContext _parentctx = _ctx;
|
|
int _parentState = getState();
|
|
LAndExpContext _localctx = new LAndExpContext(_ctx, _parentState);
|
|
LAndExpContext _prevctx = _localctx;
|
|
int _startState = 56;
|
|
enterRecursionRule(_localctx, 56, RULE_lAndExp, _p);
|
|
try {
|
|
int _alt;
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
{
|
|
_localctx = new EqLAndExpContext(_localctx);
|
|
_ctx = _localctx;
|
|
_prevctx = _localctx;
|
|
|
|
setState(343);
|
|
eqExp(0);
|
|
}
|
|
_ctx.stop = _input.LT(-1);
|
|
setState(350);
|
|
_errHandler.sync(this);
|
|
_alt = getInterpreter().adaptivePredict(_input,34,_ctx);
|
|
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
|
|
if ( _alt==1 ) {
|
|
if ( _parseListeners!=null ) triggerExitRuleEvent();
|
|
_prevctx = _localctx;
|
|
{
|
|
{
|
|
_localctx = new BinaryLAndExpContext(new LAndExpContext(_parentctx, _parentState));
|
|
pushNewRecursionContext(_localctx, _startState, RULE_lAndExp);
|
|
setState(345);
|
|
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
|
|
setState(346);
|
|
match(AND);
|
|
setState(347);
|
|
eqExp(0);
|
|
}
|
|
}
|
|
}
|
|
setState(352);
|
|
_errHandler.sync(this);
|
|
_alt = getInterpreter().adaptivePredict(_input,34,_ctx);
|
|
}
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
unrollRecursionContexts(_parentctx);
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class LOrExpContext extends ParserRuleContext {
|
|
public LOrExpContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_lOrExp; }
|
|
|
|
public LOrExpContext() { }
|
|
public void copyFrom(LOrExpContext ctx) {
|
|
super.copyFrom(ctx);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class AndLOrExpContext extends LOrExpContext {
|
|
public LAndExpContext lAndExp() {
|
|
return getRuleContext(LAndExpContext.class,0);
|
|
}
|
|
public AndLOrExpContext(LOrExpContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterAndLOrExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitAndLOrExp(this);
|
|
}
|
|
}
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class BinaryLOrExpContext extends LOrExpContext {
|
|
public LOrExpContext lOrExp() {
|
|
return getRuleContext(LOrExpContext.class,0);
|
|
}
|
|
public TerminalNode OR() { return getToken(SysYParser.OR, 0); }
|
|
public LAndExpContext lAndExp() {
|
|
return getRuleContext(LAndExpContext.class,0);
|
|
}
|
|
public BinaryLOrExpContext(LOrExpContext ctx) { copyFrom(ctx); }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterBinaryLOrExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitBinaryLOrExp(this);
|
|
}
|
|
}
|
|
|
|
public final LOrExpContext lOrExp() throws RecognitionException {
|
|
return lOrExp(0);
|
|
}
|
|
|
|
private LOrExpContext lOrExp(int _p) throws RecognitionException {
|
|
ParserRuleContext _parentctx = _ctx;
|
|
int _parentState = getState();
|
|
LOrExpContext _localctx = new LOrExpContext(_ctx, _parentState);
|
|
LOrExpContext _prevctx = _localctx;
|
|
int _startState = 58;
|
|
enterRecursionRule(_localctx, 58, RULE_lOrExp, _p);
|
|
try {
|
|
int _alt;
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
{
|
|
_localctx = new AndLOrExpContext(_localctx);
|
|
_ctx = _localctx;
|
|
_prevctx = _localctx;
|
|
|
|
setState(354);
|
|
lAndExp(0);
|
|
}
|
|
_ctx.stop = _input.LT(-1);
|
|
setState(361);
|
|
_errHandler.sync(this);
|
|
_alt = getInterpreter().adaptivePredict(_input,35,_ctx);
|
|
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
|
|
if ( _alt==1 ) {
|
|
if ( _parseListeners!=null ) triggerExitRuleEvent();
|
|
_prevctx = _localctx;
|
|
{
|
|
{
|
|
_localctx = new BinaryLOrExpContext(new LOrExpContext(_parentctx, _parentState));
|
|
pushNewRecursionContext(_localctx, _startState, RULE_lOrExp);
|
|
setState(356);
|
|
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
|
|
setState(357);
|
|
match(OR);
|
|
setState(358);
|
|
lAndExp(0);
|
|
}
|
|
}
|
|
}
|
|
setState(363);
|
|
_errHandler.sync(this);
|
|
_alt = getInterpreter().adaptivePredict(_input,35,_ctx);
|
|
}
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
unrollRecursionContexts(_parentctx);
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
@SuppressWarnings("CheckReturnValue")
|
|
public static class ConstExpContext extends ParserRuleContext {
|
|
public AddExpContext addExp() {
|
|
return getRuleContext(AddExpContext.class,0);
|
|
}
|
|
public ConstExpContext(ParserRuleContext parent, int invokingState) {
|
|
super(parent, invokingState);
|
|
}
|
|
@Override public int getRuleIndex() { return RULE_constExp; }
|
|
@Override
|
|
public void enterRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).enterConstExp(this);
|
|
}
|
|
@Override
|
|
public void exitRule(ParseTreeListener listener) {
|
|
if ( listener instanceof SysYListener ) ((SysYListener)listener).exitConstExp(this);
|
|
}
|
|
}
|
|
|
|
public final ConstExpContext constExp() throws RecognitionException {
|
|
ConstExpContext _localctx = new ConstExpContext(_ctx, getState());
|
|
enterRule(_localctx, 60, RULE_constExp);
|
|
try {
|
|
enterOuterAlt(_localctx, 1);
|
|
{
|
|
setState(364);
|
|
addExp(0);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
_errHandler.reportError(this, re);
|
|
_errHandler.recover(this, re);
|
|
}
|
|
finally {
|
|
exitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
|
|
switch (ruleIndex) {
|
|
case 24:
|
|
return mulExp_sempred((MulExpContext)_localctx, predIndex);
|
|
case 25:
|
|
return addExp_sempred((AddExpContext)_localctx, predIndex);
|
|
case 26:
|
|
return relExp_sempred((RelExpContext)_localctx, predIndex);
|
|
case 27:
|
|
return eqExp_sempred((EqExpContext)_localctx, predIndex);
|
|
case 28:
|
|
return lAndExp_sempred((LAndExpContext)_localctx, predIndex);
|
|
case 29:
|
|
return lOrExp_sempred((LOrExpContext)_localctx, predIndex);
|
|
}
|
|
return true;
|
|
}
|
|
private boolean mulExp_sempred(MulExpContext _localctx, int predIndex) {
|
|
switch (predIndex) {
|
|
case 0:
|
|
return precpred(_ctx, 1);
|
|
}
|
|
return true;
|
|
}
|
|
private boolean addExp_sempred(AddExpContext _localctx, int predIndex) {
|
|
switch (predIndex) {
|
|
case 1:
|
|
return precpred(_ctx, 1);
|
|
}
|
|
return true;
|
|
}
|
|
private boolean relExp_sempred(RelExpContext _localctx, int predIndex) {
|
|
switch (predIndex) {
|
|
case 2:
|
|
return precpred(_ctx, 1);
|
|
}
|
|
return true;
|
|
}
|
|
private boolean eqExp_sempred(EqExpContext _localctx, int predIndex) {
|
|
switch (predIndex) {
|
|
case 3:
|
|
return precpred(_ctx, 1);
|
|
}
|
|
return true;
|
|
}
|
|
private boolean lAndExp_sempred(LAndExpContext _localctx, int predIndex) {
|
|
switch (predIndex) {
|
|
case 4:
|
|
return precpred(_ctx, 1);
|
|
}
|
|
return true;
|
|
}
|
|
private boolean lOrExp_sempred(LOrExpContext _localctx, int predIndex) {
|
|
switch (predIndex) {
|
|
case 5:
|
|
return precpred(_ctx, 1);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public static final String _serializedATN =
|
|
"\u0004\u0001\'\u016f\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+
|
|
"\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002"+
|
|
"\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002"+
|
|
"\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002"+
|
|
"\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0002\u000f\u0007\u000f"+
|
|
"\u0002\u0010\u0007\u0010\u0002\u0011\u0007\u0011\u0002\u0012\u0007\u0012"+
|
|
"\u0002\u0013\u0007\u0013\u0002\u0014\u0007\u0014\u0002\u0015\u0007\u0015"+
|
|
"\u0002\u0016\u0007\u0016\u0002\u0017\u0007\u0017\u0002\u0018\u0007\u0018"+
|
|
"\u0002\u0019\u0007\u0019\u0002\u001a\u0007\u001a\u0002\u001b\u0007\u001b"+
|
|
"\u0002\u001c\u0007\u001c\u0002\u001d\u0007\u001d\u0002\u001e\u0007\u001e"+
|
|
"\u0001\u0000\u0001\u0000\u0004\u0000A\b\u0000\u000b\u0000\f\u0000B\u0001"+
|
|
"\u0000\u0001\u0000\u0001\u0001\u0001\u0001\u0003\u0001I\b\u0001\u0001"+
|
|
"\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0005\u0002P\b"+
|
|
"\u0002\n\u0002\f\u0002S\t\u0002\u0001\u0002\u0001\u0002\u0001\u0003\u0001"+
|
|
"\u0003\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0005"+
|
|
"\u0004^\b\u0004\n\u0004\f\u0004a\t\u0004\u0001\u0004\u0001\u0004\u0001"+
|
|
"\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0005"+
|
|
"\u0005k\b\u0005\n\u0005\f\u0005n\t\u0005\u0003\u0005p\b\u0005\u0001\u0005"+
|
|
"\u0003\u0005s\b\u0005\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006"+
|
|
"\u0005\u0006y\b\u0006\n\u0006\f\u0006|\t\u0006\u0001\u0006\u0001\u0006"+
|
|
"\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0005\u0007"+
|
|
"\u0085\b\u0007\n\u0007\f\u0007\u0088\t\u0007\u0001\u0007\u0001\u0007\u0001"+
|
|
"\u0007\u0001\u0007\u0001\u0007\u0005\u0007\u008f\b\u0007\n\u0007\f\u0007"+
|
|
"\u0092\t\u0007\u0001\u0007\u0001\u0007\u0003\u0007\u0096\b\u0007\u0001"+
|
|
"\b\u0001\b\u0001\b\u0001\b\u0001\b\u0005\b\u009d\b\b\n\b\f\b\u00a0\t\b"+
|
|
"\u0003\b\u00a2\b\b\u0001\b\u0003\b\u00a5\b\b\u0001\t\u0001\t\u0001\t\u0001"+
|
|
"\t\u0003\t\u00ab\b\t\u0001\t\u0001\t\u0001\t\u0001\n\u0001\n\u0001\u000b"+
|
|
"\u0001\u000b\u0001\u000b\u0005\u000b\u00b5\b\u000b\n\u000b\f\u000b\u00b8"+
|
|
"\t\u000b\u0001\f\u0001\f\u0001\f\u0001\f\u0001\f\u0001\f\u0001\f\u0001"+
|
|
"\f\u0001\f\u0001\f\u0001\f\u0005\f\u00c5\b\f\n\f\f\f\u00c8\t\f\u0003\f"+
|
|
"\u00ca\b\f\u0001\r\u0001\r\u0005\r\u00ce\b\r\n\r\f\r\u00d1\t\r\u0001\r"+
|
|
"\u0001\r\u0001\u000e\u0001\u000e\u0003\u000e\u00d7\b\u000e\u0001\u000f"+
|
|
"\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0003\u000f"+
|
|
"\u00df\b\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f"+
|
|
"\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0003\u000f\u00ea\b\u000f"+
|
|
"\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f"+
|
|
"\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f"+
|
|
"\u0003\u000f\u00f8\b\u000f\u0001\u000f\u0003\u000f\u00fb\b\u000f\u0001"+
|
|
"\u0010\u0001\u0010\u0001\u0011\u0001\u0011\u0001\u0012\u0001\u0012\u0001"+
|
|
"\u0012\u0001\u0012\u0001\u0012\u0005\u0012\u0106\b\u0012\n\u0012\f\u0012"+
|
|
"\u0109\t\u0012\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013"+
|
|
"\u0001\u0013\u0003\u0013\u0111\b\u0013\u0001\u0014\u0001\u0014\u0001\u0015"+
|
|
"\u0001\u0015\u0001\u0015\u0001\u0015\u0003\u0015\u0119\b\u0015\u0001\u0015"+
|
|
"\u0001\u0015\u0001\u0015\u0001\u0015\u0003\u0015\u011f\b\u0015\u0001\u0016"+
|
|
"\u0001\u0016\u0001\u0017\u0001\u0017\u0001\u0017\u0005\u0017\u0126\b\u0017"+
|
|
"\n\u0017\f\u0017\u0129\t\u0017\u0001\u0018\u0001\u0018\u0001\u0018\u0001"+
|
|
"\u0018\u0001\u0018\u0001\u0018\u0005\u0018\u0131\b\u0018\n\u0018\f\u0018"+
|
|
"\u0134\t\u0018\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019"+
|
|
"\u0001\u0019\u0005\u0019\u013c\b\u0019\n\u0019\f\u0019\u013f\t\u0019\u0001"+
|
|
"\u001a\u0001\u001a\u0001\u001a\u0001\u001a\u0001\u001a\u0001\u001a\u0005"+
|
|
"\u001a\u0147\b\u001a\n\u001a\f\u001a\u014a\t\u001a\u0001\u001b\u0001\u001b"+
|
|
"\u0001\u001b\u0001\u001b\u0001\u001b\u0001\u001b\u0005\u001b\u0152\b\u001b"+
|
|
"\n\u001b\f\u001b\u0155\t\u001b\u0001\u001c\u0001\u001c\u0001\u001c\u0001"+
|
|
"\u001c\u0001\u001c\u0001\u001c\u0005\u001c\u015d\b\u001c\n\u001c\f\u001c"+
|
|
"\u0160\t\u001c\u0001\u001d\u0001\u001d\u0001\u001d\u0001\u001d\u0001\u001d"+
|
|
"\u0001\u001d\u0005\u001d\u0168\b\u001d\n\u001d\f\u001d\u016b\t\u001d\u0001"+
|
|
"\u001e\u0001\u001e\u0001\u001e\u0000\u000602468:\u001f\u0000\u0002\u0004"+
|
|
"\u0006\b\n\f\u000e\u0010\u0012\u0014\u0016\u0018\u001a\u001c\u001e \""+
|
|
"$&(*,.02468:<\u0000\b\u0001\u0000\u0002\u0003\u0001\u0000\u0002\u0004"+
|
|
"\u0001\u0000#$\u0002\u0000\u000b\f\u0017\u0017\u0001\u0000\r\u000f\u0001"+
|
|
"\u0000\u000b\f\u0001\u0000\u0013\u0016\u0001\u0000\u0011\u0012\u017b\u0000"+
|
|
"@\u0001\u0000\u0000\u0000\u0002H\u0001\u0000\u0000\u0000\u0004J\u0001"+
|
|
"\u0000\u0000\u0000\u0006V\u0001\u0000\u0000\u0000\bX\u0001\u0000\u0000"+
|
|
"\u0000\nr\u0001\u0000\u0000\u0000\ft\u0001\u0000\u0000\u0000\u000e\u0095"+
|
|
"\u0001\u0000\u0000\u0000\u0010\u00a4\u0001\u0000\u0000\u0000\u0012\u00a6"+
|
|
"\u0001\u0000\u0000\u0000\u0014\u00af\u0001\u0000\u0000\u0000\u0016\u00b1"+
|
|
"\u0001\u0000\u0000\u0000\u0018\u00c9\u0001\u0000\u0000\u0000\u001a\u00cb"+
|
|
"\u0001\u0000\u0000\u0000\u001c\u00d6\u0001\u0000\u0000\u0000\u001e\u00fa"+
|
|
"\u0001\u0000\u0000\u0000 \u00fc\u0001\u0000\u0000\u0000\"\u00fe\u0001"+
|
|
"\u0000\u0000\u0000$\u0100\u0001\u0000\u0000\u0000&\u0110\u0001\u0000\u0000"+
|
|
"\u0000(\u0112\u0001\u0000\u0000\u0000*\u011e\u0001\u0000\u0000\u0000,"+
|
|
"\u0120\u0001\u0000\u0000\u0000.\u0122\u0001\u0000\u0000\u00000\u012a\u0001"+
|
|
"\u0000\u0000\u00002\u0135\u0001\u0000\u0000\u00004\u0140\u0001\u0000\u0000"+
|
|
"\u00006\u014b\u0001\u0000\u0000\u00008\u0156\u0001\u0000\u0000\u0000:"+
|
|
"\u0161\u0001\u0000\u0000\u0000<\u016c\u0001\u0000\u0000\u0000>A\u0003"+
|
|
"\u0002\u0001\u0000?A\u0003\u0012\t\u0000@>\u0001\u0000\u0000\u0000@?\u0001"+
|
|
"\u0000\u0000\u0000AB\u0001\u0000\u0000\u0000B@\u0001\u0000\u0000\u0000"+
|
|
"BC\u0001\u0000\u0000\u0000CD\u0001\u0000\u0000\u0000DE\u0005\u0000\u0000"+
|
|
"\u0001E\u0001\u0001\u0000\u0000\u0000FI\u0003\u0004\u0002\u0000GI\u0003"+
|
|
"\f\u0006\u0000HF\u0001\u0000\u0000\u0000HG\u0001\u0000\u0000\u0000I\u0003"+
|
|
"\u0001\u0000\u0000\u0000JK\u0005\u0001\u0000\u0000KL\u0003\u0006\u0003"+
|
|
"\u0000LQ\u0003\b\u0004\u0000MN\u0005 \u0000\u0000NP\u0003\b\u0004\u0000"+
|
|
"OM\u0001\u0000\u0000\u0000PS\u0001\u0000\u0000\u0000QO\u0001\u0000\u0000"+
|
|
"\u0000QR\u0001\u0000\u0000\u0000RT\u0001\u0000\u0000\u0000SQ\u0001\u0000"+
|
|
"\u0000\u0000TU\u0005!\u0000\u0000U\u0005\u0001\u0000\u0000\u0000VW\u0007"+
|
|
"\u0000\u0000\u0000W\u0007\u0001\u0000\u0000\u0000X_\u0005\"\u0000\u0000"+
|
|
"YZ\u0005\u001c\u0000\u0000Z[\u0003<\u001e\u0000[\\\u0005\u001d\u0000\u0000"+
|
|
"\\^\u0001\u0000\u0000\u0000]Y\u0001\u0000\u0000\u0000^a\u0001\u0000\u0000"+
|
|
"\u0000_]\u0001\u0000\u0000\u0000_`\u0001\u0000\u0000\u0000`b\u0001\u0000"+
|
|
"\u0000\u0000a_\u0001\u0000\u0000\u0000bc\u0005\u0010\u0000\u0000cd\u0003"+
|
|
"\n\u0005\u0000d\t\u0001\u0000\u0000\u0000es\u0003<\u001e\u0000fo\u0005"+
|
|
"\u001e\u0000\u0000gl\u0003\n\u0005\u0000hi\u0005 \u0000\u0000ik\u0003"+
|
|
"\n\u0005\u0000jh\u0001\u0000\u0000\u0000kn\u0001\u0000\u0000\u0000lj\u0001"+
|
|
"\u0000\u0000\u0000lm\u0001\u0000\u0000\u0000mp\u0001\u0000\u0000\u0000"+
|
|
"nl\u0001\u0000\u0000\u0000og\u0001\u0000\u0000\u0000op\u0001\u0000\u0000"+
|
|
"\u0000pq\u0001\u0000\u0000\u0000qs\u0005\u001f\u0000\u0000re\u0001\u0000"+
|
|
"\u0000\u0000rf\u0001\u0000\u0000\u0000s\u000b\u0001\u0000\u0000\u0000"+
|
|
"tu\u0003\u0006\u0003\u0000uz\u0003\u000e\u0007\u0000vw\u0005 \u0000\u0000"+
|
|
"wy\u0003\u000e\u0007\u0000xv\u0001\u0000\u0000\u0000y|\u0001\u0000\u0000"+
|
|
"\u0000zx\u0001\u0000\u0000\u0000z{\u0001\u0000\u0000\u0000{}\u0001\u0000"+
|
|
"\u0000\u0000|z\u0001\u0000\u0000\u0000}~\u0005!\u0000\u0000~\r\u0001\u0000"+
|
|
"\u0000\u0000\u007f\u0086\u0005\"\u0000\u0000\u0080\u0081\u0005\u001c\u0000"+
|
|
"\u0000\u0081\u0082\u0003<\u001e\u0000\u0082\u0083\u0005\u001d\u0000\u0000"+
|
|
"\u0083\u0085\u0001\u0000\u0000\u0000\u0084\u0080\u0001\u0000\u0000\u0000"+
|
|
"\u0085\u0088\u0001\u0000\u0000\u0000\u0086\u0084\u0001\u0000\u0000\u0000"+
|
|
"\u0086\u0087\u0001\u0000\u0000\u0000\u0087\u0096\u0001\u0000\u0000\u0000"+
|
|
"\u0088\u0086\u0001\u0000\u0000\u0000\u0089\u0090\u0005\"\u0000\u0000\u008a"+
|
|
"\u008b\u0005\u001c\u0000\u0000\u008b\u008c\u0003<\u001e\u0000\u008c\u008d"+
|
|
"\u0005\u001d\u0000\u0000\u008d\u008f\u0001\u0000\u0000\u0000\u008e\u008a"+
|
|
"\u0001\u0000\u0000\u0000\u008f\u0092\u0001\u0000\u0000\u0000\u0090\u008e"+
|
|
"\u0001\u0000\u0000\u0000\u0090\u0091\u0001\u0000\u0000\u0000\u0091\u0093"+
|
|
"\u0001\u0000\u0000\u0000\u0092\u0090\u0001\u0000\u0000\u0000\u0093\u0094"+
|
|
"\u0005\u0010\u0000\u0000\u0094\u0096\u0003\u0010\b\u0000\u0095\u007f\u0001"+
|
|
"\u0000\u0000\u0000\u0095\u0089\u0001\u0000\u0000\u0000\u0096\u000f\u0001"+
|
|
"\u0000\u0000\u0000\u0097\u00a5\u0003 \u0010\u0000\u0098\u00a1\u0005\u001e"+
|
|
"\u0000\u0000\u0099\u009e\u0003\u0010\b\u0000\u009a\u009b\u0005 \u0000"+
|
|
"\u0000\u009b\u009d\u0003\u0010\b\u0000\u009c\u009a\u0001\u0000\u0000\u0000"+
|
|
"\u009d\u00a0\u0001\u0000\u0000\u0000\u009e\u009c\u0001\u0000\u0000\u0000"+
|
|
"\u009e\u009f\u0001\u0000\u0000\u0000\u009f\u00a2\u0001\u0000\u0000\u0000"+
|
|
"\u00a0\u009e\u0001\u0000\u0000\u0000\u00a1\u0099\u0001\u0000\u0000\u0000"+
|
|
"\u00a1\u00a2\u0001\u0000\u0000\u0000\u00a2\u00a3\u0001\u0000\u0000\u0000"+
|
|
"\u00a3\u00a5\u0005\u001f\u0000\u0000\u00a4\u0097\u0001\u0000\u0000\u0000"+
|
|
"\u00a4\u0098\u0001\u0000\u0000\u0000\u00a5\u0011\u0001\u0000\u0000\u0000"+
|
|
"\u00a6\u00a7\u0003\u0014\n\u0000\u00a7\u00a8\u0005\"\u0000\u0000\u00a8"+
|
|
"\u00aa\u0005\u001a\u0000\u0000\u00a9\u00ab\u0003\u0016\u000b\u0000\u00aa"+
|
|
"\u00a9\u0001\u0000\u0000\u0000\u00aa\u00ab\u0001\u0000\u0000\u0000\u00ab"+
|
|
"\u00ac\u0001\u0000\u0000\u0000\u00ac\u00ad\u0005\u001b\u0000\u0000\u00ad"+
|
|
"\u00ae\u0003\u001a\r\u0000\u00ae\u0013\u0001\u0000\u0000\u0000\u00af\u00b0"+
|
|
"\u0007\u0001\u0000\u0000\u00b0\u0015\u0001\u0000\u0000\u0000\u00b1\u00b6"+
|
|
"\u0003\u0018\f\u0000\u00b2\u00b3\u0005 \u0000\u0000\u00b3\u00b5\u0003"+
|
|
"\u0018\f\u0000\u00b4\u00b2\u0001\u0000\u0000\u0000\u00b5\u00b8\u0001\u0000"+
|
|
"\u0000\u0000\u00b6\u00b4\u0001\u0000\u0000\u0000\u00b6\u00b7\u0001\u0000"+
|
|
"\u0000\u0000\u00b7\u0017\u0001\u0000\u0000\u0000\u00b8\u00b6\u0001\u0000"+
|
|
"\u0000\u0000\u00b9\u00ba\u0003\u0006\u0003\u0000\u00ba\u00bb\u0005\"\u0000"+
|
|
"\u0000\u00bb\u00ca\u0001\u0000\u0000\u0000\u00bc\u00bd\u0003\u0006\u0003"+
|
|
"\u0000\u00bd\u00be\u0005\"\u0000\u0000\u00be\u00bf\u0005\u001c\u0000\u0000"+
|
|
"\u00bf\u00c6\u0005\u001d\u0000\u0000\u00c0\u00c1\u0005\u001c\u0000\u0000"+
|
|
"\u00c1\u00c2\u0003 \u0010\u0000\u00c2\u00c3\u0005\u001d\u0000\u0000\u00c3"+
|
|
"\u00c5\u0001\u0000\u0000\u0000\u00c4\u00c0\u0001\u0000\u0000\u0000\u00c5"+
|
|
"\u00c8\u0001\u0000\u0000\u0000\u00c6\u00c4\u0001\u0000\u0000\u0000\u00c6"+
|
|
"\u00c7\u0001\u0000\u0000\u0000\u00c7\u00ca\u0001\u0000\u0000\u0000\u00c8"+
|
|
"\u00c6\u0001\u0000\u0000\u0000\u00c9\u00b9\u0001\u0000\u0000\u0000\u00c9"+
|
|
"\u00bc\u0001\u0000\u0000\u0000\u00ca\u0019\u0001\u0000\u0000\u0000\u00cb"+
|
|
"\u00cf\u0005\u001e\u0000\u0000\u00cc\u00ce\u0003\u001c\u000e\u0000\u00cd"+
|
|
"\u00cc\u0001\u0000\u0000\u0000\u00ce\u00d1\u0001\u0000\u0000\u0000\u00cf"+
|
|
"\u00cd\u0001\u0000\u0000\u0000\u00cf\u00d0\u0001\u0000\u0000\u0000\u00d0"+
|
|
"\u00d2\u0001\u0000\u0000\u0000\u00d1\u00cf\u0001\u0000\u0000\u0000\u00d2"+
|
|
"\u00d3\u0005\u001f\u0000\u0000\u00d3\u001b\u0001\u0000\u0000\u0000\u00d4"+
|
|
"\u00d7\u0003\u0002\u0001\u0000\u00d5\u00d7\u0003\u001e\u000f\u0000\u00d6"+
|
|
"\u00d4\u0001\u0000\u0000\u0000\u00d6\u00d5\u0001\u0000\u0000\u0000\u00d7"+
|
|
"\u001d\u0001\u0000\u0000\u0000\u00d8\u00d9\u0003$\u0012\u0000\u00d9\u00da"+
|
|
"\u0005\u0010\u0000\u0000\u00da\u00db\u0003 \u0010\u0000\u00db\u00dc\u0005"+
|
|
"!\u0000\u0000\u00dc\u00fb\u0001\u0000\u0000\u0000\u00dd\u00df\u0003 \u0010"+
|
|
"\u0000\u00de\u00dd\u0001\u0000\u0000\u0000\u00de\u00df\u0001\u0000\u0000"+
|
|
"\u0000\u00df\u00e0\u0001\u0000\u0000\u0000\u00e0\u00fb\u0005!\u0000\u0000"+
|
|
"\u00e1\u00fb\u0003\u001a\r\u0000\u00e2\u00e3\u0005\u0005\u0000\u0000\u00e3"+
|
|
"\u00e4\u0005\u001a\u0000\u0000\u00e4\u00e5\u0003\"\u0011\u0000\u00e5\u00e6"+
|
|
"\u0005\u001b\u0000\u0000\u00e6\u00e9\u0003\u001e\u000f\u0000\u00e7\u00e8"+
|
|
"\u0005\u0006\u0000\u0000\u00e8\u00ea\u0003\u001e\u000f\u0000\u00e9\u00e7"+
|
|
"\u0001\u0000\u0000\u0000\u00e9\u00ea\u0001\u0000\u0000\u0000\u00ea\u00fb"+
|
|
"\u0001\u0000\u0000\u0000\u00eb\u00ec\u0005\u0007\u0000\u0000\u00ec\u00ed"+
|
|
"\u0005\u001a\u0000\u0000\u00ed\u00ee\u0003\"\u0011\u0000\u00ee\u00ef\u0005"+
|
|
"\u001b\u0000\u0000\u00ef\u00f0\u0003\u001e\u000f\u0000\u00f0\u00fb\u0001"+
|
|
"\u0000\u0000\u0000\u00f1\u00f2\u0005\b\u0000\u0000\u00f2\u00fb\u0005!"+
|
|
"\u0000\u0000\u00f3\u00f4\u0005\t\u0000\u0000\u00f4\u00fb\u0005!\u0000"+
|
|
"\u0000\u00f5\u00f7\u0005\n\u0000\u0000\u00f6\u00f8\u0003 \u0010\u0000"+
|
|
"\u00f7\u00f6\u0001\u0000\u0000\u0000\u00f7\u00f8\u0001\u0000\u0000\u0000"+
|
|
"\u00f8\u00f9\u0001\u0000\u0000\u0000\u00f9\u00fb\u0005!\u0000\u0000\u00fa"+
|
|
"\u00d8\u0001\u0000\u0000\u0000\u00fa\u00de\u0001\u0000\u0000\u0000\u00fa"+
|
|
"\u00e1\u0001\u0000\u0000\u0000\u00fa\u00e2\u0001\u0000\u0000\u0000\u00fa"+
|
|
"\u00eb\u0001\u0000\u0000\u0000\u00fa\u00f1\u0001\u0000\u0000\u0000\u00fa"+
|
|
"\u00f3\u0001\u0000\u0000\u0000\u00fa\u00f5\u0001\u0000\u0000\u0000\u00fb"+
|
|
"\u001f\u0001\u0000\u0000\u0000\u00fc\u00fd\u00032\u0019\u0000\u00fd!\u0001"+
|
|
"\u0000\u0000\u0000\u00fe\u00ff\u0003:\u001d\u0000\u00ff#\u0001\u0000\u0000"+
|
|
"\u0000\u0100\u0107\u0005\"\u0000\u0000\u0101\u0102\u0005\u001c\u0000\u0000"+
|
|
"\u0102\u0103\u0003 \u0010\u0000\u0103\u0104\u0005\u001d\u0000\u0000\u0104"+
|
|
"\u0106\u0001\u0000\u0000\u0000\u0105\u0101\u0001\u0000\u0000\u0000\u0106"+
|
|
"\u0109\u0001\u0000\u0000\u0000\u0107\u0105\u0001\u0000\u0000\u0000\u0107"+
|
|
"\u0108\u0001\u0000\u0000\u0000\u0108%\u0001\u0000\u0000\u0000\u0109\u0107"+
|
|
"\u0001\u0000\u0000\u0000\u010a\u010b\u0005\u001a\u0000\u0000\u010b\u010c"+
|
|
"\u0003 \u0010\u0000\u010c\u010d\u0005\u001b\u0000\u0000\u010d\u0111\u0001"+
|
|
"\u0000\u0000\u0000\u010e\u0111\u0003$\u0012\u0000\u010f\u0111\u0003(\u0014"+
|
|
"\u0000\u0110\u010a\u0001\u0000\u0000\u0000\u0110\u010e\u0001\u0000\u0000"+
|
|
"\u0000\u0110\u010f\u0001\u0000\u0000\u0000\u0111\'\u0001\u0000\u0000\u0000"+
|
|
"\u0112\u0113\u0007\u0002\u0000\u0000\u0113)\u0001\u0000\u0000\u0000\u0114"+
|
|
"\u011f\u0003&\u0013\u0000\u0115\u0116\u0005\"\u0000\u0000\u0116\u0118"+
|
|
"\u0005\u001a\u0000\u0000\u0117\u0119\u0003.\u0017\u0000\u0118\u0117\u0001"+
|
|
"\u0000\u0000\u0000\u0118\u0119\u0001\u0000\u0000\u0000\u0119\u011a\u0001"+
|
|
"\u0000\u0000\u0000\u011a\u011f\u0005\u001b\u0000\u0000\u011b\u011c\u0003"+
|
|
",\u0016\u0000\u011c\u011d\u0003*\u0015\u0000\u011d\u011f\u0001\u0000\u0000"+
|
|
"\u0000\u011e\u0114\u0001\u0000\u0000\u0000\u011e\u0115\u0001\u0000\u0000"+
|
|
"\u0000\u011e\u011b\u0001\u0000\u0000\u0000\u011f+\u0001\u0000\u0000\u0000"+
|
|
"\u0120\u0121\u0007\u0003\u0000\u0000\u0121-\u0001\u0000\u0000\u0000\u0122"+
|
|
"\u0127\u0003 \u0010\u0000\u0123\u0124\u0005 \u0000\u0000\u0124\u0126\u0003"+
|
|
" \u0010\u0000\u0125\u0123\u0001\u0000\u0000\u0000\u0126\u0129\u0001\u0000"+
|
|
"\u0000\u0000\u0127\u0125\u0001\u0000\u0000\u0000\u0127\u0128\u0001\u0000"+
|
|
"\u0000\u0000\u0128/\u0001\u0000\u0000\u0000\u0129\u0127\u0001\u0000\u0000"+
|
|
"\u0000\u012a\u012b\u0006\u0018\uffff\uffff\u0000\u012b\u012c\u0003*\u0015"+
|
|
"\u0000\u012c\u0132\u0001\u0000\u0000\u0000\u012d\u012e\n\u0001\u0000\u0000"+
|
|
"\u012e\u012f\u0007\u0004\u0000\u0000\u012f\u0131\u0003*\u0015\u0000\u0130"+
|
|
"\u012d\u0001\u0000\u0000\u0000\u0131\u0134\u0001\u0000\u0000\u0000\u0132"+
|
|
"\u0130\u0001\u0000\u0000\u0000\u0132\u0133\u0001\u0000\u0000\u0000\u0133"+
|
|
"1\u0001\u0000\u0000\u0000\u0134\u0132\u0001\u0000\u0000\u0000\u0135\u0136"+
|
|
"\u0006\u0019\uffff\uffff\u0000\u0136\u0137\u00030\u0018\u0000\u0137\u013d"+
|
|
"\u0001\u0000\u0000\u0000\u0138\u0139\n\u0001\u0000\u0000\u0139\u013a\u0007"+
|
|
"\u0005\u0000\u0000\u013a\u013c\u00030\u0018\u0000\u013b\u0138\u0001\u0000"+
|
|
"\u0000\u0000\u013c\u013f\u0001\u0000\u0000\u0000\u013d\u013b\u0001\u0000"+
|
|
"\u0000\u0000\u013d\u013e\u0001\u0000\u0000\u0000\u013e3\u0001\u0000\u0000"+
|
|
"\u0000\u013f\u013d\u0001\u0000\u0000\u0000\u0140\u0141\u0006\u001a\uffff"+
|
|
"\uffff\u0000\u0141\u0142\u00032\u0019\u0000\u0142\u0148\u0001\u0000\u0000"+
|
|
"\u0000\u0143\u0144\n\u0001\u0000\u0000\u0144\u0145\u0007\u0006\u0000\u0000"+
|
|
"\u0145\u0147\u00032\u0019\u0000\u0146\u0143\u0001\u0000\u0000\u0000\u0147"+
|
|
"\u014a\u0001\u0000\u0000\u0000\u0148\u0146\u0001\u0000\u0000\u0000\u0148"+
|
|
"\u0149\u0001\u0000\u0000\u0000\u01495\u0001\u0000\u0000\u0000\u014a\u0148"+
|
|
"\u0001\u0000\u0000\u0000\u014b\u014c\u0006\u001b\uffff\uffff\u0000\u014c"+
|
|
"\u014d\u00034\u001a\u0000\u014d\u0153\u0001\u0000\u0000\u0000\u014e\u014f"+
|
|
"\n\u0001\u0000\u0000\u014f\u0150\u0007\u0007\u0000\u0000\u0150\u0152\u0003"+
|
|
"4\u001a\u0000\u0151\u014e\u0001\u0000\u0000\u0000\u0152\u0155\u0001\u0000"+
|
|
"\u0000\u0000\u0153\u0151\u0001\u0000\u0000\u0000\u0153\u0154\u0001\u0000"+
|
|
"\u0000\u0000\u01547\u0001\u0000\u0000\u0000\u0155\u0153\u0001\u0000\u0000"+
|
|
"\u0000\u0156\u0157\u0006\u001c\uffff\uffff\u0000\u0157\u0158\u00036\u001b"+
|
|
"\u0000\u0158\u015e\u0001\u0000\u0000\u0000\u0159\u015a\n\u0001\u0000\u0000"+
|
|
"\u015a\u015b\u0005\u0018\u0000\u0000\u015b\u015d\u00036\u001b\u0000\u015c"+
|
|
"\u0159\u0001\u0000\u0000\u0000\u015d\u0160\u0001\u0000\u0000\u0000\u015e"+
|
|
"\u015c\u0001\u0000\u0000\u0000\u015e\u015f\u0001\u0000\u0000\u0000\u015f"+
|
|
"9\u0001\u0000\u0000\u0000\u0160\u015e\u0001\u0000\u0000\u0000\u0161\u0162"+
|
|
"\u0006\u001d\uffff\uffff\u0000\u0162\u0163\u00038\u001c\u0000\u0163\u0169"+
|
|
"\u0001\u0000\u0000\u0000\u0164\u0165\n\u0001\u0000\u0000\u0165\u0166\u0005"+
|
|
"\u0019\u0000\u0000\u0166\u0168\u00038\u001c\u0000\u0167\u0164\u0001\u0000"+
|
|
"\u0000\u0000\u0168\u016b\u0001\u0000\u0000\u0000\u0169\u0167\u0001\u0000"+
|
|
"\u0000\u0000\u0169\u016a\u0001\u0000\u0000\u0000\u016a;\u0001\u0000\u0000"+
|
|
"\u0000\u016b\u0169\u0001\u0000\u0000\u0000\u016c\u016d\u00032\u0019\u0000"+
|
|
"\u016d=\u0001\u0000\u0000\u0000$@BHQ_lorz\u0086\u0090\u0095\u009e\u00a1"+
|
|
"\u00a4\u00aa\u00b6\u00c6\u00c9\u00cf\u00d6\u00de\u00e9\u00f7\u00fa\u0107"+
|
|
"\u0110\u0118\u011e\u0127\u0132\u013d\u0148\u0153\u015e\u0169";
|
|
public static final ATN _ATN =
|
|
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
|
|
static {
|
|
_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
|
|
for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
|
|
_decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
|
|
}
|
|
}
|
|
} |