// Generated from /Users/klestiselimaj/Developer/RustRoverProjects/wyst/Wyst.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 WystParser 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 T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, WS=9, NUMBER=10, HEX=11, IDENTIFIER=12, MATH=13, STRING=14; public static final int RULE_round_def = 0, RULE_func_def = 1, RULE_var_def = 2, RULE_var_def_set = 3, RULE_asm = 4, RULE_expr = 5, RULE_code_block = 6, RULE_top = 7; private static String[] makeRuleNames() { return new String[] { "round_def", "func_def", "var_def", "var_def_set", "asm", "expr", "code_block", "top" }; } public static final String[] ruleNames = makeRuleNames(); private static String[] makeLiteralNames() { return new String[] { null, "'('", "','", "')'", "'='", "'%'", "';'", "'{'", "'}'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { null, null, null, null, null, null, null, null, null, "WS", "NUMBER", "HEX", "IDENTIFIER", "MATH", "STRING" }; } private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); /** * @deprecated Use {@link #VOCABULARY} instead. */ @Deprecated public static final String[] tokenNames; static { tokenNames = new String[_SYMBOLIC_NAMES.length]; for (int i = 0; i < tokenNames.length; i++) { tokenNames[i] = VOCABULARY.getLiteralName(i); if (tokenNames[i] == null) { tokenNames[i] = VOCABULARY.getSymbolicName(i); } if (tokenNames[i] == null) { tokenNames[i] = ""; } } } @Override @Deprecated public String[] getTokenNames() { return tokenNames; } @Override public Vocabulary getVocabulary() { return VOCABULARY; } @Override public String getGrammarFileName() { return "Wyst.g4"; } @Override public String[] getRuleNames() { return ruleNames; } @Override public String getSerializedATN() { return _serializedATN; } @Override public ATN getATN() { return _ATN; } public WystParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); } @SuppressWarnings("CheckReturnValue") public static class Round_defContext extends ParserRuleContext { public List var_def() { return getRuleContexts(Var_defContext.class); } public Var_defContext var_def(int i) { return getRuleContext(Var_defContext.class,i); } public Round_defContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_round_def; } } public final Round_defContext round_def() throws RecognitionException { Round_defContext _localctx = new Round_defContext(_ctx, getState()); enterRule(_localctx, 0, RULE_round_def); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { setState(16); match(T__0); setState(28); _errHandler.sync(this); _la = _input.LA(1); if (_la==IDENTIFIER) { { setState(17); var_def(); setState(22); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,0,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { setState(18); match(T__1); setState(19); var_def(); } } } setState(24); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,0,_ctx); } setState(26); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__1) { { setState(25); match(T__1); } } } } setState(30); match(T__2); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } @SuppressWarnings("CheckReturnValue") public static class Func_defContext extends ParserRuleContext { public List IDENTIFIER() { return getTokens(WystParser.IDENTIFIER); } public TerminalNode IDENTIFIER(int i) { return getToken(WystParser.IDENTIFIER, i); } public Round_defContext round_def() { return getRuleContext(Round_defContext.class,0); } public Code_blockContext code_block() { return getRuleContext(Code_blockContext.class,0); } public Func_defContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_func_def; } } public final Func_defContext func_def() throws RecognitionException { Func_defContext _localctx = new Func_defContext(_ctx, getState()); enterRule(_localctx, 2, RULE_func_def); try { enterOuterAlt(_localctx, 1); { setState(32); match(IDENTIFIER); setState(33); match(IDENTIFIER); setState(34); round_def(); setState(35); code_block(); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } @SuppressWarnings("CheckReturnValue") public static class Var_defContext extends ParserRuleContext { public List IDENTIFIER() { return getTokens(WystParser.IDENTIFIER); } public TerminalNode IDENTIFIER(int i) { return getToken(WystParser.IDENTIFIER, i); } public Var_defContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_var_def; } } public final Var_defContext var_def() throws RecognitionException { Var_defContext _localctx = new Var_defContext(_ctx, getState()); enterRule(_localctx, 4, RULE_var_def); try { enterOuterAlt(_localctx, 1); { setState(37); match(IDENTIFIER); setState(38); match(IDENTIFIER); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } @SuppressWarnings("CheckReturnValue") public static class Var_def_setContext extends ParserRuleContext { public Var_defContext var_def() { return getRuleContext(Var_defContext.class,0); } public ExprContext expr() { return getRuleContext(ExprContext.class,0); } public Var_def_setContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_var_def_set; } } public final Var_def_setContext var_def_set() throws RecognitionException { Var_def_setContext _localctx = new Var_def_setContext(_ctx, getState()); enterRule(_localctx, 6, RULE_var_def_set); try { enterOuterAlt(_localctx, 1); { setState(40); var_def(); setState(41); match(T__3); setState(42); expr(); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } @SuppressWarnings("CheckReturnValue") public static class AsmContext extends ParserRuleContext { public TerminalNode IDENTIFIER() { return getToken(WystParser.IDENTIFIER, 0); } public List expr() { return getRuleContexts(ExprContext.class); } public ExprContext expr(int i) { return getRuleContext(ExprContext.class,i); } public AsmContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_asm; } } public final AsmContext asm() throws RecognitionException { AsmContext _localctx = new AsmContext(_ctx, getState()); enterRule(_localctx, 8, RULE_asm); int _la; try { enterOuterAlt(_localctx, 1); { setState(44); match(T__4); setState(45); match(IDENTIFIER); setState(46); expr(); setState(51); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__1) { { { setState(47); match(T__1); setState(48); expr(); } } setState(53); _errHandler.sync(this); _la = _input.LA(1); } setState(54); match(T__5); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } @SuppressWarnings("CheckReturnValue") public static class ExprContext extends ParserRuleContext { public TerminalNode NUMBER() { return getToken(WystParser.NUMBER, 0); } public TerminalNode HEX() { return getToken(WystParser.HEX, 0); } public TerminalNode IDENTIFIER() { return getToken(WystParser.IDENTIFIER, 0); } public TerminalNode STRING() { return getToken(WystParser.STRING, 0); } public List MATH() { return getTokens(WystParser.MATH); } public TerminalNode MATH(int i) { return getToken(WystParser.MATH, i); } public List expr() { return getRuleContexts(ExprContext.class); } public ExprContext expr(int i) { return getRuleContext(ExprContext.class,i); } public ExprContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_expr; } } public final ExprContext expr() throws RecognitionException { ExprContext _localctx = new ExprContext(_ctx, getState()); enterRule(_localctx, 10, RULE_expr); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { setState(56); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 23552L) != 0)) ) { _errHandler.recoverInline(this); } else { if ( _input.LA(1)==Token.EOF ) matchedEOF = true; _errHandler.reportMatch(this); consume(); } setState(61); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,4,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { setState(57); match(MATH); setState(58); expr(); } } } setState(63); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,4,_ctx); } } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } @SuppressWarnings("CheckReturnValue") public static class Code_blockContext extends ParserRuleContext { public List expr() { return getRuleContexts(ExprContext.class); } public ExprContext expr(int i) { return getRuleContext(ExprContext.class,i); } public List var_def() { return getRuleContexts(Var_defContext.class); } public Var_defContext var_def(int i) { return getRuleContext(Var_defContext.class,i); } public List var_def_set() { return getRuleContexts(Var_def_setContext.class); } public Var_def_setContext var_def_set(int i) { return getRuleContext(Var_def_setContext.class,i); } public Code_blockContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_code_block; } } public final Code_blockContext code_block() throws RecognitionException { Code_blockContext _localctx = new Code_blockContext(_ctx, getState()); enterRule(_localctx, 12, RULE_code_block); int _la; try { enterOuterAlt(_localctx, 1); { setState(64); match(T__6); setState(74); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 23552L) != 0)) { { { setState(68); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,5,_ctx) ) { case 1: { setState(65); expr(); } break; case 2: { setState(66); var_def(); } break; case 3: { setState(67); var_def_set(); } break; } setState(70); match(T__5); } } setState(76); _errHandler.sync(this); _la = _input.LA(1); } setState(77); match(T__7); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } @SuppressWarnings("CheckReturnValue") public static class TopContext extends ParserRuleContext { public List asm() { return getRuleContexts(AsmContext.class); } public AsmContext asm(int i) { return getRuleContext(AsmContext.class,i); } public List func_def() { return getRuleContexts(Func_defContext.class); } public Func_defContext func_def(int i) { return getRuleContext(Func_defContext.class,i); } public TopContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_top; } } public final TopContext top() throws RecognitionException { TopContext _localctx = new TopContext(_ctx, getState()); enterRule(_localctx, 14, RULE_top); int _la; try { enterOuterAlt(_localctx, 1); { setState(83); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__4 || _la==IDENTIFIER) { { setState(81); _errHandler.sync(this); switch (_input.LA(1)) { case T__4: { setState(79); asm(); } break; case IDENTIFIER: { setState(80); func_def(); } break; default: throw new NoViableAltException(this); } } setState(85); _errHandler.sync(this); _la = _input.LA(1); } } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static final String _serializedATN = "\u0004\u0001\u000eW\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\u0001"+ "\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0005\u0000\u0015\b\u0000\n"+ "\u0000\f\u0000\u0018\t\u0000\u0001\u0000\u0003\u0000\u001b\b\u0000\u0003"+ "\u0000\u001d\b\u0000\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0001\u0001"+ "\u0001\u0001\u0001\u0001\u0001\u0001\u0002\u0001\u0002\u0001\u0002\u0001"+ "\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0004\u0001\u0004\u0001"+ "\u0004\u0001\u0004\u0001\u0004\u0005\u00042\b\u0004\n\u0004\f\u00045\t"+ "\u0004\u0001\u0004\u0001\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0005"+ "\u0005<\b\u0005\n\u0005\f\u0005?\t\u0005\u0001\u0006\u0001\u0006\u0001"+ "\u0006\u0001\u0006\u0003\u0006E\b\u0006\u0001\u0006\u0001\u0006\u0005"+ "\u0006I\b\u0006\n\u0006\f\u0006L\t\u0006\u0001\u0006\u0001\u0006\u0001"+ "\u0007\u0001\u0007\u0005\u0007R\b\u0007\n\u0007\f\u0007U\t\u0007\u0001"+ "\u0007\u0000\u0000\b\u0000\u0002\u0004\u0006\b\n\f\u000e\u0000\u0001\u0002"+ "\u0000\n\f\u000e\u000eX\u0000\u0010\u0001\u0000\u0000\u0000\u0002 \u0001"+ "\u0000\u0000\u0000\u0004%\u0001\u0000\u0000\u0000\u0006(\u0001\u0000\u0000"+ "\u0000\b,\u0001\u0000\u0000\u0000\n8\u0001\u0000\u0000\u0000\f@\u0001"+ "\u0000\u0000\u0000\u000eS\u0001\u0000\u0000\u0000\u0010\u001c\u0005\u0001"+ "\u0000\u0000\u0011\u0016\u0003\u0004\u0002\u0000\u0012\u0013\u0005\u0002"+ "\u0000\u0000\u0013\u0015\u0003\u0004\u0002\u0000\u0014\u0012\u0001\u0000"+ "\u0000\u0000\u0015\u0018\u0001\u0000\u0000\u0000\u0016\u0014\u0001\u0000"+ "\u0000\u0000\u0016\u0017\u0001\u0000\u0000\u0000\u0017\u001a\u0001\u0000"+ "\u0000\u0000\u0018\u0016\u0001\u0000\u0000\u0000\u0019\u001b\u0005\u0002"+ "\u0000\u0000\u001a\u0019\u0001\u0000\u0000\u0000\u001a\u001b\u0001\u0000"+ "\u0000\u0000\u001b\u001d\u0001\u0000\u0000\u0000\u001c\u0011\u0001\u0000"+ "\u0000\u0000\u001c\u001d\u0001\u0000\u0000\u0000\u001d\u001e\u0001\u0000"+ "\u0000\u0000\u001e\u001f\u0005\u0003\u0000\u0000\u001f\u0001\u0001\u0000"+ "\u0000\u0000 !\u0005\f\u0000\u0000!\"\u0005\f\u0000\u0000\"#\u0003\u0000"+ "\u0000\u0000#$\u0003\f\u0006\u0000$\u0003\u0001\u0000\u0000\u0000%&\u0005"+ "\f\u0000\u0000&\'\u0005\f\u0000\u0000\'\u0005\u0001\u0000\u0000\u0000"+ "()\u0003\u0004\u0002\u0000)*\u0005\u0004\u0000\u0000*+\u0003\n\u0005\u0000"+ "+\u0007\u0001\u0000\u0000\u0000,-\u0005\u0005\u0000\u0000-.\u0005\f\u0000"+ "\u0000.3\u0003\n\u0005\u0000/0\u0005\u0002\u0000\u000002\u0003\n\u0005"+ "\u00001/\u0001\u0000\u0000\u000025\u0001\u0000\u0000\u000031\u0001\u0000"+ "\u0000\u000034\u0001\u0000\u0000\u000046\u0001\u0000\u0000\u000053\u0001"+ "\u0000\u0000\u000067\u0005\u0006\u0000\u00007\t\u0001\u0000\u0000\u0000"+ "8=\u0007\u0000\u0000\u00009:\u0005\r\u0000\u0000:<\u0003\n\u0005\u0000"+ ";9\u0001\u0000\u0000\u0000\u0001\u0000\u0000\u0000>\u000b\u0001\u0000\u0000\u0000?=\u0001"+ "\u0000\u0000\u0000@J\u0005\u0007\u0000\u0000AE\u0003\n\u0005\u0000BE\u0003"+ "\u0004\u0002\u0000CE\u0003\u0006\u0003\u0000DA\u0001\u0000\u0000\u0000"+ "DB\u0001\u0000\u0000\u0000DC\u0001\u0000\u0000\u0000EF\u0001\u0000\u0000"+ "\u0000FG\u0005\u0006\u0000\u0000GI\u0001\u0000\u0000\u0000HD\u0001\u0000"+ "\u0000\u0000IL\u0001\u0000\u0000\u0000JH\u0001\u0000\u0000\u0000JK\u0001"+ "\u0000\u0000\u0000KM\u0001\u0000\u0000\u0000LJ\u0001\u0000\u0000\u0000"+ "MN\u0005\b\u0000\u0000N\r\u0001\u0000\u0000\u0000OR\u0003\b\u0004\u0000"+ "PR\u0003\u0002\u0001\u0000QO\u0001\u0000\u0000\u0000QP\u0001\u0000\u0000"+ "\u0000RU\u0001\u0000\u0000\u0000SQ\u0001\u0000\u0000\u0000ST\u0001\u0000"+ "\u0000\u0000T\u000f\u0001\u0000\u0000\u0000US\u0001\u0000\u0000\u0000"+ "\t\u0016\u001a\u001c3=DJQS"; 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); } } }