// $ANTLR start "propertyModifiers" // C:\\Projects\\CalcEngine\\src\\CalcEngine\\Parsers\\Antlr\\AntlrCalcEngine.g:100:1: propertyModifiers : ( exclusivePropertyModifier -> ^( MODIFIERS exclusivePropertyModifier ) | ( propertyModifier )+ -> ^( MODIFIERS ( propertyModifier )+ ) ); public propertyModifiers_return propertyModifiers() // throws RecognitionException [1] { var retval = new propertyModifiers_return(); retval.Start = input.LT( 1 ); CommonTree root_0 = null; exclusivePropertyModifier_return exclusivePropertyModifier21 = default( exclusivePropertyModifier_return ); propertyModifier_return propertyModifier22 = default( propertyModifier_return ); var stream_propertyModifier = new RewriteRuleSubtreeStream( adaptor, "rule propertyModifier" ); var stream_exclusivePropertyModifier = new RewriteRuleSubtreeStream( adaptor, "rule exclusivePropertyModifier" ); try { // C:\\Projects\\CalcEngine\\src\\CalcEngine\\Parsers\\Antlr\\AntlrCalcEngine.g:101:2: ( exclusivePropertyModifier -> ^( MODIFIERS exclusivePropertyModifier ) | ( propertyModifier )+ -> ^( MODIFIERS ( propertyModifier )+ ) ) int alt8 = 2; int LA8_0 = input.LA( 1 ); if ( ( LA8_0 == 64 ) ) alt8 = 1; else if ( ( ( LA8_0 >= 65 && LA8_0 <= 66 ) ) ) alt8 = 2; else { var nvae_d8s0 = new NoViableAltException( "", 8, 0, input ); throw nvae_d8s0; } switch ( alt8 ) { case 1: // C:\\Projects\\CalcEngine\\src\\CalcEngine\\Parsers\\Antlr\\AntlrCalcEngine.g:101:4: exclusivePropertyModifier { PushFollow( FOLLOW_exclusivePropertyModifier_in_propertyModifiers419 ); exclusivePropertyModifier21 = exclusivePropertyModifier(); state.followingStackPointer--; stream_exclusivePropertyModifier.Add( exclusivePropertyModifier21.Tree ); // AST REWRITE // elements: exclusivePropertyModifier // token labels: // rule labels: retval // token list labels: // rule list labels: // wildcard labels: retval.Tree = root_0; var stream_retval = new RewriteRuleSubtreeStream( adaptor, "rule retval", retval != null ? retval.Tree : null ); root_0 = (CommonTree)adaptor.GetNilNode(); // 101:30: -> ^( MODIFIERS exclusivePropertyModifier ) { // C:\\Projects\\CalcEngine\\src\\CalcEngine\\Parsers\\Antlr\\AntlrCalcEngine.g:101:33: ^( MODIFIERS exclusivePropertyModifier ) { var root_1 = (CommonTree)adaptor.GetNilNode(); root_1 = (CommonTree)adaptor.BecomeRoot( adaptor.Create( MODIFIERS, "MODIFIERS" ), root_1 ); adaptor.AddChild( root_1, stream_exclusivePropertyModifier.NextTree() ); adaptor.AddChild( root_0, root_1 ); } } retval.Tree = root_0; retval.Tree = root_0; } break; case 2: // C:\\Projects\\CalcEngine\\src\\CalcEngine\\Parsers\\Antlr\\AntlrCalcEngine.g:102:4: ( propertyModifier )+ { // C:\\Projects\\CalcEngine\\src\\CalcEngine\\Parsers\\Antlr\\AntlrCalcEngine.g:102:4: ( propertyModifier )+ int cnt7 = 0; do { int alt7 = 2; int LA7_0 = input.LA( 1 ); if ( ( ( LA7_0 >= 65 && LA7_0 <= 66 ) ) ) alt7 = 1; switch ( alt7 ) { case 1: // C:\\Projects\\CalcEngine\\src\\CalcEngine\\Parsers\\Antlr\\AntlrCalcEngine.g:102:4: propertyModifier { PushFollow( FOLLOW_propertyModifier_in_propertyModifiers434 ); propertyModifier22 = propertyModifier(); state.followingStackPointer--; stream_propertyModifier.Add( propertyModifier22.Tree ); } break; default: if ( cnt7 >= 1 ) goto loop7; var eee7 = new EarlyExitException( 7, input ); throw eee7; } cnt7++; } while ( true ); loop7: ; // Stops C# compiler whining that label 'loop7' has no statements // AST REWRITE // elements: propertyModifier // token labels: // rule labels: retval // token list labels: // rule list labels: // wildcard labels: retval.Tree = root_0; var stream_retval = new RewriteRuleSubtreeStream( adaptor, "rule retval", retval != null ? retval.Tree : null ); root_0 = (CommonTree)adaptor.GetNilNode(); // 102:22: -> ^( MODIFIERS ( propertyModifier )+ ) { // C:\\Projects\\CalcEngine\\src\\CalcEngine\\Parsers\\Antlr\\AntlrCalcEngine.g:102:25: ^( MODIFIERS ( propertyModifier )+ ) { var root_1 = (CommonTree)adaptor.GetNilNode(); root_1 = (CommonTree)adaptor.BecomeRoot( adaptor.Create( MODIFIERS, "MODIFIERS" ), root_1 ); if ( !( stream_propertyModifier.HasNext() ) ) throw new RewriteEarlyExitException(); while ( stream_propertyModifier.HasNext() ) adaptor.AddChild( root_1, stream_propertyModifier.NextTree() ); stream_propertyModifier.Reset(); adaptor.AddChild( root_0, root_1 ); } } retval.Tree = root_0; retval.Tree = root_0; } break; } retval.Stop = input.LT( -1 ); retval.Tree = adaptor.RulePostProcessing( root_0 ); adaptor.SetTokenBoundaries( retval.Tree, (IToken)retval.Start, (IToken)retval.Stop ); } catch ( RecognitionException re ) { ReportError( re ); Recover( input, re ); // Conversion of the second argument necessary, but harmless retval.Tree = adaptor.ErrorNode( input, (IToken)retval.Start, input.LT( -1 ), re ); } finally {} return retval; }
// $ANTLR end "TSTOP" // $ANTLR start "WS" public void mWS() // throws RecognitionException [2] { try { int _type = WS; int _channel = DEFAULT_TOKEN_CHANNEL; // C:\\Development\\TT.Net\\TT\\Template.g:23:4: ( ( '\\r' | '\\n' | '\\t' | ' ' )+ ) // C:\\Development\\TT.Net\\TT\\Template.g:23:6: ( '\\r' | '\\n' | '\\t' | ' ' )+ { // C:\\Development\\TT.Net\\TT\\Template.g:23:6: ( '\\r' | '\\n' | '\\t' | ' ' )+ int cnt3 = 0; do { int alt3 = 2; int LA3_0 = input.LA(1); if ( ((LA3_0 >= '\t' && LA3_0 <= '\n') || LA3_0 == '\r' || LA3_0 == ' ') ) { alt3 = 1; } switch (alt3) { case 1 : // C:\\Development\\TT.Net\\TT\\Template.g: { if ( (input.LA(1) >= '\t' && input.LA(1) <= '\n') || input.LA(1) == '\r' || input.LA(1) == ' ' ) { input.Consume(); } else { MismatchedSetException mse = new MismatchedSetException(null,input); Recover(mse); throw mse;} } break; default: if ( cnt3 >= 1 ) goto loop3; EarlyExitException eee3 = new EarlyExitException(3, input); throw eee3; } cnt3++; } while (true); loop3: ; // Stops C# compiler whining that label 'loop3' has no statements _channel=HIDDEN; } state.type = _type; state.channel = _channel; } finally { } }
private void mLETTERS() { EnterRule_LETTERS(); EnterRule("LETTERS", 40); TraceIn("LETTERS", 40); try { int _type = LETTERS; int _channel = DefaultTokenChannel; // FlashTeaseScript.g:229:2: ( ( 'a' .. 'z' | 'A' .. 'Z' )+ ) DebugEnterAlt(1); // FlashTeaseScript.g:229:4: ( 'a' .. 'z' | 'A' .. 'Z' )+ { DebugLocation(229, 4); // FlashTeaseScript.g:229:4: ( 'a' .. 'z' | 'A' .. 'Z' )+ int cnt5=0; try { DebugEnterSubRule(5); while (true) { int alt5=2; try { DebugEnterDecision(5, false); int LA5_0 = input.LA(1); if (((LA5_0>='A' && LA5_0<='Z')||(LA5_0>='a' && LA5_0<='z'))) { alt5 = 1; } } finally { DebugExitDecision(5); } switch (alt5) { case 1: DebugEnterAlt(1); // FlashTeaseScript.g: { DebugLocation(229, 4); input.Consume(); } break; default: if (cnt5 >= 1) goto loop5; EarlyExitException eee5 = new EarlyExitException( 5, input ); DebugRecognitionException(eee5); throw eee5; } cnt5++; } loop5: ; } finally { DebugExitSubRule(5); } } state.type = _type; state.channel = _channel; } finally { TraceOut("LETTERS", 40); LeaveRule("LETTERS", 40); LeaveRule_LETTERS(); } }
// $ANTLR start "structdec" // Interp.g:93:1: structdec returns [StructDeclaration ret] : ( 'Struct' variable '{' (el1= structvardec )+ '}' ) END_OF_STATEMENT ; public InterpParser.structdec_return structdec() // throws RecognitionException [1] { InterpParser.structdec_return retval = new InterpParser.structdec_return(); retval.Start = input.LT(1); object root_0 = null; IToken string_literal26 = null; IToken char_literal28 = null; IToken char_literal29 = null; IToken END_OF_STATEMENT30 = null; InterpParser.structvardec_return el1 = null; InterpParser.variable_return variable27 = null; object string_literal26_tree=null; object char_literal28_tree=null; object char_literal29_tree=null; object END_OF_STATEMENT30_tree=null; retval.ret = new StructDeclaration(); try { // Interp.g:97:2: ( ( 'Struct' variable '{' (el1= structvardec )+ '}' ) END_OF_STATEMENT ) // Interp.g:97:4: ( 'Struct' variable '{' (el1= structvardec )+ '}' ) END_OF_STATEMENT { root_0 = (object)adaptor.GetNilNode(); // Interp.g:97:4: ( 'Struct' variable '{' (el1= structvardec )+ '}' ) // Interp.g:97:5: 'Struct' variable '{' (el1= structvardec )+ '}' { string_literal26=(IToken)Match(input,16,FOLLOW_16_in_structdec446); string_literal26_tree = (object)adaptor.Create(string_literal26); adaptor.AddChild(root_0, string_literal26_tree); PushFollow(FOLLOW_variable_in_structdec448); variable27 = variable(); state.followingStackPointer--; adaptor.AddChild(root_0, variable27.Tree); retval.ret.setName(((variable27 != null) ? variable27.ret : null)); char_literal28=(IToken)Match(input,17,FOLLOW_17_in_structdec453); char_literal28_tree = (object)adaptor.Create(char_literal28); adaptor.AddChild(root_0, char_literal28_tree); // Interp.g:98:6: (el1= structvardec )+ int cnt7 = 0; do { int alt7 = 2; int LA7_0 = input.LA(1); if ( (LA7_0 == TYPE) ) { alt7 = 1; } switch (alt7) { case 1 : // Interp.g:98:7: el1= structvardec { PushFollow(FOLLOW_structvardec_in_structdec458); el1 = structvardec(); state.followingStackPointer--; adaptor.AddChild(root_0, el1.Tree); retval.ret.setVarType(((el1 != null) ? el1.ret : null)); } break; default: if ( cnt7 >= 1 ) goto loop7; EarlyExitException eee7 = new EarlyExitException(7, input); throw eee7; } cnt7++; } while (true); loop7: ; // Stops C# compiler whining that label 'loop7' has no statements char_literal29=(IToken)Match(input,18,FOLLOW_18_in_structdec465); char_literal29_tree = (object)adaptor.Create(char_literal29); adaptor.AddChild(root_0, char_literal29_tree); } END_OF_STATEMENT30=(IToken)Match(input,END_OF_STATEMENT,FOLLOW_END_OF_STATEMENT_in_structdec467); END_OF_STATEMENT30_tree = (object)adaptor.Create(END_OF_STATEMENT30); adaptor.AddChild(root_0, END_OF_STATEMENT30_tree); } retval.Stop = input.LT(-1); retval.Tree = (object)adaptor.RulePostProcessing(root_0); adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop); } catch (RecognitionException re) { ReportError(re); Recover(input,re); // Conversion of the second argument necessary, but harmless retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re); } finally { } return retval; }
// $ANTLR start "diagram" // D:\\Olle\\Projects\\WikiUml\\source\\Grammar\\WikiUml.g:20:1: diagram returns [Diagram result] : ( ( associated_classes )+ EOF | ); public Diagram diagram() // throws RecognitionException [1] { Diagram result = default(Diagram); result = new Diagram(); try { // D:\\Olle\\Projects\\WikiUml\\source\\Grammar\\WikiUml.g:23:4: ( ( associated_classes )+ EOF | ) int alt2 = 2; int LA2_0 = input.LA(1); if ( ((LA2_0 >= WS && LA2_0 <= LBRACK)) ) { alt2 = 1; } else if ( (LA2_0 == EOF) ) { alt2 = 2; } else { NoViableAltException nvae_d2s0 = new NoViableAltException("", 2, 0, input); throw nvae_d2s0; } switch (alt2) { case 1 : // D:\\Olle\\Projects\\WikiUml\\source\\Grammar\\WikiUml.g:23:5: ( associated_classes )+ EOF { // D:\\Olle\\Projects\\WikiUml\\source\\Grammar\\WikiUml.g:23:5: ( associated_classes )+ int cnt1 = 0; do { int alt1 = 2; int LA1_0 = input.LA(1); if ( ((LA1_0 >= WS && LA1_0 <= LBRACK)) ) { alt1 = 1; } switch (alt1) { case 1 : // D:\\Olle\\Projects\\WikiUml\\source\\Grammar\\WikiUml.g:23:6: associated_classes { PushFollow(FOLLOW_associated_classes_in_diagram62); associated_classes(); state.followingStackPointer--; } break; default: if ( cnt1 >= 1 ) goto loop1; EarlyExitException eee = new EarlyExitException(1, input); throw eee; } cnt1++; } while (true); loop1: ; // Stops C# compiler whinging that label 'loop1' has no statements Match(input,EOF,FOLLOW_EOF_in_diagram66); result.umlClasses.AddRange(umlClasses.Values); result.umlClasses.AddRange(unnamedUmlClasses); } break; case 2 : // D:\\Olle\\Projects\\WikiUml\\source\\Grammar\\WikiUml.g:23:132: { } break; } } catch (RecognitionException re) { ReportError(re); Recover(input,re); } finally { } return result; }
private void mINT() { EnterRule_INT(); EnterRule("INT", 19); TraceIn("INT", 19); try { int _type = INT; int _channel = DefaultTokenChannel; // D:\\_Dokumente\\GitHub\\lokad-codedsl\\Source\\MessageContracts.g:125:5: ( ( '0' .. '9' )+ ) DebugEnterAlt(1); // D:\\_Dokumente\\GitHub\\lokad-codedsl\\Source\\MessageContracts.g:125:7: ( '0' .. '9' )+ { DebugLocation(125, 7); // D:\\_Dokumente\\GitHub\\lokad-codedsl\\Source\\MessageContracts.g:125:7: ( '0' .. '9' )+ int cnt2=0; try { DebugEnterSubRule(2); while (true) { int alt2=2; try { DebugEnterDecision(2, decisionCanBacktrack[2]); int LA2_0 = input.LA(1); if (((LA2_0>='0' && LA2_0<='9'))) { alt2 = 1; } } finally { DebugExitDecision(2); } switch (alt2) { case 1: DebugEnterAlt(1); // D:\\_Dokumente\\GitHub\\lokad-codedsl\\Source\\MessageContracts.g: { DebugLocation(125, 7); input.Consume(); } break; default: if (cnt2 >= 1) goto loop2; EarlyExitException eee2 = new EarlyExitException( 2, input ); DebugRecognitionException(eee2); throw eee2; } cnt2++; } loop2: ; } finally { DebugExitSubRule(2); } } state.type = _type; state.channel = _channel; } finally { TraceOut("INT", 19); LeaveRule("INT", 19); LeaveRule_INT(); } }
// $ANTLR end "NEWLINE" // $ANTLR start "WORDCHAR" public void mWORDCHAR() // throws RecognitionException [2] { try { int _type = WORDCHAR; int _channel = DEFAULT_TOKEN_CHANNEL; // SpecFlowLangLexer_en.g:35:17: ( ( ( '\\u0000' .. '\\b' ) | ( '\\u000B' .. '\\f' ) | ( '\\u000E' .. '\\u001F' ) | ( '!' .. '\"' ) | ( '$' .. '?' ) | ( 'A' .. '\\uFFFF' ) )+ ) // SpecFlowLangLexer_en.g:35:19: ( ( '\\u0000' .. '\\b' ) | ( '\\u000B' .. '\\f' ) | ( '\\u000E' .. '\\u001F' ) | ( '!' .. '\"' ) | ( '$' .. '?' ) | ( 'A' .. '\\uFFFF' ) )+ { // SpecFlowLangLexer_en.g:35:19: ( ( '\\u0000' .. '\\b' ) | ( '\\u000B' .. '\\f' ) | ( '\\u000E' .. '\\u001F' ) | ( '!' .. '\"' ) | ( '$' .. '?' ) | ( 'A' .. '\\uFFFF' ) )+ int cnt7 = 0; do { int alt7 = 7; int LA7_0 = input.LA(1); if ( ((LA7_0 >= '\u0000' && LA7_0 <= '\b')) ) { alt7 = 1; } else if ( ((LA7_0 >= '\u000B' && LA7_0 <= '\f')) ) { alt7 = 2; } else if ( ((LA7_0 >= '\u000E' && LA7_0 <= '\u001F')) ) { alt7 = 3; } else if ( ((LA7_0 >= '!' && LA7_0 <= '\"')) ) { alt7 = 4; } else if ( ((LA7_0 >= '$' && LA7_0 <= '?')) ) { alt7 = 5; } else if ( ((LA7_0 >= 'A' && LA7_0 <= '\uFFFF')) ) { alt7 = 6; } switch (alt7) { case 1 : // SpecFlowLangLexer_en.g:35:20: ( '\\u0000' .. '\\b' ) { // SpecFlowLangLexer_en.g:35:20: ( '\\u0000' .. '\\b' ) // SpecFlowLangLexer_en.g:35:21: '\\u0000' .. '\\b' { MatchRange('\u0000','\b'); if (state.failed) return ; } } break; case 2 : // SpecFlowLangLexer_en.g:36:7: ( '\\u000B' .. '\\f' ) { // SpecFlowLangLexer_en.g:36:7: ( '\\u000B' .. '\\f' ) // SpecFlowLangLexer_en.g:36:8: '\\u000B' .. '\\f' { MatchRange('\u000B','\f'); if (state.failed) return ; } } break; case 3 : // SpecFlowLangLexer_en.g:37:7: ( '\\u000E' .. '\\u001F' ) { // SpecFlowLangLexer_en.g:37:7: ( '\\u000E' .. '\\u001F' ) // SpecFlowLangLexer_en.g:37:8: '\\u000E' .. '\\u001F' { MatchRange('\u000E','\u001F'); if (state.failed) return ; } } break; case 4 : // SpecFlowLangLexer_en.g:38:7: ( '!' .. '\"' ) { // SpecFlowLangLexer_en.g:38:7: ( '!' .. '\"' ) // SpecFlowLangLexer_en.g:38:8: '!' .. '\"' { MatchRange('!','\"'); if (state.failed) return ; } } break; case 5 : // SpecFlowLangLexer_en.g:39:7: ( '$' .. '?' ) { // SpecFlowLangLexer_en.g:39:7: ( '$' .. '?' ) // SpecFlowLangLexer_en.g:39:8: '$' .. '?' { MatchRange('$','?'); if (state.failed) return ; } } break; case 6 : // SpecFlowLangLexer_en.g:40:7: ( 'A' .. '\\uFFFF' ) { // SpecFlowLangLexer_en.g:40:7: ( 'A' .. '\\uFFFF' ) // SpecFlowLangLexer_en.g:40:8: 'A' .. '\\uFFFF' { MatchRange('A','\uFFFF'); if (state.failed) return ; } } break; default: if ( cnt7 >= 1 ) goto loop7; if ( state.backtracking > 0 ) {state.failed = true; return ;} EarlyExitException eee7 = new EarlyExitException(7, input); throw eee7; } cnt7++; } while (true); loop7: ; // Stops C# compiler whinging that label 'loop7' has no statements } state.type = _type; state.channel = _channel; } finally { } }
private AstParserRuleReturnScope<object, IToken> formalParameterDecls() { EnterRule_formalParameterDecls(); EnterRule("formalParameterDecls", 40); TraceIn("formalParameterDecls", 40); AstParserRuleReturnScope<object, IToken> retval = new AstParserRuleReturnScope<object, IToken>(); retval.Start = (IToken)input.LT(1); int formalParameterDecls_StartIndex = input.Index; object root_0 = default(object); IToken char_literal200 = default(IToken); IToken char_literal203 = default(IToken); AstParserRuleReturnScope<object, IToken> ellipsisParameterDecl198 = default(AstParserRuleReturnScope<object, IToken>); AstParserRuleReturnScope<object, IToken> normalParameterDecl199 = default(AstParserRuleReturnScope<object, IToken>); AstParserRuleReturnScope<object, IToken> normalParameterDecl201 = default(AstParserRuleReturnScope<object, IToken>); AstParserRuleReturnScope<object, IToken> normalParameterDecl202 = default(AstParserRuleReturnScope<object, IToken>); AstParserRuleReturnScope<object, IToken> ellipsisParameterDecl204 = default(AstParserRuleReturnScope<object, IToken>); object char_literal200_tree = default(object); object char_literal203_tree = default(object); try { DebugEnterRule(GrammarFileName, "formalParameterDecls"); DebugLocation(677, 4); try { if (state.backtracking > 0 && AlreadyParsedRule(input, 40)) { return retval; } // Java.g:678:5: ( ellipsisParameterDecl | normalParameterDecl ( ',' normalParameterDecl )* | ( normalParameterDecl ',' )+ ellipsisParameterDecl ) int alt75=3; try { DebugEnterDecision(75, false); switch (input.LA(1)) { case FINAL: { int LA75_2 = input.LA(2); if ((EvaluatePredicate(synpred99_Java_fragment))) { alt75 = 1; } else if ((EvaluatePredicate(synpred101_Java_fragment))) { alt75 = 2; } else if ((true)) { alt75 = 3; } else { if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 75, 1, input, 2); DebugRecognitionException(nvae); throw nvae; } } break; case MONKEYS_AT: { int LA75_2 = input.LA(2); if ((EvaluatePredicate(synpred99_Java_fragment))) { alt75 = 1; } else if ((EvaluatePredicate(synpred101_Java_fragment))) { alt75 = 2; } else if ((true)) { alt75 = 3; } else { if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 75, 2, input, 2); DebugRecognitionException(nvae); throw nvae; } } break; case IDENTIFIER: { int LA75_2 = input.LA(2); if ((EvaluatePredicate(synpred99_Java_fragment))) { alt75 = 1; } else if ((EvaluatePredicate(synpred101_Java_fragment))) { alt75 = 2; } else if ((true)) { alt75 = 3; } else { if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 75, 3, input, 2); DebugRecognitionException(nvae); throw nvae; } } break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: { int LA75_2 = input.LA(2); if ((EvaluatePredicate(synpred99_Java_fragment))) { alt75 = 1; } else if ((EvaluatePredicate(synpred101_Java_fragment))) { alt75 = 2; } else if ((true)) { alt75 = 3; } else { if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 75, 4, input, 2); DebugRecognitionException(nvae); throw nvae; } } break; default: { if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 75, 0, input, 1); DebugRecognitionException(nvae); throw nvae; } } } finally { DebugExitDecision(75); } switch (alt75) { case 1: DebugEnterAlt(1); // Java.g:678:9: ellipsisParameterDecl { root_0 = (object)adaptor.Nil(); DebugLocation(678, 9); PushFollow(Follow._ellipsisParameterDecl_in_formalParameterDecls3181); ellipsisParameterDecl198=ellipsisParameterDecl(); PopFollow(); if (state.failed) return retval; if (state.backtracking == 0) adaptor.AddChild(root_0, ellipsisParameterDecl198.Tree); } break; case 2: DebugEnterAlt(2); // Java.g:679:9: normalParameterDecl ( ',' normalParameterDecl )* { root_0 = (object)adaptor.Nil(); DebugLocation(679, 9); PushFollow(Follow._normalParameterDecl_in_formalParameterDecls3191); normalParameterDecl199=normalParameterDecl(); PopFollow(); if (state.failed) return retval; if (state.backtracking == 0) adaptor.AddChild(root_0, normalParameterDecl199.Tree); DebugLocation(680, 9); // Java.g:680:9: ( ',' normalParameterDecl )* try { DebugEnterSubRule(73); while (true) { int alt73=2; try { DebugEnterDecision(73, false); int LA73_1 = input.LA(1); if ((LA73_1==COMMA)) { alt73 = 1; } } finally { DebugExitDecision(73); } switch ( alt73 ) { case 1: DebugEnterAlt(1); // Java.g:680:10: ',' normalParameterDecl { DebugLocation(680, 10); char_literal200=(IToken)Match(input,COMMA,Follow._COMMA_in_formalParameterDecls3202); if (state.failed) return retval; if (state.backtracking == 0) { char_literal200_tree = (object)adaptor.Create(char_literal200); adaptor.AddChild(root_0, char_literal200_tree); } DebugLocation(680, 14); PushFollow(Follow._normalParameterDecl_in_formalParameterDecls3204); normalParameterDecl201=normalParameterDecl(); PopFollow(); if (state.failed) return retval; if (state.backtracking == 0) adaptor.AddChild(root_0, normalParameterDecl201.Tree); } break; default: goto loop73; } } loop73: ; } finally { DebugExitSubRule(73); } } break; case 3: DebugEnterAlt(3); // Java.g:682:9: ( normalParameterDecl ',' )+ ellipsisParameterDecl { root_0 = (object)adaptor.Nil(); DebugLocation(682, 9); // Java.g:682:9: ( normalParameterDecl ',' )+ int cnt74=0; try { DebugEnterSubRule(74); while (true) { int alt74=2; try { DebugEnterDecision(74, false); switch (input.LA(1)) { case FINAL: { int LA74_2 = input.LA(2); if ((EvaluatePredicate(synpred102_Java_fragment))) { alt74 = 1; } } break; case MONKEYS_AT: { int LA74_2 = input.LA(2); if ((EvaluatePredicate(synpred102_Java_fragment))) { alt74 = 1; } } break; case IDENTIFIER: { int LA74_2 = input.LA(2); if ((EvaluatePredicate(synpred102_Java_fragment))) { alt74 = 1; } } break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: { int LA74_2 = input.LA(2); if ((EvaluatePredicate(synpred102_Java_fragment))) { alt74 = 1; } } break; } } finally { DebugExitDecision(74); } switch (alt74) { case 1: DebugEnterAlt(1); // Java.g:682:10: normalParameterDecl ',' { DebugLocation(682, 10); PushFollow(Follow._normalParameterDecl_in_formalParameterDecls3226); normalParameterDecl202=normalParameterDecl(); PopFollow(); if (state.failed) return retval; if (state.backtracking == 0) adaptor.AddChild(root_0, normalParameterDecl202.Tree); DebugLocation(683, 9); char_literal203=(IToken)Match(input,COMMA,Follow._COMMA_in_formalParameterDecls3236); if (state.failed) return retval; if (state.backtracking == 0) { char_literal203_tree = (object)adaptor.Create(char_literal203); adaptor.AddChild(root_0, char_literal203_tree); } } break; default: if (cnt74 >= 1) goto loop74; if (state.backtracking>0) {state.failed=true; return retval;} EarlyExitException eee74 = new EarlyExitException( 74, input ); DebugRecognitionException(eee74); throw eee74; } cnt74++; } loop74: ; } finally { DebugExitSubRule(74); } DebugLocation(685, 9); PushFollow(Follow._ellipsisParameterDecl_in_formalParameterDecls3258); ellipsisParameterDecl204=ellipsisParameterDecl(); PopFollow(); if (state.failed) return retval; if (state.backtracking == 0) adaptor.AddChild(root_0, ellipsisParameterDecl204.Tree); } break; } retval.Stop = (IToken)input.LT(-1); if (state.backtracking == 0) { retval.Tree = (object)adaptor.RulePostProcessing(root_0); adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop); } } catch (RecognitionException re) { ReportError(re); Recover(input,re); retval.Tree = (object)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re); } finally { TraceOut("formalParameterDecls", 40); LeaveRule("formalParameterDecls", 40); LeaveRule_formalParameterDecls(); if (state.backtracking > 0) { Memoize(input, 40, formalParameterDecls_StartIndex); } } DebugLocation(686, 4); } finally { DebugExitRule(GrammarFileName, "formalParameterDecls"); } return retval; }
private void mDigits() { EnterRule_Digits(); EnterRule("Digits", 110); TraceIn("Digits", 110); try { // C:\\Users\\exKAZUu\\Projects\\Code2Xml\\Code2Xml.Core\\Generators\\ANTLRv3\\Php\\Php.g:678:2: ( ( '0' .. '9' )+ ) DebugEnterAlt(1); // C:\\Users\\exKAZUu\\Projects\\Code2Xml\\Code2Xml.Core\\Generators\\ANTLRv3\\Php\\Php.g:678:4: ( '0' .. '9' )+ { DebugLocation(678, 7); // C:\\Users\\exKAZUu\\Projects\\Code2Xml\\Code2Xml.Core\\Generators\\ANTLRv3\\Php\\Php.g:678:7: ( '0' .. '9' )+ int cnt16=0; try { DebugEnterSubRule(16); while (true) { int alt16=2; try { DebugEnterDecision(16, false); int LA16_1 = input.LA(1); if (((LA16_1>='0' && LA16_1<='9'))) { alt16 = 1; } } finally { DebugExitDecision(16); } switch (alt16) { case 1: DebugEnterAlt(1); // C:\\Users\\exKAZUu\\Projects\\Code2Xml\\Code2Xml.Core\\Generators\\ANTLRv3\\Php\\Php.g: { DebugLocation(678, 7); input.Consume(); state.failed=false; } break; default: if (cnt16 >= 1) goto loop16; if (state.backtracking>0) {state.failed=true; return;} EarlyExitException eee16 = new EarlyExitException( 16, input ); DebugRecognitionException(eee16); throw eee16; } cnt16++; } loop16: ; } finally { DebugExitSubRule(16); } } } finally { TraceOut("Digits", 110); LeaveRule("Digits", 110); LeaveRule_Digits(); } }
// $ANTLR end "COMMENT" // $ANTLR start "WS" public void mWS() // throws RecognitionException [2] { try { int _type = WS; int _channel = DEFAULT_TOKEN_CHANNEL; // SpecFlowLangLexer_en.g:33:17: ( ( WSCHAR )+ ) // SpecFlowLangLexer_en.g:33:19: ( WSCHAR )+ { // SpecFlowLangLexer_en.g:33:19: ( WSCHAR )+ int cnt5 = 0; do { int alt5 = 2; int LA5_0 = input.LA(1); if ( (LA5_0 == '\t' || LA5_0 == ' ') ) { alt5 = 1; } switch (alt5) { case 1 : // SpecFlowLangLexer_en.g:33:19: WSCHAR { mWSCHAR(); if (state.failed) return ; } break; default: if ( cnt5 >= 1 ) goto loop5; if ( state.backtracking > 0 ) {state.failed = true; return ;} EarlyExitException eee5 = new EarlyExitException(5, input); throw eee5; } cnt5++; } while (true); loop5: ; // Stops C# compiler whinging that label 'loop5' has no statements } state.type = _type; state.channel = _channel; } finally { } }
private void mOctal() { EnterRule_Octal(); EnterRule("Octal", 108); TraceIn("Octal", 108); try { // C:\\Users\\exKAZUu\\Projects\\Code2Xml\\Code2Xml.Core\\Generators\\ANTLRv3\\Php\\Php.g:670:2: ( '0' ( '0' .. '7' )+ ) DebugEnterAlt(1); // C:\\Users\\exKAZUu\\Projects\\Code2Xml\\Code2Xml.Core\\Generators\\ANTLRv3\\Php\\Php.g:670:4: '0' ( '0' .. '7' )+ { DebugLocation(670, 4); Match('0'); if (state.failed) return; DebugLocation(670, 7); // C:\\Users\\exKAZUu\\Projects\\Code2Xml\\Code2Xml.Core\\Generators\\ANTLRv3\\Php\\Php.g:670:7: ( '0' .. '7' )+ int cnt14=0; try { DebugEnterSubRule(14); while (true) { int alt14=2; try { DebugEnterDecision(14, false); int LA14_1 = input.LA(1); if (((LA14_1>='0' && LA14_1<='7'))) { alt14 = 1; } } finally { DebugExitDecision(14); } switch (alt14) { case 1: DebugEnterAlt(1); // C:\\Users\\exKAZUu\\Projects\\Code2Xml\\Code2Xml.Core\\Generators\\ANTLRv3\\Php\\Php.g: { DebugLocation(670, 7); input.Consume(); state.failed=false; } break; default: if (cnt14 >= 1) goto loop14; if (state.backtracking>0) {state.failed=true; return;} EarlyExitException eee14 = new EarlyExitException( 14, input ); DebugRecognitionException(eee14); throw eee14; } cnt14++; } loop14: ; } finally { DebugExitSubRule(14); } } } finally { TraceOut("Octal", 108); LeaveRule("Octal", 108); LeaveRule_Octal(); } }
private void mHexadecimal() { EnterRule_Hexadecimal(); EnterRule("Hexadecimal", 107); TraceIn("Hexadecimal", 107); try { // C:\\Users\\exKAZUu\\Projects\\Code2Xml\\Code2Xml.Core\\Generators\\ANTLRv3\\Php\\Php.g:665:2: ( '0' ( 'x' | 'X' ) ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ ) DebugEnterAlt(1); // C:\\Users\\exKAZUu\\Projects\\Code2Xml\\Code2Xml.Core\\Generators\\ANTLRv3\\Php\\Php.g:665:4: '0' ( 'x' | 'X' ) ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ { DebugLocation(665, 4); Match('0'); if (state.failed) return; DebugLocation(665, 7); if (input.LA(1)=='X'||input.LA(1)=='x') { input.Consume(); state.failed=false; } else { if (state.backtracking>0) {state.failed=true; return;} MismatchedSetException mse = new MismatchedSetException(null,input); DebugRecognitionException(mse); Recover(mse); throw mse; } DebugLocation(665, 16); // C:\\Users\\exKAZUu\\Projects\\Code2Xml\\Code2Xml.Core\\Generators\\ANTLRv3\\Php\\Php.g:665:16: ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ int cnt13=0; try { DebugEnterSubRule(13); while (true) { int alt13=2; try { DebugEnterDecision(13, false); int LA13_1 = input.LA(1); if (((LA13_1>='0' && LA13_1<='9')||(LA13_1>='A' && LA13_1<='F')||(LA13_1>='a' && LA13_1<='f'))) { alt13 = 1; } } finally { DebugExitDecision(13); } switch (alt13) { case 1: DebugEnterAlt(1); // C:\\Users\\exKAZUu\\Projects\\Code2Xml\\Code2Xml.Core\\Generators\\ANTLRv3\\Php\\Php.g: { DebugLocation(665, 16); input.Consume(); state.failed=false; } break; default: if (cnt13 >= 1) goto loop13; if (state.backtracking>0) {state.failed=true; return;} EarlyExitException eee13 = new EarlyExitException( 13, input ); DebugRecognitionException(eee13); throw eee13; } cnt13++; } loop13: ; } finally { DebugExitSubRule(13); } } } finally { TraceOut("Hexadecimal", 107); LeaveRule("Hexadecimal", 107); LeaveRule_Hexadecimal(); } }
private void mInteger() { EnterRule_Integer(); EnterRule("Integer", 35); TraceIn("Integer", 35); try { int _type = Integer; int _channel = DefaultTokenChannel; // Grammar\\SimpleC.g:277:8: ( ( '0' .. '9' )+ ) DebugEnterAlt(1); // Grammar\\SimpleC.g:278:2: ( '0' .. '9' )+ { DebugLocation(278, 2); // Grammar\\SimpleC.g:278:2: ( '0' .. '9' )+ int cnt2=0; try { DebugEnterSubRule(2); while (true) { int alt2=2; try { DebugEnterDecision(2, false); int LA2_0 = input.LA(1); if (((LA2_0>='0' && LA2_0<='9'))) { alt2 = 1; } } finally { DebugExitDecision(2); } switch (alt2) { case 1: DebugEnterAlt(1); // Grammar\\SimpleC.g: { DebugLocation(278, 2); input.Consume(); } break; default: if (cnt2 >= 1) goto loop2; EarlyExitException eee2 = new EarlyExitException( 2, input ); DebugRecognitionException(eee2); throw eee2; } cnt2++; } loop2: ; } finally { DebugExitSubRule(2); } } state.type = _type; state.channel = _channel; } finally { TraceOut("Integer", 35); LeaveRule("Integer", 35); LeaveRule_Integer(); } }
private void mWhitespace() { EnterRule_Whitespace(); EnterRule("Whitespace", 34); TraceIn("Whitespace", 34); try { int _type = Whitespace; int _channel = DefaultTokenChannel; // Grammar\\SimpleC.g:271:11: ( ( ' ' | '\\t' | '\\f' | '\\r' | '\\n' )+ ) DebugEnterAlt(1); // Grammar\\SimpleC.g:272:2: ( ' ' | '\\t' | '\\f' | '\\r' | '\\n' )+ { DebugLocation(272, 2); // Grammar\\SimpleC.g:272:2: ( ' ' | '\\t' | '\\f' | '\\r' | '\\n' )+ int cnt1=0; try { DebugEnterSubRule(1); while (true) { int alt1=2; try { DebugEnterDecision(1, false); int LA1_0 = input.LA(1); if (((LA1_0>='\t' && LA1_0<='\n')||(LA1_0>='\f' && LA1_0<='\r')||LA1_0==' ')) { alt1 = 1; } } finally { DebugExitDecision(1); } switch (alt1) { case 1: DebugEnterAlt(1); // Grammar\\SimpleC.g: { DebugLocation(272, 2); input.Consume(); } break; default: if (cnt1 >= 1) goto loop1; EarlyExitException eee1 = new EarlyExitException( 1, input ); DebugRecognitionException(eee1); throw eee1; } cnt1++; } loop1: ; } finally { DebugExitSubRule(1); } DebugLocation(272, 39); _channel=Hidden; } state.type = _type; state.channel = _channel; } finally { TraceOut("Whitespace", 34); LeaveRule("Whitespace", 34); LeaveRule_Whitespace(); } }
// $ANTLR end "USP" // $ANTLR start "WhiteSpace" public void mWhiteSpace() // throws RecognitionException [2] { try { int _type = WhiteSpace; int _channel = DEFAULT_TOKEN_CHANNEL; // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:600:2: ( ( TAB | VT | FF | SP | NBSP | USP )+ ) // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:600:4: ( TAB | VT | FF | SP | NBSP | USP )+ { // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:600:4: ( TAB | VT | FF | SP | NBSP | USP )+ int cnt1 = 0; do { int alt1 = 2; int LA1_0 = input.LA(1); if ( (LA1_0 == '\t' || (LA1_0 >= '\u000B' && LA1_0 <= '\f') || LA1_0 == ' ' || LA1_0 == '\u00A0' || LA1_0 == '\u1680' || LA1_0 == '\u180E' || (LA1_0 >= '\u2000' && LA1_0 <= '\u200A') || LA1_0 == '\u202F' || LA1_0 == '\u205F' || LA1_0 == '\u3000') ) { alt1 = 1; } switch (alt1) { case 1 : // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g: { if ( input.LA(1) == '\t' || (input.LA(1) >= '\u000B' && input.LA(1) <= '\f') || input.LA(1) == ' ' || input.LA(1) == '\u00A0' || input.LA(1) == '\u1680' || input.LA(1) == '\u180E' || (input.LA(1) >= '\u2000' && input.LA(1) <= '\u200A') || input.LA(1) == '\u202F' || input.LA(1) == '\u205F' || input.LA(1) == '\u3000' ) { input.Consume(); } else { MismatchedSetException mse = new MismatchedSetException(null,input); Recover(mse); throw mse;} } break; default: if ( cnt1 >= 1 ) goto loop1; EarlyExitException eee1 = new EarlyExitException(1, input); throw eee1; } cnt1++; } while (true); loop1: ; // Stops C# compiler whining that label 'loop1' has no statements _channel = HIDDEN; } state.type = _type; state.channel = _channel; } finally { } }
private AstParserRuleReturnScope<object, IToken> importDeclaration() { EnterRule_importDeclaration(); EnterRule("importDeclaration", 3); TraceIn("importDeclaration", 3); AstParserRuleReturnScope<object, IToken> retval = new AstParserRuleReturnScope<object, IToken>(); retval.Start = (IToken)input.LT(1); int importDeclaration_StartIndex = input.Index; object root_0 = default(object); IToken string_literal8 = default(IToken); IToken string_literal9 = default(IToken); IToken IDENTIFIER10 = default(IToken); IToken char_literal11 = default(IToken); IToken char_literal12 = default(IToken); IToken char_literal13 = default(IToken); IToken string_literal14 = default(IToken); IToken string_literal15 = default(IToken); IToken IDENTIFIER16 = default(IToken); IToken char_literal17 = default(IToken); IToken IDENTIFIER18 = default(IToken); IToken char_literal19 = default(IToken); IToken char_literal20 = default(IToken); IToken char_literal21 = default(IToken); object string_literal8_tree = default(object); object string_literal9_tree = default(object); object IDENTIFIER10_tree = default(object); object char_literal11_tree = default(object); object char_literal12_tree = default(object); object char_literal13_tree = default(object); object string_literal14_tree = default(object); object string_literal15_tree = default(object); object IDENTIFIER16_tree = default(object); object char_literal17_tree = default(object); object IDENTIFIER18_tree = default(object); object char_literal19_tree = default(object); object char_literal20_tree = default(object); object char_literal21_tree = default(object); try { DebugEnterRule(GrammarFileName, "importDeclaration"); DebugLocation(317, 4); try { if (state.backtracking > 0 && AlreadyParsedRule(input, 3)) { return retval; } // Java.g:318:5: ( 'import' ( 'static' )? IDENTIFIER '.' '*' ';' | 'import' ( 'static' )? IDENTIFIER ( '.' IDENTIFIER )+ ( '.' '*' )? ';' ) int alt9=2; try { DebugEnterDecision(9, false); int LA9_1 = input.LA(1); if ((LA9_1==IMPORT)) { int LA9_2 = input.LA(2); if ((LA9_2==STATIC)) { int LA9_3 = input.LA(3); if ((LA9_3==IDENTIFIER)) { int LA9_4 = input.LA(4); if ((LA9_4==DOT)) { int LA9_5 = input.LA(5); if ((LA9_5==STAR)) { alt9 = 1; } else if ((LA9_5==IDENTIFIER)) { alt9 = 2; } else { if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 9, 4, input, 5); DebugRecognitionException(nvae); throw nvae; } } else { if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 9, 3, input, 4); DebugRecognitionException(nvae); throw nvae; } } else { if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 9, 2, input, 3); DebugRecognitionException(nvae); throw nvae; } } else if ((LA9_2==IDENTIFIER)) { int LA9_3 = input.LA(3); if ((LA9_3==DOT)) { int LA9_4 = input.LA(4); if ((LA9_4==STAR)) { alt9 = 1; } else if ((LA9_4==IDENTIFIER)) { alt9 = 2; } else { if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 9, 4, input, 4); DebugRecognitionException(nvae); throw nvae; } } else { if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 9, 3, input, 3); DebugRecognitionException(nvae); throw nvae; } } else { if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 9, 1, input, 2); DebugRecognitionException(nvae); throw nvae; } } else { if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 9, 0, input, 1); DebugRecognitionException(nvae); throw nvae; } } finally { DebugExitDecision(9); } switch (alt9) { case 1: DebugEnterAlt(1); // Java.g:318:9: 'import' ( 'static' )? IDENTIFIER '.' '*' ';' { root_0 = (object)adaptor.Nil(); DebugLocation(318, 9); string_literal8=(IToken)Match(input,IMPORT,Follow._IMPORT_in_importDeclaration244); if (state.failed) return retval; if (state.backtracking == 0) { string_literal8_tree = (object)adaptor.Create(string_literal8); adaptor.AddChild(root_0, string_literal8_tree); } DebugLocation(319, 9); // Java.g:319:9: ( 'static' )? int alt5=2; try { DebugEnterSubRule(5); try { DebugEnterDecision(5, false); int LA5_1 = input.LA(1); if ((LA5_1==STATIC)) { alt5 = 1; } } finally { DebugExitDecision(5); } switch (alt5) { case 1: DebugEnterAlt(1); // Java.g:319:10: 'static' { DebugLocation(319, 10); string_literal9=(IToken)Match(input,STATIC,Follow._STATIC_in_importDeclaration256); if (state.failed) return retval; if (state.backtracking == 0) { string_literal9_tree = (object)adaptor.Create(string_literal9); adaptor.AddChild(root_0, string_literal9_tree); } } break; } } finally { DebugExitSubRule(5); } DebugLocation(321, 9); IDENTIFIER10=(IToken)Match(input,IDENTIFIER,Follow._IDENTIFIER_in_importDeclaration277); if (state.failed) return retval; if (state.backtracking == 0) { IDENTIFIER10_tree = (object)adaptor.Create(IDENTIFIER10); adaptor.AddChild(root_0, IDENTIFIER10_tree); } DebugLocation(321, 20); char_literal11=(IToken)Match(input,DOT,Follow._DOT_in_importDeclaration279); if (state.failed) return retval; if (state.backtracking == 0) { char_literal11_tree = (object)adaptor.Create(char_literal11); adaptor.AddChild(root_0, char_literal11_tree); } DebugLocation(321, 24); char_literal12=(IToken)Match(input,STAR,Follow._STAR_in_importDeclaration281); if (state.failed) return retval; if (state.backtracking == 0) { char_literal12_tree = (object)adaptor.Create(char_literal12); adaptor.AddChild(root_0, char_literal12_tree); } DebugLocation(322, 9); char_literal13=(IToken)Match(input,SEMI,Follow._SEMI_in_importDeclaration291); if (state.failed) return retval; if (state.backtracking == 0) { char_literal13_tree = (object)adaptor.Create(char_literal13); adaptor.AddChild(root_0, char_literal13_tree); } } break; case 2: DebugEnterAlt(2); // Java.g:323:9: 'import' ( 'static' )? IDENTIFIER ( '.' IDENTIFIER )+ ( '.' '*' )? ';' { root_0 = (object)adaptor.Nil(); DebugLocation(323, 9); string_literal14=(IToken)Match(input,IMPORT,Follow._IMPORT_in_importDeclaration308); if (state.failed) return retval; if (state.backtracking == 0) { string_literal14_tree = (object)adaptor.Create(string_literal14); adaptor.AddChild(root_0, string_literal14_tree); } DebugLocation(324, 9); // Java.g:324:9: ( 'static' )? int alt6=2; try { DebugEnterSubRule(6); try { DebugEnterDecision(6, false); int LA6_1 = input.LA(1); if ((LA6_1==STATIC)) { alt6 = 1; } } finally { DebugExitDecision(6); } switch (alt6) { case 1: DebugEnterAlt(1); // Java.g:324:10: 'static' { DebugLocation(324, 10); string_literal15=(IToken)Match(input,STATIC,Follow._STATIC_in_importDeclaration320); if (state.failed) return retval; if (state.backtracking == 0) { string_literal15_tree = (object)adaptor.Create(string_literal15); adaptor.AddChild(root_0, string_literal15_tree); } } break; } } finally { DebugExitSubRule(6); } DebugLocation(326, 9); IDENTIFIER16=(IToken)Match(input,IDENTIFIER,Follow._IDENTIFIER_in_importDeclaration341); if (state.failed) return retval; if (state.backtracking == 0) { IDENTIFIER16_tree = (object)adaptor.Create(IDENTIFIER16); adaptor.AddChild(root_0, IDENTIFIER16_tree); } DebugLocation(327, 9); // Java.g:327:9: ( '.' IDENTIFIER )+ int cnt7=0; try { DebugEnterSubRule(7); while (true) { int alt7=2; try { DebugEnterDecision(7, false); int LA7_1 = input.LA(1); if ((LA7_1==DOT)) { int LA7_2 = input.LA(2); if ((LA7_2==IDENTIFIER)) { alt7 = 1; } } } finally { DebugExitDecision(7); } switch (alt7) { case 1: DebugEnterAlt(1); // Java.g:327:10: '.' IDENTIFIER { DebugLocation(327, 10); char_literal17=(IToken)Match(input,DOT,Follow._DOT_in_importDeclaration352); if (state.failed) return retval; if (state.backtracking == 0) { char_literal17_tree = (object)adaptor.Create(char_literal17); adaptor.AddChild(root_0, char_literal17_tree); } DebugLocation(327, 14); IDENTIFIER18=(IToken)Match(input,IDENTIFIER,Follow._IDENTIFIER_in_importDeclaration354); if (state.failed) return retval; if (state.backtracking == 0) { IDENTIFIER18_tree = (object)adaptor.Create(IDENTIFIER18); adaptor.AddChild(root_0, IDENTIFIER18_tree); } } break; default: if (cnt7 >= 1) goto loop7; if (state.backtracking>0) {state.failed=true; return retval;} EarlyExitException eee7 = new EarlyExitException( 7, input ); DebugRecognitionException(eee7); throw eee7; } cnt7++; } loop7: ; } finally { DebugExitSubRule(7); } DebugLocation(329, 9); // Java.g:329:9: ( '.' '*' )? int alt8=2; try { DebugEnterSubRule(8); try { DebugEnterDecision(8, false); int LA8_1 = input.LA(1); if ((LA8_1==DOT)) { alt8 = 1; } } finally { DebugExitDecision(8); } switch (alt8) { case 1: DebugEnterAlt(1); // Java.g:329:10: '.' '*' { DebugLocation(329, 10); char_literal19=(IToken)Match(input,DOT,Follow._DOT_in_importDeclaration376); if (state.failed) return retval; if (state.backtracking == 0) { char_literal19_tree = (object)adaptor.Create(char_literal19); adaptor.AddChild(root_0, char_literal19_tree); } DebugLocation(329, 14); char_literal20=(IToken)Match(input,STAR,Follow._STAR_in_importDeclaration378); if (state.failed) return retval; if (state.backtracking == 0) { char_literal20_tree = (object)adaptor.Create(char_literal20); adaptor.AddChild(root_0, char_literal20_tree); } } break; } } finally { DebugExitSubRule(8); } DebugLocation(331, 9); char_literal21=(IToken)Match(input,SEMI,Follow._SEMI_in_importDeclaration399); if (state.failed) return retval; if (state.backtracking == 0) { char_literal21_tree = (object)adaptor.Create(char_literal21); adaptor.AddChild(root_0, char_literal21_tree); } } break; } retval.Stop = (IToken)input.LT(-1); if (state.backtracking == 0) { retval.Tree = (object)adaptor.RulePostProcessing(root_0); adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop); } } catch (RecognitionException re) { ReportError(re); Recover(input,re); retval.Tree = (object)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re); } finally { TraceOut("importDeclaration", 3); LeaveRule("importDeclaration", 3); LeaveRule_importDeclaration(); if (state.backtracking > 0) { Memoize(input, 3, importDeclaration_StartIndex); } } DebugLocation(332, 4); } finally { DebugExitRule(GrammarFileName, "importDeclaration"); } return retval; }
// $ANTLR end "OctalDigit" // $ANTLR start "ExponentPart" public void mExponentPart() // throws RecognitionException [2] { try { // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:865:2: ( ( 'e' | 'E' ) ( '+' | '-' )? ( DecimalDigit )+ ) // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:865:4: ( 'e' | 'E' ) ( '+' | '-' )? ( DecimalDigit )+ { if ( input.LA(1) == 'E' || input.LA(1) == 'e' ) { input.Consume(); } else { MismatchedSetException mse = new MismatchedSetException(null,input); Recover(mse); throw mse;} // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:865:18: ( '+' | '-' )? int alt10 = 2; int LA10_0 = input.LA(1); if ( (LA10_0 == '+' || LA10_0 == '-') ) { alt10 = 1; } switch (alt10) { case 1 : // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g: { if ( input.LA(1) == '+' || input.LA(1) == '-' ) { input.Consume(); } else { MismatchedSetException mse = new MismatchedSetException(null,input); Recover(mse); throw mse;} } break; } // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:865:33: ( DecimalDigit )+ int cnt11 = 0; do { int alt11 = 2; int LA11_0 = input.LA(1); if ( ((LA11_0 >= '0' && LA11_0 <= '9')) ) { alt11 = 1; } switch (alt11) { case 1 : // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:865:33: DecimalDigit { mDecimalDigit(); } break; default: if ( cnt11 >= 1 ) goto loop11; EarlyExitException eee11 = new EarlyExitException(11, input); throw eee11; } cnt11++; } while (true); loop11: ; // Stops C# compiler whining that label 'loop11' has no statements } } finally { } }
private AstParserRuleReturnScope<object, IToken> annotations() { EnterRule_annotations(); EnterRule("annotations", 45); TraceIn("annotations", 45); AstParserRuleReturnScope<object, IToken> retval = new AstParserRuleReturnScope<object, IToken>(); retval.Start = (IToken)input.LT(1); int annotations_StartIndex = input.Index; object root_0 = default(object); AstParserRuleReturnScope<object, IToken> annotation227 = default(AstParserRuleReturnScope<object, IToken>); try { DebugEnterRule(GrammarFileName, "annotations"); DebugLocation(723, 4); try { if (state.backtracking > 0 && AlreadyParsedRule(input, 45)) { return retval; } // Java.g:724:5: ( ( annotation )+ ) DebugEnterAlt(1); // Java.g:724:9: ( annotation )+ { root_0 = (object)adaptor.Nil(); DebugLocation(724, 9); // Java.g:724:9: ( annotation )+ int cnt81=0; try { DebugEnterSubRule(81); while (true) { int alt81=2; try { DebugEnterDecision(81, false); int LA81_1 = input.LA(1); if ((LA81_1==MONKEYS_AT)) { alt81 = 1; } } finally { DebugExitDecision(81); } switch (alt81) { case 1: DebugEnterAlt(1); // Java.g:724:10: annotation { DebugLocation(724, 10); PushFollow(Follow._annotation_in_annotations3561); annotation227=annotation(); PopFollow(); if (state.failed) return retval; if (state.backtracking == 0) adaptor.AddChild(root_0, annotation227.Tree); } break; default: if (cnt81 >= 1) goto loop81; if (state.backtracking>0) {state.failed=true; return retval;} EarlyExitException eee81 = new EarlyExitException( 81, input ); DebugRecognitionException(eee81); throw eee81; } cnt81++; } loop81: ; } finally { DebugExitSubRule(81); } } retval.Stop = (IToken)input.LT(-1); if (state.backtracking == 0) { retval.Tree = (object)adaptor.RulePostProcessing(root_0); adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop); } } catch (RecognitionException re) { ReportError(re); Recover(input,re); retval.Tree = (object)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re); } finally { TraceOut("annotations", 45); LeaveRule("annotations", 45); LeaveRule_annotations(); if (state.backtracking > 0) { Memoize(input, 45, annotations_StartIndex); } } DebugLocation(726, 4); } finally { DebugExitRule(GrammarFileName, "annotations"); } return retval; }
// $ANTLR end "DecimalIntegerLiteral" // $ANTLR start "DecimalLiteral" public void mDecimalLiteral() // throws RecognitionException [2] { try { int _type = DecimalLiteral; int _channel = DEFAULT_TOKEN_CHANNEL; // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:874:2: ( DecimalIntegerLiteral '.' ( DecimalDigit )* ( ExponentPart )? | '.' ( DecimalDigit )+ ( ExponentPart )? | DecimalIntegerLiteral ( ExponentPart )? ) int alt19 = 3; alt19 = dfa19.Predict(input); switch (alt19) { case 1 : // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:874:4: DecimalIntegerLiteral '.' ( DecimalDigit )* ( ExponentPart )? { mDecimalIntegerLiteral(); Match('.'); // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:874:30: ( DecimalDigit )* do { int alt14 = 2; int LA14_0 = input.LA(1); if ( ((LA14_0 >= '0' && LA14_0 <= '9')) ) { alt14 = 1; } switch (alt14) { case 1 : // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:874:30: DecimalDigit { mDecimalDigit(); } break; default: goto loop14; } } while (true); loop14: ; // Stops C# compiler whining that label 'loop14' has no statements // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:874:44: ( ExponentPart )? int alt15 = 2; int LA15_0 = input.LA(1); if ( (LA15_0 == 'E' || LA15_0 == 'e') ) { alt15 = 1; } switch (alt15) { case 1 : // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:874:44: ExponentPart { mExponentPart(); } break; } } break; case 2 : // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:875:4: '.' ( DecimalDigit )+ ( ExponentPart )? { Match('.'); // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:875:8: ( DecimalDigit )+ int cnt16 = 0; do { int alt16 = 2; int LA16_0 = input.LA(1); if ( ((LA16_0 >= '0' && LA16_0 <= '9')) ) { alt16 = 1; } switch (alt16) { case 1 : // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:875:8: DecimalDigit { mDecimalDigit(); } break; default: if ( cnt16 >= 1 ) goto loop16; EarlyExitException eee16 = new EarlyExitException(16, input); throw eee16; } cnt16++; } while (true); loop16: ; // Stops C# compiler whining that label 'loop16' has no statements // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:875:22: ( ExponentPart )? int alt17 = 2; int LA17_0 = input.LA(1); if ( (LA17_0 == 'E' || LA17_0 == 'e') ) { alt17 = 1; } switch (alt17) { case 1 : // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:875:22: ExponentPart { mExponentPart(); } break; } } break; case 3 : // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:876:4: DecimalIntegerLiteral ( ExponentPart )? { mDecimalIntegerLiteral(); // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:876:26: ( ExponentPart )? int alt18 = 2; int LA18_0 = input.LA(1); if ( (LA18_0 == 'E' || LA18_0 == 'e') ) { alt18 = 1; } switch (alt18) { case 1 : // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:876:26: ExponentPart { mExponentPart(); } break; } } break; } state.type = _type; state.channel = _channel; } finally { } }
private void mWS() { EnterRule_WS(); EnterRule("WS", 29); TraceIn("WS", 29); try { int _type = WS; int _channel = DefaultTokenChannel; // ..\\..\\NameParsing\\CSharpNames.g:222:2: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) DebugEnterAlt(1); // ..\\..\\NameParsing\\CSharpNames.g:222:4: ( ' ' | '\\t' | '\\r' | '\\n' )+ { DebugLocation(222, 4); // ..\\..\\NameParsing\\CSharpNames.g:222:4: ( ' ' | '\\t' | '\\r' | '\\n' )+ int cnt4=0; try { DebugEnterSubRule(4); while (true) { int alt4=2; try { DebugEnterDecision(4, false); int LA4_1 = input.LA(1); if (((LA4_1>='\t' && LA4_1<='\n')||LA4_1=='\r'||LA4_1==' ')) { alt4 = 1; } } finally { DebugExitDecision(4); } switch (alt4) { case 1: DebugEnterAlt(1); // ..\\..\\NameParsing\\CSharpNames.g: { DebugLocation(222, 4); input.Consume(); } break; default: if (cnt4 >= 1) goto loop4; EarlyExitException eee4 = new EarlyExitException( 4, input ); DebugRecognitionException(eee4); throw eee4; } cnt4++; } loop4: ; } finally { DebugExitSubRule(4); } DebugLocation(223, 2); Skip(); } state.type = _type; state.channel = _channel; } finally { TraceOut("WS", 29); LeaveRule("WS", 29); LeaveRule_WS(); } }
// $ANTLR end "DecimalLiteral" // $ANTLR start "OctalIntegerLiteral" public void mOctalIntegerLiteral() // throws RecognitionException [2] { try { int _type = OctalIntegerLiteral; int _channel = DEFAULT_TOKEN_CHANNEL; // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:880:2: ( '0' ( OctalDigit )+ ) // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:880:4: '0' ( OctalDigit )+ { Match('0'); // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:880:8: ( OctalDigit )+ int cnt20 = 0; do { int alt20 = 2; int LA20_0 = input.LA(1); if ( ((LA20_0 >= '0' && LA20_0 <= '7')) ) { alt20 = 1; } switch (alt20) { case 1 : // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:880:8: OctalDigit { mOctalDigit(); } break; default: if ( cnt20 >= 1 ) goto loop20; EarlyExitException eee20 = new EarlyExitException(20, input); throw eee20; } cnt20++; } while (true); loop20: ; // Stops C# compiler whining that label 'loop20' has no statements } state.type = _type; state.channel = _channel; } finally { } }
private void mINTEGER() { EnterRule_INTEGER(); EnterRule("INTEGER", 39); TraceIn("INTEGER", 39); try { int _type = INTEGER; int _channel = DefaultTokenChannel; // FlashTeaseScript.g:225:2: ( ( '0' .. '9' )+ ) DebugEnterAlt(1); // FlashTeaseScript.g:225:4: ( '0' .. '9' )+ { DebugLocation(225, 4); // FlashTeaseScript.g:225:4: ( '0' .. '9' )+ int cnt4=0; try { DebugEnterSubRule(4); while (true) { int alt4=2; try { DebugEnterDecision(4, false); int LA4_0 = input.LA(1); if (((LA4_0>='0' && LA4_0<='9'))) { alt4 = 1; } } finally { DebugExitDecision(4); } switch (alt4) { case 1: DebugEnterAlt(1); // FlashTeaseScript.g: { DebugLocation(225, 4); input.Consume(); } break; default: if (cnt4 >= 1) goto loop4; EarlyExitException eee4 = new EarlyExitException( 4, input ); DebugRecognitionException(eee4); throw eee4; } cnt4++; } loop4: ; } finally { DebugExitSubRule(4); } } state.type = _type; state.channel = _channel; } finally { TraceOut("INTEGER", 39); LeaveRule("INTEGER", 39); LeaveRule_INTEGER(); } }
// $ANTLR end "OctalIntegerLiteral" // $ANTLR start "HexIntegerLiteral" public void mHexIntegerLiteral() // throws RecognitionException [2] { try { int _type = HexIntegerLiteral; int _channel = DEFAULT_TOKEN_CHANNEL; // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:884:2: ( ( '0x' | '0X' ) ( HexDigit )+ ) // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:884:4: ( '0x' | '0X' ) ( HexDigit )+ { // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:884:4: ( '0x' | '0X' ) int alt21 = 2; int LA21_0 = input.LA(1); if ( (LA21_0 == '0') ) { int LA21_1 = input.LA(2); if ( (LA21_1 == 'x') ) { alt21 = 1; } else if ( (LA21_1 == 'X') ) { alt21 = 2; } else { NoViableAltException nvae_d21s1 = new NoViableAltException("", 21, 1, input); throw nvae_d21s1; } } else { NoViableAltException nvae_d21s0 = new NoViableAltException("", 21, 0, input); throw nvae_d21s0; } switch (alt21) { case 1 : // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:884:6: '0x' { Match("0x"); } break; case 2 : // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:884:13: '0X' { Match("0X"); } break; } // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:884:20: ( HexDigit )+ int cnt22 = 0; do { int alt22 = 2; int LA22_0 = input.LA(1); if ( ((LA22_0 >= '0' && LA22_0 <= '9') || (LA22_0 >= 'A' && LA22_0 <= 'F') || (LA22_0 >= 'a' && LA22_0 <= 'f')) ) { alt22 = 1; } switch (alt22) { case 1 : // C:\\Users\\s.ros\\Projets\\Jint\\Jint\\ES3.g:884:20: HexDigit { mHexDigit(); } break; default: if ( cnt22 >= 1 ) goto loop22; EarlyExitException eee22 = new EarlyExitException(22, input); throw eee22; } cnt22++; } while (true); loop22: ; // Stops C# compiler whining that label 'loop22' has no statements } state.type = _type; state.channel = _channel; } finally { } }
// $ANTLR start "program" // Interp.g:29:1: program returns [List<Element> ret] : ( expr )+ ; public InterpParser.program_return program() // throws RecognitionException [1] { InterpParser.program_return retval = new InterpParser.program_return(); retval.Start = input.LT(1); object root_0 = null; InterpParser.expr_return expr1 = null; retval.ret = new List<Element>(); try { // Interp.g:33:3: ( ( expr )+ ) // Interp.g:33:5: ( expr )+ { root_0 = (object)adaptor.GetNilNode(); // Interp.g:33:5: ( expr )+ int cnt1 = 0; do { int alt1 = 2; int LA1_0 = input.LA(1); if ( (LA1_0 == VARIABLE || LA1_0 == 16 || LA1_0 == 20) ) { alt1 = 1; } switch (alt1) { case 1 : // Interp.g:33:6: expr { PushFollow(FOLLOW_expr_in_program74); expr1 = expr(); state.followingStackPointer--; adaptor.AddChild(root_0, expr1.Tree); retval.ret.Add(((expr1 != null) ? expr1.ret : null)); } break; default: if ( cnt1 >= 1 ) goto loop1; EarlyExitException eee1 = new EarlyExitException(1, input); throw eee1; } cnt1++; } while (true); loop1: ; // Stops C# compiler whining that label 'loop1' has no statements } retval.Stop = input.LT(-1); retval.Tree = (object)adaptor.RulePostProcessing(root_0); adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop); } catch (RecognitionException re) { ReportError(re); Recover(input,re); // Conversion of the second argument necessary, but harmless retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re); } finally { } return retval; }
// $ANTLR end "WS" // $ANTLR start "NUM_INT" public void mNUM_INT() // throws RecognitionException [2] { try { int _type = NUM_INT; int _channel = DEFAULT_TOKEN_CHANNEL; IToken f1 = null; IToken f2 = null; IToken f3 = null; IToken f4 = null; bool isDecimal=false; IToken t=null; // Hql.g:742:2: ( '.' ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )? | ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )? ) int alt20 = 2; int LA20_0 = input.LA(1); if ( (LA20_0 == '.') ) { alt20 = 1; } else if ( ((LA20_0 >= '0' && LA20_0 <= '9')) ) { alt20 = 2; } else { if ( state.backtracking > 0 ) {state.failed = true; return ;} NoViableAltException nvae_d20s0 = new NoViableAltException("", 20, 0, input); throw nvae_d20s0; } switch (alt20) { case 1 : // Hql.g:742:6: '.' ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )? { Match('.'); if (state.failed) return ; if ( (state.backtracking==0) ) { _type = DOT; } // Hql.g:743:4: ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )? int alt8 = 2; int LA8_0 = input.LA(1); if ( ((LA8_0 >= '0' && LA8_0 <= '9')) ) { alt8 = 1; } switch (alt8) { case 1 : // Hql.g:743:6: ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? { // Hql.g:743:6: ( '0' .. '9' )+ int cnt5 = 0; do { int alt5 = 2; int LA5_0 = input.LA(1); if ( ((LA5_0 >= '0' && LA5_0 <= '9')) ) { alt5 = 1; } switch (alt5) { case 1 : // Hql.g:743:7: '0' .. '9' { MatchRange('0','9'); if (state.failed) return ; } break; default: if ( cnt5 >= 1 ) goto loop5; if ( state.backtracking > 0 ) {state.failed = true; return ;} EarlyExitException eee5 = new EarlyExitException(5, input); throw eee5; } cnt5++; } while (true); loop5: ; // Stops C# compiler whining that label 'loop5' has no statements // Hql.g:743:18: ( EXPONENT )? int alt6 = 2; int LA6_0 = input.LA(1); if ( (LA6_0 == 'e') ) { alt6 = 1; } switch (alt6) { case 1 : // Hql.g:743:19: EXPONENT { mEXPONENT(); if (state.failed) return ; } break; } // Hql.g:743:30: (f1= FLOAT_SUFFIX )? int alt7 = 2; int LA7_0 = input.LA(1); if ( (LA7_0 == 'd' || LA7_0 == 'f' || LA7_0 == 'm') ) { alt7 = 1; } switch (alt7) { case 1 : // Hql.g:743:31: f1= FLOAT_SUFFIX { int f1Start1018 = CharIndex; mFLOAT_SUFFIX(); if (state.failed) return ; f1 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f1Start1018, CharIndex-1); if ( (state.backtracking==0) ) { t=f1; } } break; } if ( (state.backtracking==0) ) { if (t != null && t.Text.ToUpperInvariant().IndexOf('F')>=0) { _type = NUM_FLOAT; } else if (t != null && t.Text.ToUpperInvariant().IndexOf('M')>=0) { _type = NUM_DECIMAL; } else { _type = NUM_DOUBLE; // assume double } } } break; } } break; case 2 : // Hql.g:759:4: ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )? { // Hql.g:759:4: ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) int alt13 = 2; int LA13_0 = input.LA(1); if ( (LA13_0 == '0') ) { alt13 = 1; } else if ( ((LA13_0 >= '1' && LA13_0 <= '9')) ) { alt13 = 2; } else { if ( state.backtracking > 0 ) {state.failed = true; return ;} NoViableAltException nvae_d13s0 = new NoViableAltException("", 13, 0, input); throw nvae_d13s0; } switch (alt13) { case 1 : // Hql.g:759:6: '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? { Match('0'); if (state.failed) return ; if ( (state.backtracking==0) ) { isDecimal = true; } // Hql.g:760:4: ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? int alt11 = 3; int LA11_0 = input.LA(1); if ( (LA11_0 == 'x') ) { alt11 = 1; } else if ( ((LA11_0 >= '0' && LA11_0 <= '7')) ) { alt11 = 2; } switch (alt11) { case 1 : // Hql.g:760:6: ( 'x' ) ( HEX_DIGIT )+ { // Hql.g:760:6: ( 'x' ) // Hql.g:760:7: 'x' { Match('x'); if (state.failed) return ; } // Hql.g:761:5: ( HEX_DIGIT )+ int cnt9 = 0; do { int alt9 = 2; switch ( input.LA(1) ) { case 'e': { int LA9_2 = input.LA(2); if ( ((LA9_2 >= '0' && LA9_2 <= '9')) ) { int LA9_5 = input.LA(3); if ( (!(((isDecimal)))) ) { alt9 = 1; } } else { alt9 = 1; } } break; case 'd': case 'f': { int LA9_3 = input.LA(2); if ( (!(((isDecimal)))) ) { alt9 = 1; } } break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'a': case 'b': case 'c': { alt9 = 1; } break; } switch (alt9) { case 1 : // Hql.g:768:7: HEX_DIGIT { mHEX_DIGIT(); if (state.failed) return ; } break; default: if ( cnt9 >= 1 ) goto loop9; if ( state.backtracking > 0 ) {state.failed = true; return ;} EarlyExitException eee9 = new EarlyExitException(9, input); throw eee9; } cnt9++; } while (true); loop9: ; // Stops C# compiler whining that label 'loop9' has no statements } break; case 2 : // Hql.g:770:6: ( '0' .. '7' )+ { // Hql.g:770:6: ( '0' .. '7' )+ int cnt10 = 0; do { int alt10 = 2; int LA10_0 = input.LA(1); if ( ((LA10_0 >= '0' && LA10_0 <= '7')) ) { alt10 = 1; } switch (alt10) { case 1 : // Hql.g:770:7: '0' .. '7' { MatchRange('0','7'); if (state.failed) return ; } break; default: if ( cnt10 >= 1 ) goto loop10; if ( state.backtracking > 0 ) {state.failed = true; return ;} EarlyExitException eee10 = new EarlyExitException(10, input); throw eee10; } cnt10++; } while (true); loop10: ; // Stops C# compiler whining that label 'loop10' has no statements } break; } } break; case 2 : // Hql.g:772:5: ( '1' .. '9' ) ( '0' .. '9' )* { // Hql.g:772:5: ( '1' .. '9' ) // Hql.g:772:6: '1' .. '9' { MatchRange('1','9'); if (state.failed) return ; } // Hql.g:772:16: ( '0' .. '9' )* do { int alt12 = 2; int LA12_0 = input.LA(1); if ( ((LA12_0 >= '0' && LA12_0 <= '9')) ) { alt12 = 1; } switch (alt12) { case 1 : // Hql.g:772:17: '0' .. '9' { MatchRange('0','9'); if (state.failed) return ; } break; default: goto loop12; } } while (true); loop12: ; // Stops C# compiler whining that label 'loop12' has no statements if ( (state.backtracking==0) ) { isDecimal=true; } } break; } // Hql.g:774:3: ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )? int alt19 = 3; int LA19_0 = input.LA(1); if ( (LA19_0 == 'l') ) { alt19 = 1; } else if ( (LA19_0 == '.' || (LA19_0 >= 'd' && LA19_0 <= 'f') || LA19_0 == 'm') ) { alt19 = 2; } switch (alt19) { case 1 : // Hql.g:774:5: ( 'l' ) { // Hql.g:774:5: ( 'l' ) // Hql.g:774:6: 'l' { Match('l'); if (state.failed) return ; } if ( (state.backtracking==0) ) { _type = NUM_LONG; } } break; case 2 : // Hql.g:777:5: {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) { if ( !((isDecimal)) ) { if ( state.backtracking > 0 ) {state.failed = true; return ;} throw new FailedPredicateException(input, "NUM_INT", "isDecimal"); } // Hql.g:778:4: ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) int alt18 = 3; switch ( input.LA(1) ) { case '.': { alt18 = 1; } break; case 'e': { alt18 = 2; } break; case 'd': case 'f': case 'm': { alt18 = 3; } break; default: if ( state.backtracking > 0 ) {state.failed = true; return ;} NoViableAltException nvae_d18s0 = new NoViableAltException("", 18, 0, input); throw nvae_d18s0; } switch (alt18) { case 1 : // Hql.g:778:8: '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? { Match('.'); if (state.failed) return ; // Hql.g:778:12: ( '0' .. '9' )* do { int alt14 = 2; int LA14_0 = input.LA(1); if ( ((LA14_0 >= '0' && LA14_0 <= '9')) ) { alt14 = 1; } switch (alt14) { case 1 : // Hql.g:778:13: '0' .. '9' { MatchRange('0','9'); if (state.failed) return ; } break; default: goto loop14; } } while (true); loop14: ; // Stops C# compiler whining that label 'loop14' has no statements // Hql.g:778:24: ( EXPONENT )? int alt15 = 2; int LA15_0 = input.LA(1); if ( (LA15_0 == 'e') ) { alt15 = 1; } switch (alt15) { case 1 : // Hql.g:778:25: EXPONENT { mEXPONENT(); if (state.failed) return ; } break; } // Hql.g:778:36: (f2= FLOAT_SUFFIX )? int alt16 = 2; int LA16_0 = input.LA(1); if ( (LA16_0 == 'd' || LA16_0 == 'f' || LA16_0 == 'm') ) { alt16 = 1; } switch (alt16) { case 1 : // Hql.g:778:37: f2= FLOAT_SUFFIX { int f2Start1220 = CharIndex; mFLOAT_SUFFIX(); if (state.failed) return ; f2 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f2Start1220, CharIndex-1); if ( (state.backtracking==0) ) { t=f2; } } break; } } break; case 2 : // Hql.g:779:8: EXPONENT (f3= FLOAT_SUFFIX )? { mEXPONENT(); if (state.failed) return ; // Hql.g:779:17: (f3= FLOAT_SUFFIX )? int alt17 = 2; int LA17_0 = input.LA(1); if ( (LA17_0 == 'd' || LA17_0 == 'f' || LA17_0 == 'm') ) { alt17 = 1; } switch (alt17) { case 1 : // Hql.g:779:18: f3= FLOAT_SUFFIX { int f3Start1238 = CharIndex; mFLOAT_SUFFIX(); if (state.failed) return ; f3 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f3Start1238, CharIndex-1); if ( (state.backtracking==0) ) { t=f3; } } break; } } break; case 3 : // Hql.g:780:8: f4= FLOAT_SUFFIX { int f4Start1253 = CharIndex; mFLOAT_SUFFIX(); if (state.failed) return ; f4 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f4Start1253, CharIndex-1); if ( (state.backtracking==0) ) { t=f4; } } break; } if ( (state.backtracking==0) ) { if (t != null && t.Text.ToUpperInvariant().IndexOf('F') >= 0) { _type = NUM_FLOAT; } else if (t != null && t.Text.ToUpperInvariant().IndexOf('M')>=0) { _type = NUM_DECIMAL; } else { _type = NUM_DOUBLE; // assume double } } } break; } } break; } state.type = _type; state.channel = _channel; } finally { } }
// $ANTLR start "matrixoperation" // Interp.g:69:1: matrixoperation returns [MatrixOperationElement ret] : ( '(' el1= int_literal ')' '(' el2= int_literal ')' '[' (el3= int_literal )+ ']' ) ; public InterpParser.matrixoperation_return matrixoperation() // throws RecognitionException [1] { InterpParser.matrixoperation_return retval = new InterpParser.matrixoperation_return(); retval.Start = input.LT(1); object root_0 = null; IToken char_literal18 = null; IToken char_literal19 = null; IToken char_literal20 = null; IToken char_literal21 = null; IToken char_literal22 = null; IToken char_literal23 = null; InterpParser.int_literal_return el1 = null; InterpParser.int_literal_return el2 = null; InterpParser.int_literal_return el3 = null; object char_literal18_tree=null; object char_literal19_tree=null; object char_literal20_tree=null; object char_literal21_tree=null; object char_literal22_tree=null; object char_literal23_tree=null; retval.ret = new MatrixOperationElement(); try { // Interp.g:73:2: ( ( '(' el1= int_literal ')' '(' el2= int_literal ')' '[' (el3= int_literal )+ ']' ) ) // Interp.g:73:3: ( '(' el1= int_literal ')' '(' el2= int_literal ')' '[' (el3= int_literal )+ ']' ) { root_0 = (object)adaptor.GetNilNode(); // Interp.g:73:3: ( '(' el1= int_literal ')' '(' el2= int_literal ')' '[' (el3= int_literal )+ ']' ) // Interp.g:73:4: '(' el1= int_literal ')' '(' el2= int_literal ')' '[' (el3= int_literal )+ ']' { char_literal18=(IToken)Match(input,12,FOLLOW_12_in_matrixoperation299); char_literal18_tree = (object)adaptor.Create(char_literal18); adaptor.AddChild(root_0, char_literal18_tree); PushFollow(FOLLOW_int_literal_in_matrixoperation302); el1 = int_literal(); state.followingStackPointer--; adaptor.AddChild(root_0, el1.Tree); retval.ret.setRow(((el1 != null) ? el1.ret : null)); char_literal19=(IToken)Match(input,13,FOLLOW_13_in_matrixoperation305); char_literal19_tree = (object)adaptor.Create(char_literal19); adaptor.AddChild(root_0, char_literal19_tree); char_literal20=(IToken)Match(input,12,FOLLOW_12_in_matrixoperation308); char_literal20_tree = (object)adaptor.Create(char_literal20); adaptor.AddChild(root_0, char_literal20_tree); PushFollow(FOLLOW_int_literal_in_matrixoperation312); el2 = int_literal(); state.followingStackPointer--; adaptor.AddChild(root_0, el2.Tree); retval.ret.setColumn(((el2 != null) ? el2.ret : null)); char_literal21=(IToken)Match(input,13,FOLLOW_13_in_matrixoperation315); char_literal21_tree = (object)adaptor.Create(char_literal21); adaptor.AddChild(root_0, char_literal21_tree); char_literal22=(IToken)Match(input,14,FOLLOW_14_in_matrixoperation318); char_literal22_tree = (object)adaptor.Create(char_literal22); adaptor.AddChild(root_0, char_literal22_tree); // Interp.g:75:5: (el3= int_literal )+ int cnt6 = 0; do { int alt6 = 2; int LA6_0 = input.LA(1); if ( (LA6_0 == INT_LITERAL) ) { alt6 = 1; } switch (alt6) { case 1 : // Interp.g:75:6: el3= int_literal { PushFollow(FOLLOW_int_literal_in_matrixoperation322); el3 = int_literal(); state.followingStackPointer--; adaptor.AddChild(root_0, el3.Tree); retval.ret.setValue(((el3 != null) ? el3.ret : null)); } break; default: if ( cnt6 >= 1 ) goto loop6; EarlyExitException eee6 = new EarlyExitException(6, input); throw eee6; } cnt6++; } while (true); loop6: ; // Stops C# compiler whining that label 'loop6' has no statements char_literal23=(IToken)Match(input,15,FOLLOW_15_in_matrixoperation328); char_literal23_tree = (object)adaptor.Create(char_literal23); adaptor.AddChild(root_0, char_literal23_tree); } } retval.Stop = input.LT(-1); retval.Tree = (object)adaptor.RulePostProcessing(root_0); adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop); } catch (RecognitionException re) { ReportError(re); Recover(input,re); // Conversion of the second argument necessary, but harmless retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re); } finally { } return retval; }
// $ANTLR end "HEX_DIGIT" // $ANTLR start "EXPONENT" public void mEXPONENT() // throws RecognitionException [2] { try { // Hql.g:808:2: ( ( 'e' ) ( '+' | '-' )? ( '0' .. '9' )+ ) // Hql.g:808:4: ( 'e' ) ( '+' | '-' )? ( '0' .. '9' )+ { // Hql.g:808:4: ( 'e' ) // Hql.g:808:5: 'e' { Match('e'); if (state.failed) return ; } // Hql.g:808:10: ( '+' | '-' )? int alt21 = 2; int LA21_0 = input.LA(1); if ( (LA21_0 == '+' || LA21_0 == '-') ) { alt21 = 1; } switch (alt21) { case 1 : // Hql.g: { if ( input.LA(1) == '+' || input.LA(1) == '-' ) { input.Consume(); state.failed = false; } else { if ( state.backtracking > 0 ) {state.failed = true; return ;} MismatchedSetException mse = new MismatchedSetException(null,input); Recover(mse); throw mse;} } break; } // Hql.g:808:21: ( '0' .. '9' )+ int cnt22 = 0; do { int alt22 = 2; int LA22_0 = input.LA(1); if ( ((LA22_0 >= '0' && LA22_0 <= '9')) ) { alt22 = 1; } switch (alt22) { case 1 : // Hql.g:808:22: '0' .. '9' { MatchRange('0','9'); if (state.failed) return ; } break; default: if ( cnt22 >= 1 ) goto loop22; if ( state.backtracking > 0 ) {state.failed = true; return ;} EarlyExitException eee22 = new EarlyExitException(22, input); throw eee22; } cnt22++; } while (true); loop22: ; // Stops C# compiler whining that label 'loop22' has no statements } } finally { } }
// $ANTLR end "ID" // $ANTLR start "NUMBER" public void mNUMBER() // throws RecognitionException [2] { try { int _type = NUMBER; int _channel = DEFAULT_TOKEN_CHANNEL; // C:\\Development\\TT.Net\\TT\\Template.g:59:8: ( ( '0' .. '9' )+ ) // C:\\Development\\TT.Net\\TT\\Template.g:59:10: ( '0' .. '9' )+ { // C:\\Development\\TT.Net\\TT\\Template.g:59:10: ( '0' .. '9' )+ int cnt7 = 0; do { int alt7 = 2; int LA7_0 = input.LA(1); if ( ((LA7_0 >= '0' && LA7_0 <= '9')) ) { alt7 = 1; } switch (alt7) { case 1 : // C:\\Development\\TT.Net\\TT\\Template.g:59:11: '0' .. '9' { MatchRange('0','9'); } break; default: if ( cnt7 >= 1 ) goto loop7; EarlyExitException eee7 = new EarlyExitException(7, input); throw eee7; } cnt7++; } while (true); loop7: ; // Stops C# compiler whining that label 'loop7' has no statements } state.type = _type; state.channel = _channel; } finally { } }
private AstParserRuleReturnScope<object, IToken> identifierSuffix() { EnterRule_identifierSuffix(); EnterRule("identifierSuffix", 97); TraceIn("identifierSuffix", 97); AstParserRuleReturnScope<object, IToken> retval = new AstParserRuleReturnScope<object, IToken>(); retval.Start = (IToken)input.LT(1); int identifierSuffix_StartIndex = input.Index; object root_0 = default(object); IToken char_literal538 = default(IToken); IToken char_literal539 = default(IToken); IToken char_literal540 = default(IToken); IToken string_literal541 = default(IToken); IToken char_literal542 = default(IToken); IToken char_literal544 = default(IToken); IToken char_literal546 = default(IToken); IToken string_literal547 = default(IToken); IToken char_literal548 = default(IToken); IToken IDENTIFIER550 = default(IToken); IToken char_literal552 = default(IToken); IToken string_literal553 = default(IToken); IToken char_literal554 = default(IToken); IToken string_literal555 = default(IToken); AstParserRuleReturnScope<object, IToken> expression543 = default(AstParserRuleReturnScope<object, IToken>); AstParserRuleReturnScope<object, IToken> arguments545 = default(AstParserRuleReturnScope<object, IToken>); AstParserRuleReturnScope<object, IToken> nonWildcardTypeArguments549 = default(AstParserRuleReturnScope<object, IToken>); AstParserRuleReturnScope<object, IToken> arguments551 = default(AstParserRuleReturnScope<object, IToken>); AstParserRuleReturnScope<object, IToken> arguments556 = default(AstParserRuleReturnScope<object, IToken>); AstParserRuleReturnScope<object, IToken> innerCreator557 = default(AstParserRuleReturnScope<object, IToken>); object char_literal538_tree = default(object); object char_literal539_tree = default(object); object char_literal540_tree = default(object); object string_literal541_tree = default(object); object char_literal542_tree = default(object); object char_literal544_tree = default(object); object char_literal546_tree = default(object); object string_literal547_tree = default(object); object char_literal548_tree = default(object); object IDENTIFIER550_tree = default(object); object char_literal552_tree = default(object); object string_literal553_tree = default(object); object char_literal554_tree = default(object); object string_literal555_tree = default(object); try { DebugEnterRule(GrammarFileName, "identifierSuffix"); DebugLocation(1160, 4); try { if (state.backtracking > 0 && AlreadyParsedRule(input, 97)) { return retval; } // Java.g:1161:5: ( ( '[' ']' )+ '.' 'class' | ( '[' expression ']' )+ | arguments | '.' 'class' | '.' nonWildcardTypeArguments IDENTIFIER arguments | '.' 'this' | '.' 'super' arguments | innerCreator ) int alt154=8; try { DebugEnterDecision(154, false); switch (input.LA(1)) { case LBRACKET: { int LA154_2 = input.LA(2); if ((LA154_2==RBRACKET)) { alt154 = 1; } else if ((LA154_2==BANG||LA154_2==BOOLEAN||LA154_2==BYTE||LA154_2==BooleanLiteral||LA154_2==CHAR||LA154_2==CharacterLiteral||LA154_2==DOUBLE||LA154_2==FLOAT||LA154_2==FloatingPointLiteral||LA154_2==IDENTIFIER||LA154_2==INT||LA154_2==IntegerLiteral||(LA154_2>=LONG && LA154_2<=LPAREN)||LA154_2==NEW||LA154_2==NullLiteral||LA154_2==PLUS||LA154_2==PLUSPLUS||LA154_2==SHORT||LA154_2==SUB||(LA154_2>=SUBSUB && LA154_2<=SUPER)||LA154_2==StringLiteral||LA154_2==THIS||LA154_2==TILDE||LA154_2==VOID)) { alt154 = 2; } else { if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 154, 1, input, 2); DebugRecognitionException(nvae); throw nvae; } } break; case LPAREN: { alt154 = 3; } break; case DOT: { switch (input.LA(2)) { case CLASS: { alt154 = 4; } break; case THIS: { alt154 = 6; } break; case SUPER: { alt154 = 7; } break; case NEW: { alt154 = 8; } break; case LT: { alt154 = 5; } break; default: { if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 154, 3, input, 2); DebugRecognitionException(nvae); throw nvae; } } } break; default: { if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 154, 0, input, 1); DebugRecognitionException(nvae); throw nvae; } } } finally { DebugExitDecision(154); } switch (alt154) { case 1: DebugEnterAlt(1); // Java.g:1161:9: ( '[' ']' )+ '.' 'class' { root_0 = (object)adaptor.Nil(); DebugLocation(1161, 9); // Java.g:1161:9: ( '[' ']' )+ int cnt152=0; try { DebugEnterSubRule(152); while (true) { int alt152=2; try { DebugEnterDecision(152, false); int LA152_1 = input.LA(1); if ((LA152_1==LBRACKET)) { alt152 = 1; } } finally { DebugExitDecision(152); } switch (alt152) { case 1: DebugEnterAlt(1); // Java.g:1161:10: '[' ']' { DebugLocation(1161, 10); char_literal538=(IToken)Match(input,LBRACKET,Follow._LBRACKET_in_identifierSuffix7078); if (state.failed) return retval; if (state.backtracking == 0) { char_literal538_tree = (object)adaptor.Create(char_literal538); adaptor.AddChild(root_0, char_literal538_tree); } DebugLocation(1161, 14); char_literal539=(IToken)Match(input,RBRACKET,Follow._RBRACKET_in_identifierSuffix7080); if (state.failed) return retval; if (state.backtracking == 0) { char_literal539_tree = (object)adaptor.Create(char_literal539); adaptor.AddChild(root_0, char_literal539_tree); } } break; default: if (cnt152 >= 1) goto loop152; if (state.backtracking>0) {state.failed=true; return retval;} EarlyExitException eee152 = new EarlyExitException( 152, input ); DebugRecognitionException(eee152); throw eee152; } cnt152++; } loop152: ; } finally { DebugExitSubRule(152); } DebugLocation(1163, 9); char_literal540=(IToken)Match(input,DOT,Follow._DOT_in_identifierSuffix7101); if (state.failed) return retval; if (state.backtracking == 0) { char_literal540_tree = (object)adaptor.Create(char_literal540); adaptor.AddChild(root_0, char_literal540_tree); } DebugLocation(1163, 13); string_literal541=(IToken)Match(input,CLASS,Follow._CLASS_in_identifierSuffix7103); if (state.failed) return retval; if (state.backtracking == 0) { string_literal541_tree = (object)adaptor.Create(string_literal541); adaptor.AddChild(root_0, string_literal541_tree); } } break; case 2: DebugEnterAlt(2); // Java.g:1164:9: ( '[' expression ']' )+ { root_0 = (object)adaptor.Nil(); DebugLocation(1164, 9); // Java.g:1164:9: ( '[' expression ']' )+ int cnt153=0; try { DebugEnterSubRule(153); while (true) { int alt153=2; try { DebugEnterDecision(153, false); int LA153_1 = input.LA(1); if ((LA153_1==LBRACKET)) { int LA153_2 = input.LA(2); if ((EvaluatePredicate(synpred235_Java_fragment))) { alt153 = 1; } } } finally { DebugExitDecision(153); } switch (alt153) { case 1: DebugEnterAlt(1); // Java.g:1164:10: '[' expression ']' { DebugLocation(1164, 10); char_literal542=(IToken)Match(input,LBRACKET,Follow._LBRACKET_in_identifierSuffix7114); if (state.failed) return retval; if (state.backtracking == 0) { char_literal542_tree = (object)adaptor.Create(char_literal542); adaptor.AddChild(root_0, char_literal542_tree); } DebugLocation(1164, 14); PushFollow(Follow._expression_in_identifierSuffix7116); expression543=expression(); PopFollow(); if (state.failed) return retval; if (state.backtracking == 0) adaptor.AddChild(root_0, expression543.Tree); DebugLocation(1164, 25); char_literal544=(IToken)Match(input,RBRACKET,Follow._RBRACKET_in_identifierSuffix7118); if (state.failed) return retval; if (state.backtracking == 0) { char_literal544_tree = (object)adaptor.Create(char_literal544); adaptor.AddChild(root_0, char_literal544_tree); } } break; default: if (cnt153 >= 1) goto loop153; if (state.backtracking>0) {state.failed=true; return retval;} EarlyExitException eee153 = new EarlyExitException( 153, input ); DebugRecognitionException(eee153); throw eee153; } cnt153++; } loop153: ; } finally { DebugExitSubRule(153); } } break; case 3: DebugEnterAlt(3); // Java.g:1166:9: arguments { root_0 = (object)adaptor.Nil(); DebugLocation(1166, 9); PushFollow(Follow._arguments_in_identifierSuffix7139); arguments545=arguments(); PopFollow(); if (state.failed) return retval; if (state.backtracking == 0) adaptor.AddChild(root_0, arguments545.Tree); } break; case 4: DebugEnterAlt(4); // Java.g:1167:9: '.' 'class' { root_0 = (object)adaptor.Nil(); DebugLocation(1167, 9); char_literal546=(IToken)Match(input,DOT,Follow._DOT_in_identifierSuffix7149); if (state.failed) return retval; if (state.backtracking == 0) { char_literal546_tree = (object)adaptor.Create(char_literal546); adaptor.AddChild(root_0, char_literal546_tree); } DebugLocation(1167, 13); string_literal547=(IToken)Match(input,CLASS,Follow._CLASS_in_identifierSuffix7151); if (state.failed) return retval; if (state.backtracking == 0) { string_literal547_tree = (object)adaptor.Create(string_literal547); adaptor.AddChild(root_0, string_literal547_tree); } } break; case 5: DebugEnterAlt(5); // Java.g:1168:9: '.' nonWildcardTypeArguments IDENTIFIER arguments { root_0 = (object)adaptor.Nil(); DebugLocation(1168, 9); char_literal548=(IToken)Match(input,DOT,Follow._DOT_in_identifierSuffix7161); if (state.failed) return retval; if (state.backtracking == 0) { char_literal548_tree = (object)adaptor.Create(char_literal548); adaptor.AddChild(root_0, char_literal548_tree); } DebugLocation(1168, 13); PushFollow(Follow._nonWildcardTypeArguments_in_identifierSuffix7163); nonWildcardTypeArguments549=nonWildcardTypeArguments(); PopFollow(); if (state.failed) return retval; if (state.backtracking == 0) adaptor.AddChild(root_0, nonWildcardTypeArguments549.Tree); DebugLocation(1168, 38); IDENTIFIER550=(IToken)Match(input,IDENTIFIER,Follow._IDENTIFIER_in_identifierSuffix7165); if (state.failed) return retval; if (state.backtracking == 0) { IDENTIFIER550_tree = (object)adaptor.Create(IDENTIFIER550); adaptor.AddChild(root_0, IDENTIFIER550_tree); } DebugLocation(1168, 49); PushFollow(Follow._arguments_in_identifierSuffix7167); arguments551=arguments(); PopFollow(); if (state.failed) return retval; if (state.backtracking == 0) adaptor.AddChild(root_0, arguments551.Tree); } break; case 6: DebugEnterAlt(6); // Java.g:1169:9: '.' 'this' { root_0 = (object)adaptor.Nil(); DebugLocation(1169, 9); char_literal552=(IToken)Match(input,DOT,Follow._DOT_in_identifierSuffix7177); if (state.failed) return retval; if (state.backtracking == 0) { char_literal552_tree = (object)adaptor.Create(char_literal552); adaptor.AddChild(root_0, char_literal552_tree); } DebugLocation(1169, 13); string_literal553=(IToken)Match(input,THIS,Follow._THIS_in_identifierSuffix7179); if (state.failed) return retval; if (state.backtracking == 0) { string_literal553_tree = (object)adaptor.Create(string_literal553); adaptor.AddChild(root_0, string_literal553_tree); } } break; case 7: DebugEnterAlt(7); // Java.g:1170:9: '.' 'super' arguments { root_0 = (object)adaptor.Nil(); DebugLocation(1170, 9); char_literal554=(IToken)Match(input,DOT,Follow._DOT_in_identifierSuffix7189); if (state.failed) return retval; if (state.backtracking == 0) { char_literal554_tree = (object)adaptor.Create(char_literal554); adaptor.AddChild(root_0, char_literal554_tree); } DebugLocation(1170, 13); string_literal555=(IToken)Match(input,SUPER,Follow._SUPER_in_identifierSuffix7191); if (state.failed) return retval; if (state.backtracking == 0) { string_literal555_tree = (object)adaptor.Create(string_literal555); adaptor.AddChild(root_0, string_literal555_tree); } DebugLocation(1170, 21); PushFollow(Follow._arguments_in_identifierSuffix7193); arguments556=arguments(); PopFollow(); if (state.failed) return retval; if (state.backtracking == 0) adaptor.AddChild(root_0, arguments556.Tree); } break; case 8: DebugEnterAlt(8); // Java.g:1171:9: innerCreator { root_0 = (object)adaptor.Nil(); DebugLocation(1171, 9); PushFollow(Follow._innerCreator_in_identifierSuffix7203); innerCreator557=innerCreator(); PopFollow(); if (state.failed) return retval; if (state.backtracking == 0) adaptor.AddChild(root_0, innerCreator557.Tree); } break; } retval.Stop = (IToken)input.LT(-1); if (state.backtracking == 0) { retval.Tree = (object)adaptor.RulePostProcessing(root_0); adaptor.SetTokenBoundaries(retval.Tree, retval.Start, retval.Stop); } } catch (RecognitionException re) { ReportError(re); Recover(input,re); retval.Tree = (object)adaptor.ErrorNode(input, retval.Start, input.LT(-1), re); } finally { TraceOut("identifierSuffix", 97); LeaveRule("identifierSuffix", 97); LeaveRule_identifierSuffix(); if (state.backtracking > 0) { Memoize(input, 97, identifierSuffix_StartIndex); } } DebugLocation(1172, 4); } finally { DebugExitRule(GrammarFileName, "identifierSuffix"); } return retval; }
private void mINT_CONST() { Enter_INT_CONST(); EnterRule("INT_CONST", 43); TraceIn("INT_CONST", 43); try { int _type = INT_CONST; int _channel = DefaultTokenChannel; // C:\\Users\\Oscar\\Documents\\Visual Studio 2010\\Projects\\TigerNET\\Grammar\\Tiger.g:77:12: ( ( DIGIT )+ ) DebugEnterAlt(1); // C:\\Users\\Oscar\\Documents\\Visual Studio 2010\\Projects\\TigerNET\\Grammar\\Tiger.g:77:14: ( DIGIT )+ { DebugLocation(77, 14); // C:\\Users\\Oscar\\Documents\\Visual Studio 2010\\Projects\\TigerNET\\Grammar\\Tiger.g:77:14: ( DIGIT )+ int cnt1=0; try { DebugEnterSubRule(1); while (true) { int alt1=2; try { DebugEnterDecision(1, decisionCanBacktrack[1]); int LA1_0 = input.LA(1); if (((LA1_0>='0' && LA1_0<='9'))) { alt1=1; } } finally { DebugExitDecision(1); } switch (alt1) { case 1: DebugEnterAlt(1); // C:\\Users\\Oscar\\Documents\\Visual Studio 2010\\Projects\\TigerNET\\Grammar\\Tiger.g:77:15: DIGIT { DebugLocation(77, 15); mDIGIT(); } break; default: if (cnt1 >= 1) goto loop1; EarlyExitException eee1 = new EarlyExitException( 1, input ); DebugRecognitionException(eee1); throw eee1; } cnt1++; } loop1: ; } finally { DebugExitSubRule(1); } } state.type = _type; state.channel = _channel; } finally { TraceOut("INT_CONST", 43); LeaveRule("INT_CONST", 43); Leave_INT_CONST(); } }
/// <summary> /// What error message should be generated for the various exception types? /// /// Not very object-oriented code, but I like having all error message generation /// within one method rather than spread among all of the exception classes. This /// also makes it much easier for the exception handling because the exception /// classes do not have to have pointers back to this object to access utility /// routines and so on. Also, changing the message for an exception type would be /// difficult because you would have to subclassing exception, but then somehow get /// ANTLR to make those kinds of exception objects instead of the default. /// /// This looks weird, but trust me--it makes the most sense in terms of flexibility. /// /// For grammar debugging, you will want to override this to add more information /// such as the stack frame with GetRuleInvocationStack(e, this.GetType().Fullname) /// and, for no viable alts, the decision description and state etc... /// /// Override this to change the message generated for one or more exception types. /// </summary> public virtual string GetErrorMessage(RecognitionException e, string[] tokenNames) { string msg = e.Message; if (e is UnwantedTokenException) { UnwantedTokenException ute = (UnwantedTokenException)e; string tokenName = "<unknown>"; if (ute.Expecting == Token.EOF) { tokenName = "EOF"; } else { tokenName = tokenNames[ute.Expecting]; } msg = "extraneous input " + GetTokenErrorDisplay(ute.UnexpectedToken) + " expecting " + tokenName; } else if (e is MissingTokenException) { MissingTokenException mte = (MissingTokenException)e; string tokenName = "<unknown>"; if (mte.Expecting == Token.EOF) { tokenName = "EOF"; } else { tokenName = tokenNames[mte.Expecting]; } msg = "missing " + tokenName + " at " + GetTokenErrorDisplay(e.Token); } else if (e is MismatchedTokenException) { MismatchedTokenException mte = (MismatchedTokenException)e; string tokenName = "<unknown>"; if (mte.Expecting == Token.EOF) { tokenName = "EOF"; } else { tokenName = tokenNames[mte.Expecting]; } msg = "mismatched input " + GetTokenErrorDisplay(e.Token) + " expecting " + tokenName; } else if (e is MismatchedTreeNodeException) { MismatchedTreeNodeException mtne = (MismatchedTreeNodeException)e; string tokenName = "<unknown>"; if (mtne.expecting == Token.EOF) { tokenName = "EOF"; } else { tokenName = tokenNames[mtne.expecting]; } // The ternary operator is only necessary because of a bug in the .NET framework msg = "mismatched tree node: " + ((mtne.Node != null && mtne.Node.ToString() != null) ? mtne.Node : string.Empty) + " expecting " + tokenName; } else if (e is NoViableAltException) { NoViableAltException nvae = (NoViableAltException)e; // for development, can add "decision=<<"+nvae.grammarDecisionDescription+">>" // and "(decision="+nvae.decisionNumber+") and // "state "+nvae.stateNumber msg = "no viable alternative at input " + GetTokenErrorDisplay(e.Token); } else if (e is EarlyExitException) { EarlyExitException eee = (EarlyExitException)e; // for development, can add "(decision="+eee.decisionNumber+")" msg = "required (...)+ loop did not match anything at input " + GetTokenErrorDisplay(e.Token); } else if (e is MismatchedSetException) { MismatchedSetException mse = (MismatchedSetException)e; msg = "mismatched input " + GetTokenErrorDisplay(e.Token) + " expecting set " + mse.expecting; } else if (e is MismatchedNotSetException) { MismatchedNotSetException mse = (MismatchedNotSetException)e; msg = "mismatched input " + GetTokenErrorDisplay(e.Token) + " expecting set " + mse.expecting; } else if (e is FailedPredicateException) { FailedPredicateException fpe = (FailedPredicateException)e; msg = "rule " + fpe.ruleName + " failed predicate: {" + fpe.predicateText + "}?"; } return(msg); }