// $ANTLR 2.7.7 (2006-11-01): "cp51.g" -> "Ob51Parser.cs"$ namespace Ob51.Parsing { // Generate the header common to all output files. using System; using TokenBuffer = antlr.TokenBuffer; using TokenStreamException = antlr.TokenStreamException; using TokenStreamIOException = antlr.TokenStreamIOException; using ANTLRException = antlr.ANTLRException; using LLkParser = antlr.LLkParser; using Token = antlr.Token; using IToken = antlr.IToken; using TokenStream = antlr.TokenStream; using RecognitionException = antlr.RecognitionException; using NoViableAltException = antlr.NoViableAltException; using MismatchedTokenException = antlr.MismatchedTokenException; using SemanticException = antlr.SemanticException; using ParserSharedInputState = antlr.ParserSharedInputState; using BitSet = antlr.collections.impl.BitSet; /*************************** SYNTAX ANALISYS ***************************/ public class Ob51Parser : antlr.LLkParser { public const int EOF = 1; public const int NULL_TREE_LOOKAHEAD = 3; public const int BOOLEAN = 4; public const int SHORTCHAR = 5; public const int CHAR = 6; public const int BYTE = 7; public const int SHORTINT = 8; public const int INTEGER = 9; public const int LONGINT = 10; public const int SHORTREAL = 11; public const int REAL = 12; public const int SET = 13; public const int MODULEID = 14; public const int WS = 15; public const int COMMENTTEXT = 16; public const int COMMENT = 17; public const int DIGIT = 18; public const int HEXDIGIT = 19; public const int LETTER = 20; public const int ID = 21; public const int SCALEFACTOR = 22; public const int NUM_VALUE = 23; public const int STRING = 24; public const int PUNCTUATION = 25; public const int LITERAL_MODULE = 26; // ";" = 27 public const int LITERAL_BEGIN = 28; public const int LITERAL_CLOSE = 29; public const int LITERAL_END = 30; // "." = 31 public const int LITERAL_IMPORT = 32; // ":=" = 33 // "*" = 34 // "-" = 35 public const int LITERAL_CONST = 36; public const int LITERAL_TYPE = 37; public const int LITERAL_VAR = 38; // "=" = 39 // ":" = 40 public const int LITERAL_AT = 41; // "," = 42 public const int LITERAL_PROCEDURE = 43; // "^" = 44 // "(" = 45 // ")" = 46 public const int LITERAL_IN = 47; public const int LITERAL_OUT = 48; public const int LITERAL_NEW = 49; public const int LITERAL_ABSTRACT = 50; public const int LITERAL_EMPTY = 51; public const int LITERAL_EXTENSIBLE = 52; public const int LITERAL_HANDLER = 53; public const int LITERAL_OF = 54; public const int LITERAL_ARRAY = 55; public const int LITERAL_LIMITED = 56; public const int LITERAL_RECORD = 57; public const int LITERAL_POINTER = 58; public const int LITERAL_TO = 59; public const int LITERAL_IF = 60; public const int LITERAL_THEN = 61; public const int LITERAL_ELSIF = 62; public const int LITERAL_ELSE = 63; public const int LITERAL_CASE = 64; // "|" = 65 public const int LITERAL_WHILE = 66; public const int LITERAL_DO = 67; public const int LITERAL_REPEAT = 68; public const int LITERAL_UNTIL = 69; public const int LITERAL_FOR = 70; public const int TYPE = 71; public const int LITERAL_BY = 72; public const int LITERAL_LOOP = 73; public const int LITERAL_WITH = 74; public const int LITERAL_EXIT = 75; public const int LITERAL_RETURN = 76; // ".." = 77 // "#" = 78 // "<" = 79 // "<=" = 80 // ">" = 81 // ">=" = 82 public const int LITERAL_IS = 83; // "+" = 84 public const int LITERAL_OR = 85; // "/" = 86 public const int LITERAL_DIV = 87; public const int LITERAL_MOD = 88; // "&" = 89 public const int NUMBER = 90; public const int CHARACTER = 91; public const int LITERAL_NIL = 92; // "~" = 93 // "{" = 94 // "}" = 95 // "[" = 96 // "]" = 97 // "$" = 98 protected void initialize() { tokenNames = tokenNames_; } protected Ob51Parser(TokenBuffer tokenBuf, int k) : base(tokenBuf, k) { initialize(); } public Ob51Parser(TokenBuffer tokenBuf) : this(tokenBuf,2) { } protected Ob51Parser(TokenStream lexer, int k) : base(lexer,k) { initialize(); } public Ob51Parser(TokenStream lexer) : this(lexer,2) { } public Ob51Parser(ParserSharedInputState state) : base(state,2) { initialize(); } public void module( out Module module ) //throws RecognitionException, TokenStreamException { IToken id_ = null; ImportList importList_; DeclSeq declsSeq_; StatSeq beginSeq_, endSeq_; try { // for error handling match(LITERAL_MODULE); id_ = LT(1); match(ID); match(27); { switch ( LA(1) ) { case LITERAL_IMPORT: { importList(out _importList); break; } case LITERAL_BEGIN: case LITERAL_CLOSE: case LITERAL_END: case LITERAL_CONST: case LITERAL_TYPE: case LITERAL_VAR: case LITERAL_PROCEDURE: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } declsSeq(out _declsSeq); { switch ( LA(1) ) { case LITERAL_BEGIN: { match(LITERAL_BEGIN); statementsSeq(out _beginSeq); break; } case LITERAL_CLOSE: case LITERAL_END: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } { switch ( LA(1) ) { case LITERAL_CLOSE: { match(LITERAL_CLOSE); statementsSeq(out _endSeq); break; } case LITERAL_END: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } module = new Module(new ID(id_.GetText()), _importList, _declsSeq, _beginSeq, _endSeq); match(LITERAL_END); match(ID); match(31); match(Token.EOF_TYPE); } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_0_); } } public void importList( out ImportList importList ) //throws RecognitionException, TokenStreamException { IToken id1_ = null; IToken id2_ = null; importList = new ImportList(); string nick_ = null, name_; try { // for error handling match(LITERAL_IMPORT); { // ( ... )+ int _cnt67=0; for (;;) { if ((LA(1)==ID)) { { if ((LA(1)==ID) && (LA(2)==33)) { id1_ = LT(1); match(ID); match(33); nick = id1_.GetText(); } else if ((LA(1)==ID) && (LA(2)==ID||LA(2)==27)) { } else { throw new NoViableAltException(LT(1), getFilename()); } } id2_ = LT(1); match(ID); name = id2_.GetText(); } else { if (_cnt67 >= 1) { goto _loop67_breakloop; } else { throw new NoViableAltException(LT(1), getFilename());; } } _cnt67++; } _loop67_breakloop: ; } // ( ... )+ match(27); importList.AddItem(name_, nick_); } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_1_); } } public void declsSeq( out DeclSeq declsSeq ) //throws RecognitionException, TokenStreamException { declsSeq = new DeclSeq(); try { // for error handling { // ( ... )* for (;;) { switch ( LA(1) ) { case LITERAL_CONST: { ConstDecl constDecl_; match(LITERAL_CONST); { // ( ... )* for (;;) { if ((LA(1)==ID)) { constDecl(out constDecl_); declsSeq.AddItem(constDecl); } else { goto _loop73_breakloop; } } _loop73_breakloop: ; } // ( ... )* break; } case LITERAL_TYPE: { TypeDecl typeDecl_; match(LITERAL_TYPE); { // ( ... )* for (;;) { if ((LA(1)==ID)) { typeDecl(out typeDecl_); declsSeq.AddItem(typeDecl_); } else { goto _loop75_breakloop; } } _loop75_breakloop: ; } // ( ... )* break; } case LITERAL_VAR: { VarDecl varDecl_; match(LITERAL_VAR); { // ( ... )* for (;;) { if ((LA(1)==ID)) { varDecl(out varDecl_); declsSeq.AddItem(varDecl_); } else { goto _loop77_breakloop; } } _loop77_breakloop: ; } // ( ... )* break; } default: { goto _loop78_breakloop; } } } _loop78_breakloop: ; } // ( ... )* { // ( ... )* for (;;) { if ((LA(1)==LITERAL_PROCEDURE) && (LA(2)==ID||LA(2)==45)) { procDecl(); } else if ((LA(1)==LITERAL_PROCEDURE) && (LA(2)==44)) { forwardDecl(); } else { goto _loop80_breakloop; } } _loop80_breakloop: ; } // ( ... )* } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_2_); } } public void statementsSeq() //throws RecognitionException, TokenStreamException { try { // for error handling statement(); { // ( ... )* for (;;) { if ((LA(1)==27)) { match(27); statement(); } else { goto _loop123_breakloop; } } _loop123_breakloop: ; } // ( ... )* } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_3_); } } public void newID() //throws RecognitionException, TokenStreamException { try { // for error handling if ((LA(1)==ID) && (tokenSet_4_.member(LA(2)))) { match(ID); } else if ((LA(1)==ID) && (LA(2)==34)) { match(ID); match(34); } else if ((LA(1)==ID) && (LA(2)==35)) { match(ID); match(35); } else { throw new NoViableAltException(LT(1), getFilename()); } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_4_); } } public void qualID() //throws RecognitionException, TokenStreamException { try { // for error handling switch ( LA(1) ) { case MODULEID: { match(MODULEID); match(31); match(ID); break; } case ID: { match(ID); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_5_); } } public void constDecl() //throws RecognitionException, TokenStreamException { try { // for error handling newID(); match(39); constExpr(); } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_6_); } } public void typeDecl() //throws RecognitionException, TokenStreamException { try { // for error handling newID(); match(39); type(); } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_6_); } } public void varDecl() //throws RecognitionException, TokenStreamException { try { // for error handling varList(); match(40); type(); } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_6_); } } public void procDecl() //throws RecognitionException, TokenStreamException { try { // for error handling match(LITERAL_PROCEDURE); { switch ( LA(1) ) { case 45: { receiver(); break; } case ID: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } newID(); { switch ( LA(1) ) { case 45: { formalParams(); break; } case 27: case LITERAL_END: case 42: case LITERAL_EMPTY: case LITERAL_EXTENSIBLE: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } methAttributes(); { switch ( LA(1) ) { case 27: { match(27); declsSeq(); match(LITERAL_BEGIN); statementsSeq(); break; } case LITERAL_END: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(LITERAL_END); match(ID); } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_7_); } } public void forwardDecl() //throws RecognitionException, TokenStreamException { try { // for error handling match(LITERAL_PROCEDURE); match(44); { switch ( LA(1) ) { case 45: { receiver(); break; } case ID: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } newID(); { switch ( LA(1) ) { case 45: { formalParams(); break; } case LITERAL_BEGIN: case LITERAL_CLOSE: case LITERAL_END: case 42: case LITERAL_PROCEDURE: case LITERAL_EMPTY: case LITERAL_EXTENSIBLE: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } methAttributes(); } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_7_); } } public void constExpr() //throws RecognitionException, TokenStreamException { try { // for error handling expr(); } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_8_); } } public void type() //throws RecognitionException, TokenStreamException { try { // for error handling switch ( LA(1) ) { case MODULEID: case ID: { qualID(); break; } case LITERAL_ARRAY: { match(LITERAL_ARRAY); { switch ( LA(1) ) { case MODULEID: case ID: case STRING: case 35: case 45: case 84: case NUMBER: case CHARACTER: case LITERAL_NIL: case 93: case 94: { constExpr(); { // ( ... )* for (;;) { if ((LA(1)==42)) { match(42); constExpr(); } else { goto _loop113_breakloop; } } _loop113_breakloop: ; } // ( ... )* break; } case LITERAL_OF: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(LITERAL_OF); type(); break; } case LITERAL_ABSTRACT: case LITERAL_EXTENSIBLE: case LITERAL_LIMITED: case LITERAL_RECORD: { { switch ( LA(1) ) { case LITERAL_ABSTRACT: { match(LITERAL_ABSTRACT); break; } case LITERAL_EXTENSIBLE: { match(LITERAL_EXTENSIBLE); break; } case LITERAL_LIMITED: { match(LITERAL_LIMITED); break; } case LITERAL_RECORD: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(LITERAL_RECORD); { switch ( LA(1) ) { case 45: { match(45); qualID(); match(46); break; } case ID: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } fieldsDef(); { switch ( LA(1) ) { case 27: { match(27); fieldsDef(); break; } case LITERAL_END: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(LITERAL_END); break; } case LITERAL_POINTER: { match(LITERAL_POINTER); match(LITERAL_TO); type(); break; } case LITERAL_PROCEDURE: { match(LITERAL_PROCEDURE); { switch ( LA(1) ) { case 45: { formalParams(); break; } case ID: case 27: case LITERAL_BEGIN: case LITERAL_CLOSE: case LITERAL_END: case LITERAL_CONST: case LITERAL_TYPE: case LITERAL_VAR: case 42: case LITERAL_PROCEDURE: case 46: case LITERAL_EMPTY: case LITERAL_EXTENSIBLE: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_9_); } } public void varList() //throws RecognitionException, TokenStreamException { try { // for error handling newID(); { switch ( LA(1) ) { case LITERAL_AT: { match(LITERAL_AT); constExpr(); match(40); constExpr(); break; } case 40: case 42: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } { // ( ... )* for (;;) { if ((LA(1)==42)) { match(42); newID(); { switch ( LA(1) ) { case LITERAL_AT: { match(LITERAL_AT); constExpr(); match(40); constExpr(); break; } case 40: case 42: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } else { goto _loop88_breakloop; } } _loop88_breakloop: ; } // ( ... )* } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_10_); } } public void receiver() //throws RecognitionException, TokenStreamException { try { // for error handling match(45); { switch ( LA(1) ) { case LITERAL_VAR: { match(LITERAL_VAR); break; } case LITERAL_IN: { match(LITERAL_IN); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(ID); match(40); match(ID); match(46); } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_11_); } } public void formalParams() //throws RecognitionException, TokenStreamException { try { // for error handling match(45); fpSection(); { // ( ... )* for (;;) { if ((LA(1)==27)) { match(27); fpSection(); } else { goto _loop98_breakloop; } } _loop98_breakloop: ; } // ( ... )* match(46); { switch ( LA(1) ) { case 40: { match(40); type(); break; } case ID: case 27: case LITERAL_BEGIN: case LITERAL_CLOSE: case LITERAL_END: case LITERAL_CONST: case LITERAL_TYPE: case LITERAL_VAR: case 42: case LITERAL_PROCEDURE: case 46: case LITERAL_EMPTY: case LITERAL_EXTENSIBLE: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_9_); } } public void methAttributes() //throws RecognitionException, TokenStreamException { try { // for error handling { if ((LA(1)==42) && (LA(2)==LITERAL_NEW)) { match(42); match(LITERAL_NEW); } else if ((tokenSet_12_.member(LA(1))) && (tokenSet_13_.member(LA(2)))) { } else { throw new NoViableAltException(LT(1), getFilename()); } } { switch ( LA(1) ) { case LITERAL_EMPTY: { match(LITERAL_EMPTY); break; } case LITERAL_EXTENSIBLE: { match(LITERAL_EXTENSIBLE); break; } default: if ((LA(1)==42) && (LA(2)==LITERAL_ABSTRACT)) { match(42); match(LITERAL_ABSTRACT); } else if ((tokenSet_14_.member(LA(1))) && (tokenSet_15_.member(LA(2)))) { } else { throw new NoViableAltException(LT(1), getFilename()); } break; } } { switch ( LA(1) ) { case 42: { match(42); match(LITERAL_HANDLER); match(LITERAL_OF); constExpr(); break; } case 27: case LITERAL_BEGIN: case LITERAL_CLOSE: case LITERAL_END: case LITERAL_PROCEDURE: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_16_); } } public void fpSection() //throws RecognitionException, TokenStreamException { try { // for error handling { switch ( LA(1) ) { case LITERAL_VAR: { match(LITERAL_VAR); break; } case LITERAL_IN: { match(LITERAL_IN); break; } case LITERAL_OUT: { match(LITERAL_OUT); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(ID); { // ( ... )* for (;;) { if ((LA(1)==42)) { match(42); match(ID); } else { goto _loop103_breakloop; } } _loop103_breakloop: ; } // ( ... )* match(40); type(); } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_17_); } } public void fieldsDef() //throws RecognitionException, TokenStreamException { try { // for error handling newID(); { // ( ... )* for (;;) { if ((LA(1)==42)) { match(42); newID(); } else { goto _loop120_breakloop; } } _loop120_breakloop: ; } // ( ... )* match(40); type(); } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_18_); } } public void statement() //throws RecognitionException, TokenStreamException { try { // for error handling switch ( LA(1) ) { case MODULEID: case ID: { designator(); { switch ( LA(1) ) { case 33: { match(33); expr(); break; } case 45: { match(45); exprsList(); match(46); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } break; } case LITERAL_IF: { match(LITERAL_IF); expr(); match(LITERAL_THEN); statementsSeq(); { // ( ... )* for (;;) { if ((LA(1)==LITERAL_ELSIF)) { match(LITERAL_ELSIF); expr(); match(LITERAL_THEN); statementsSeq(); } else { goto _loop127_breakloop; } } _loop127_breakloop: ; } // ( ... )* { switch ( LA(1) ) { case LITERAL_ELSE: { match(LITERAL_ELSE); statementsSeq(); break; } case LITERAL_END: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(LITERAL_END); break; } case LITERAL_CASE: { match(LITERAL_CASE); expr(); match(LITERAL_OF); caseVariant(); { // ( ... )* for (;;) { if ((LA(1)==65)) { match(65); caseVariant(); } else { goto _loop130_breakloop; } } _loop130_breakloop: ; } // ( ... )* { switch ( LA(1) ) { case LITERAL_ELSE: { match(LITERAL_ELSE); statementsSeq(); break; } case LITERAL_END: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(LITERAL_END); break; } case LITERAL_WHILE: { match(LITERAL_WHILE); expr(); match(LITERAL_DO); statementsSeq(); match(LITERAL_END); break; } case LITERAL_REPEAT: { match(LITERAL_REPEAT); statementsSeq(); match(LITERAL_UNTIL); expr(); break; } case LITERAL_FOR: { match(LITERAL_FOR); { switch ( LA(1) ) { case LITERAL_VAR: { match(LITERAL_VAR); match(ID); match(40); match(TYPE); break; } case ID: { match(ID); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(33); expr(); match(LITERAL_TO); expr(); { switch ( LA(1) ) { case LITERAL_BY: { match(LITERAL_BY); constExpr(); break; } case LITERAL_DO: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(LITERAL_DO); statementsSeq(); match(LITERAL_END); break; } case LITERAL_LOOP: { match(LITERAL_LOOP); statementsSeq(); match(LITERAL_END); break; } case LITERAL_WITH: { match(LITERAL_WITH); { switch ( LA(1) ) { case MODULEID: case ID: { guard(); match(LITERAL_DO); statementsSeq(); break; } case LITERAL_END: case LITERAL_ELSE: case 65: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } { // ( ... )* for (;;) { if ((LA(1)==65)) { match(65); guard(); match(LITERAL_DO); statementsSeq(); } else { goto _loop136_breakloop; } } _loop136_breakloop: ; } // ( ... )* { switch ( LA(1) ) { case LITERAL_ELSE: { match(LITERAL_ELSE); statementsSeq(); break; } case LITERAL_END: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(LITERAL_END); break; } case LITERAL_EXIT: { match(LITERAL_EXIT); break; } case LITERAL_RETURN: { match(LITERAL_RETURN); expr(); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_19_); } } public void designator() //throws RecognitionException, TokenStreamException { try { // for error handling qualID(); { // ( ... )* for (;;) { switch ( LA(1) ) { case 31: { match(31); match(ID); break; } case 96: { match(96); exprsList(); match(97); break; } case 44: { match(44); break; } default: if ((LA(1)==45) && (tokenSet_20_.member(LA(2)))) { match(45); exprsList(); match(46); } else { goto _loop166_breakloop; } break; } } _loop166_breakloop: ; } // ( ... )* { switch ( LA(1) ) { case 98: { match(98); break; } case ID: case 27: case LITERAL_BEGIN: case LITERAL_CLOSE: case LITERAL_END: case 33: case 34: case 35: case LITERAL_CONST: case LITERAL_TYPE: case LITERAL_VAR: case 39: case 40: case 42: case LITERAL_PROCEDURE: case 45: case 46: case LITERAL_IN: case LITERAL_OF: case LITERAL_TO: case LITERAL_THEN: case LITERAL_ELSIF: case LITERAL_ELSE: case 65: case LITERAL_DO: case LITERAL_UNTIL: case LITERAL_BY: case 77: case 78: case 79: case 80: case 81: case 82: case LITERAL_IS: case 84: case LITERAL_OR: case 86: case LITERAL_DIV: case LITERAL_MOD: case 89: case 95: case 97: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_21_); } } public void expr() //throws RecognitionException, TokenStreamException { try { // for error handling simpleExpr(); { switch ( LA(1) ) { case 39: case LITERAL_IN: case 78: case 79: case 80: case 81: case 82: case LITERAL_IS: { relation(); simpleExpr(); break; } case ID: case 27: case LITERAL_BEGIN: case LITERAL_CLOSE: case LITERAL_END: case LITERAL_CONST: case LITERAL_TYPE: case LITERAL_VAR: case 40: case 42: case LITERAL_PROCEDURE: case 46: case LITERAL_OF: case LITERAL_TO: case LITERAL_THEN: case LITERAL_ELSIF: case LITERAL_ELSE: case 65: case LITERAL_DO: case LITERAL_UNTIL: case LITERAL_BY: case 77: case 95: case 97: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_22_); } } public void exprsList() //throws RecognitionException, TokenStreamException { try { // for error handling expr(); { // ( ... )* for (;;) { if ((LA(1)==42)) { match(42); expr(); } else { goto _loop170_breakloop; } } _loop170_breakloop: ; } // ( ... )* } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_23_); } } public void caseVariant() //throws RecognitionException, TokenStreamException { try { // for error handling caseLabel(); { // ( ... )* for (;;) { if ((LA(1)==42)) { match(42); caseLabel(); } else { goto _loop140_breakloop; } } _loop140_breakloop: ; } // ( ... )* match(40); statementsSeq(); } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_24_); } } public void guard() //throws RecognitionException, TokenStreamException { try { // for error handling qualID(); match(40); qualID(); } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_25_); } } public void caseLabel() //throws RecognitionException, TokenStreamException { try { // for error handling constExpr(); { switch ( LA(1) ) { case 77: { match(77); constExpr(); break; } case 40: case 42: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_26_); } } public void simpleExpr() //throws RecognitionException, TokenStreamException { try { // for error handling switch ( LA(1) ) { case 84: { match(84); unaryArgument(); break; } case 35: { match(35); unaryArgument(); break; } case MODULEID: case ID: case STRING: case 45: case NUMBER: case CHARACTER: case LITERAL_NIL: case 93: case 94: { unaryArgument(); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_27_); } } public void relation() //throws RecognitionException, TokenStreamException { try { // for error handling switch ( LA(1) ) { case 39: { match(39); break; } case 78: { match(78); break; } case 79: { match(79); break; } case 80: { match(80); break; } case 81: { match(81); break; } case 82: { match(82); break; } case LITERAL_IN: { match(LITERAL_IN); break; } case LITERAL_IS: { match(LITERAL_IS); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_20_); } } public void unaryArgument() //throws RecognitionException, TokenStreamException { try { // for error handling term(); { // ( ... )* for (;;) { if ((LA(1)==35||LA(1)==84||LA(1)==LITERAL_OR)) { addOp(); term(); } else { goto _loop151_breakloop; } } _loop151_breakloop: ; } // ( ... )* } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_27_); } } public void term() //throws RecognitionException, TokenStreamException { try { // for error handling factor(); { // ( ... )* for (;;) { if ((tokenSet_28_.member(LA(1)))) { mulOp(); factor(); } else { goto _loop155_breakloop; } } _loop155_breakloop: ; } // ( ... )* } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_29_); } } public void addOp() //throws RecognitionException, TokenStreamException { try { // for error handling switch ( LA(1) ) { case 84: { match(84); break; } case 35: { match(35); break; } case LITERAL_OR: { match(LITERAL_OR); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_30_); } } public void factor() //throws RecognitionException, TokenStreamException { try { // for error handling switch ( LA(1) ) { case MODULEID: case ID: { designator(); break; } case NUMBER: { match(NUMBER); break; } case CHARACTER: { match(CHARACTER); break; } case STRING: { match(STRING); break; } case LITERAL_NIL: { match(LITERAL_NIL); break; } case 94: { set(); break; } case 45: { match(45); expr(); match(46); break; } case 93: { match(93); factor(); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_31_); } } public void mulOp() //throws RecognitionException, TokenStreamException { try { // for error handling switch ( LA(1) ) { case 34: { match(34); break; } case 86: { match(86); break; } case LITERAL_DIV: { match(LITERAL_DIV); break; } case LITERAL_MOD: { match(LITERAL_MOD); break; } case 89: { match(89); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_30_); } } public void set() //throws RecognitionException, TokenStreamException { try { // for error handling match(94); { switch ( LA(1) ) { case MODULEID: case ID: case STRING: case 35: case 45: case 84: case NUMBER: case CHARACTER: case LITERAL_NIL: case 93: case 94: { setElement(); { // ( ... )* for (;;) { if ((LA(1)==42)) { match(42); setElement(); } else { goto _loop161_breakloop; } } _loop161_breakloop: ; } // ( ... )* break; } case 95: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(95); } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_31_); } } public void setElement() //throws RecognitionException, TokenStreamException { try { // for error handling expr(); { switch ( LA(1) ) { case 77: { match(77); expr(); break; } case 42: case 95: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_32_); } } private void initializeFactory() { } public static readonly string[] tokenNames_ = new string[] { @"""<0>""", @"""EOF""", @"""<2>""", @"""NULL_TREE_LOOKAHEAD""", @"""BOOLEAN""", @"""SHORTCHAR""", @"""CHAR""", @"""BYTE""", @"""SHORTINT""", @"""INTEGER""", @"""LONGINT""", @"""SHORTREAL""", @"""REAL""", @"""SET""", @"""MODULEID""", @"""WS""", @"""COMMENTTEXT""", @"""COMMENT""", @"""DIGIT""", @"""HEXDIGIT""", @"""LETTER""", @"""ID""", @"""SCALEFACTOR""", @"""NUM_VALUE""", @"""STRING""", @"""PUNCTUATION""", @"""MODULE""", @""";""", @"""BEGIN""", @"""CLOSE""", @"""END""", @""".""", @"""IMPORT""", @""":=""", @"""*""", @"""-""", @"""CONST""", @"""TYPE""", @"""VAR""", @"""=""", @""":""", @"""AT""", @""",""", @"""PROCEDURE""", @"""^""", @"""(""", @""")""", @"""IN""", @"""OUT""", @"""NEW""", @"""ABSTRACT""", @"""EMPTY""", @"""EXTENSIBLE""", @"""HANDLER""", @"""OF""", @"""ARRAY""", @"""LIMITED""", @"""RECORD""", @"""POINTER""", @"""TO""", @"""IF""", @"""THEN""", @"""ELSIF""", @"""ELSE""", @"""CASE""", @"""|""", @"""WHILE""", @"""DO""", @"""REPEAT""", @"""UNTIL""", @"""FOR""", @"""TYPE""", @"""BY""", @"""LOOP""", @"""WITH""", @"""EXIT""", @"""RETURN""", @"""..""", @"""#""", @"""<""", @"""<=""", @""">""", @""">=""", @"""IS""", @"""+""", @"""OR""", @"""/""", @"""DIV""", @"""MOD""", @"""&""", @"""NUMBER""", @"""CHARACTER""", @"""NIL""", @"""~""", @"""{""", @"""}""", @"""[""", @"""]""", @"""$""" }; private static long[] mk_tokenSet_0_() { long[] data = { 2L, 0L}; return data; } public static readonly BitSet tokenSet_0_ = new BitSet(mk_tokenSet_0_()); private static long[] mk_tokenSet_1_() { long[] data = { 9279008407552L, 0L}; return data; } public static readonly BitSet tokenSet_1_ = new BitSet(mk_tokenSet_1_()); private static long[] mk_tokenSet_2_() { long[] data = { 1879048192L, 0L}; return data; } public static readonly BitSet tokenSet_2_ = new BitSet(mk_tokenSet_2_()); private static long[] mk_tokenSet_3_() { long[] data = { -4611686016816775168L, 34L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_3_ = new BitSet(mk_tokenSet_3_()); private static long[] mk_tokenSet_4_() { long[] data = { 6807628256641024L, 0L}; return data; } public static readonly BitSet tokenSet_4_ = new BitSet(mk_tokenSet_4_()); private static long[] mk_tokenSet_5_() { long[] data = { -1704333187433365504L, 32279355690L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_5_ = new BitSet(mk_tokenSet_5_()); private static long[] mk_tokenSet_6_() { long[] data = { 9279010504704L, 0L}; return data; } public static readonly BitSet tokenSet_6_ = new BitSet(mk_tokenSet_6_()); private static long[] mk_tokenSet_7_() { long[] data = { 8797972070400L, 0L}; return data; } public static readonly BitSet tokenSet_7_ = new BitSet(mk_tokenSet_7_()); private static long[] mk_tokenSet_8_() { long[] data = { 18029175212343296L, 8200L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_8_ = new BitSet(mk_tokenSet_8_()); private static long[] mk_tokenSet_9_() { long[] data = { 6839445376466944L, 0L}; return data; } public static readonly BitSet tokenSet_9_ = new BitSet(mk_tokenSet_9_()); private static long[] mk_tokenSet_10_() { long[] data = { 1099511627776L, 0L}; return data; } public static readonly BitSet tokenSet_10_ = new BitSet(mk_tokenSet_10_()); private static long[] mk_tokenSet_11_() { long[] data = { 2097152L, 0L}; return data; } public static readonly BitSet tokenSet_11_ = new BitSet(mk_tokenSet_11_()); private static long[] mk_tokenSet_12_() { long[] data = { 6768595593854976L, 0L}; return data; } public static readonly BitSet tokenSet_12_ = new BitSet(mk_tokenSet_12_()); private static long[] mk_tokenSet_13_() { long[] data = { 1163121057517813760L, 7765L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_13_ = new BitSet(mk_tokenSet_13_()); private static long[] mk_tokenSet_14_() { long[] data = { 13196152799232L, 0L}; return data; } public static readonly BitSet tokenSet_14_ = new BitSet(mk_tokenSet_14_()); private static long[] mk_tokenSet_15_() { long[] data = { 1161990757819629568L, 7765L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_15_ = new BitSet(mk_tokenSet_15_()); private static long[] mk_tokenSet_16_() { long[] data = { 8798106288128L, 0L}; return data; } public static readonly BitSet tokenSet_16_ = new BitSet(mk_tokenSet_16_()); private static long[] mk_tokenSet_17_() { long[] data = { 70368878395392L, 0L}; return data; } public static readonly BitSet tokenSet_17_ = new BitSet(mk_tokenSet_17_()); private static long[] mk_tokenSet_18_() { long[] data = { 1207959552L, 0L}; return data; } public static readonly BitSet tokenSet_18_ = new BitSet(mk_tokenSet_18_()); private static long[] mk_tokenSet_19_() { long[] data = { -4611686016682557440L, 34L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_19_ = new BitSet(mk_tokenSet_19_()); private static long[] mk_tokenSet_20_() { long[] data = { 35218750717952L, 2081423360L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_20_ = new BitSet(mk_tokenSet_20_()); private static long[] mk_tokenSet_21_() { long[] data = { -1711106181207949312L, 10804519210L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_21_ = new BitSet(mk_tokenSet_21_()); private static long[] mk_tokenSet_22_() { long[] data = { -1711282712953749504L, 10737426730L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_22_ = new BitSet(mk_tokenSet_22_()); private static long[] mk_tokenSet_23_() { long[] data = { 70368744177664L, 8589934592L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_23_ = new BitSet(mk_tokenSet_23_()); private static long[] mk_tokenSet_24_() { long[] data = { -9223372035781033984L, 2L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_24_ = new BitSet(mk_tokenSet_24_()); private static long[] mk_tokenSet_25_() { long[] data = { 0L, 8L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_25_ = new BitSet(mk_tokenSet_25_()); private static long[] mk_tokenSet_26_() { long[] data = { 5497558138880L, 0L}; return data; } public static readonly BitSet tokenSet_26_ = new BitSet(mk_tokenSet_26_()); private static long[] mk_tokenSet_27_() { long[] data = { -1711141425709580288L, 10738458922L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_27_ = new BitSet(mk_tokenSet_27_()); private static long[] mk_tokenSet_28_() { long[] data = { 17179869184L, 62914560L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_28_ = new BitSet(mk_tokenSet_28_()); private static long[] mk_tokenSet_29_() { long[] data = { -1711141391349841920L, 10741604650L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_29_ = new BitSet(mk_tokenSet_29_()); private static long[] mk_tokenSet_30_() { long[] data = { 35184390979584L, 2080374784L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_30_ = new BitSet(mk_tokenSet_30_()); private static long[] mk_tokenSet_31_() { long[] data = { -1711141374169972736L, 10804519210L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_31_ = new BitSet(mk_tokenSet_31_()); private static long[] mk_tokenSet_32_() { long[] data = { 4398046511104L, 2147483648L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_32_ = new BitSet(mk_tokenSet_32_()); } }