Files
pdp7-unix/pdp7parse/src/main/java/com/khubla/pdp7parse/antlr4/pdp7Parser.java
T

1302 lines
40 KiB
Java

// Generated from com/khubla/pdp7parse/antlr4/pdp7.g4 by ANTLR 4.5
package com.khubla.pdp7parse.antlr4;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.misc.*;
import org.antlr.v4.runtime.tree.*;
import java.util.List;
import java.util.Iterator;
import java.util.ArrayList;
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class pdp7Parser extends Parser {
static { RuntimeMetaData.checkVersion("4.5", 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, T__8=9,
T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17,
T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, T__23=24,
T__24=25, T__25=26, T__26=27, T__27=28, T__28=29, T__29=30, T__30=31,
T__31=32, T__32=33, T__33=34, T__34=35, T__35=36, T__36=37, T__37=38,
T__38=39, T__39=40, T__40=41, T__41=42, T__42=43, T__43=44, T__44=45,
T__45=46, T__46=47, T__47=48, T__48=49, T__49=50, T__50=51, T__51=52,
T__52=53, T__53=54, T__54=55, T__55=56, T__56=57, T__57=58, T__58=59,
T__59=60, T__60=61, T__61=62, T__62=63, T__63=64, T__64=65, T__65=66,
T__66=67, T__67=68, T__68=69, T__69=70, T__70=71, T__71=72, T__72=73,
T__73=74, T__74=75, T__75=76, T__76=77, T__77=78, T__78=79, T__79=80,
T__80=81, T__81=82, T__82=83, T__83=84, T__84=85, T__85=86, T__86=87,
T__87=88, T__88=89, T__89=90, T__90=91, T__91=92, T__92=93, T__93=94,
LOC=95, RELOC=96, PLUS=97, MINUS=98, TIMES=99, DIV=100, LABEL=101, IDENTIFIER=102,
NUMERIC_LITERAL=103, DECIMAL=104, OCTAL=105, DECIMAL_MINUS=106, STRING=107,
COMMENT=108, EOL=109, WS=110;
public static final int
RULE_prog = 0, RULE_line = 1, RULE_lineeol = 2, RULE_declarations = 3,
RULE_declaration = 4, RULE_instruction = 5, RULE_argument = 6, RULE_assignment = 7,
RULE_expression = 8, RULE_multiplyingExpression = 9, RULE_atom = 10, RULE_string = 11,
RULE_eol = 12, RULE_comment = 13, RULE_label = 14, RULE_variable = 15,
RULE_opcode = 16;
public static final String[] ruleNames = {
"prog", "line", "lineeol", "declarations", "declaration", "instruction",
"argument", "assignment", "expression", "multiplyingExpression", "atom",
"string", "eol", "comment", "label", "variable", "opcode"
};
private static final String[] _LITERAL_NAMES = {
null, "';'", "'='", "'>'", "'dac'", "'jms'", "'dzm'", "'lac'", "'xor'",
"'add'", "'tad'", "'xct'", "'isz'", "'and'", "'sad'", "'jmp'", "'nop'",
"'law'", "'cma'", "'las'", "'ral'", "'rar'", "'hlt'", "'sma'", "'sza'",
"'snl'", "'skp'", "'sna'", "'szl'", "'rtl'", "'rtr'", "'cil'", "'rcl'",
"'rcr'", "'cia'", "'lrs'", "'lrss'", "'lls'", "'llss'", "'als'", "'alss'",
"'mul'", "'idiv'", "'lacq'", "'clq'", "'omq'", "'cmq'", "'lmq'", "'dscs'",
"'dslw'", "'dslm'", "'dsld'", "'dsls'", "'dssf'", "'dsrs'", "'iof'", "'ion'",
"'caf'", "'clon'", "'clsf'", "'clof'", "'ksf'", "'krb'", "'tsf'", "'tcf'",
"'tls'", "'sck'", "'cck'", "'lck'", "'rsf'", "'rsa'", "'rrb'", "'psf'",
"'pcf'", "'psa'", "'cdf'", "'rlpd'", "'lda'", "'wcga'", "'raef'", "'beg'",
"'spb'", "'cpb'", "'lpb'", "'wbl'", "'dprs'", "'dpsf'", "'dpcf'", "'dprc'",
"'crsf'", "'crrb'", "'sys'", "'czm'", "'irss'", "'dsm'", "'.'", "'..'",
"'+'", "'-'", "'*'", "'/'"
};
private static final String[] _SYMBOLIC_NAMES = {
null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, "LOC",
"RELOC", "PLUS", "MINUS", "TIMES", "DIV", "LABEL", "IDENTIFIER", "NUMERIC_LITERAL",
"DECIMAL", "OCTAL", "DECIMAL_MINUS", "STRING", "COMMENT", "EOL", "WS"
};
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 "pdp7.g4"; }
@Override
public String[] getRuleNames() { return ruleNames; }
@Override
public String getSerializedATN() { return _serializedATN; }
@Override
public ATN getATN() { return _ATN; }
public pdp7Parser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
public static class ProgContext extends ParserRuleContext {
public TerminalNode EOF() { return getToken(pdp7Parser.EOF, 0); }
public List<LineeolContext> lineeol() {
return getRuleContexts(LineeolContext.class);
}
public LineeolContext lineeol(int i) {
return getRuleContext(LineeolContext.class,i);
}
public LineContext line() {
return getRuleContext(LineContext.class,0);
}
public ProgContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_prog; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterProg(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitProg(this);
}
}
public final ProgContext prog() throws RecognitionException {
ProgContext _localctx = new ProgContext(_ctx, getState());
enterRule(_localctx, 0, RULE_prog);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(35);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
setState(34);
lineeol();
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(37);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,0,_ctx);
} while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
setState(40);
switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) {
case 1:
{
setState(39);
line();
}
break;
}
setState(42);
match(EOF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class LineContext extends ParserRuleContext {
public DeclarationsContext declarations() {
return getRuleContext(DeclarationsContext.class,0);
}
public CommentContext comment() {
return getRuleContext(CommentContext.class,0);
}
public LineContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_line; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterLine(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitLine(this);
}
}
public final LineContext line() throws RecognitionException {
LineContext _localctx = new LineContext(_ctx, getState());
enterRule(_localctx, 2, RULE_line);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(45);
switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) {
case 1:
{
setState(44);
declarations();
}
break;
}
setState(48);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(47);
comment();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class LineeolContext extends ParserRuleContext {
public LineContext line() {
return getRuleContext(LineContext.class,0);
}
public EolContext eol() {
return getRuleContext(EolContext.class,0);
}
public LineeolContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_lineeol; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterLineeol(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitLineeol(this);
}
}
public final LineeolContext lineeol() throws RecognitionException {
LineeolContext _localctx = new LineeolContext(_ctx, getState());
enterRule(_localctx, 4, RULE_lineeol);
try {
enterOuterAlt(_localctx, 1);
{
setState(50);
line();
setState(51);
eol();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class DeclarationsContext extends ParserRuleContext {
public List<DeclarationContext> declaration() {
return getRuleContexts(DeclarationContext.class);
}
public DeclarationContext declaration(int i) {
return getRuleContext(DeclarationContext.class,i);
}
public DeclarationsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_declarations; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterDeclarations(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitDeclarations(this);
}
}
public final DeclarationsContext declarations() throws RecognitionException {
DeclarationsContext _localctx = new DeclarationsContext(_ctx, getState());
enterRule(_localctx, 6, RULE_declarations);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(53);
declaration();
setState(58);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__0) {
{
{
setState(54);
match(T__0);
setState(55);
declaration();
}
}
setState(60);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class DeclarationContext extends ParserRuleContext {
public List<LabelContext> label() {
return getRuleContexts(LabelContext.class);
}
public LabelContext label(int i) {
return getRuleContext(LabelContext.class,i);
}
public List<InstructionContext> instruction() {
return getRuleContexts(InstructionContext.class);
}
public InstructionContext instruction(int i) {
return getRuleContext(InstructionContext.class,i);
}
public List<AssignmentContext> assignment() {
return getRuleContexts(AssignmentContext.class);
}
public AssignmentContext assignment(int i) {
return getRuleContext(AssignmentContext.class,i);
}
public List<ExpressionContext> expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public DeclarationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_declaration; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterDeclaration(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitDeclaration(this);
}
}
public final DeclarationContext declaration() throws RecognitionException {
DeclarationContext _localctx = new DeclarationContext(_ctx, getState());
enterRule(_localctx, 8, RULE_declaration);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(64);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==LABEL) {
{
{
setState(61);
label();
}
}
setState(66);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(72);
_errHandler.sync(this);
_la = _input.LA(1);
while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__3) | (1L << T__4) | (1L << T__5) | (1L << T__6) | (1L << T__7) | (1L << T__8) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__12) | (1L << T__13) | (1L << T__14) | (1L << T__15) | (1L << T__16) | (1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << T__31) | (1L << T__32) | (1L << T__33) | (1L << T__34) | (1L << T__35) | (1L << T__36) | (1L << T__37) | (1L << T__38) | (1L << T__39) | (1L << T__40) | (1L << T__41) | (1L << T__42) | (1L << T__43) | (1L << T__44) | (1L << T__45) | (1L << T__46) | (1L << T__47) | (1L << T__48) | (1L << T__49) | (1L << T__50) | (1L << T__51) | (1L << T__52) | (1L << T__53) | (1L << T__54) | (1L << T__55) | (1L << T__56) | (1L << T__57) | (1L << T__58) | (1L << T__59) | (1L << T__60) | (1L << T__61) | (1L << T__62))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (T__63 - 64)) | (1L << (T__64 - 64)) | (1L << (T__65 - 64)) | (1L << (T__66 - 64)) | (1L << (T__67 - 64)) | (1L << (T__68 - 64)) | (1L << (T__69 - 64)) | (1L << (T__70 - 64)) | (1L << (T__71 - 64)) | (1L << (T__72 - 64)) | (1L << (T__73 - 64)) | (1L << (T__74 - 64)) | (1L << (T__75 - 64)) | (1L << (T__76 - 64)) | (1L << (T__77 - 64)) | (1L << (T__78 - 64)) | (1L << (T__79 - 64)) | (1L << (T__80 - 64)) | (1L << (T__81 - 64)) | (1L << (T__82 - 64)) | (1L << (T__83 - 64)) | (1L << (T__84 - 64)) | (1L << (T__85 - 64)) | (1L << (T__86 - 64)) | (1L << (T__87 - 64)) | (1L << (T__88 - 64)) | (1L << (T__89 - 64)) | (1L << (T__90 - 64)) | (1L << (T__91 - 64)) | (1L << (T__92 - 64)) | (1L << (T__93 - 64)) | (1L << (LOC - 64)) | (1L << (RELOC - 64)) | (1L << (MINUS - 64)) | (1L << (IDENTIFIER - 64)) | (1L << (NUMERIC_LITERAL - 64)) | (1L << (DECIMAL - 64)) | (1L << (OCTAL - 64)) | (1L << (DECIMAL_MINUS - 64)) | (1L << (STRING - 64)))) != 0)) {
{
setState(70);
switch ( getInterpreter().adaptivePredict(_input,6,_ctx) ) {
case 1:
{
setState(67);
instruction();
}
break;
case 2:
{
setState(68);
assignment();
}
break;
case 3:
{
setState(69);
expression();
}
break;
}
}
setState(74);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class InstructionContext extends ParserRuleContext {
public OpcodeContext opcode() {
return getRuleContext(OpcodeContext.class,0);
}
public List<ArgumentContext> argument() {
return getRuleContexts(ArgumentContext.class);
}
public ArgumentContext argument(int i) {
return getRuleContext(ArgumentContext.class,i);
}
public InstructionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_instruction; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterInstruction(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitInstruction(this);
}
}
public final InstructionContext instruction() throws RecognitionException {
InstructionContext _localctx = new InstructionContext(_ctx, getState());
enterRule(_localctx, 10, RULE_instruction);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(75);
opcode();
setState(79);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,8,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(76);
argument();
}
}
}
setState(81);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,8,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ArgumentContext extends ParserRuleContext {
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public ArgumentContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_argument; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterArgument(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitArgument(this);
}
}
public final ArgumentContext argument() throws RecognitionException {
ArgumentContext _localctx = new ArgumentContext(_ctx, getState());
enterRule(_localctx, 12, RULE_argument);
try {
enterOuterAlt(_localctx, 1);
{
setState(82);
expression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class AssignmentContext extends ParserRuleContext {
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public OpcodeContext opcode() {
return getRuleContext(OpcodeContext.class,0);
}
public VariableContext variable() {
return getRuleContext(VariableContext.class,0);
}
public TerminalNode LOC() { return getToken(pdp7Parser.LOC, 0); }
public TerminalNode RELOC() { return getToken(pdp7Parser.RELOC, 0); }
public AssignmentContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_assignment; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterAssignment(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitAssignment(this);
}
}
public final AssignmentContext assignment() throws RecognitionException {
AssignmentContext _localctx = new AssignmentContext(_ctx, getState());
enterRule(_localctx, 14, RULE_assignment);
try {
enterOuterAlt(_localctx, 1);
{
setState(88);
switch (_input.LA(1)) {
case T__3:
case T__4:
case T__5:
case T__6:
case T__7:
case T__8:
case T__9:
case T__10:
case T__11:
case T__12:
case T__13:
case T__14:
case T__15:
case T__16:
case T__17:
case T__18:
case T__19:
case T__20:
case T__21:
case T__22:
case T__23:
case T__24:
case T__25:
case T__26:
case T__27:
case T__28:
case T__29:
case T__30:
case T__31:
case T__32:
case T__33:
case T__34:
case T__35:
case T__36:
case T__37:
case T__38:
case T__39:
case T__40:
case T__41:
case T__42:
case T__43:
case T__44:
case T__45:
case T__46:
case T__47:
case T__48:
case T__49:
case T__50:
case T__51:
case T__52:
case T__53:
case T__54:
case T__55:
case T__56:
case T__57:
case T__58:
case T__59:
case T__60:
case T__61:
case T__62:
case T__63:
case T__64:
case T__65:
case T__66:
case T__67:
case T__68:
case T__69:
case T__70:
case T__71:
case T__72:
case T__73:
case T__74:
case T__75:
case T__76:
case T__77:
case T__78:
case T__79:
case T__80:
case T__81:
case T__82:
case T__83:
case T__84:
case T__85:
case T__86:
case T__87:
case T__88:
case T__89:
case T__90:
case T__91:
case T__92:
case T__93:
{
setState(84);
opcode();
}
break;
case IDENTIFIER:
{
setState(85);
variable();
}
break;
case LOC:
{
setState(86);
match(LOC);
}
break;
case RELOC:
{
setState(87);
match(RELOC);
}
break;
default:
throw new NoViableAltException(this);
}
setState(90);
match(T__1);
setState(91);
expression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ExpressionContext extends ParserRuleContext {
public List<MultiplyingExpressionContext> multiplyingExpression() {
return getRuleContexts(MultiplyingExpressionContext.class);
}
public MultiplyingExpressionContext multiplyingExpression(int i) {
return getRuleContext(MultiplyingExpressionContext.class,i);
}
public List<TerminalNode> PLUS() { return getTokens(pdp7Parser.PLUS); }
public TerminalNode PLUS(int i) {
return getToken(pdp7Parser.PLUS, i);
}
public List<TerminalNode> MINUS() { return getTokens(pdp7Parser.MINUS); }
public TerminalNode MINUS(int i) {
return getToken(pdp7Parser.MINUS, i);
}
public ExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_expression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitExpression(this);
}
}
public final ExpressionContext expression() throws RecognitionException {
ExpressionContext _localctx = new ExpressionContext(_ctx, getState());
enterRule(_localctx, 16, RULE_expression);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(93);
multiplyingExpression();
setState(98);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,10,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(94);
_la = _input.LA(1);
if ( !(_la==PLUS || _la==MINUS) ) {
_errHandler.recoverInline(this);
} else {
consume();
}
setState(95);
multiplyingExpression();
}
}
}
setState(100);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,10,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class MultiplyingExpressionContext extends ParserRuleContext {
public List<AtomContext> atom() {
return getRuleContexts(AtomContext.class);
}
public AtomContext atom(int i) {
return getRuleContext(AtomContext.class,i);
}
public List<TerminalNode> TIMES() { return getTokens(pdp7Parser.TIMES); }
public TerminalNode TIMES(int i) {
return getToken(pdp7Parser.TIMES, i);
}
public List<TerminalNode> DIV() { return getTokens(pdp7Parser.DIV); }
public TerminalNode DIV(int i) {
return getToken(pdp7Parser.DIV, i);
}
public MultiplyingExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_multiplyingExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterMultiplyingExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitMultiplyingExpression(this);
}
}
public final MultiplyingExpressionContext multiplyingExpression() throws RecognitionException {
MultiplyingExpressionContext _localctx = new MultiplyingExpressionContext(_ctx, getState());
enterRule(_localctx, 18, RULE_multiplyingExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(101);
atom();
setState(106);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==TIMES || _la==DIV) {
{
{
setState(102);
_la = _input.LA(1);
if ( !(_la==TIMES || _la==DIV) ) {
_errHandler.recoverInline(this);
} else {
consume();
}
setState(103);
atom();
}
}
setState(108);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class AtomContext extends ParserRuleContext {
public VariableContext variable() {
return getRuleContext(VariableContext.class,0);
}
public TerminalNode LOC() { return getToken(pdp7Parser.LOC, 0); }
public TerminalNode RELOC() { return getToken(pdp7Parser.RELOC, 0); }
public StringContext string() {
return getRuleContext(StringContext.class,0);
}
public TerminalNode DECIMAL() { return getToken(pdp7Parser.DECIMAL, 0); }
public TerminalNode DECIMAL_MINUS() { return getToken(pdp7Parser.DECIMAL_MINUS, 0); }
public TerminalNode OCTAL() { return getToken(pdp7Parser.OCTAL, 0); }
public TerminalNode NUMERIC_LITERAL() { return getToken(pdp7Parser.NUMERIC_LITERAL, 0); }
public AtomContext atom() {
return getRuleContext(AtomContext.class,0);
}
public AtomContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_atom; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitAtom(this);
}
}
public final AtomContext atom() throws RecognitionException {
AtomContext _localctx = new AtomContext(_ctx, getState());
enterRule(_localctx, 20, RULE_atom);
try {
setState(119);
switch (_input.LA(1)) {
case IDENTIFIER:
enterOuterAlt(_localctx, 1);
{
setState(109);
variable();
}
break;
case LOC:
enterOuterAlt(_localctx, 2);
{
setState(110);
match(LOC);
}
break;
case RELOC:
enterOuterAlt(_localctx, 3);
{
setState(111);
match(RELOC);
}
break;
case STRING:
enterOuterAlt(_localctx, 4);
{
setState(112);
string();
}
break;
case DECIMAL:
enterOuterAlt(_localctx, 5);
{
setState(113);
match(DECIMAL);
}
break;
case DECIMAL_MINUS:
enterOuterAlt(_localctx, 6);
{
setState(114);
match(DECIMAL_MINUS);
}
break;
case OCTAL:
enterOuterAlt(_localctx, 7);
{
setState(115);
match(OCTAL);
}
break;
case NUMERIC_LITERAL:
enterOuterAlt(_localctx, 8);
{
setState(116);
match(NUMERIC_LITERAL);
}
break;
case MINUS:
enterOuterAlt(_localctx, 9);
{
setState(117);
match(MINUS);
setState(118);
atom();
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class StringContext extends ParserRuleContext {
public TerminalNode STRING() { return getToken(pdp7Parser.STRING, 0); }
public List<TerminalNode> NUMERIC_LITERAL() { return getTokens(pdp7Parser.NUMERIC_LITERAL); }
public TerminalNode NUMERIC_LITERAL(int i) {
return getToken(pdp7Parser.NUMERIC_LITERAL, i);
}
public StringContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_string; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterString(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitString(this);
}
}
public final StringContext string() throws RecognitionException {
StringContext _localctx = new StringContext(_ctx, getState());
enterRule(_localctx, 22, RULE_string);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(121);
match(STRING);
setState(125);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,13,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(122);
match(NUMERIC_LITERAL);
}
}
}
setState(127);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,13,_ctx);
}
setState(129);
_la = _input.LA(1);
if (_la==T__2) {
{
setState(128);
match(T__2);
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class EolContext extends ParserRuleContext {
public TerminalNode EOL() { return getToken(pdp7Parser.EOL, 0); }
public EolContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_eol; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterEol(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitEol(this);
}
}
public final EolContext eol() throws RecognitionException {
EolContext _localctx = new EolContext(_ctx, getState());
enterRule(_localctx, 24, RULE_eol);
try {
enterOuterAlt(_localctx, 1);
{
setState(131);
match(EOL);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class CommentContext extends ParserRuleContext {
public TerminalNode COMMENT() { return getToken(pdp7Parser.COMMENT, 0); }
public CommentContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_comment; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterComment(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitComment(this);
}
}
public final CommentContext comment() throws RecognitionException {
CommentContext _localctx = new CommentContext(_ctx, getState());
enterRule(_localctx, 26, RULE_comment);
try {
enterOuterAlt(_localctx, 1);
{
setState(133);
match(COMMENT);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class LabelContext extends ParserRuleContext {
public TerminalNode LABEL() { return getToken(pdp7Parser.LABEL, 0); }
public LabelContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_label; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterLabel(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitLabel(this);
}
}
public final LabelContext label() throws RecognitionException {
LabelContext _localctx = new LabelContext(_ctx, getState());
enterRule(_localctx, 28, RULE_label);
try {
enterOuterAlt(_localctx, 1);
{
setState(135);
match(LABEL);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class VariableContext extends ParserRuleContext {
public TerminalNode IDENTIFIER() { return getToken(pdp7Parser.IDENTIFIER, 0); }
public VariableContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_variable; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterVariable(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitVariable(this);
}
}
public final VariableContext variable() throws RecognitionException {
VariableContext _localctx = new VariableContext(_ctx, getState());
enterRule(_localctx, 30, RULE_variable);
try {
enterOuterAlt(_localctx, 1);
{
setState(137);
match(IDENTIFIER);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class OpcodeContext extends ParserRuleContext {
public OpcodeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_opcode; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).enterOpcode(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof pdp7Listener ) ((pdp7Listener)listener).exitOpcode(this);
}
}
public final OpcodeContext opcode() throws RecognitionException {
OpcodeContext _localctx = new OpcodeContext(_ctx, getState());
enterRule(_localctx, 32, RULE_opcode);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(139);
_la = _input.LA(1);
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__3) | (1L << T__4) | (1L << T__5) | (1L << T__6) | (1L << T__7) | (1L << T__8) | (1L << T__9) | (1L << T__10) | (1L << T__11) | (1L << T__12) | (1L << T__13) | (1L << T__14) | (1L << T__15) | (1L << T__16) | (1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << T__31) | (1L << T__32) | (1L << T__33) | (1L << T__34) | (1L << T__35) | (1L << T__36) | (1L << T__37) | (1L << T__38) | (1L << T__39) | (1L << T__40) | (1L << T__41) | (1L << T__42) | (1L << T__43) | (1L << T__44) | (1L << T__45) | (1L << T__46) | (1L << T__47) | (1L << T__48) | (1L << T__49) | (1L << T__50) | (1L << T__51) | (1L << T__52) | (1L << T__53) | (1L << T__54) | (1L << T__55) | (1L << T__56) | (1L << T__57) | (1L << T__58) | (1L << T__59) | (1L << T__60) | (1L << T__61) | (1L << T__62))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (T__63 - 64)) | (1L << (T__64 - 64)) | (1L << (T__65 - 64)) | (1L << (T__66 - 64)) | (1L << (T__67 - 64)) | (1L << (T__68 - 64)) | (1L << (T__69 - 64)) | (1L << (T__70 - 64)) | (1L << (T__71 - 64)) | (1L << (T__72 - 64)) | (1L << (T__73 - 64)) | (1L << (T__74 - 64)) | (1L << (T__75 - 64)) | (1L << (T__76 - 64)) | (1L << (T__77 - 64)) | (1L << (T__78 - 64)) | (1L << (T__79 - 64)) | (1L << (T__80 - 64)) | (1L << (T__81 - 64)) | (1L << (T__82 - 64)) | (1L << (T__83 - 64)) | (1L << (T__84 - 64)) | (1L << (T__85 - 64)) | (1L << (T__86 - 64)) | (1L << (T__87 - 64)) | (1L << (T__88 - 64)) | (1L << (T__89 - 64)) | (1L << (T__90 - 64)) | (1L << (T__91 - 64)) | (1L << (T__92 - 64)) | (1L << (T__93 - 64)))) != 0)) ) {
_errHandler.recoverInline(this);
} else {
consume();
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static final String _serializedATN =
"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3p\u0090\4\2\t\2\4"+
"\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t"+
"\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+
"\3\2\6\2&\n\2\r\2\16\2\'\3\2\5\2+\n\2\3\2\3\2\3\3\5\3\60\n\3\3\3\5\3\63"+
"\n\3\3\4\3\4\3\4\3\5\3\5\3\5\7\5;\n\5\f\5\16\5>\13\5\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u0087\u0088\7n\2\2\u0088\35\3\2"+
"\2\2\u0089\u008a\7g\2\2\u008a\37\3\2\2\2\u008b\u008c\7h\2\2\u008c!\3\2"+
"\2\2\u008d\u008e\t\4\2\2\u008e#\3\2\2\2\21\'*/\62<BHJQZdly\177\u0083";
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);
}
}
}