use of org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken in project n4js by eclipse.
the class InternalTypesParser method ruleTClassOrInterfaceHeader.
// $ANTLR end "ruleTypeVariable"
// $ANTLR start "ruleTClassOrInterfaceHeader"
// InternalTypesParser.g:2043:1: ruleTClassOrInterfaceHeader[EObject in_current] returns [EObject current=in_current] : ( ( (lv_typingStrategy_0_0= ruleTypingStrategyDefSiteOperator ) )? ( (lv_name_1_0= ruleBindingTypesIdentifier ) ) (otherlv_2= LessThanSign ( (lv_typeVars_3_0= superTypeVariable ) ) (otherlv_4= Comma ( (lv_typeVars_5_0= superTypeVariable ) ) )* otherlv_6= GreaterThanSign )? ) ;
public final EObject ruleTClassOrInterfaceHeader(EObject in_current) throws RecognitionException {
EObject current = in_current;
Token otherlv_2 = null;
Token otherlv_4 = null;
Token otherlv_6 = null;
AntlrDatatypeRuleToken lv_typingStrategy_0_0 = null;
AntlrDatatypeRuleToken lv_name_1_0 = null;
EObject lv_typeVars_3_0 = null;
EObject lv_typeVars_5_0 = null;
enterRule();
try {
// InternalTypesParser.g:2049:2: ( ( ( (lv_typingStrategy_0_0= ruleTypingStrategyDefSiteOperator ) )? ( (lv_name_1_0= ruleBindingTypesIdentifier ) ) (otherlv_2= LessThanSign ( (lv_typeVars_3_0= superTypeVariable ) ) (otherlv_4= Comma ( (lv_typeVars_5_0= superTypeVariable ) ) )* otherlv_6= GreaterThanSign )? ) )
// InternalTypesParser.g:2050:2: ( ( (lv_typingStrategy_0_0= ruleTypingStrategyDefSiteOperator ) )? ( (lv_name_1_0= ruleBindingTypesIdentifier ) ) (otherlv_2= LessThanSign ( (lv_typeVars_3_0= superTypeVariable ) ) (otherlv_4= Comma ( (lv_typeVars_5_0= superTypeVariable ) ) )* otherlv_6= GreaterThanSign )? )
{
// InternalTypesParser.g:2050:2: ( ( (lv_typingStrategy_0_0= ruleTypingStrategyDefSiteOperator ) )? ( (lv_name_1_0= ruleBindingTypesIdentifier ) ) (otherlv_2= LessThanSign ( (lv_typeVars_3_0= superTypeVariable ) ) (otherlv_4= Comma ( (lv_typeVars_5_0= superTypeVariable ) ) )* otherlv_6= GreaterThanSign )? )
// InternalTypesParser.g:2051:3: ( (lv_typingStrategy_0_0= ruleTypingStrategyDefSiteOperator ) )? ( (lv_name_1_0= ruleBindingTypesIdentifier ) ) (otherlv_2= LessThanSign ( (lv_typeVars_3_0= superTypeVariable ) ) (otherlv_4= Comma ( (lv_typeVars_5_0= superTypeVariable ) ) )* otherlv_6= GreaterThanSign )?
{
// InternalTypesParser.g:2051:3: ( (lv_typingStrategy_0_0= ruleTypingStrategyDefSiteOperator ) )?
int alt46 = 2;
int LA46_0 = input.LA(1);
if ((LA46_0 == Tilde)) {
alt46 = 1;
}
switch(alt46) {
case 1:
// InternalTypesParser.g:2052:4: (lv_typingStrategy_0_0= ruleTypingStrategyDefSiteOperator )
{
// InternalTypesParser.g:2052:4: (lv_typingStrategy_0_0= ruleTypingStrategyDefSiteOperator )
// InternalTypesParser.g:2053:5: lv_typingStrategy_0_0= ruleTypingStrategyDefSiteOperator
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTClassOrInterfaceHeaderAccess().getTypingStrategyTypingStrategyDefSiteOperatorParserRuleCall_0_0());
}
pushFollow(FOLLOW_10);
lv_typingStrategy_0_0 = ruleTypingStrategyDefSiteOperator();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTClassOrInterfaceHeaderRule());
}
set(current, "typingStrategy", lv_typingStrategy_0_0, "org.eclipse.n4js.ts.TypeExpressions.TypingStrategyDefSiteOperator");
afterParserOrEnumRuleCall();
}
}
}
break;
}
// InternalTypesParser.g:2070:3: ( (lv_name_1_0= ruleBindingTypesIdentifier ) )
// InternalTypesParser.g:2071:4: (lv_name_1_0= ruleBindingTypesIdentifier )
{
// InternalTypesParser.g:2071:4: (lv_name_1_0= ruleBindingTypesIdentifier )
// InternalTypesParser.g:2072:5: lv_name_1_0= ruleBindingTypesIdentifier
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTClassOrInterfaceHeaderAccess().getNameBindingTypesIdentifierParserRuleCall_1_0());
}
pushFollow(FOLLOW_45);
lv_name_1_0 = ruleBindingTypesIdentifier();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTClassOrInterfaceHeaderRule());
}
set(current, "name", lv_name_1_0, "org.eclipse.n4js.ts.Types.BindingTypesIdentifier");
afterParserOrEnumRuleCall();
}
}
}
// InternalTypesParser.g:2089:3: (otherlv_2= LessThanSign ( (lv_typeVars_3_0= superTypeVariable ) ) (otherlv_4= Comma ( (lv_typeVars_5_0= superTypeVariable ) ) )* otherlv_6= GreaterThanSign )?
int alt48 = 2;
int LA48_0 = input.LA(1);
if ((LA48_0 == LessThanSign)) {
alt48 = 1;
}
switch(alt48) {
case 1:
// InternalTypesParser.g:2090:4: otherlv_2= LessThanSign ( (lv_typeVars_3_0= superTypeVariable ) ) (otherlv_4= Comma ( (lv_typeVars_5_0= superTypeVariable ) ) )* otherlv_6= GreaterThanSign
{
otherlv_2 = (Token) match(input, LessThanSign, FOLLOW_46);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(otherlv_2, grammarAccess.getTClassOrInterfaceHeaderAccess().getLessThanSignKeyword_2_0());
}
// InternalTypesParser.g:2094:4: ( (lv_typeVars_3_0= superTypeVariable ) )
// InternalTypesParser.g:2095:5: (lv_typeVars_3_0= superTypeVariable )
{
// InternalTypesParser.g:2095:5: (lv_typeVars_3_0= superTypeVariable )
// InternalTypesParser.g:2096:6: lv_typeVars_3_0= superTypeVariable
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTClassOrInterfaceHeaderAccess().getTypeVarsTypeVariableParserRuleCall_2_1_0());
}
pushFollow(FOLLOW_47);
lv_typeVars_3_0 = superTypeVariable();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTClassOrInterfaceHeaderRule());
}
add(current, "typeVars", lv_typeVars_3_0, "org.eclipse.n4js.ts.TypeExpressions.TypeVariable");
afterParserOrEnumRuleCall();
}
}
}
// InternalTypesParser.g:2113:4: (otherlv_4= Comma ( (lv_typeVars_5_0= superTypeVariable ) ) )*
loop47: do {
int alt47 = 2;
int LA47_0 = input.LA(1);
if ((LA47_0 == Comma)) {
alt47 = 1;
}
switch(alt47) {
case 1:
// InternalTypesParser.g:2114:5: otherlv_4= Comma ( (lv_typeVars_5_0= superTypeVariable ) )
{
otherlv_4 = (Token) match(input, Comma, FOLLOW_46);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(otherlv_4, grammarAccess.getTClassOrInterfaceHeaderAccess().getCommaKeyword_2_2_0());
}
// InternalTypesParser.g:2118:5: ( (lv_typeVars_5_0= superTypeVariable ) )
// InternalTypesParser.g:2119:6: (lv_typeVars_5_0= superTypeVariable )
{
// InternalTypesParser.g:2119:6: (lv_typeVars_5_0= superTypeVariable )
// InternalTypesParser.g:2120:7: lv_typeVars_5_0= superTypeVariable
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTClassOrInterfaceHeaderAccess().getTypeVarsTypeVariableParserRuleCall_2_2_1_0());
}
pushFollow(FOLLOW_47);
lv_typeVars_5_0 = superTypeVariable();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTClassOrInterfaceHeaderRule());
}
add(current, "typeVars", lv_typeVars_5_0, "org.eclipse.n4js.ts.TypeExpressions.TypeVariable");
afterParserOrEnumRuleCall();
}
}
}
}
break;
default:
break loop47;
}
} while (true);
otherlv_6 = (Token) match(input, GreaterThanSign, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(otherlv_6, grammarAccess.getTClassOrInterfaceHeaderAccess().getGreaterThanSignKeyword_2_3());
}
}
break;
}
}
}
if (state.backtracking == 0) {
leaveRule();
}
} catch (RecognitionException re) {
recover(input, re);
appendSkippedTokens();
} finally {
}
return current;
}
use of org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken in project n4js by eclipse.
the class InternalTypesParser method ruleTMethod.
// $ANTLR end "entryRuleTMethod"
// $ANTLR start "ruleTMethod"
// InternalTypesParser.g:2445:1: ruleTMethod returns [EObject current=null] : ( ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? ( ruleTypeVariables[null] )? ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) LeftParenthesis ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? (this_TypeVariables_3= ruleTypeVariables[$current] )? ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ( ( LeftParenthesis )=>this_TFormalParameters_6= ruleTFormalParameters[$current] ) ) ) this_ColonSepReturnTypeRef_7= ruleColonSepReturnTypeRef[$current] (otherlv_8= Semicolon )? ) ;
public final EObject ruleTMethod() throws RecognitionException {
EObject current = null;
Token lv_declaredAbstract_1_0 = null;
Token lv_declaredStatic_2_0 = null;
Token otherlv_8 = null;
Enumerator lv_declaredMemberAccessModifier_0_0 = null;
EObject this_TypeVariables_3 = null;
AntlrDatatypeRuleToken lv_name_4_0 = null;
AntlrDatatypeRuleToken lv_name_5_0 = null;
EObject this_TFormalParameters_6 = null;
EObject this_ColonSepReturnTypeRef_7 = null;
enterRule();
try {
// InternalTypesParser.g:2451:2: ( ( ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? ( ruleTypeVariables[null] )? ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) LeftParenthesis ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? (this_TypeVariables_3= ruleTypeVariables[$current] )? ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ( ( LeftParenthesis )=>this_TFormalParameters_6= ruleTFormalParameters[$current] ) ) ) this_ColonSepReturnTypeRef_7= ruleColonSepReturnTypeRef[$current] (otherlv_8= Semicolon )? ) )
// InternalTypesParser.g:2452:2: ( ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? ( ruleTypeVariables[null] )? ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) LeftParenthesis ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? (this_TypeVariables_3= ruleTypeVariables[$current] )? ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ( ( LeftParenthesis )=>this_TFormalParameters_6= ruleTFormalParameters[$current] ) ) ) this_ColonSepReturnTypeRef_7= ruleColonSepReturnTypeRef[$current] (otherlv_8= Semicolon )? )
{
// InternalTypesParser.g:2452:2: ( ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? ( ruleTypeVariables[null] )? ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) LeftParenthesis ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? (this_TypeVariables_3= ruleTypeVariables[$current] )? ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ( ( LeftParenthesis )=>this_TFormalParameters_6= ruleTFormalParameters[$current] ) ) ) this_ColonSepReturnTypeRef_7= ruleColonSepReturnTypeRef[$current] (otherlv_8= Semicolon )? )
// InternalTypesParser.g:2453:3: ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? ( ruleTypeVariables[null] )? ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) LeftParenthesis ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? (this_TypeVariables_3= ruleTypeVariables[$current] )? ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ( ( LeftParenthesis )=>this_TFormalParameters_6= ruleTFormalParameters[$current] ) ) ) this_ColonSepReturnTypeRef_7= ruleColonSepReturnTypeRef[$current] (otherlv_8= Semicolon )?
{
// InternalTypesParser.g:2453:3: ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? ( ruleTypeVariables[null] )? ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) LeftParenthesis ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? (this_TypeVariables_3= ruleTypeVariables[$current] )? ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ( ( LeftParenthesis )=>this_TFormalParameters_6= ruleTFormalParameters[$current] ) ) )
// InternalTypesParser.g:2454:4: ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? ( ruleTypeVariables[null] )? ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) LeftParenthesis ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? (this_TypeVariables_3= ruleTypeVariables[$current] )? ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ( ( LeftParenthesis )=>this_TFormalParameters_6= ruleTFormalParameters[$current] ) )
{
// InternalTypesParser.g:2492:4: ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? (this_TypeVariables_3= ruleTypeVariables[$current] )? ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ( ( LeftParenthesis )=>this_TFormalParameters_6= ruleTFormalParameters[$current] ) )
// InternalTypesParser.g:2493:5: ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? (this_TypeVariables_3= ruleTypeVariables[$current] )? ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ( ( LeftParenthesis )=>this_TFormalParameters_6= ruleTFormalParameters[$current] )
{
// InternalTypesParser.g:2493:5: ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) )
// InternalTypesParser.g:2494:6: (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier )
{
// InternalTypesParser.g:2494:6: (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier )
// InternalTypesParser.g:2495:7: lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTMethodAccess().getDeclaredMemberAccessModifierMemberAccessModifierEnumRuleCall_0_0_0_0());
}
pushFollow(FOLLOW_52);
lv_declaredMemberAccessModifier_0_0 = ruleMemberAccessModifier();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTMethodRule());
}
set(current, "declaredMemberAccessModifier", lv_declaredMemberAccessModifier_0_0, "org.eclipse.n4js.ts.Types.MemberAccessModifier");
afterParserOrEnumRuleCall();
}
}
}
// InternalTypesParser.g:2512:5: ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )?
int alt54 = 3;
int LA54_0 = input.LA(1);
if ((LA54_0 == Abstract)) {
int LA54_1 = input.LA(2);
if ((LA54_1 == AssignmnentCompatible || (LA54_1 >= AutoboxedType && LA54_1 <= Finally) || (LA54_1 >= Private && LA54_1 <= False) || (LA54_1 >= Super && LA54_1 <= With) || (LA54_1 >= Any && LA54_1 <= Var) || (LA54_1 >= As && LA54_1 <= Of) || LA54_1 == LessThanSign || LA54_1 == LeftSquareBracket || LA54_1 == RULE_IDENTIFIER)) {
alt54 = 1;
}
} else if ((LA54_0 == Static)) {
int LA54_2 = input.LA(2);
if ((LA54_2 == AssignmnentCompatible || (LA54_2 >= AutoboxedType && LA54_2 <= Finally) || (LA54_2 >= Private && LA54_2 <= False) || (LA54_2 >= Super && LA54_2 <= With) || (LA54_2 >= Any && LA54_2 <= Var) || (LA54_2 >= As && LA54_2 <= Of) || LA54_2 == LessThanSign || LA54_2 == LeftSquareBracket || LA54_2 == RULE_IDENTIFIER)) {
alt54 = 2;
}
}
switch(alt54) {
case 1:
// InternalTypesParser.g:2513:6: ( (lv_declaredAbstract_1_0= Abstract ) )
{
// InternalTypesParser.g:2513:6: ( (lv_declaredAbstract_1_0= Abstract ) )
// InternalTypesParser.g:2514:7: (lv_declaredAbstract_1_0= Abstract )
{
// InternalTypesParser.g:2514:7: (lv_declaredAbstract_1_0= Abstract )
// InternalTypesParser.g:2515:8: lv_declaredAbstract_1_0= Abstract
{
lv_declaredAbstract_1_0 = (Token) match(input, Abstract, FOLLOW_52);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(lv_declaredAbstract_1_0, grammarAccess.getTMethodAccess().getDeclaredAbstractAbstractKeyword_0_0_1_0_0());
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTMethodRule());
}
setWithLastConsumed(current, "declaredAbstract", true, "abstract");
}
}
}
}
break;
case 2:
// InternalTypesParser.g:2528:6: ( (lv_declaredStatic_2_0= Static ) )
{
// InternalTypesParser.g:2528:6: ( (lv_declaredStatic_2_0= Static ) )
// InternalTypesParser.g:2529:7: (lv_declaredStatic_2_0= Static )
{
// InternalTypesParser.g:2529:7: (lv_declaredStatic_2_0= Static )
// InternalTypesParser.g:2530:8: lv_declaredStatic_2_0= Static
{
lv_declaredStatic_2_0 = (Token) match(input, Static, FOLLOW_52);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(lv_declaredStatic_2_0, grammarAccess.getTMethodAccess().getDeclaredStaticStaticKeyword_0_0_1_1_0());
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTMethodRule());
}
setWithLastConsumed(current, "declaredStatic", true, "static");
}
}
}
}
break;
}
// InternalTypesParser.g:2543:5: (this_TypeVariables_3= ruleTypeVariables[$current] )?
int alt55 = 2;
int LA55_0 = input.LA(1);
if ((LA55_0 == LessThanSign)) {
alt55 = 1;
}
switch(alt55) {
case 1:
// InternalTypesParser.g:2544:6: this_TypeVariables_3= ruleTypeVariables[$current]
{
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTMethodRule());
}
newCompositeNode(grammarAccess.getTMethodAccess().getTypeVariablesParserRuleCall_0_0_2());
}
pushFollow(FOLLOW_52);
this_TypeVariables_3 = ruleTypeVariables(current);
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
current = this_TypeVariables_3;
afterParserOrEnumRuleCall();
}
}
break;
}
// InternalTypesParser.g:2556:5: ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) )
int alt56 = 2;
int LA56_0 = input.LA(1);
if ((LA56_0 == AssignmnentCompatible || (LA56_0 >= AutoboxedType && LA56_0 <= Finally) || (LA56_0 >= Private && LA56_0 <= False) || (LA56_0 >= Super && LA56_0 <= With) || (LA56_0 >= Any && LA56_0 <= Var) || (LA56_0 >= As && LA56_0 <= Of) || LA56_0 == RULE_IDENTIFIER)) {
alt56 = 1;
} else if ((LA56_0 == LeftSquareBracket)) {
alt56 = 2;
} else {
if (state.backtracking > 0) {
state.failed = true;
return current;
}
NoViableAltException nvae = new NoViableAltException("", 56, 0, input);
throw nvae;
}
switch(alt56) {
case 1:
// InternalTypesParser.g:2557:6: ( (lv_name_4_0= ruleTypesIdentifier ) )
{
// InternalTypesParser.g:2557:6: ( (lv_name_4_0= ruleTypesIdentifier ) )
// InternalTypesParser.g:2558:7: (lv_name_4_0= ruleTypesIdentifier )
{
// InternalTypesParser.g:2558:7: (lv_name_4_0= ruleTypesIdentifier )
// InternalTypesParser.g:2559:8: lv_name_4_0= ruleTypesIdentifier
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTMethodAccess().getNameTypesIdentifierParserRuleCall_0_0_3_0_0());
}
pushFollow(FOLLOW_53);
lv_name_4_0 = ruleTypesIdentifier();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTMethodRule());
}
set(current, "name", lv_name_4_0, "org.eclipse.n4js.ts.Types.TypesIdentifier");
afterParserOrEnumRuleCall();
}
}
}
}
break;
case 2:
// InternalTypesParser.g:2577:6: ( (lv_name_5_0= ruleTypesComputedPropertyName ) )
{
// InternalTypesParser.g:2577:6: ( (lv_name_5_0= ruleTypesComputedPropertyName ) )
// InternalTypesParser.g:2578:7: (lv_name_5_0= ruleTypesComputedPropertyName )
{
// InternalTypesParser.g:2578:7: (lv_name_5_0= ruleTypesComputedPropertyName )
// InternalTypesParser.g:2579:8: lv_name_5_0= ruleTypesComputedPropertyName
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTMethodAccess().getNameTypesComputedPropertyNameParserRuleCall_0_0_3_1_0());
}
pushFollow(FOLLOW_53);
lv_name_5_0 = ruleTypesComputedPropertyName();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTMethodRule());
}
set(current, "name", lv_name_5_0, "org.eclipse.n4js.ts.Types.TypesComputedPropertyName");
afterParserOrEnumRuleCall();
}
}
}
}
break;
}
// InternalTypesParser.g:2597:5: ( ( LeftParenthesis )=>this_TFormalParameters_6= ruleTFormalParameters[$current] )
// InternalTypesParser.g:2598:6: ( LeftParenthesis )=>this_TFormalParameters_6= ruleTFormalParameters[$current]
{
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTMethodRule());
}
newCompositeNode(grammarAccess.getTMethodAccess().getTFormalParametersParserRuleCall_0_0_4());
}
pushFollow(FOLLOW_54);
this_TFormalParameters_6 = ruleTFormalParameters(current);
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
current = this_TFormalParameters_6;
afterParserOrEnumRuleCall();
}
}
}
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTMethodRule());
}
newCompositeNode(grammarAccess.getTMethodAccess().getColonSepReturnTypeRefParserRuleCall_1());
}
pushFollow(FOLLOW_49);
this_ColonSepReturnTypeRef_7 = ruleColonSepReturnTypeRef(current);
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
current = this_ColonSepReturnTypeRef_7;
afterParserOrEnumRuleCall();
}
// InternalTypesParser.g:2624:3: (otherlv_8= Semicolon )?
int alt57 = 2;
int LA57_0 = input.LA(1);
if ((LA57_0 == Semicolon)) {
alt57 = 1;
}
switch(alt57) {
case 1:
// InternalTypesParser.g:2625:4: otherlv_8= Semicolon
{
otherlv_8 = (Token) match(input, Semicolon, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(otherlv_8, grammarAccess.getTMethodAccess().getSemicolonKeyword_2());
}
}
break;
}
}
}
if (state.backtracking == 0) {
leaveRule();
}
} catch (RecognitionException re) {
recover(input, re);
appendSkippedTokens();
} finally {
}
return current;
}
use of org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken in project n4js by eclipse.
the class InternalTypesParser method entryRuleTypesStringLiteralComputedName.
// $ANTLR end "ruleTypesSymbolLiteralComputedName"
// $ANTLR start "entryRuleTypesStringLiteralComputedName"
// InternalTypesParser.g:1171:1: entryRuleTypesStringLiteralComputedName returns [String current=null] : iv_ruleTypesStringLiteralComputedName= ruleTypesStringLiteralComputedName EOF ;
public final String entryRuleTypesStringLiteralComputedName() throws RecognitionException {
String current = null;
AntlrDatatypeRuleToken iv_ruleTypesStringLiteralComputedName = null;
try {
// InternalTypesParser.g:1171:70: (iv_ruleTypesStringLiteralComputedName= ruleTypesStringLiteralComputedName EOF )
// InternalTypesParser.g:1172:2: iv_ruleTypesStringLiteralComputedName= ruleTypesStringLiteralComputedName EOF
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTypesStringLiteralComputedNameRule());
}
pushFollow(FOLLOW_1);
iv_ruleTypesStringLiteralComputedName = ruleTypesStringLiteralComputedName();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
current = iv_ruleTypesStringLiteralComputedName.getText();
}
match(input, EOF, FOLLOW_2);
if (state.failed)
return current;
}
} catch (RecognitionException re) {
recover(input, re);
appendSkippedTokens();
} finally {
}
return current;
}
use of org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken in project n4js by eclipse.
the class InternalTypesParser method ruleTypesComputedPropertyName.
// $ANTLR end "entryRuleTypesComputedPropertyName"
// $ANTLR start "ruleTypesComputedPropertyName"
// InternalTypesParser.g:1082:1: ruleTypesComputedPropertyName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (kw= LeftSquareBracket (this_TypesSymbolLiteralComputedName_1= ruleTypesSymbolLiteralComputedName | this_TypesStringLiteralComputedName_2= ruleTypesStringLiteralComputedName ) kw= RightSquareBracket ) ;
public final AntlrDatatypeRuleToken ruleTypesComputedPropertyName() throws RecognitionException {
AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
Token kw = null;
AntlrDatatypeRuleToken this_TypesSymbolLiteralComputedName_1 = null;
AntlrDatatypeRuleToken this_TypesStringLiteralComputedName_2 = null;
enterRule();
try {
// InternalTypesParser.g:1088:2: ( (kw= LeftSquareBracket (this_TypesSymbolLiteralComputedName_1= ruleTypesSymbolLiteralComputedName | this_TypesStringLiteralComputedName_2= ruleTypesStringLiteralComputedName ) kw= RightSquareBracket ) )
// InternalTypesParser.g:1089:2: (kw= LeftSquareBracket (this_TypesSymbolLiteralComputedName_1= ruleTypesSymbolLiteralComputedName | this_TypesStringLiteralComputedName_2= ruleTypesStringLiteralComputedName ) kw= RightSquareBracket )
{
// InternalTypesParser.g:1089:2: (kw= LeftSquareBracket (this_TypesSymbolLiteralComputedName_1= ruleTypesSymbolLiteralComputedName | this_TypesStringLiteralComputedName_2= ruleTypesStringLiteralComputedName ) kw= RightSquareBracket )
// InternalTypesParser.g:1090:3: kw= LeftSquareBracket (this_TypesSymbolLiteralComputedName_1= ruleTypesSymbolLiteralComputedName | this_TypesStringLiteralComputedName_2= ruleTypesStringLiteralComputedName ) kw= RightSquareBracket
{
kw = (Token) match(input, LeftSquareBracket, FOLLOW_20);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getTypesComputedPropertyNameAccess().getLeftSquareBracketKeyword_0());
}
// InternalTypesParser.g:1095:3: (this_TypesSymbolLiteralComputedName_1= ruleTypesSymbolLiteralComputedName | this_TypesStringLiteralComputedName_2= ruleTypesStringLiteralComputedName )
int alt18 = 2;
int LA18_0 = input.LA(1);
if ((LA18_0 == AssignmnentCompatible || (LA18_0 >= AutoboxedType && LA18_0 <= Finally) || (LA18_0 >= Private && LA18_0 <= False) || (LA18_0 >= Super && LA18_0 <= With) || (LA18_0 >= Any && LA18_0 <= Var) || (LA18_0 >= As && LA18_0 <= Of) || LA18_0 == RULE_IDENTIFIER)) {
alt18 = 1;
} else if ((LA18_0 == RULE_STRING)) {
alt18 = 2;
} else {
if (state.backtracking > 0) {
state.failed = true;
return current;
}
NoViableAltException nvae = new NoViableAltException("", 18, 0, input);
throw nvae;
}
switch(alt18) {
case 1:
// InternalTypesParser.g:1096:4: this_TypesSymbolLiteralComputedName_1= ruleTypesSymbolLiteralComputedName
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTypesComputedPropertyNameAccess().getTypesSymbolLiteralComputedNameParserRuleCall_1_0());
}
pushFollow(FOLLOW_21);
this_TypesSymbolLiteralComputedName_1 = ruleTypesSymbolLiteralComputedName();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(this_TypesSymbolLiteralComputedName_1);
}
if (state.backtracking == 0) {
afterParserOrEnumRuleCall();
}
}
break;
case 2:
// InternalTypesParser.g:1107:4: this_TypesStringLiteralComputedName_2= ruleTypesStringLiteralComputedName
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTypesComputedPropertyNameAccess().getTypesStringLiteralComputedNameParserRuleCall_1_1());
}
pushFollow(FOLLOW_21);
this_TypesStringLiteralComputedName_2 = ruleTypesStringLiteralComputedName();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(this_TypesStringLiteralComputedName_2);
}
if (state.backtracking == 0) {
afterParserOrEnumRuleCall();
}
}
break;
}
kw = (Token) match(input, RightSquareBracket, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getTypesComputedPropertyNameAccess().getRightSquareBracketKeyword_2());
}
}
}
if (state.backtracking == 0) {
leaveRule();
}
} catch (RecognitionException re) {
recover(input, re);
appendSkippedTokens();
} finally {
}
return current;
}
use of org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken in project n4js by eclipse.
the class InternalTypesParser method ruleTField.
// $ANTLR end "entryRuleTField"
// $ANTLR start "ruleTField"
// InternalTypesParser.g:2641:1: ruleTField returns [EObject current=null] : ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredStatic_1_0= Static ) ) | ( (lv_const_2_0= Const ) ) | ( (lv_declaredFinal_3_0= Final ) ) )? ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ( (lv_optional_6_0= QuestionMark ) )? this_ColonSepTypeRef_7= ruleColonSepTypeRef[$current] (otherlv_8= Semicolon )? ) ;
public final EObject ruleTField() throws RecognitionException {
EObject current = null;
Token lv_declaredStatic_1_0 = null;
Token lv_const_2_0 = null;
Token lv_declaredFinal_3_0 = null;
Token lv_optional_6_0 = null;
Token otherlv_8 = null;
Enumerator lv_declaredMemberAccessModifier_0_0 = null;
AntlrDatatypeRuleToken lv_name_4_0 = null;
AntlrDatatypeRuleToken lv_name_5_0 = null;
EObject this_ColonSepTypeRef_7 = null;
enterRule();
try {
// InternalTypesParser.g:2647:2: ( ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredStatic_1_0= Static ) ) | ( (lv_const_2_0= Const ) ) | ( (lv_declaredFinal_3_0= Final ) ) )? ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ( (lv_optional_6_0= QuestionMark ) )? this_ColonSepTypeRef_7= ruleColonSepTypeRef[$current] (otherlv_8= Semicolon )? ) )
// InternalTypesParser.g:2648:2: ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredStatic_1_0= Static ) ) | ( (lv_const_2_0= Const ) ) | ( (lv_declaredFinal_3_0= Final ) ) )? ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ( (lv_optional_6_0= QuestionMark ) )? this_ColonSepTypeRef_7= ruleColonSepTypeRef[$current] (otherlv_8= Semicolon )? )
{
// InternalTypesParser.g:2648:2: ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredStatic_1_0= Static ) ) | ( (lv_const_2_0= Const ) ) | ( (lv_declaredFinal_3_0= Final ) ) )? ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ( (lv_optional_6_0= QuestionMark ) )? this_ColonSepTypeRef_7= ruleColonSepTypeRef[$current] (otherlv_8= Semicolon )? )
// InternalTypesParser.g:2649:3: ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredStatic_1_0= Static ) ) | ( (lv_const_2_0= Const ) ) | ( (lv_declaredFinal_3_0= Final ) ) )? ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ( (lv_optional_6_0= QuestionMark ) )? this_ColonSepTypeRef_7= ruleColonSepTypeRef[$current] (otherlv_8= Semicolon )?
{
// InternalTypesParser.g:2649:3: ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) )
// InternalTypesParser.g:2650:4: (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier )
{
// InternalTypesParser.g:2650:4: (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier )
// InternalTypesParser.g:2651:5: lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTFieldAccess().getDeclaredMemberAccessModifierMemberAccessModifierEnumRuleCall_0_0());
}
pushFollow(FOLLOW_55);
lv_declaredMemberAccessModifier_0_0 = ruleMemberAccessModifier();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTFieldRule());
}
set(current, "declaredMemberAccessModifier", lv_declaredMemberAccessModifier_0_0, "org.eclipse.n4js.ts.Types.MemberAccessModifier");
afterParserOrEnumRuleCall();
}
}
}
// InternalTypesParser.g:2668:3: ( ( (lv_declaredStatic_1_0= Static ) ) | ( (lv_const_2_0= Const ) ) | ( (lv_declaredFinal_3_0= Final ) ) )?
int alt58 = 4;
switch(input.LA(1)) {
case Static:
{
int LA58_1 = input.LA(2);
if ((LA58_1 == AssignmnentCompatible || (LA58_1 >= AutoboxedType && LA58_1 <= Finally) || (LA58_1 >= Private && LA58_1 <= False) || (LA58_1 >= Super && LA58_1 <= With) || (LA58_1 >= Any && LA58_1 <= Var) || (LA58_1 >= As && LA58_1 <= Of) || LA58_1 == LeftSquareBracket || LA58_1 == RULE_IDENTIFIER)) {
alt58 = 1;
}
}
break;
case Const:
{
int LA58_2 = input.LA(2);
if ((LA58_2 == AssignmnentCompatible || (LA58_2 >= AutoboxedType && LA58_2 <= Finally) || (LA58_2 >= Private && LA58_2 <= False) || (LA58_2 >= Super && LA58_2 <= With) || (LA58_2 >= Any && LA58_2 <= Var) || (LA58_2 >= As && LA58_2 <= Of) || LA58_2 == LeftSquareBracket || LA58_2 == RULE_IDENTIFIER)) {
alt58 = 2;
}
}
break;
case Final:
{
alt58 = 3;
}
break;
}
switch(alt58) {
case 1:
// InternalTypesParser.g:2669:4: ( (lv_declaredStatic_1_0= Static ) )
{
// InternalTypesParser.g:2669:4: ( (lv_declaredStatic_1_0= Static ) )
// InternalTypesParser.g:2670:5: (lv_declaredStatic_1_0= Static )
{
// InternalTypesParser.g:2670:5: (lv_declaredStatic_1_0= Static )
// InternalTypesParser.g:2671:6: lv_declaredStatic_1_0= Static
{
lv_declaredStatic_1_0 = (Token) match(input, Static, FOLLOW_52);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(lv_declaredStatic_1_0, grammarAccess.getTFieldAccess().getDeclaredStaticStaticKeyword_1_0_0());
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTFieldRule());
}
setWithLastConsumed(current, "declaredStatic", true, "static");
}
}
}
}
break;
case 2:
// InternalTypesParser.g:2684:4: ( (lv_const_2_0= Const ) )
{
// InternalTypesParser.g:2684:4: ( (lv_const_2_0= Const ) )
// InternalTypesParser.g:2685:5: (lv_const_2_0= Const )
{
// InternalTypesParser.g:2685:5: (lv_const_2_0= Const )
// InternalTypesParser.g:2686:6: lv_const_2_0= Const
{
lv_const_2_0 = (Token) match(input, Const, FOLLOW_52);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(lv_const_2_0, grammarAccess.getTFieldAccess().getConstConstKeyword_1_1_0());
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTFieldRule());
}
setWithLastConsumed(current, "const", true, "const");
}
}
}
}
break;
case 3:
// InternalTypesParser.g:2699:4: ( (lv_declaredFinal_3_0= Final ) )
{
// InternalTypesParser.g:2699:4: ( (lv_declaredFinal_3_0= Final ) )
// InternalTypesParser.g:2700:5: (lv_declaredFinal_3_0= Final )
{
// InternalTypesParser.g:2700:5: (lv_declaredFinal_3_0= Final )
// InternalTypesParser.g:2701:6: lv_declaredFinal_3_0= Final
{
lv_declaredFinal_3_0 = (Token) match(input, Final, FOLLOW_52);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(lv_declaredFinal_3_0, grammarAccess.getTFieldAccess().getDeclaredFinalFinalKeyword_1_2_0());
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTFieldRule());
}
setWithLastConsumed(current, "declaredFinal", true, "final");
}
}
}
}
break;
}
// InternalTypesParser.g:2714:3: ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) )
int alt59 = 2;
int LA59_0 = input.LA(1);
if ((LA59_0 == AssignmnentCompatible || (LA59_0 >= AutoboxedType && LA59_0 <= Finally) || (LA59_0 >= Private && LA59_0 <= False) || (LA59_0 >= Super && LA59_0 <= With) || (LA59_0 >= Any && LA59_0 <= Var) || (LA59_0 >= As && LA59_0 <= Of) || LA59_0 == RULE_IDENTIFIER)) {
alt59 = 1;
} else if ((LA59_0 == LeftSquareBracket)) {
alt59 = 2;
} else {
if (state.backtracking > 0) {
state.failed = true;
return current;
}
NoViableAltException nvae = new NoViableAltException("", 59, 0, input);
throw nvae;
}
switch(alt59) {
case 1:
// InternalTypesParser.g:2715:4: ( (lv_name_4_0= ruleTypesIdentifier ) )
{
// InternalTypesParser.g:2715:4: ( (lv_name_4_0= ruleTypesIdentifier ) )
// InternalTypesParser.g:2716:5: (lv_name_4_0= ruleTypesIdentifier )
{
// InternalTypesParser.g:2716:5: (lv_name_4_0= ruleTypesIdentifier )
// InternalTypesParser.g:2717:6: lv_name_4_0= ruleTypesIdentifier
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTFieldAccess().getNameTypesIdentifierParserRuleCall_2_0_0());
}
pushFollow(FOLLOW_56);
lv_name_4_0 = ruleTypesIdentifier();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTFieldRule());
}
set(current, "name", lv_name_4_0, "org.eclipse.n4js.ts.Types.TypesIdentifier");
afterParserOrEnumRuleCall();
}
}
}
}
break;
case 2:
// InternalTypesParser.g:2735:4: ( (lv_name_5_0= ruleTypesComputedPropertyName ) )
{
// InternalTypesParser.g:2735:4: ( (lv_name_5_0= ruleTypesComputedPropertyName ) )
// InternalTypesParser.g:2736:5: (lv_name_5_0= ruleTypesComputedPropertyName )
{
// InternalTypesParser.g:2736:5: (lv_name_5_0= ruleTypesComputedPropertyName )
// InternalTypesParser.g:2737:6: lv_name_5_0= ruleTypesComputedPropertyName
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTFieldAccess().getNameTypesComputedPropertyNameParserRuleCall_2_1_0());
}
pushFollow(FOLLOW_56);
lv_name_5_0 = ruleTypesComputedPropertyName();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTFieldRule());
}
set(current, "name", lv_name_5_0, "org.eclipse.n4js.ts.Types.TypesComputedPropertyName");
afterParserOrEnumRuleCall();
}
}
}
}
break;
}
// InternalTypesParser.g:2755:3: ( (lv_optional_6_0= QuestionMark ) )?
int alt60 = 2;
int LA60_0 = input.LA(1);
if ((LA60_0 == QuestionMark)) {
alt60 = 1;
}
switch(alt60) {
case 1:
// InternalTypesParser.g:2756:4: (lv_optional_6_0= QuestionMark )
{
// InternalTypesParser.g:2756:4: (lv_optional_6_0= QuestionMark )
// InternalTypesParser.g:2757:5: lv_optional_6_0= QuestionMark
{
lv_optional_6_0 = (Token) match(input, QuestionMark, FOLLOW_56);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(lv_optional_6_0, grammarAccess.getTFieldAccess().getOptionalQuestionMarkKeyword_3_0());
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTFieldRule());
}
setWithLastConsumed(current, "optional", true, "?");
}
}
}
break;
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTFieldRule());
}
newCompositeNode(grammarAccess.getTFieldAccess().getColonSepTypeRefParserRuleCall_4());
}
pushFollow(FOLLOW_49);
this_ColonSepTypeRef_7 = ruleColonSepTypeRef(current);
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
current = this_ColonSepTypeRef_7;
afterParserOrEnumRuleCall();
}
// InternalTypesParser.g:2780:3: (otherlv_8= Semicolon )?
int alt61 = 2;
int LA61_0 = input.LA(1);
if ((LA61_0 == Semicolon)) {
alt61 = 1;
}
switch(alt61) {
case 1:
// InternalTypesParser.g:2781:4: otherlv_8= Semicolon
{
otherlv_8 = (Token) match(input, Semicolon, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(otherlv_8, grammarAccess.getTFieldAccess().getSemicolonKeyword_5());
}
}
break;
}
}
}
if (state.backtracking == 0) {
leaveRule();
}
} catch (RecognitionException re) {
recover(input, re);
appendSkippedTokens();
} finally {
}
return current;
}
Aggregations