本文整理汇总了C#中TemplateParserRuleReturnScope类的典型用法代码示例。如果您正苦于以下问题:C# TemplateParserRuleReturnScope类的具体用法?C# TemplateParserRuleReturnScope怎么用?C# TemplateParserRuleReturnScope使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TemplateParserRuleReturnScope类属于命名空间,在下文中一共展示了TemplateParserRuleReturnScope类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: doWhileStatement
private TemplateParserRuleReturnScope<StringTemplate, IToken> doWhileStatement()
{
EnterRule_doWhileStatement();
EnterRule("doWhileStatement", 69);
TraceIn("doWhileStatement", 69);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
try { DebugEnterRule(GrammarFileName, "doWhileStatement");
DebugLocation(816, 1);
try
{
// AS3T.g:817:2: ( DO statement WHILE condition semi )
DebugEnterAlt(1);
// AS3T.g:817:4: DO statement WHILE condition semi
{
DebugLocation(817, 4);
Match(input,DO,Follow._DO_in_doWhileStatement2790); if (state.failed) return retval;
DebugLocation(817, 7);
PushFollow(Follow._statement_in_doWhileStatement2792);
statement();
PopFollow();
if (state.failed) return retval;
DebugLocation(817, 17);
Match(input,WHILE,Follow._WHILE_in_doWhileStatement2794); if (state.failed) return retval;
DebugLocation(817, 23);
PushFollow(Follow._condition_in_doWhileStatement2796);
condition();
PopFollow();
if (state.failed) return retval;
DebugLocation(817, 33);
PushFollow(Follow._semi_in_doWhileStatement2798);
semi();
PopFollow();
if (state.failed) return retval;
}
retval.Stop = (IToken)input.LT(-1);
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
}
finally
{
TraceOut("doWhileStatement", 69);
LeaveRule("doWhileStatement", 69);
LeaveRule_doWhileStatement();
}
DebugLocation(819, 1);
} finally { DebugExitRule(GrammarFileName, "doWhileStatement"); }
return retval;
}
开发者ID:jbakst,项目名称:xas,代码行数:57,代码来源:AS3TParser.cs
示例2: objectLiteral
private TemplateParserRuleReturnScope<StringTemplate, IToken> objectLiteral()
{
EnterRule_objectLiteral();
EnterRule("objectLiteral", 91);
TraceIn("objectLiteral", 91);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
try { DebugEnterRule(GrammarFileName, "objectLiteral");
DebugLocation(960, 1);
try
{
// AS3T.g:961:2: ( LCURLY ( fieldList )? RCURLY )
DebugEnterAlt(1);
// AS3T.g:961:4: LCURLY ( fieldList )? RCURLY
{
DebugLocation(961, 4);
Match(input,LCURLY,Follow._LCURLY_in_objectLiteral3517); if (state.failed) return retval;
DebugLocation(961, 11);
// AS3T.g:961:11: ( fieldList )?
int alt71=2;
try { DebugEnterSubRule(71);
try { DebugEnterDecision(71, false);
int LA71_1 = input.LA(1);
if ((LA71_1==AS||LA71_1==DECIMAL_LITERAL||LA71_1==DYNAMIC||LA71_1==FLOAT_LITERAL||LA71_1==GET||(LA71_1>=HEX_LITERAL && LA71_1<=IDENT)||LA71_1==IS||LA71_1==NAMESPACE||LA71_1==OCTAL_LITERAL||LA71_1==SET||LA71_1==SUPER||LA71_1==TRACE||LA71_1==USE||LA71_1==XML))
{
alt71 = 1;
}
} finally { DebugExitDecision(71); }
switch (alt71)
{
case 1:
DebugEnterAlt(1);
// AS3T.g:961:11: fieldList
{
DebugLocation(961, 11);
PushFollow(Follow._fieldList_in_objectLiteral3519);
fieldList();
PopFollow();
if (state.failed) return retval;
}
break;
}
} finally { DebugExitSubRule(71); }
DebugLocation(961, 22);
Match(input,RCURLY,Follow._RCURLY_in_objectLiteral3522); if (state.failed) return retval;
}
retval.Stop = (IToken)input.LT(-1);
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
}
finally
{
TraceOut("objectLiteral", 91);
LeaveRule("objectLiteral", 91);
LeaveRule_objectLiteral();
}
DebugLocation(962, 1);
} finally { DebugExitRule(GrammarFileName, "objectLiteral"); }
return retval;
}
开发者ID:jbakst,项目名称:xas,代码行数:72,代码来源:AS3TParser.cs
示例3: literalField
private TemplateParserRuleReturnScope<StringTemplate, IToken> literalField()
{
EnterRule_literalField();
EnterRule("literalField", 93);
TraceIn("literalField", 93);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
try { DebugEnterRule(GrammarFileName, "literalField");
DebugLocation(968, 1);
try
{
// AS3T.g:969:2: ( fieldName COLON element )
DebugEnterAlt(1);
// AS3T.g:969:5: fieldName COLON element
{
DebugLocation(969, 5);
PushFollow(Follow._fieldName_in_literalField3556);
fieldName();
PopFollow();
if (state.failed) return retval;
DebugLocation(969, 15);
Match(input,COLON,Follow._COLON_in_literalField3558); if (state.failed) return retval;
DebugLocation(969, 21);
PushFollow(Follow._element_in_literalField3560);
element();
PopFollow();
if (state.failed) return retval;
}
retval.Stop = (IToken)input.LT(-1);
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
}
finally
{
TraceOut("literalField", 93);
LeaveRule("literalField", 93);
LeaveRule_literalField();
}
DebugLocation(970, 1);
} finally { DebugExitRule(GrammarFileName, "literalField"); }
return retval;
}
开发者ID:jbakst,项目名称:xas,代码行数:50,代码来源:AS3TParser.cs
示例4: arrayLiteral
private TemplateParserRuleReturnScope<StringTemplate, IToken> arrayLiteral()
{
EnterRule_arrayLiteral();
EnterRule("arrayLiteral", 87);
TraceIn("arrayLiteral", 87);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
try { DebugEnterRule(GrammarFileName, "arrayLiteral");
DebugLocation(942, 1);
try
{
// AS3T.g:943:2: ( LBRACK ( elementList )? RBRACK )
DebugEnterAlt(1);
// AS3T.g:943:4: LBRACK ( elementList )? RBRACK
{
DebugLocation(943, 4);
Match(input,LBRACK,Follow._LBRACK_in_arrayLiteral3453); if (state.failed) return retval;
DebugLocation(943, 11);
// AS3T.g:943:11: ( elementList )?
int alt68=2;
try { DebugEnterSubRule(68);
try { DebugEnterDecision(68, false);
int LA68_1 = input.LA(1);
if ((LA68_1==AS||LA68_1==BNOT||LA68_1==COMMA||(LA68_1>=DEC && LA68_1<=DECIMAL_LITERAL)||(LA68_1>=DYNAMIC && LA68_1<=E4X_ATTRI)||(LA68_1>=FALSE && LA68_1<=FLOAT_LITERAL)||LA68_1==FUNCTION||LA68_1==GET||(LA68_1>=HEX_LITERAL && LA68_1<=IDENT)||LA68_1==INC||(LA68_1>=INTERNAL && LA68_1<=IS)||(LA68_1>=LBRACK && LA68_1<=LCURLY)||LA68_1==LNOT||LA68_1==LPAREN||LA68_1==MINUS||LA68_1==NAMESPACE||LA68_1==NEW||LA68_1==NULL||LA68_1==OCTAL_LITERAL||LA68_1==PLUS||LA68_1==PRIVATE||(LA68_1>=PROTECTED && LA68_1<=PUBLIC)||LA68_1==REGEX_LITERAL||LA68_1==SET||(LA68_1>=STRING_LITERAL_DOUBLE && LA68_1<=SUPER)||(LA68_1>=TRACE && LA68_1<=TRUE)||LA68_1==USE||LA68_1==XML||LA68_1==XML_LITERAL||LA68_1==244||(LA68_1>=256 && LA68_1<=258)))
{
alt68 = 1;
}
} finally { DebugExitDecision(68); }
switch (alt68)
{
case 1:
DebugEnterAlt(1);
// AS3T.g:943:11: elementList
{
DebugLocation(943, 11);
PushFollow(Follow._elementList_in_arrayLiteral3455);
elementList();
PopFollow();
if (state.failed) return retval;
}
break;
}
} finally { DebugExitSubRule(68); }
DebugLocation(943, 24);
Match(input,RBRACK,Follow._RBRACK_in_arrayLiteral3458); if (state.failed) return retval;
}
retval.Stop = (IToken)input.LT(-1);
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
}
finally
{
TraceOut("arrayLiteral", 87);
LeaveRule("arrayLiteral", 87);
LeaveRule_arrayLiteral();
}
DebugLocation(944, 1);
} finally { DebugExitRule(GrammarFileName, "arrayLiteral"); }
return retval;
}
开发者ID:jbakst,项目名称:xas,代码行数:72,代码来源:AS3TParser.cs
示例5: nonemptyElementList
private TemplateParserRuleReturnScope<StringTemplate, IToken> nonemptyElementList()
{
EnterRule_nonemptyElementList();
EnterRule("nonemptyElementList", 89);
TraceIn("nonemptyElementList", 89);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
try { DebugEnterRule(GrammarFileName, "nonemptyElementList");
DebugLocation(951, 1);
try
{
// AS3T.g:952:2: ( assignmentExpression ( COMMA assignmentExpression )* )
DebugEnterAlt(1);
// AS3T.g:952:4: assignmentExpression ( COMMA assignmentExpression )*
{
DebugLocation(952, 4);
PushFollow(Follow._assignmentExpression_in_nonemptyElementList3487);
assignmentExpression();
PopFollow();
if (state.failed) return retval;
DebugLocation(952, 25);
// AS3T.g:952:25: ( COMMA assignmentExpression )*
try { DebugEnterSubRule(70);
while (true)
{
int alt70=2;
try { DebugEnterDecision(70, false);
int LA70_1 = input.LA(1);
if ((LA70_1==COMMA))
{
alt70 = 1;
}
} finally { DebugExitDecision(70); }
switch ( alt70 )
{
case 1:
DebugEnterAlt(1);
// AS3T.g:952:26: COMMA assignmentExpression
{
DebugLocation(952, 26);
Match(input,COMMA,Follow._COMMA_in_nonemptyElementList3490); if (state.failed) return retval;
DebugLocation(952, 32);
PushFollow(Follow._assignmentExpression_in_nonemptyElementList3492);
assignmentExpression();
PopFollow();
if (state.failed) return retval;
}
break;
default:
goto loop70;
}
}
loop70:
;
} finally { DebugExitSubRule(70); }
}
retval.Stop = (IToken)input.LT(-1);
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
}
finally
{
TraceOut("nonemptyElementList", 89);
LeaveRule("nonemptyElementList", 89);
LeaveRule_nonemptyElementList();
}
DebugLocation(953, 1);
} finally { DebugExitRule(GrammarFileName, "nonemptyElementList"); }
return retval;
}
开发者ID:jbakst,项目名称:xas,代码行数:86,代码来源:AS3TParser.cs
示例6: modifiers
private TemplateParserRuleReturnScope<StringTemplate, IToken> modifiers()
{
EnterRule_modifiers();
EnterRule("modifiers", 84);
TraceIn("modifiers", 84);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
try { DebugEnterRule(GrammarFileName, "modifiers");
DebugLocation(918, 1);
try
{
// AS3T.g:920:2: ( ( modifier ( modifier )* )? )
DebugEnterAlt(1);
// AS3T.g:920:4: ( modifier ( modifier )* )?
{
DebugLocation(920, 4);
// AS3T.g:920:4: ( modifier ( modifier )* )?
int alt65=2;
try { DebugEnterSubRule(65);
try { DebugEnterDecision(65, false);
int LA65_1 = input.LA(1);
if ((LA65_1==DYNAMIC||LA65_1==IDENT||LA65_1==INTERNAL||LA65_1==PRIVATE||(LA65_1>=PROTECTED && LA65_1<=PUBLIC)||LA65_1==STATIC||(LA65_1>=245 && LA65_1<=247)||LA65_1==251||LA65_1==253))
{
alt65 = 1;
}
} finally { DebugExitDecision(65); }
switch (alt65)
{
case 1:
DebugEnterAlt(1);
// AS3T.g:920:6: modifier ( modifier )*
{
DebugLocation(920, 6);
PushFollow(Follow._modifier_in_modifiers3347);
modifier();
PopFollow();
if (state.failed) return retval;
DebugLocation(920, 15);
// AS3T.g:920:15: ( modifier )*
try { DebugEnterSubRule(64);
while (true)
{
int alt64=2;
try { DebugEnterDecision(64, false);
int LA64_1 = input.LA(1);
if ((LA64_1==DYNAMIC||LA64_1==IDENT||LA64_1==INTERNAL||LA64_1==PRIVATE||(LA64_1>=PROTECTED && LA64_1<=PUBLIC)||LA64_1==STATIC||(LA64_1>=245 && LA64_1<=247)||LA64_1==251||LA64_1==253))
{
alt64 = 1;
}
} finally { DebugExitDecision(64); }
switch ( alt64 )
{
case 1:
DebugEnterAlt(1);
// AS3T.g:920:16: modifier
{
DebugLocation(920, 16);
PushFollow(Follow._modifier_in_modifiers3350);
modifier();
PopFollow();
if (state.failed) return retval;
}
break;
default:
goto loop64;
}
}
loop64:
;
} finally { DebugExitSubRule(64); }
}
break;
}
} finally { DebugExitSubRule(65); }
}
retval.Stop = (IToken)input.LT(-1);
if (state.backtracking == 0)
{
retval.Template = new StringTemplate(TemplateGroup,input.ToString(retval.Start,input.LT(-1)));
}
}
catch (RecognitionException re)
{
ReportError(re);
//.........这里部分代码省略.........
开发者ID:jbakst,项目名称:xas,代码行数:101,代码来源:AS3TParser.cs
示例7: modifier
private TemplateParserRuleReturnScope<StringTemplate, IToken> modifier()
{
EnterRule_modifier();
EnterRule("modifier", 85);
TraceIn("modifier", 85);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
try { DebugEnterRule(GrammarFileName, "modifier");
DebugLocation(923, 1);
try
{
// AS3T.g:925:2: ( namespaceName | STATIC -> ignore(| 'final' | 'enumerable' | 'explicit' | 'override' | DYNAMIC | 'intrinsic' )
int alt66=8;
try { DebugEnterDecision(66, false);
switch (input.LA(1))
{
case IDENT:
case INTERNAL:
case PRIVATE:
case PROTECTED:
case PUBLIC:
{
alt66 = 1;
}
break;
case STATIC:
{
alt66 = 2;
}
break;
case 247:
{
alt66 = 3;
}
break;
case 245:
{
alt66 = 4;
}
break;
case 246:
{
alt66 = 5;
}
break;
case 253:
{
alt66 = 6;
}
break;
case DYNAMIC:
{
alt66 = 7;
}
break;
case 251:
{
alt66 = 8;
}
break;
default:
{
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae = new NoViableAltException("", 66, 0, input, 1);
DebugRecognitionException(nvae);
throw nvae;
}
}
} finally { DebugExitDecision(66); }
switch (alt66)
{
case 1:
DebugEnterAlt(1);
// AS3T.g:925:4: namespaceName
{
DebugLocation(925, 4);
PushFollow(Follow._namespaceName_in_modifier3371);
namespaceName();
PopFollow();
if (state.failed) return retval;
}
break;
case 2:
DebugEnterAlt(2);
// AS3T.g:926:4: STATIC
{
DebugLocation(926, 4);
Match(input,STATIC,Follow._STATIC_in_modifier3376); if (state.failed) return retval;
DebugLocation(926, 11);
if (state.backtracking == 0)
{
_storage = Symbol.STATIC;
}
// TEMPLATE REWRITE
if (state.backtracking == 0)
{
//.........这里部分代码省略.........
开发者ID:jbakst,项目名称:xas,代码行数:101,代码来源:AS3TParser.cs
示例8: identifier
private TemplateParserRuleReturnScope<StringTemplate, IToken> identifier()
{
EnterRule_identifier();
EnterRule("identifier", 74);
TraceIn("identifier", 74);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
try { DebugEnterRule(GrammarFileName, "identifier");
DebugLocation(842, 1);
try
{
// AS3T.g:844:2: ( ( qualifiedIdent ) ( propOrIdent )* )
DebugEnterAlt(1);
// AS3T.g:844:4: ( qualifiedIdent ) ( propOrIdent )*
{
DebugLocation(844, 4);
// AS3T.g:844:4: ( qualifiedIdent )
DebugEnterAlt(1);
// AS3T.g:844:5: qualifiedIdent
{
DebugLocation(844, 5);
PushFollow(Follow._qualifiedIdent_in_identifier2944);
qualifiedIdent();
PopFollow();
if (state.failed) return retval;
}
DebugLocation(844, 21);
// AS3T.g:844:21: ( propOrIdent )*
try { DebugEnterSubRule(53);
while (true)
{
int alt53=2;
try { DebugEnterDecision(53, false);
int LA53_1 = input.LA(1);
if ((LA53_1==DOT))
{
alt53 = 1;
}
} finally { DebugExitDecision(53); }
switch ( alt53 )
{
case 1:
DebugEnterAlt(1);
// AS3T.g:844:22: propOrIdent
{
DebugLocation(844, 22);
PushFollow(Follow._propOrIdent_in_identifier2948);
propOrIdent();
PopFollow();
if (state.failed) return retval;
}
break;
default:
goto loop53;
}
}
loop53:
;
} finally { DebugExitSubRule(53); }
}
retval.Stop = (IToken)input.LT(-1);
if (state.backtracking == 0)
{
retval.Template = new StringTemplate(TemplateGroup,input.ToString(retval.Start,input.LT(-1)));
}
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
}
finally
{
TraceOut("identifier", 74);
LeaveRule("identifier", 74);
LeaveRule_identifier();
}
DebugLocation(845, 1);
} finally { DebugExitRule(GrammarFileName, "identifier"); }
return retval;
}
开发者ID:jbakst,项目名称:xas,代码行数:96,代码来源:AS3TParser.cs
示例9: qualifiedIdent
private TemplateParserRuleReturnScope<StringTemplate, IToken> qualifiedIdent()
{
EnterRule_qualifiedIdent();
EnterRule("qualifiedIdent", 75);
TraceIn("qualifiedIdent", 75);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
try { DebugEnterRule(GrammarFileName, "qualifiedIdent");
DebugLocation(847, 4);
try
{
// AS3T.g:850:5: ( ( namespaceName DBL_COLON )=> namespaceName DBL_COLON ident | ident )
int alt54=2;
try { DebugEnterDecision(54, false);
int LA54_1 = input.LA(1);
if ((LA54_1==IDENT))
{
int LA54_2 = input.LA(2);
if ((EvaluatePredicate(synpred15_AS3T_fragment)))
{
alt54 = 1;
}
else if ((true))
{
alt54 = 2;
}
else
{
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae = new NoViableAltException("", 54, 1, input, 2);
DebugRecognitionException(nvae);
throw nvae;
}
}
else if ((LA54_1==PUBLIC) && (EvaluatePredicate(synpred15_AS3T_fragment)))
{
alt54 = 1;
}
else if ((LA54_1==PRIVATE) && (EvaluatePredicate(synpred15_AS3T_fragment)))
{
alt54 = 1;
}
else if ((LA54_1==PROTECTED) && (EvaluatePredicate(synpred15_AS3T_fragment)))
{
alt54 = 1;
}
else if ((LA54_1==INTERNAL) && (EvaluatePredicate(synpred15_AS3T_fragment)))
{
alt54 = 1;
}
else if ((LA54_1==AS||LA54_1==DYNAMIC||LA54_1==GET||LA54_1==IS||LA54_1==NAMESPACE||LA54_1==SET||LA54_1==SUPER||LA54_1==TRACE||LA54_1==USE||LA54_1==XML))
{
alt54 = 2;
}
else
{
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae = new NoViableAltException("", 54, 0, input, 1);
DebugRecognitionException(nvae);
throw nvae;
}
} finally { DebugExitDecision(54); }
switch (alt54)
{
case 1:
DebugEnterAlt(1);
// AS3T.g:850:7: ( namespaceName DBL_COLON )=> namespaceName DBL_COLON ident
{
DebugLocation(850, 36);
PushFollow(Follow._namespaceName_in_qualifiedIdent2985);
namespaceName();
PopFollow();
if (state.failed) return retval;
DebugLocation(850, 50);
Match(input,DBL_COLON,Follow._DBL_COLON_in_qualifiedIdent2987); if (state.failed) return retval;
DebugLocation(850, 60);
PushFollow(Follow._ident_in_qualifiedIdent2989);
ident();
PopFollow();
if (state.failed) return retval;
}
break;
case 2:
DebugEnterAlt(2);
// AS3T.g:851:7: ident
{
DebugLocation(851, 7);
PushFollow(Follow._ident_in_qualifiedIdent2997);
ident();
PopFollow();
if (state.failed) return retval;
}
break;
}
//.........这里部分代码省略.........
开发者ID:jbakst,项目名称:xas,代码行数:101,代码来源:AS3TParser.cs
示例10: typeExpression
private TemplateParserRuleReturnScope<StringTemplate, IToken> typeExpression()
{
EnterRule_typeExpression();
EnterRule("typeExpression", 72);
TraceIn("typeExpression", 72);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
TemplateParserRuleReturnScope<StringTemplate, IToken> typeIdentifier22 = default(TemplateParserRuleReturnScope<StringTemplate, IToken>);
try { DebugEnterRule(GrammarFileName, "typeExpression");
DebugLocation(830, 4);
try
{
// AS3T.g:832:2: ( COLON typeIdentifier -> type(t=$typeIdentifier.text)| 'void' -> type(t=\"void\")| STAR -> type(t=\"void*\"))
int alt51=3;
try { DebugEnterDecision(51, false);
switch (input.LA(1))
{
case COLON:
{
alt51 = 1;
}
break;
case 258:
{
alt51 = 2;
}
break;
case STAR:
{
alt51 = 3;
}
break;
default:
{
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae = new NoViableAltException("", 51, 0, input, 1);
DebugRecognitionException(nvae);
throw nvae;
}
}
} finally { DebugExitDecision(51); }
switch (alt51)
{
case 1:
DebugEnterAlt(1);
// AS3T.g:832:4: COLON typeIdentifier
{
DebugLocation(832, 4);
Match(input,COLON,Follow._COLON_in_typeExpression2856); if (state.failed) return retval;
DebugLocation(832, 10);
PushFollow(Follow._typeIdentifier_in_typeExpression2858);
typeIdentifier22=typeIdentifier();
PopFollow();
if (state.failed) return retval;
// TEMPLATE REWRITE
if (state.backtracking == 0)
{
// 832:25: -> type(t=$typeIdentifier.text)
{
retval.Template = TemplateGroup.GetInstanceOf("type",
new Dictionary<string, object>() { {"t", (typeIdentifier22!=null?input.ToString(typeIdentifier22.Start,typeIdentifier22.Stop):null)} }
);
}
((TokenRewriteStream)input).Replace(
retval.Start.TokenIndex,
input.LT(-1).TokenIndex,
retval.Template);
}
}
break;
case 2:
DebugEnterAlt(2);
// AS3T.g:833:4: 'void'
{
DebugLocation(833, 4);
Match(input,258,Follow._258_in_typeExpression2872); if (state.failed) return retval;
// TEMPLATE REWRITE
if (state.backtracking == 0)
{
// 833:12: -> type(t=\"void\")
{
retval.Template = TemplateGroup.GetInstanceOf("type",
new Dictionary<string, object>() { {"t", "void"} }
);
}
((TokenRewriteStream)input).Replace(
retval.Start.TokenIndex,
input.LT(-1).TokenIndex,
retval.Template);
//.........这里部分代码省略.........
开发者ID:jbakst,项目名称:xas,代码行数:101,代码来源:AS3TParser.cs
示例11: typeIdentifier
private TemplateParserRuleReturnScope<StringTemplate, IToken> typeIdentifier()
{
EnterRule_typeIdentifier();
EnterRule("typeIdentifier", 73);
TraceIn("typeIdentifier", 73);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
try { DebugEnterRule(GrammarFileName, "typeIdentifier");
DebugLocation(837, 4);
try
{
// AS3T.g:839:5: ( ident ( propOrIdent )* )
DebugEnterAlt(1);
// AS3T.g:839:7: ident ( propOrIdent )*
{
DebugLocation(839, 7);
PushFollow(Follow._ident_in_typeIdentifier2918);
ident();
PopFollow();
if (state.failed) return retval;
DebugLocation(839, 13);
// AS3T.g:839:13: ( propOrIdent )*
try { DebugEnterSubRule(52);
while (true)
{
int alt52=2;
try { DebugEnterDecision(52, false);
int LA52_1 = input.LA(1);
if ((LA52_1==DOT))
{
alt52 = 1;
}
} finally { DebugExitDecision(52); }
switch ( alt52 )
{
case 1:
DebugEnterAlt(1);
// AS3T.g:839:14: propOrIdent
{
DebugLocation(839, 14);
PushFollow(Follow._propOrIdent_in_typeIdentifier2921);
propOrIdent();
PopFollow();
if (state.failed) return retval;
}
break;
default:
goto loop52;
}
}
loop52:
;
} finally { DebugExitSubRule(52); }
}
retval.Stop = (IToken)input.LT(-1);
if (state.backtracking == 0)
{
retval.Template = new StringTemplate(TemplateGroup,input.ToString(retval.Start,input.LT(-1)));
}
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
}
finally
{
TraceOut("typeIdentifier", 73);
LeaveRule("typeIdentifier", 73);
LeaveRule_typeIdentifier();
}
DebugLocation(840, 4);
} finally { DebugExitRule(GrammarFileName, "typeIdentifier"); }
return retval;
}
开发者ID:jbakst,项目名称:xas,代码行数:88,代码来源:AS3TParser.cs
示例12: defaultXMLNamespaceStatement
private TemplateParserRuleReturnScope<StringTemplate, IToken> defaultXMLNamespaceStatement()
{
EnterRule_defaultXMLNamespaceStatement();
EnterRule("defaultXMLNamespaceStatement", 71);
TraceIn("defaultXMLNamespaceStatement", 71);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
try { DebugEnterRule(GrammarFileName, "defaultXMLNamespaceStatement");
DebugLocation(825, 1);
try
{
// AS3T.g:826:2: ( DEFAULT XML NAMESPACE ASSIGN expression semi )
DebugEnterAlt(1);
// AS3T.g:826:4: DEFAULT XML NAMESPACE ASSIGN expression semi
{
DebugLocation(826, 4);
Match(input,DEFAULT,Follow._DEFAULT_in_defaultXMLNamespaceStatement2827); if (state.failed) return retval;
DebugLocation(826, 12);
Match(input,XML,Follow._XML_in_defaultXMLNamespaceStatement2829); if (state.failed) return retval;
DebugLocation(826, 16);
Match(input,NAMESPACE,Follow._NAMESPACE_in_defaultXMLNamespaceStatement2831); if (state.failed) return retval;
DebugLocation(826, 26);
Match(input,ASSIGN,Follow._ASSIGN_in_defaultXMLNamespaceStatement2833); if (state.failed) return retval;
DebugLocation(826, 33);
PushFollow(Follow._expression_in_defaultXMLNamespaceStatement2835);
expression();
PopFollow();
if (state.failed) return retval;
DebugLocation(826, 44);
PushFollow(Follow._semi_in_defaultXMLNamespaceStatement2837);
semi();
PopFollow();
if (state.failed) return retval;
}
retval.Stop = (IToken)input.LT(-1);
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
}
finally
{
TraceOut("defaultXMLNamespaceStatement", 71);
LeaveRule("defaultXMLNamespaceStatement", 71);
LeaveRule_defaultXMLNamespaceStatement();
}
DebugLocation(828, 1);
} finally { DebugExitRule(GrammarFileName, "defaultXMLNamespaceStatement"); }
return retval;
}
开发者ID:jbakst,项目名称:xas,代码行数:56,代码来源:AS3TParser.cs
示例13: as2CompilationUnit
private TemplateParserRuleReturnScope<StringTemplate, IToken> as2CompilationUnit()
{
EnterRule_as2CompilationUnit();
EnterRule("as2CompilationUnit", 3);
TraceIn("as2CompilationUnit", 3);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
try { DebugEnterRule(GrammarFileName, "as2CompilationUnit");
DebugLocation(339, 1);
try
{
// AS3T.g:341:2: ( ( importDefinition )* as2Type )
DebugEnterAlt(1);
// AS3T.g:341:4: ( importDefinition )* as2Type
{
DebugLocation(341, 4);
// AS3T.g:341:4: ( importDefinition )*
try { DebugEnterSubRule(2);
while (true)
{
int alt2=2;
try { DebugEnterDecision(2, false);
int LA2_1 = input.LA(1);
if ((LA2_1==IMPORT))
{
alt2 = 1;
}
} finally { DebugExitDecision(2); }
switch ( alt2 )
{
case 1:
DebugEnterAlt(1);
// AS3T.g:341:4: importDefinition
{
DebugLocation(341, 4);
PushFollow(Follow._importDefinition_in_as2CompilationUnit510);
importDefinition();
PopFollow();
if (state.failed) return retval;
}
break;
default:
goto loop2;
}
}
loop2:
;
} finally { DebugExitSubRule(2); }
DebugLocation(342, 3);
PushFollow(Follow._as2Type_in_as2CompilationUnit515);
as2Type();
PopFollow();
if (state.failed) return retval;
}
retval.Stop = (IToken)input.LT(-1);
if (state.backtracking == 0)
{
retval.Template = new StringTemplate(TemplateGroup,input.ToString(retval.Start,input.LT(-1)));
}
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
}
finally
{
TraceOut("as2CompilationUnit", 3);
LeaveRule("as2CompilationUnit", 3);
LeaveRule_as2CompilationUnit();
}
DebugLocation(343, 1);
} finally { DebugExitRule(GrammarFileName, "as2CompilationUnit"); }
return retval;
}
开发者ID:jbakst,项目名称:xas,代码行数:88,代码来源:AS3TParser.cs
示例14: withStatement
private TemplateParserRuleReturnScope<StringTemplate, IToken> withStatement()
{
EnterRule_withStatement();
EnterRule("withStatement", 70);
TraceIn("withStatement", 70);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
try { DebugEnterRule(GrammarFileName, "withStatement");
DebugLocation(821, 1);
try
{
// AS3T.g:822:2: ( WITH condition statement )
DebugEnterAlt(1);
// AS3T.g:822:4: WITH condition statement
{
DebugLocation(822, 4);
Match(input,WITH,Follow._WITH_in_withStatement2812); if (state.failed) return retval;
DebugLocation(822, 9);
PushFollow(Follow._condition_in_withStatement2814);
condition();
PopFollow();
if (state.failed) return retval;
DebugLocation(822, 19);
PushFollow(Follow._statement_in_withStatement2816);
statement();
PopFollow();
if (state.failed) return retval;
}
retval.Stop = (IToken)input.LT(-1);
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
}
finally
{
TraceOut("withStatement", 70);
LeaveRule("withStatement", 70);
LeaveRule_withStatement();
}
DebugLocation(823, 1);
} finally { DebugExitRule(GrammarFileName, "withStatement"); }
return retval;
}
开发者ID:jbakst,项目名称:xas,代码行数:50,代码来源:AS3TParser.cs
示例15: annotationParamList
private TemplateParserRuleReturnScope<StringTemplate, IToken> annotationParamList()
{
EnterRule_annotationParamList();
EnterRule("annotationParamList", 82);
TraceIn("annotationParamList", 82);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
try { DebugEnterRule(GrammarFileName, "annotationParamList");
DebugLocation(902, 1);
try
{
// AS3T.g:903:2: ( LPAREN ( annotationParam ( COMMA annotationParam )* )? RPAREN )
DebugEnterAlt(1);
// AS3T.g:904:3: LPAREN ( annotationParam ( COMMA annotationParam )* )? RPAREN
{
DebugLocation(904, 3);
Match(input,LPAREN,Follow._LPAREN_in_annotationParamList3273); if (state.failed) return retval;
DebugLocation(905, 3);
// AS3T.g:905:3: ( annotationParam ( COMMA annotationParam )* )?
int alt62=2;
try { DebugEnterSubRule(62);
try { DebugEnterDecision(62, false);
int LA62_1 = input.LA(1);
if ((LA62_1==AS||LA62_1==DECIMAL_LITERAL||LA62_1==DYNAMIC||(LA62_1>=FALSE && LA62_1<=FLOAT_LITERAL)||LA62_1==GET||(LA62_1>=HEX_LITERAL && LA62_1<=IDENT)||LA62_1==IS||LA62_1==NAMESPACE||LA62_1==NULL||LA62_1==OCTAL_LITERAL||LA62_1==REGEX_LITERAL||LA62_1==SET||(LA62_1>=STRING_LITERAL_DOUBLE && LA62_1<=SUPER)||(LA62_1>=TRACE && LA62_1<=TRUE)||LA62_1==USE||LA62_1==XML||LA62_1==XML_LITERAL))
{
alt62 = 1;
}
} finally { DebugExitDecision(62); }
switch (alt62)
{
case 1:
DebugEnterAlt(1);
// AS3T.g:905:5: annotationParam ( COMMA annotationParam )*
{
DebugLocation(905, 5);
PushFollow(Follow._annotationParam_in_annotationParamList3279);
annotationParam();
PopFollow();
if (state.failed) return retval;
DebugLocation(906, 4);
// AS3T.g:906:4: ( COMMA annotationParam )*
try { DebugEnterSubRule(61);
while (true)
{
int alt61=2;
try { DebugEnterDecision(61, false);
int LA61_1 = input.LA(1);
if ((LA61_1==COMMA))
{
alt61 = 1;
}
} finally { DebugExitDecision(61); }
switch ( alt61 )
{
case 1:
DebugEnterAlt(1);
// AS3T.g:906:5: COMMA annotationParam
{
DebugLocation(906, 5);
Match(input,COMMA,Follow._COMMA_in_annotationParamList3285); if (state.failed) return retval;
DebugLocation(906, 11);
PushFollow(Follow._annotationParam_in_annotationParamList3287);
annotationParam();
PopFollow();
if (state.failed) return retval;
}
break;
default:
goto loop61;
}
}
loop61:
;
} finally { DebugExitSubRule(61); }
}
break;
}
} finally { DebugExitSubRule(62); }
DebugLocation(908, 3);
Match(input,RPAREN,Follow._RPAREN_in_annotationParamList3298); if (state.failed) return retval;
}
retval.Stop = (IToken)input.LT(-1);
}
catch (RecognitionException re)
//.........这里部分代码省略.........
开发者ID:jbakst,项目名称:xas,代码行数:101,代码来源:AS3TParser.cs
示例16: namespaceName
private TemplateParserRuleReturnScope<StringTemplate, IToken> namespaceName()
{
EnterRule_namespaceName();
EnterRule("namespaceName", 76);
TraceIn("namespaceName", 76);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
try { DebugEnterRule(GrammarFileName, "namespaceName");
DebugLocation(854, 1);
try
{
// AS3T.g:856:2: ( IDENT | reservedNamespace )
int alt55=2;
try { DebugEnterDecision(55, false);
int LA55_1 = input.LA(1);
if ((LA55_1==IDENT))
{
alt55 = 1;
}
else if ((LA55_1==INTERNAL||LA55_1==PRIVATE||(LA55_1>=PROTECTED && LA55_1<=PUBLIC)))
{
alt55 = 2;
}
else
{
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae = new NoViableAltException("", 55, 0, input, 1);
DebugRecognitionException(nvae);
throw nvae;
}
} finally { DebugExitDecision(55); }
switch (alt55)
{
case 1:
DebugEnterAlt(1);
// AS3T.g:856:4: IDENT
{
DebugLocation(856, 4);
Match(input,IDENT,Follow._IDENT_in_namespaceName3016); if (state.failed) return retval;
}
break;
case 2:
DebugEnterAlt(2);
// AS3T.g:856:12: reservedNamespace
{
DebugLocation(856, 12);
PushFollow(Follow._reservedNamespace_in_namespaceName3020);
reservedNamespace();
PopFollow();
if (state.failed) return retval;
}
break;
}
retval.Stop = (IToken)input.LT(-1);
if (state.backtracking == 0)
{
retval.Template = new StringTemplate(TemplateGroup,input.ToString(retval.Start,input.LT(-1)));
}
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
}
finally
{
TraceOut("namespaceName", 76);
LeaveRule("namespaceName", 76);
LeaveRule_namespaceName();
}
DebugLocation(857, 1);
} finally { DebugExitRule(GrammarFileName, "namespaceName"); }
return retval;
}
开发者ID:jbakst,项目名称:xas,代码行数:81,代码来源:AS3TParser.cs
示例17: annotationParam
private TemplateParserRuleReturnScope<StringTemplate, IToken> annotationParam()
{
EnterRule_annotationParam();
EnterRule("annotationParam", 83);
TraceIn("annotationParam", 83);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
try { DebugEnterRule(GrammarFileName, "annotationParam");
DebugLocation(912, 1);
try
{
// AS3T.g:913:2: ( ident ASSIGN constant | constant | ident )
int alt63=3;
try { DebugEnterDecision(63, false);
switch (input.LA(1))
{
case IDENT:
{
int LA63_2 = input.LA(2);
if ((LA63_2==ASSIGN))
{
alt63 = 1;
}
else if ((LA63_2==COMMA||LA63_2==RPAREN))
{
alt63 = 3;
}
else
{
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae = new NoViableAltException("", 63, 1, input, 2);
DebugRecognitionException(nvae);
throw nvae;
}
}
break;
case USE:
{
int LA63_2 = input.LA(2);
if ((LA63_2==ASSIGN))
{
alt63 = 1;
}
else if ((LA63_2==COMMA||LA63_2==RPAREN))
{
alt63 = 3;
}
else
{
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae = new NoViableAltException("", 63, 2, input, 2);
DebugRecognitionException(nvae);
throw nvae;
}
}
break;
case XML:
{
int LA63_2 = input.LA(2);
if ((LA63_2==ASSIGN))
{
alt63 = 1;
}
else if ((LA63_2==COMMA||LA63_2==RPAREN))
{
alt63 = 3;
}
else
{
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae = new NoViableAltException("", 63, 3, input, 2);
DebugRecognitionException(nvae);
throw nvae;
}
}
break;
case TRACE:
{
int LA63_2 = input.LA(2);
if ((LA63_2==ASSIGN))
{
alt63 = 1;
}
else if ((LA63_2==COMMA||LA63_2==RPAREN))
{
alt63 = 3;
}
else
{
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae = new NoViableAltException("", 63, 4, input, 2);
DebugRecognitionException(nvae);
throw nvae;
}
}
//.........这里部分代码省略.........
开发者ID:jbakst,项目名称:xas,代码行数:101,代码来源:AS3TParser.cs
示例18: reservedNamespace
private TemplateParserRuleReturnScope<StringTemplate, IToken> reservedNamespace()
{
EnterRule_reservedNamespace();
EnterRule("reservedNamespace", 77);
TraceIn("reservedNamespace", 77);
TemplateParserRuleReturnScope<StringTemplate, IToken> retval = new TemplateParserRuleReturnScope<StringTemplate, IToken>();
retval.Start = (IToken)input.LT(1);
try { DebugEnterRule(GrammarFileName, "reservedNamespace");
DebugLocation(859, 1);
try
{
// AS3T.g:861:2: ( PUBLIC -> ignore(| PRIVATE -> ignore(| PROTECTED -> ignore(| INTERNAL -> ignore()
int alt56=4;
try { DebugEnterDecision(56, false);
switch (input.LA(1))
{
case PUBLIC:
{
alt56 = 1;
}
break;
case PRIVATE:
{
alt56 = 2;
}
break;
case PROTECTED:
{
alt56 = 3;
}
break;
case INTERNAL:
{
alt56 = 4;
}
break;
default:
{
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae = new NoViableAltException("", 56, 0, input, 1);
DebugRecognitionException(nvae);
throw nvae;
}
}
} finally { DebugExitDecision(56); }
switch (alt56)
{
case 1:
DebugEnterAlt(1);
// AS3T.g:861:4: PUBLIC
{
DebugLocation(861, 4);
Match(input,PUBLIC,Follow._PUBLIC_in_reservedNamespace3036); if (state.failed) return retval;
DebugLocation(861, 11);
if (state.backtracking == 0)
{
_scope = Symbol.PUBLIC;
}
// TEMPLATE REWRITE
if (state.backtracking == 0)
{
// 861:39: -> ignore(
{
retval.Template = TemplateGroup.GetInstanceOf("ignore");
}
((TokenRewriteStream)input).Replace(
retval.Start.TokenIndex,
input.LT(-1).TokenIndex,
retval.Template);
}
}
break;
case 2:
DebugEnterAl
|
请发表评论