// $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; using AST = antlr.collections.AST; using ASTPair = antlr.ASTPair; using ASTFactory = antlr.ASTFactory; using ASTArray = antlr.collections.impl.ASTArray; /*************************** 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 ConstDeclToken = 26; public const int CycleToken = 27; public const int DeclsSeqToken = 28; public const int EmptyToken = 29; public const int IfToken = 30; public const int ModuleToken = 31; public const int OperationToken = 32; public const int ProcDeclToken = 33; public const int StatsSeqToken = 34; public const int TypeDeclToken = 35; public const int VarDeclToken = 36; public const int LITERAL_MODULE = 37; // ";" = 38 public const int LITERAL_BEGIN = 39; public const int LITERAL_CLOSE = 40; public const int LITERAL_END = 41; // "." = 42 public const int LITERAL_IMPORT = 43; // ":=" = 44 // "*" = 45 // "-" = 46 public const int LITERAL_CONST = 47; public const int LITERAL_TYPE = 48; public const int LITERAL_VAR = 49; // "=" = 50 // ":" = 51 // "," = 52 public const int LITERAL_PROCEDURE = 53; public const int IdentDef = 54; // "^" = 55 // "(" = 56 // ")" = 57 public const int LITERAL_IN = 58; public const int LITERAL_OUT = 59; public const int LITERAL_NEW = 60; public const int LITERAL_ABSTRACT = 61; public const int LITERAL_EMPTY = 62; public const int LITERAL_EXTENSIBLE = 63; public const int LITERAL_HANDLER = 64; public const int LITERAL_OF = 65; public const int LITERAL_ARRAY = 66; public const int LITERAL_LIMITED = 67; public const int LITERAL_RECORD = 68; public const int LITERAL_POINTER = 69; public const int LITERAL_TO = 70; public const int IdentList = 71; public const int LITERAL_IF = 72; public const int LITERAL_THEN = 73; public const int LITERAL_ELSIF = 74; public const int LITERAL_ELSE = 75; public const int LITERAL_CASE = 76; // "|" = 77 public const int LITERAL_WHILE = 78; public const int LITERAL_DO = 79; public const int LITERAL_REPEAT = 80; public const int LITERAL_UNTIL = 81; public const int LITERAL_FOR = 82; public const int TYPE = 83; public const int LITERAL_BY = 84; public const int LITERAL_LOOP = 85; public const int LITERAL_WITH = 86; public const int LITERAL_EXIT = 87; public const int LITERAL_RETURN = 88; // ".." = 89 // "#" = 90 // "<" = 91 // "<=" = 92 // ">" = 93 // ">=" = 94 public const int LITERAL_IS = 95; // "+" = 96 public const int LITERAL_OR = 97; // "/" = 98 public const int LITERAL_DIV = 99; public const int LITERAL_MOD = 100; // "&" = 101 public const int CHARACTER = 102; public const int LITERAL_NIL = 103; // "~" = 104 // "{" = 105 // "}" = 106 // "[" = 107 // "]" = 108 // "$" = 109 protected void initialize() { tokenNames = tokenNames_; initializeFactory(); } 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() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST module_AST = null; try { // for error handling Ob51.Parsing.Module tmp1_AST = null; tmp1_AST = (Ob51.Parsing.Module) astFactory.create(LT(1), "Ob51.Parsing.Module"); astFactory.makeASTRoot(ref currentAST, (AST)tmp1_AST); match(LITERAL_MODULE); Ob51.Parsing.NewAST tmp2_AST = null; tmp2_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp2_AST); match(ID); match(38); { switch ( LA(1) ) { case LITERAL_IMPORT: { importList(); astFactory.addASTChild(ref currentAST, (AST)returnAST); 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(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { switch ( LA(1) ) { case LITERAL_BEGIN: { Ob51.Parsing.NewAST tmp4_AST = null; tmp4_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp4_AST); match(LITERAL_BEGIN); statementsSeq(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case LITERAL_CLOSE: case LITERAL_END: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } { switch ( LA(1) ) { case LITERAL_CLOSE: { Ob51.Parsing.NewAST tmp5_AST = null; tmp5_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp5_AST); match(LITERAL_CLOSE); statementsSeq(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case LITERAL_END: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(LITERAL_END); Ob51.Parsing.NewAST tmp7_AST = null; tmp7_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp7_AST); match(ID); match(42); match(Token.EOF_TYPE); module_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_0_); } returnAST = module_AST; } public void importList() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST importList_AST = null; IToken id1_ = null; Ob51.Parsing.NewAST id1__AST = null; IToken id2_ = null; Ob51.Parsing.NewAST id2__AST = null; try { // for error handling match(LITERAL_IMPORT); { // ( ... )+ int _cnt67=0; for (;;) { if ((LA(1)==ID)) { { if ((LA(1)==ID) && (LA(2)==44)) { id1_ = LT(1); id1__AST = (Ob51.Parsing.NewAST) astFactory.create(id1_); astFactory.addASTChild(ref currentAST, (AST)id1__AST); match(ID); Ob51.Parsing.NewAST tmp11_AST = null; tmp11_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp11_AST); match(44); } else if ((LA(1)==ID) && (LA(2)==ID||LA(2)==38)) { } else { throw new NoViableAltException(LT(1), getFilename()); } } id2_ = LT(1); id2__AST = (Ob51.Parsing.NewAST) astFactory.create(id2_); astFactory.addASTChild(ref currentAST, (AST)id2__AST); match(ID); } else { if (_cnt67 >= 1) { goto _loop67_breakloop; } else { throw new NoViableAltException(LT(1), getFilename());; } } _cnt67++; } _loop67_breakloop: ; } // ( ... )+ Ob51.Parsing.NewAST tmp12_AST = null; tmp12_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp12_AST); match(38); importList_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_1_); } returnAST = importList_AST; } public void declsSeq() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST declsSeq_AST = null; try { // for error handling { // ( ... )* for (;;) { switch ( LA(1) ) { case LITERAL_CONST: { Ob51.Parsing.NewAST tmp13_AST = null; tmp13_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp13_AST); match(LITERAL_CONST); { // ( ... )* for (;;) { if ((LA(1)==ID)) { constDecl(); astFactory.addASTChild(ref currentAST, (AST)returnAST); match(38); } else { goto _loop74_breakloop; } } _loop74_breakloop: ; } // ( ... )* break; } case LITERAL_TYPE: { match(LITERAL_TYPE); { // ( ... )* for (;;) { if ((LA(1)==ID)) { typeDecl(); astFactory.addASTChild(ref currentAST, (AST)returnAST); match(38); } else { goto _loop76_breakloop; } } _loop76_breakloop: ; } // ( ... )* break; } case LITERAL_VAR: { match(LITERAL_VAR); { // ( ... )* for (;;) { if ((LA(1)==ID)) { varDecl(); astFactory.addASTChild(ref currentAST, (AST)returnAST); match(38); } else { goto _loop78_breakloop; } } _loop78_breakloop: ; } // ( ... )* break; } default: { goto _loop79_breakloop; } } } _loop79_breakloop: ; } // ( ... )* { // ( ... )* for (;;) { if ((LA(1)==LITERAL_PROCEDURE) && (LA(2)==IdentDef||LA(2)==56)) { procDecl(); astFactory.addASTChild(ref currentAST, (AST)returnAST); match(38); } else if ((LA(1)==LITERAL_PROCEDURE) && (LA(2)==55)) { forwardDecl(); astFactory.addASTChild(ref currentAST, (AST)returnAST); match(38); } else { goto _loop81_breakloop; } } _loop81_breakloop: ; } // ( ... )* declsSeq_AST = (Ob51.Parsing.NewAST)currentAST.root; declsSeq_AST = (Ob51.Parsing.NewAST) astFactory.make((AST)(Ob51.Parsing.DeclsSeq) astFactory.create(DeclsSeqToken), (AST)declsSeq_AST); currentAST.root = declsSeq_AST; if ( (null != declsSeq_AST) && (null != declsSeq_AST.getFirstChild()) ) currentAST.child = declsSeq_AST.getFirstChild(); else currentAST.child = declsSeq_AST; currentAST.advanceChildToEnd(); declsSeq_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_2_); } returnAST = declsSeq_AST; } public void statementsSeq() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST statementsSeq_AST = null; try { // for error handling statement(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { // ( ... )* for (;;) { if ((LA(1)==38)) { match(38); statement(); astFactory.addASTChild(ref currentAST, (AST)returnAST); } else { goto _loop120_breakloop; } } _loop120_breakloop: ; } // ( ... )* statementsSeq_AST = (Ob51.Parsing.NewAST)currentAST.root; statementsSeq_AST = (Ob51.Parsing.NewAST) astFactory.make((AST)(Ob51.Parsing.StatsSeq) astFactory.create(StatsSeqToken), (AST)statementsSeq_AST); currentAST.root = statementsSeq_AST; if ( (null != statementsSeq_AST) && (null != statementsSeq_AST.getFirstChild()) ) currentAST.child = statementsSeq_AST.getFirstChild(); else currentAST.child = statementsSeq_AST; currentAST.advanceChildToEnd(); statementsSeq_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_3_); } returnAST = statementsSeq_AST; } public void identDef() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST identDef_AST = null; try { // for error handling Ob51.Parsing.NewAST tmp22_AST = null; tmp22_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp22_AST); match(ID); { switch ( LA(1) ) { case 45: { Ob51.Parsing.NewAST tmp23_AST = null; tmp23_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp23_AST); match(45); break; } case 46: { Ob51.Parsing.NewAST tmp24_AST = null; tmp24_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp24_AST); match(46); break; } case 50: case 51: case 52: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } identDef_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_4_); } returnAST = identDef_AST; } public void qualident() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST qualident_AST = null; try { // for error handling switch ( LA(1) ) { case MODULEID: { Ob51.Parsing.NewAST tmp25_AST = null; tmp25_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp25_AST); match(MODULEID); Ob51.Parsing.NewAST tmp26_AST = null; tmp26_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp26_AST); match(42); Ob51.Parsing.NewAST tmp27_AST = null; tmp27_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp27_AST); match(ID); qualident_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case ID: { Ob51.Parsing.NewAST tmp28_AST = null; tmp28_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp28_AST); match(ID); qualident_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_5_); } returnAST = qualident_AST; } public void constDecl() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST constDecl_AST = null; Ob51.Parsing.NewAST identDef__AST = null; Ob51.Parsing.NewAST constExpr__AST = null; try { // for error handling identDef(); identDef__AST = (Ob51.Parsing.NewAST)returnAST; match(50); constExpr(); constExpr__AST = (Ob51.Parsing.NewAST)returnAST; constDecl_AST = (Ob51.Parsing.NewAST)currentAST.root; constDecl_AST = (Ob51.Parsing.NewAST) astFactory.make((AST)(Ob51.Parsing.ConstDecl) astFactory.create(ConstDeclToken), (AST)identDef__AST, (AST)constExpr__AST); currentAST.root = constDecl_AST; if ( (null != constDecl_AST) && (null != constDecl_AST.getFirstChild()) ) currentAST.child = constDecl_AST.getFirstChild(); else currentAST.child = constDecl_AST; currentAST.advanceChildToEnd(); } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_6_); } returnAST = constDecl_AST; } public void typeDecl() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST typeDecl_AST = null; Ob51.Parsing.NewAST identDef__AST = null; Ob51.Parsing.NewAST type__AST = null; try { // for error handling identDef(); identDef__AST = (Ob51.Parsing.NewAST)returnAST; match(50); type(); type__AST = (Ob51.Parsing.NewAST)returnAST; typeDecl_AST = (Ob51.Parsing.NewAST)currentAST.root; typeDecl_AST = (Ob51.Parsing.NewAST) astFactory.make((AST)(Ob51.Parsing.TypeDecl) astFactory.create(TypeDeclToken), (AST)identDef__AST, (AST)type__AST); currentAST.root = typeDecl_AST; if ( (null != typeDecl_AST) && (null != typeDecl_AST.getFirstChild()) ) currentAST.child = typeDecl_AST.getFirstChild(); else currentAST.child = typeDecl_AST; currentAST.advanceChildToEnd(); } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_6_); } returnAST = typeDecl_AST; } public void varDecl() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST varDecl_AST = null; Ob51.Parsing.NewAST identList__AST = null; Ob51.Parsing.NewAST type__AST = null; try { // for error handling identList(); identList__AST = (Ob51.Parsing.NewAST)returnAST; match(51); type(); type__AST = (Ob51.Parsing.NewAST)returnAST; varDecl_AST = (Ob51.Parsing.NewAST)currentAST.root; varDecl_AST = (Ob51.Parsing.NewAST) astFactory.make((AST)(Ob51.Parsing.VarDecl) astFactory.create(VarDeclToken), (AST)identList__AST, (AST)type__AST); currentAST.root = varDecl_AST; if ( (null != varDecl_AST) && (null != varDecl_AST.getFirstChild()) ) currentAST.child = varDecl_AST.getFirstChild(); else currentAST.child = varDecl_AST; currentAST.advanceChildToEnd(); } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_6_); } returnAST = varDecl_AST; } public void procDecl() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST procDecl_AST = null; try { // for error handling Ob51.Parsing.NewAST tmp32_AST = null; tmp32_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp32_AST); match(LITERAL_PROCEDURE); { switch ( LA(1) ) { case 56: { receiver(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case IdentDef: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } Ob51.Parsing.NewAST tmp33_AST = null; tmp33_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp33_AST); match(IdentDef); { switch ( LA(1) ) { case 56: { formalParams(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case 38: case LITERAL_END: case 52: case LITERAL_EMPTY: case LITERAL_EXTENSIBLE: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } methAttributes(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { switch ( LA(1) ) { case 38: { Ob51.Parsing.NewAST tmp34_AST = null; tmp34_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp34_AST); match(38); declsSeq(); astFactory.addASTChild(ref currentAST, (AST)returnAST); Ob51.Parsing.NewAST tmp35_AST = null; tmp35_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp35_AST); match(LITERAL_BEGIN); statementsSeq(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case LITERAL_END: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } Ob51.Parsing.NewAST tmp36_AST = null; tmp36_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp36_AST); match(LITERAL_END); Ob51.Parsing.NewAST tmp37_AST = null; tmp37_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp37_AST); match(ID); procDecl_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_6_); } returnAST = procDecl_AST; } public void forwardDecl() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST forwardDecl_AST = null; try { // for error handling Ob51.Parsing.NewAST tmp38_AST = null; tmp38_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp38_AST); match(LITERAL_PROCEDURE); Ob51.Parsing.NewAST tmp39_AST = null; tmp39_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp39_AST); match(55); { switch ( LA(1) ) { case 56: { receiver(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case IdentDef: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } Ob51.Parsing.NewAST tmp40_AST = null; tmp40_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp40_AST); match(IdentDef); { switch ( LA(1) ) { case 56: { formalParams(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case 38: case 52: case LITERAL_EMPTY: case LITERAL_EXTENSIBLE: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } methAttributes(); astFactory.addASTChild(ref currentAST, (AST)returnAST); forwardDecl_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_6_); } returnAST = forwardDecl_AST; } public void constExpr() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST constExpr_AST = null; try { // for error handling expr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); constExpr_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_7_); } returnAST = constExpr_AST; } public void type() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST type_AST = null; try { // for error handling switch ( LA(1) ) { case MODULEID: case ID: { qualident(); astFactory.addASTChild(ref currentAST, (AST)returnAST); type_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_ARRAY: { Ob51.Parsing.NewAST tmp41_AST = null; tmp41_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp41_AST); match(LITERAL_ARRAY); { switch ( LA(1) ) { case MODULEID: case ID: case NUM_VALUE: case STRING: case 46: case 56: case 96: case CHARACTER: case LITERAL_NIL: case 104: case 105: { constExpr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { // ( ... )* for (;;) { if ((LA(1)==52)) { match(52); constExpr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); } else { goto _loop112_breakloop; } } _loop112_breakloop: ; } // ( ... )* break; } case LITERAL_OF: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(LITERAL_OF); type(); astFactory.addASTChild(ref currentAST, (AST)returnAST); type_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_ABSTRACT: case LITERAL_EXTENSIBLE: case LITERAL_LIMITED: case LITERAL_RECORD: { { switch ( LA(1) ) { case LITERAL_ABSTRACT: { Ob51.Parsing.NewAST tmp44_AST = null; tmp44_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp44_AST); match(LITERAL_ABSTRACT); break; } case LITERAL_EXTENSIBLE: { Ob51.Parsing.NewAST tmp45_AST = null; tmp45_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp45_AST); match(LITERAL_EXTENSIBLE); break; } case LITERAL_LIMITED: { Ob51.Parsing.NewAST tmp46_AST = null; tmp46_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp46_AST); match(LITERAL_LIMITED); break; } case LITERAL_RECORD: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } Ob51.Parsing.NewAST tmp47_AST = null; tmp47_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp47_AST); match(LITERAL_RECORD); { switch ( LA(1) ) { case 56: { Ob51.Parsing.NewAST tmp48_AST = null; tmp48_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp48_AST); match(56); qualident(); astFactory.addASTChild(ref currentAST, (AST)returnAST); Ob51.Parsing.NewAST tmp49_AST = null; tmp49_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp49_AST); match(57); break; } case IdentList: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } fieldsDef(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { switch ( LA(1) ) { case 38: { Ob51.Parsing.NewAST tmp50_AST = null; tmp50_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp50_AST); match(38); fieldsDef(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case LITERAL_END: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } Ob51.Parsing.NewAST tmp51_AST = null; tmp51_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp51_AST); match(LITERAL_END); type_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_POINTER: { Ob51.Parsing.NewAST tmp52_AST = null; tmp52_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp52_AST); match(LITERAL_POINTER); Ob51.Parsing.NewAST tmp53_AST = null; tmp53_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp53_AST); match(LITERAL_TO); type(); astFactory.addASTChild(ref currentAST, (AST)returnAST); type_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_PROCEDURE: { Ob51.Parsing.NewAST tmp54_AST = null; tmp54_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp54_AST); match(LITERAL_PROCEDURE); { switch ( LA(1) ) { case 56: { formalParams(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case 38: case LITERAL_END: case 52: case 57: case LITERAL_EMPTY: case LITERAL_EXTENSIBLE: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } type_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_8_); } returnAST = type_AST; } public void identList() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST identList_AST = null; try { // for error handling identDef(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { // ( ... )* for (;;) { if ((LA(1)==52)) { match(52); identDef(); astFactory.addASTChild(ref currentAST, (AST)returnAST); } else { goto _loop87_breakloop; } } _loop87_breakloop: ; } // ( ... )* identList_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_9_); } returnAST = identList_AST; } public void receiver() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST receiver_AST = null; try { // for error handling Ob51.Parsing.NewAST tmp56_AST = null; tmp56_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp56_AST); match(56); { switch ( LA(1) ) { case LITERAL_VAR: { Ob51.Parsing.NewAST tmp57_AST = null; tmp57_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp57_AST); match(LITERAL_VAR); break; } case LITERAL_IN: { Ob51.Parsing.NewAST tmp58_AST = null; tmp58_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp58_AST); match(LITERAL_IN); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } Ob51.Parsing.NewAST tmp59_AST = null; tmp59_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp59_AST); match(ID); Ob51.Parsing.NewAST tmp60_AST = null; tmp60_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp60_AST); match(51); Ob51.Parsing.NewAST tmp61_AST = null; tmp61_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp61_AST); match(ID); Ob51.Parsing.NewAST tmp62_AST = null; tmp62_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp62_AST); match(57); receiver_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_10_); } returnAST = receiver_AST; } public void formalParams() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST formalParams_AST = null; try { // for error handling Ob51.Parsing.NewAST tmp63_AST = null; tmp63_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp63_AST); match(56); fpSection(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { // ( ... )* for (;;) { if ((LA(1)==38)) { Ob51.Parsing.NewAST tmp64_AST = null; tmp64_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp64_AST); match(38); fpSection(); astFactory.addASTChild(ref currentAST, (AST)returnAST); } else { goto _loop97_breakloop; } } _loop97_breakloop: ; } // ( ... )* Ob51.Parsing.NewAST tmp65_AST = null; tmp65_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp65_AST); match(57); { switch ( LA(1) ) { case 51: { Ob51.Parsing.NewAST tmp66_AST = null; tmp66_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp66_AST); match(51); type(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case 38: case LITERAL_END: case 52: case 57: case LITERAL_EMPTY: case LITERAL_EXTENSIBLE: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } formalParams_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_8_); } returnAST = formalParams_AST; } public void methAttributes() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST methAttributes_AST = null; try { // for error handling { if ((LA(1)==52) && (LA(2)==LITERAL_NEW)) { Ob51.Parsing.NewAST tmp67_AST = null; tmp67_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp67_AST); match(52); Ob51.Parsing.NewAST tmp68_AST = null; tmp68_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp68_AST); match(LITERAL_NEW); } else if ((tokenSet_11_.member(LA(1))) && (tokenSet_12_.member(LA(2)))) { } else { throw new NoViableAltException(LT(1), getFilename()); } } { switch ( LA(1) ) { case LITERAL_EMPTY: { Ob51.Parsing.NewAST tmp69_AST = null; tmp69_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp69_AST); match(LITERAL_EMPTY); break; } case LITERAL_EXTENSIBLE: { Ob51.Parsing.NewAST tmp70_AST = null; tmp70_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp70_AST); match(LITERAL_EXTENSIBLE); break; } default: if ((LA(1)==52) && (LA(2)==LITERAL_ABSTRACT)) { Ob51.Parsing.NewAST tmp71_AST = null; tmp71_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp71_AST); match(52); Ob51.Parsing.NewAST tmp72_AST = null; tmp72_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp72_AST); match(LITERAL_ABSTRACT); } else if ((LA(1)==38||LA(1)==LITERAL_END||LA(1)==52) && (tokenSet_13_.member(LA(2)))) { } else { throw new NoViableAltException(LT(1), getFilename()); } break; } } { switch ( LA(1) ) { case 52: { Ob51.Parsing.NewAST tmp73_AST = null; tmp73_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp73_AST); match(52); Ob51.Parsing.NewAST tmp74_AST = null; tmp74_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp74_AST); match(LITERAL_HANDLER); Ob51.Parsing.NewAST tmp75_AST = null; tmp75_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp75_AST); match(LITERAL_OF); constExpr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case 38: case LITERAL_END: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } methAttributes_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_14_); } returnAST = methAttributes_AST; } public void fpSection() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST fpSection_AST = null; try { // for error handling { switch ( LA(1) ) { case LITERAL_VAR: { Ob51.Parsing.NewAST tmp76_AST = null; tmp76_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp76_AST); match(LITERAL_VAR); break; } case LITERAL_IN: { Ob51.Parsing.NewAST tmp77_AST = null; tmp77_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp77_AST); match(LITERAL_IN); break; } case LITERAL_OUT: { Ob51.Parsing.NewAST tmp78_AST = null; tmp78_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp78_AST); match(LITERAL_OUT); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } Ob51.Parsing.NewAST tmp79_AST = null; tmp79_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp79_AST); match(ID); { // ( ... )* for (;;) { if ((LA(1)==52)) { Ob51.Parsing.NewAST tmp80_AST = null; tmp80_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp80_AST); match(52); Ob51.Parsing.NewAST tmp81_AST = null; tmp81_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp81_AST); match(ID); } else { goto _loop102_breakloop; } } _loop102_breakloop: ; } // ( ... )* Ob51.Parsing.NewAST tmp82_AST = null; tmp82_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp82_AST); match(51); type(); astFactory.addASTChild(ref currentAST, (AST)returnAST); fpSection_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_15_); } returnAST = fpSection_AST; } public void fieldsDef() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST fieldsDef_AST = null; try { // for error handling Ob51.Parsing.NewAST tmp83_AST = null; tmp83_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp83_AST); match(IdentList); Ob51.Parsing.NewAST tmp84_AST = null; tmp84_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp84_AST); match(51); type(); astFactory.addASTChild(ref currentAST, (AST)returnAST); fieldsDef_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_14_); } returnAST = fieldsDef_AST; } public void statement() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST statement_AST = null; try { // for error handling switch ( LA(1) ) { case MODULEID: case ID: { designator(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { switch ( LA(1) ) { case 44: { match(44); expr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case 56: { match(56); exprsList(); astFactory.addASTChild(ref currentAST, (AST)returnAST); match(57); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } statement_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_IF: { Ob51.Parsing.If tmp88_AST = null; tmp88_AST = (Ob51.Parsing.If) astFactory.create(LT(1), "Ob51.Parsing.If"); astFactory.makeASTRoot(ref currentAST, (AST)tmp88_AST); match(LITERAL_IF); expr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); match(LITERAL_THEN); statementsSeq(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { // ( ... )* for (;;) { if ((LA(1)==LITERAL_ELSIF)) { match(LITERAL_ELSIF); expr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); match(LITERAL_THEN); statementsSeq(); astFactory.addASTChild(ref currentAST, (AST)returnAST); } else { goto _loop124_breakloop; } } _loop124_breakloop: ; } // ( ... )* { switch ( LA(1) ) { case LITERAL_ELSE: { match(LITERAL_ELSE); statementsSeq(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case LITERAL_END: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(LITERAL_END); statement_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_CASE: { Ob51.Parsing.NewAST tmp94_AST = null; tmp94_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp94_AST); match(LITERAL_CASE); expr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); match(LITERAL_OF); caseVariant(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { // ( ... )* for (;;) { if ((LA(1)==77)) { Ob51.Parsing.NewAST tmp96_AST = null; tmp96_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp96_AST); match(77); caseVariant(); astFactory.addASTChild(ref currentAST, (AST)returnAST); } else { goto _loop127_breakloop; } } _loop127_breakloop: ; } // ( ... )* { switch ( LA(1) ) { case LITERAL_ELSE: { Ob51.Parsing.NewAST tmp97_AST = null; tmp97_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp97_AST); match(LITERAL_ELSE); statementsSeq(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case LITERAL_END: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } Ob51.Parsing.NewAST tmp98_AST = null; tmp98_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp98_AST); match(LITERAL_END); statement_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_WHILE: { Ob51.Parsing.Cycle tmp99_AST = null; tmp99_AST = (Ob51.Parsing.Cycle) astFactory.create(LT(1), "Ob51.Parsing.Cycle"); astFactory.makeASTRoot(ref currentAST, (AST)tmp99_AST); match(LITERAL_WHILE); expr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); match(LITERAL_DO); statementsSeq(); astFactory.addASTChild(ref currentAST, (AST)returnAST); match(LITERAL_END); statement_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_REPEAT: { Ob51.Parsing.Cycle tmp102_AST = null; tmp102_AST = (Ob51.Parsing.Cycle) astFactory.create(LT(1), "Ob51.Parsing.Cycle"); astFactory.makeASTRoot(ref currentAST, (AST)tmp102_AST); match(LITERAL_REPEAT); statementsSeq(); astFactory.addASTChild(ref currentAST, (AST)returnAST); Ob51.Parsing.NewAST tmp103_AST = null; tmp103_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp103_AST); match(LITERAL_UNTIL); expr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); statement_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_FOR: { Ob51.Parsing.Cycle tmp104_AST = null; tmp104_AST = (Ob51.Parsing.Cycle) astFactory.create(LT(1), "Ob51.Parsing.Cycle"); astFactory.makeASTRoot(ref currentAST, (AST)tmp104_AST); match(LITERAL_FOR); { switch ( LA(1) ) { case LITERAL_VAR: { Ob51.Parsing.NewAST tmp105_AST = null; tmp105_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp105_AST); match(LITERAL_VAR); Ob51.Parsing.NewAST tmp106_AST = null; tmp106_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp106_AST); match(ID); Ob51.Parsing.NewAST tmp107_AST = null; tmp107_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp107_AST); match(51); Ob51.Parsing.NewAST tmp108_AST = null; tmp108_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp108_AST); match(TYPE); break; } case ID: { Ob51.Parsing.NewAST tmp109_AST = null; tmp109_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp109_AST); match(ID); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(44); expr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); match(LITERAL_TO); expr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { switch ( LA(1) ) { case LITERAL_BY: { match(LITERAL_BY); constExpr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case LITERAL_DO: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(LITERAL_DO); statementsSeq(); astFactory.addASTChild(ref currentAST, (AST)returnAST); match(LITERAL_END); statement_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_LOOP: { Ob51.Parsing.Cycle tmp115_AST = null; tmp115_AST = (Ob51.Parsing.Cycle) astFactory.create(LT(1), "Ob51.Parsing.Cycle"); astFactory.addASTChild(ref currentAST, (AST)tmp115_AST); match(LITERAL_LOOP); statementsSeq(); astFactory.addASTChild(ref currentAST, (AST)returnAST); match(LITERAL_END); statement_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_WITH: { Ob51.Parsing.NewAST tmp117_AST = null; tmp117_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp117_AST); match(LITERAL_WITH); { switch ( LA(1) ) { case MODULEID: case ID: { guard(); astFactory.addASTChild(ref currentAST, (AST)returnAST); Ob51.Parsing.NewAST tmp118_AST = null; tmp118_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp118_AST); match(LITERAL_DO); statementsSeq(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case LITERAL_END: case LITERAL_ELSE: case 77: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } { // ( ... )* for (;;) { if ((LA(1)==77)) { Ob51.Parsing.NewAST tmp119_AST = null; tmp119_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp119_AST); match(77); guard(); astFactory.addASTChild(ref currentAST, (AST)returnAST); Ob51.Parsing.NewAST tmp120_AST = null; tmp120_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp120_AST); match(LITERAL_DO); statementsSeq(); astFactory.addASTChild(ref currentAST, (AST)returnAST); } else { goto _loop133_breakloop; } } _loop133_breakloop: ; } // ( ... )* { switch ( LA(1) ) { case LITERAL_ELSE: { Ob51.Parsing.NewAST tmp121_AST = null; tmp121_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp121_AST); match(LITERAL_ELSE); statementsSeq(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case LITERAL_END: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } Ob51.Parsing.NewAST tmp122_AST = null; tmp122_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp122_AST); match(LITERAL_END); statement_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_EXIT: { Ob51.Parsing.NewAST tmp123_AST = null; tmp123_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp123_AST); match(LITERAL_EXIT); statement_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_RETURN: { Ob51.Parsing.NewAST tmp124_AST = null; tmp124_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp124_AST); match(LITERAL_RETURN); expr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); statement_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_16_); } returnAST = statement_AST; } public void designator() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST designator_AST = null; try { // for error handling qualident(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { // ( ... )* for (;;) { switch ( LA(1) ) { case 42: { Ob51.Parsing.NewAST tmp125_AST = null; tmp125_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp125_AST); match(42); Ob51.Parsing.NewAST tmp126_AST = null; tmp126_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp126_AST); match(ID); break; } case 107: { Ob51.Parsing.NewAST tmp127_AST = null; tmp127_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp127_AST); match(107); exprsList(); astFactory.addASTChild(ref currentAST, (AST)returnAST); Ob51.Parsing.NewAST tmp128_AST = null; tmp128_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp128_AST); match(108); break; } case 55: { Ob51.Parsing.NewAST tmp129_AST = null; tmp129_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp129_AST); match(55); break; } default: if ((LA(1)==56) && (tokenSet_17_.member(LA(2)))) { Ob51.Parsing.NewAST tmp130_AST = null; tmp130_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp130_AST); match(56); exprsList(); astFactory.addASTChild(ref currentAST, (AST)returnAST); Ob51.Parsing.NewAST tmp131_AST = null; tmp131_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp131_AST); match(57); } else { goto _loop163_breakloop; } break; } } _loop163_breakloop: ; } // ( ... )* { switch ( LA(1) ) { case 109: { Ob51.Parsing.NewAST tmp132_AST = null; tmp132_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp132_AST); match(109); break; } case 38: case LITERAL_CLOSE: case LITERAL_END: case 44: case 45: case 46: case 50: case 51: case 52: case 56: case 57: case LITERAL_IN: case LITERAL_OF: case LITERAL_TO: case LITERAL_THEN: case LITERAL_ELSIF: case LITERAL_ELSE: case 77: case LITERAL_DO: case LITERAL_UNTIL: case LITERAL_BY: case 89: case 90: case 91: case 92: case 93: case 94: case LITERAL_IS: case 96: case LITERAL_OR: case 98: case LITERAL_DIV: case LITERAL_MOD: case 101: case 106: case 108: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } designator_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_18_); } returnAST = designator_AST; } public void expr() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST expr_AST = null; Ob51.Parsing.NewAST expr1__AST = null; Ob51.Parsing.NewAST rel__AST = null; Ob51.Parsing.NewAST expr2__AST = null; string opName; try { // for error handling simpleExpr(); expr1__AST = (Ob51.Parsing.NewAST)returnAST; expr_AST = (Ob51.Parsing.NewAST)currentAST.root; expr_AST = expr1__AST; currentAST.root = expr_AST; if ( (null != expr_AST) && (null != expr_AST.getFirstChild()) ) currentAST.child = expr_AST.getFirstChild(); else currentAST.child = expr_AST; currentAST.advanceChildToEnd(); { switch ( LA(1) ) { case 50: case LITERAL_IN: case 90: case 91: case 92: case 93: case 94: case LITERAL_IS: { relation(); rel__AST = (Ob51.Parsing.NewAST)returnAST; opName = rel__AST.getText(); simpleExpr(); expr2__AST = (Ob51.Parsing.NewAST)returnAST; expr_AST = (Ob51.Parsing.NewAST)currentAST.root; expr_AST = (Ob51.Parsing.NewAST) astFactory.make((AST)(Ob51.Parsing.Operation) astFactory.create(OperationToken,opName), (AST)expr_AST, (AST)expr2__AST); currentAST.root = expr_AST; if ( (null != expr_AST) && (null != expr_AST.getFirstChild()) ) currentAST.child = expr_AST.getFirstChild(); else currentAST.child = expr_AST; currentAST.advanceChildToEnd(); break; } case 38: case LITERAL_CLOSE: case LITERAL_END: case 51: case 52: case 57: case LITERAL_OF: case LITERAL_TO: case LITERAL_THEN: case LITERAL_ELSIF: case LITERAL_ELSE: case 77: case LITERAL_DO: case LITERAL_UNTIL: case LITERAL_BY: case 89: case 106: case 108: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_19_); } returnAST = expr_AST; } public void exprsList() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST exprsList_AST = null; try { // for error handling expr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { // ( ... )* for (;;) { if ((LA(1)==52)) { Ob51.Parsing.NewAST tmp133_AST = null; tmp133_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp133_AST); match(52); expr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); } else { goto _loop167_breakloop; } } _loop167_breakloop: ; } // ( ... )* exprsList_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_20_); } returnAST = exprsList_AST; } public void caseVariant() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST caseVariant_AST = null; try { // for error handling caseLabel(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { // ( ... )* for (;;) { if ((LA(1)==52)) { Ob51.Parsing.NewAST tmp134_AST = null; tmp134_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp134_AST); match(52); caseLabel(); astFactory.addASTChild(ref currentAST, (AST)returnAST); } else { goto _loop137_breakloop; } } _loop137_breakloop: ; } // ( ... )* Ob51.Parsing.NewAST tmp135_AST = null; tmp135_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp135_AST); match(51); statementsSeq(); astFactory.addASTChild(ref currentAST, (AST)returnAST); caseVariant_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_21_); } returnAST = caseVariant_AST; } public void guard() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST guard_AST = null; try { // for error handling qualident(); astFactory.addASTChild(ref currentAST, (AST)returnAST); Ob51.Parsing.NewAST tmp136_AST = null; tmp136_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp136_AST); match(51); qualident(); astFactory.addASTChild(ref currentAST, (AST)returnAST); guard_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_22_); } returnAST = guard_AST; } public void caseLabel() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST caseLabel_AST = null; try { // for error handling constExpr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { switch ( LA(1) ) { case 89: { Ob51.Parsing.NewAST tmp137_AST = null; tmp137_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp137_AST); match(89); constExpr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case 51: case 52: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } caseLabel_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_23_); } returnAST = caseLabel_AST; } public void simpleExpr() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST simpleExpr_AST = null; IToken head_ = null; Ob51.Parsing.NewAST head__AST = null; Ob51.Parsing.NewAST term1__AST = null; Ob51.Parsing.NewAST add__AST = null; Ob51.Parsing.NewAST term2__AST = null; string opName = null; try { // for error handling { switch ( LA(1) ) { case 96: { match(96); break; } case 46: { head_ = LT(1); head__AST = (Ob51.Parsing.NewAST) astFactory.create(head_); match(46); opName = head__AST.getText(); break; } case MODULEID: case ID: case NUM_VALUE: case STRING: case 56: case CHARACTER: case LITERAL_NIL: case 104: case 105: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } term(); term1__AST = (Ob51.Parsing.NewAST)returnAST; simpleExpr_AST = (Ob51.Parsing.NewAST)currentAST.root; if (!String.IsNullOrEmpty(opName)) simpleExpr_AST = (Ob51.Parsing.NewAST) astFactory.make((AST)(Ob51.Parsing.Operation) astFactory.create(OperationToken,opName), (AST)term1__AST); currentAST.root = simpleExpr_AST; if ( (null != simpleExpr_AST) && (null != simpleExpr_AST.getFirstChild()) ) currentAST.child = simpleExpr_AST.getFirstChild(); else currentAST.child = simpleExpr_AST; currentAST.advanceChildToEnd(); { // ( ... )* for (;;) { if ((LA(1)==46||LA(1)==96||LA(1)==LITERAL_OR)) { addOp(); add__AST = (Ob51.Parsing.NewAST)returnAST; opName = add__AST.getText(); term(); term2__AST = (Ob51.Parsing.NewAST)returnAST; simpleExpr_AST = (Ob51.Parsing.NewAST)currentAST.root; simpleExpr_AST = (Ob51.Parsing.NewAST) astFactory.make((AST)(Ob51.Parsing.Operation) astFactory.create(OperationToken,opName), (AST)simpleExpr_AST, (AST)term2__AST); currentAST.root = simpleExpr_AST; if ( (null != simpleExpr_AST) && (null != simpleExpr_AST.getFirstChild()) ) currentAST.child = simpleExpr_AST.getFirstChild(); else currentAST.child = simpleExpr_AST; currentAST.advanceChildToEnd(); } else { goto _loop148_breakloop; } } _loop148_breakloop: ; } // ( ... )* } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_24_); } returnAST = simpleExpr_AST; } public void relation() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST relation_AST = null; try { // for error handling switch ( LA(1) ) { case 50: { Ob51.Parsing.NewAST tmp139_AST = null; tmp139_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp139_AST); match(50); relation_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case 90: { Ob51.Parsing.NewAST tmp140_AST = null; tmp140_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp140_AST); match(90); relation_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case 91: { Ob51.Parsing.NewAST tmp141_AST = null; tmp141_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp141_AST); match(91); relation_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case 92: { Ob51.Parsing.NewAST tmp142_AST = null; tmp142_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp142_AST); match(92); relation_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case 93: { Ob51.Parsing.NewAST tmp143_AST = null; tmp143_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp143_AST); match(93); relation_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case 94: { Ob51.Parsing.NewAST tmp144_AST = null; tmp144_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp144_AST); match(94); relation_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_IN: { Ob51.Parsing.NewAST tmp145_AST = null; tmp145_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp145_AST); match(LITERAL_IN); relation_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_IS: { Ob51.Parsing.NewAST tmp146_AST = null; tmp146_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp146_AST); match(LITERAL_IS); relation_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_17_); } returnAST = relation_AST; } public void term() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST term_AST = null; try { // for error handling factor(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { // ( ... )* for (;;) { if ((tokenSet_25_.member(LA(1)))) { mulOp(); astFactory.addASTChild(ref currentAST, (AST)returnAST); factor(); astFactory.addASTChild(ref currentAST, (AST)returnAST); } else { goto _loop152_breakloop; } } _loop152_breakloop: ; } // ( ... )* term_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_26_); } returnAST = term_AST; } public void addOp() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST addOp_AST = null; try { // for error handling switch ( LA(1) ) { case 96: { Ob51.Parsing.NewAST tmp147_AST = null; tmp147_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp147_AST); match(96); addOp_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case 46: { Ob51.Parsing.NewAST tmp148_AST = null; tmp148_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp148_AST); match(46); addOp_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_OR: { Ob51.Parsing.NewAST tmp149_AST = null; tmp149_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp149_AST); match(LITERAL_OR); addOp_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_27_); } returnAST = addOp_AST; } public void factor() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST factor_AST = null; try { // for error handling switch ( LA(1) ) { case MODULEID: case ID: { designator(); astFactory.addASTChild(ref currentAST, (AST)returnAST); factor_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case NUM_VALUE: { Ob51.Parsing.NewAST tmp150_AST = null; tmp150_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp150_AST); match(NUM_VALUE); factor_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case CHARACTER: { Ob51.Parsing.NewAST tmp151_AST = null; tmp151_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp151_AST); match(CHARACTER); factor_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case STRING: { Ob51.Parsing.NewAST tmp152_AST = null; tmp152_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp152_AST); match(STRING); factor_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_NIL: { Ob51.Parsing.NewAST tmp153_AST = null; tmp153_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp153_AST); match(LITERAL_NIL); factor_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case 105: { set(); astFactory.addASTChild(ref currentAST, (AST)returnAST); factor_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case 56: { match(56); expr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); match(57); factor_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case 104: { Ob51.Parsing.NewAST tmp156_AST = null; tmp156_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp156_AST); match(104); factor(); astFactory.addASTChild(ref currentAST, (AST)returnAST); factor_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_28_); } returnAST = factor_AST; } public void mulOp() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST mulOp_AST = null; try { // for error handling switch ( LA(1) ) { case 45: { Ob51.Parsing.NewAST tmp157_AST = null; tmp157_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp157_AST); match(45); mulOp_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case 98: { Ob51.Parsing.NewAST tmp158_AST = null; tmp158_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp158_AST); match(98); mulOp_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_DIV: { Ob51.Parsing.NewAST tmp159_AST = null; tmp159_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp159_AST); match(LITERAL_DIV); mulOp_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case LITERAL_MOD: { Ob51.Parsing.NewAST tmp160_AST = null; tmp160_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp160_AST); match(LITERAL_MOD); mulOp_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } case 101: { Ob51.Parsing.NewAST tmp161_AST = null; tmp161_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp161_AST); match(101); mulOp_AST = (Ob51.Parsing.NewAST)currentAST.root; break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_27_); } returnAST = mulOp_AST; } public void set() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST set_AST = null; try { // for error handling match(105); { switch ( LA(1) ) { case MODULEID: case ID: case NUM_VALUE: case STRING: case 46: case 56: case 96: case CHARACTER: case LITERAL_NIL: case 104: case 105: { setElement(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { // ( ... )* for (;;) { if ((LA(1)==52)) { match(52); setElement(); astFactory.addASTChild(ref currentAST, (AST)returnAST); } else { goto _loop158_breakloop; } } _loop158_breakloop: ; } // ( ... )* break; } case 106: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(106); set_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_28_); } returnAST = set_AST; } public void setElement() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); Ob51.Parsing.NewAST setElement_AST = null; try { // for error handling expr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); { switch ( LA(1) ) { case 89: { Ob51.Parsing.NewAST tmp165_AST = null; tmp165_AST = (Ob51.Parsing.NewAST) astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp165_AST); match(89); expr(); astFactory.addASTChild(ref currentAST, (AST)returnAST); break; } case 52: case 106: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } setElement_AST = (Ob51.Parsing.NewAST)currentAST.root; } catch (RecognitionException ex) { reportError(ex); recover(ex,tokenSet_29_); } returnAST = setElement_AST; } public new Ob51.Parsing.NewAST getAST() { return (Ob51.Parsing.NewAST) returnAST; } private void initializeFactory() { if (astFactory == null) { astFactory = new ASTFactory("Ob51.Parsing.NewAST"); } initializeASTFactory( astFactory ); } static public void initializeASTFactory( ASTFactory factory ) { factory.setMaxNodeType(109); factory.setTokenTypeASTNodeType(ConstDeclToken, "Ob51.Parsing.ConstDecl"); factory.setTokenTypeASTNodeType(CycleToken, "Ob51.Parsing.Cycle"); factory.setTokenTypeASTNodeType(DeclsSeqToken, "Ob51.Parsing.DeclsSeq"); factory.setTokenTypeASTNodeType(EmptyToken, "Ob51.Parsing.EmptyNode"); factory.setTokenTypeASTNodeType(IfToken, "Ob51.Parsing.If"); factory.setTokenTypeASTNodeType(ModuleToken, "Ob51.Parsing.Module"); factory.setTokenTypeASTNodeType(OperationToken, "Ob51.Parsing.Operation"); factory.setTokenTypeASTNodeType(ProcDeclToken, "Ob51.Parsing.ProcDecl"); factory.setTokenTypeASTNodeType(StatsSeqToken, "Ob51.Parsing.StatsSeq"); factory.setTokenTypeASTNodeType(TypeDeclToken, "Ob51.Parsing.TypeDecl"); factory.setTokenTypeASTNodeType(VarDeclToken, "Ob51.Parsing.VarDecl"); } 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""", @"""ConstDeclToken""", @"""CycleToken""", @"""DeclsSeqToken""", @"""EmptyToken""", @"""IfToken""", @"""ModuleToken""", @"""OperationToken""", @"""ProcDeclToken""", @"""StatsSeqToken""", @"""TypeDeclToken""", @"""VarDeclToken""", @"""MODULE""", @""";""", @"""BEGIN""", @"""CLOSE""", @"""END""", @""".""", @"""IMPORT""", @""":=""", @"""*""", @"""-""", @"""CONST""", @"""TYPE""", @"""VAR""", @"""=""", @""":""", @""",""", @"""PROCEDURE""", @"""IdentDef""", @"""^""", @"""(""", @""")""", @"""IN""", @"""OUT""", @"""NEW""", @"""ABSTRACT""", @"""EMPTY""", @"""EXTENSIBLE""", @"""HANDLER""", @"""OF""", @"""ARRAY""", @"""LIMITED""", @"""RECORD""", @"""POINTER""", @"""TO""", @"""IdentList""", @"""IF""", @"""THEN""", @"""ELSIF""", @"""ELSE""", @"""CASE""", @"""|""", @"""WHILE""", @"""DO""", @"""REPEAT""", @"""UNTIL""", @"""FOR""", @"""TYPE""", @"""BY""", @"""LOOP""", @"""WITH""", @"""EXIT""", @"""RETURN""", @"""..""", @"""#""", @"""<""", @"""<=""", @""">""", @""">=""", @"""IS""", @"""+""", @"""OR""", @"""/""", @"""DIV""", @"""MOD""", @"""&""", @"""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 = { 9996209963925504L, 0L}; return data; } public static readonly BitSet tokenSet_1_ = new BitSet(mk_tokenSet_1_()); private static long[] mk_tokenSet_2_() { long[] data = { 3848290697216L, 0L}; return data; } public static readonly BitSet tokenSet_2_ = new BitSet(mk_tokenSet_2_()); private static long[] mk_tokenSet_3_() { long[] data = { 3298534883328L, 142336L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_3_ = new BitSet(mk_tokenSet_3_()); private static long[] mk_tokenSet_4_() { long[] data = { 7881299347898368L, 0L}; return data; } public static readonly BitSet tokenSet_4_ = new BitSet(mk_tokenSet_4_()); private static long[] mk_tokenSet_5_() { long[] data = { -4063241647033417728L, 66245543243330L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_5_ = new BitSet(mk_tokenSet_5_()); private static long[] mk_tokenSet_6_() { long[] data = { 274877906944L, 0L}; return data; } public static readonly BitSet tokenSet_6_ = new BitSet(mk_tokenSet_6_()); private static long[] mk_tokenSet_7_() { long[] data = { 6757873342218240L, 33587202L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_7_ = new BitSet(mk_tokenSet_7_()); private static long[] mk_tokenSet_8_() { long[] data = { -4463064756822999040L, 0L}; return data; } public static readonly BitSet tokenSet_8_ = new BitSet(mk_tokenSet_8_()); private static long[] mk_tokenSet_9_() { long[] data = { 2251799813685248L, 0L}; return data; } public static readonly BitSet tokenSet_9_ = new BitSet(mk_tokenSet_9_()); private static long[] mk_tokenSet_10_() { long[] data = { 18014398509481984L, 0L}; return data; } public static readonly BitSet tokenSet_10_ = new BitSet(mk_tokenSet_10_()); private static long[] mk_tokenSet_11_() { long[] data = { -4607179944898854912L, 0L}; return data; } public static readonly BitSet tokenSet_11_ = new BitSet(mk_tokenSet_11_()); private static long[] mk_tokenSet_12_() { long[] data = { 2320343093684994048L, 1L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_12_ = new BitSet(mk_tokenSet_12_()); private static long[] mk_tokenSet_13_() { long[] data = { 9996209966022656L, 1L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_13_ = new BitSet(mk_tokenSet_13_()); private static long[] mk_tokenSet_14_() { long[] data = { 2473901162496L, 0L}; return data; } public static readonly BitSet tokenSet_14_ = new BitSet(mk_tokenSet_14_()); private static long[] mk_tokenSet_15_() { long[] data = { 144115462953762816L, 0L}; return data; } public static readonly BitSet tokenSet_15_ = new BitSet(mk_tokenSet_15_()); private static long[] mk_tokenSet_16_() { long[] data = { 3573412790272L, 142336L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_16_ = new BitSet(mk_tokenSet_16_()); private static long[] mk_tokenSet_17_() { long[] data = { 72127962809384960L, 4127463571456L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_17_ = new BitSet(mk_tokenSet_17_()); private static long[] mk_tokenSet_18_() { long[] data = { 512411176328495104L, 22265078132290L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_18_ = new BitSet(mk_tokenSet_18_()); private static long[] mk_tokenSet_19_() { long[] data = { 150874160929701888L, 21990267334210L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_19_ = new BitSet(mk_tokenSet_19_()); private static long[] mk_tokenSet_20_() { long[] data = { 144115188075855872L, 17592186044416L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_20_ = new BitSet(mk_tokenSet_20_()); private static long[] mk_tokenSet_21_() { long[] data = { 2199023255552L, 10240L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_21_ = new BitSet(mk_tokenSet_21_()); private static long[] mk_tokenSet_22_() { long[] data = { 0L, 32768L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_22_ = new BitSet(mk_tokenSet_22_()); private static long[] mk_tokenSet_23_() { long[] data = { 6755399441055744L, 0L}; return data; } public static readonly BitSet tokenSet_23_ = new BitSet(mk_tokenSet_23_()); private static long[] mk_tokenSet_24_() { long[] data = { 440230436988256256L, 21994495192642L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_24_ = new BitSet(mk_tokenSet_24_()); private static long[] mk_tokenSet_25_() { long[] data = { 35184372088832L, 257698037760L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_25_ = new BitSet(mk_tokenSet_25_()); private static long[] mk_tokenSet_26_() { long[] data = { 440300805732433920L, 22007380094530L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_26_ = new BitSet(mk_tokenSet_26_()); private static long[] mk_tokenSet_27_() { long[] data = { 72057594065207296L, 4123168604160L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_27_ = new BitSet(mk_tokenSet_27_()); private static long[] mk_tokenSet_28_() { long[] data = { 440335990104522752L, 22265078132290L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_28_ = new BitSet(mk_tokenSet_28_()); private static long[] mk_tokenSet_29_() { long[] data = { 4503599627370496L, 4398046511104L, 0L, 0L}; return data; } public static readonly BitSet tokenSet_29_ = new BitSet(mk_tokenSet_29_()); } }