use of org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken in project n4js by eclipse.
the class InternalTypesParser method ruleParameterizedTypeRefStructural.
// $ANTLR end "entryRuleParameterizedTypeRefStructural"
// $ANTLR start "ruleParameterizedTypeRefStructural"
// InternalTypesParser.g:4716:1: ruleParameterizedTypeRefStructural returns [EObject current=null] : ( ( ( ( (lv_definedTypingStrategy_0_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) ) ) | ( () ( (lv_definedTypingStrategy_3_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) ) this_VersionRequest_5= ruleVersionRequest[$current] ) ) ( ( LessThanSign )=>this_TypeArguments_6= ruleTypeArguments[$current] )? (otherlv_7= With this_TStructMemberList_8= ruleTStructMemberList[$current] )? ) ;
public final EObject ruleParameterizedTypeRefStructural() throws RecognitionException {
EObject current = null;
Token otherlv_7 = null;
AntlrDatatypeRuleToken lv_definedTypingStrategy_0_0 = null;
AntlrDatatypeRuleToken lv_definedTypingStrategy_3_0 = null;
EObject this_VersionRequest_5 = null;
EObject this_TypeArguments_6 = null;
EObject this_TStructMemberList_8 = null;
enterRule();
try {
// InternalTypesParser.g:4722:2: ( ( ( ( ( (lv_definedTypingStrategy_0_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) ) ) | ( () ( (lv_definedTypingStrategy_3_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) ) this_VersionRequest_5= ruleVersionRequest[$current] ) ) ( ( LessThanSign )=>this_TypeArguments_6= ruleTypeArguments[$current] )? (otherlv_7= With this_TStructMemberList_8= ruleTStructMemberList[$current] )? ) )
// InternalTypesParser.g:4723:2: ( ( ( ( (lv_definedTypingStrategy_0_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) ) ) | ( () ( (lv_definedTypingStrategy_3_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) ) this_VersionRequest_5= ruleVersionRequest[$current] ) ) ( ( LessThanSign )=>this_TypeArguments_6= ruleTypeArguments[$current] )? (otherlv_7= With this_TStructMemberList_8= ruleTStructMemberList[$current] )? )
{
// InternalTypesParser.g:4723:2: ( ( ( ( (lv_definedTypingStrategy_0_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) ) ) | ( () ( (lv_definedTypingStrategy_3_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) ) this_VersionRequest_5= ruleVersionRequest[$current] ) ) ( ( LessThanSign )=>this_TypeArguments_6= ruleTypeArguments[$current] )? (otherlv_7= With this_TStructMemberList_8= ruleTStructMemberList[$current] )? )
// InternalTypesParser.g:4724:3: ( ( ( (lv_definedTypingStrategy_0_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) ) ) | ( () ( (lv_definedTypingStrategy_3_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) ) this_VersionRequest_5= ruleVersionRequest[$current] ) ) ( ( LessThanSign )=>this_TypeArguments_6= ruleTypeArguments[$current] )? (otherlv_7= With this_TStructMemberList_8= ruleTStructMemberList[$current] )?
{
// InternalTypesParser.g:4724:3: ( ( ( (lv_definedTypingStrategy_0_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) ) ) | ( () ( (lv_definedTypingStrategy_3_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) ) this_VersionRequest_5= ruleVersionRequest[$current] ) )
int alt95 = 2;
alt95 = dfa95.predict(input);
switch(alt95) {
case 1:
// InternalTypesParser.g:4725:4: ( ( (lv_definedTypingStrategy_0_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) ) )
{
// InternalTypesParser.g:4725:4: ( ( (lv_definedTypingStrategy_0_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) ) )
// InternalTypesParser.g:4726:5: ( (lv_definedTypingStrategy_0_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) )
{
// InternalTypesParser.g:4726:5: ( (lv_definedTypingStrategy_0_0= ruleTypingStrategyUseSiteOperator ) )
// InternalTypesParser.g:4727:6: (lv_definedTypingStrategy_0_0= ruleTypingStrategyUseSiteOperator )
{
// InternalTypesParser.g:4727:6: (lv_definedTypingStrategy_0_0= ruleTypingStrategyUseSiteOperator )
// InternalTypesParser.g:4728:7: lv_definedTypingStrategy_0_0= ruleTypingStrategyUseSiteOperator
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getParameterizedTypeRefStructuralAccess().getDefinedTypingStrategyTypingStrategyUseSiteOperatorParserRuleCall_0_0_0_0());
}
pushFollow(FOLLOW_14);
lv_definedTypingStrategy_0_0 = ruleTypingStrategyUseSiteOperator();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getParameterizedTypeRefStructuralRule());
}
set(current, "definedTypingStrategy", lv_definedTypingStrategy_0_0, "org.eclipse.n4js.ts.TypeExpressions.TypingStrategyUseSiteOperator");
afterParserOrEnumRuleCall();
}
}
}
// InternalTypesParser.g:4745:5: ( ( ruleTypeReferenceName ) )
// InternalTypesParser.g:4746:6: ( ruleTypeReferenceName )
{
// InternalTypesParser.g:4746:6: ( ruleTypeReferenceName )
// InternalTypesParser.g:4747:7: ruleTypeReferenceName
{
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getParameterizedTypeRefStructuralRule());
}
}
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getParameterizedTypeRefStructuralAccess().getDeclaredTypeTypeCrossReference_0_0_1_0());
}
pushFollow(FOLLOW_86);
ruleTypeReferenceName();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
afterParserOrEnumRuleCall();
}
}
}
}
}
break;
case 2:
// InternalTypesParser.g:4763:4: ( () ( (lv_definedTypingStrategy_3_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) ) this_VersionRequest_5= ruleVersionRequest[$current] )
{
// InternalTypesParser.g:4763:4: ( () ( (lv_definedTypingStrategy_3_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) ) this_VersionRequest_5= ruleVersionRequest[$current] )
// InternalTypesParser.g:4764:5: () ( (lv_definedTypingStrategy_3_0= ruleTypingStrategyUseSiteOperator ) ) ( ( ruleTypeReferenceName ) ) this_VersionRequest_5= ruleVersionRequest[$current]
{
// InternalTypesParser.g:4764:5: ()
// InternalTypesParser.g:4765:6:
{
if (state.backtracking == 0) {
current = forceCreateModelElement(grammarAccess.getParameterizedTypeRefStructuralAccess().getVersionedParameterizedTypeRefStructuralAction_0_1_0(), current);
}
}
// InternalTypesParser.g:4771:5: ( (lv_definedTypingStrategy_3_0= ruleTypingStrategyUseSiteOperator ) )
// InternalTypesParser.g:4772:6: (lv_definedTypingStrategy_3_0= ruleTypingStrategyUseSiteOperator )
{
// InternalTypesParser.g:4772:6: (lv_definedTypingStrategy_3_0= ruleTypingStrategyUseSiteOperator )
// InternalTypesParser.g:4773:7: lv_definedTypingStrategy_3_0= ruleTypingStrategyUseSiteOperator
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getParameterizedTypeRefStructuralAccess().getDefinedTypingStrategyTypingStrategyUseSiteOperatorParserRuleCall_0_1_1_0());
}
pushFollow(FOLLOW_14);
lv_definedTypingStrategy_3_0 = ruleTypingStrategyUseSiteOperator();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getParameterizedTypeRefStructuralRule());
}
set(current, "definedTypingStrategy", lv_definedTypingStrategy_3_0, "org.eclipse.n4js.ts.TypeExpressions.TypingStrategyUseSiteOperator");
afterParserOrEnumRuleCall();
}
}
}
// InternalTypesParser.g:4790:5: ( ( ruleTypeReferenceName ) )
// InternalTypesParser.g:4791:6: ( ruleTypeReferenceName )
{
// InternalTypesParser.g:4791:6: ( ruleTypeReferenceName )
// InternalTypesParser.g:4792:7: ruleTypeReferenceName
{
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getParameterizedTypeRefStructuralRule());
}
}
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getParameterizedTypeRefStructuralAccess().getDeclaredTypeTypeCrossReference_0_1_2_0());
}
pushFollow(FOLLOW_87);
ruleTypeReferenceName();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
afterParserOrEnumRuleCall();
}
}
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getParameterizedTypeRefStructuralRule());
}
newCompositeNode(grammarAccess.getParameterizedTypeRefStructuralAccess().getVersionRequestParserRuleCall_0_1_3());
}
pushFollow(FOLLOW_86);
this_VersionRequest_5 = ruleVersionRequest(current);
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
current = this_VersionRequest_5;
afterParserOrEnumRuleCall();
}
}
}
break;
}
// InternalTypesParser.g:4819:3: ( ( LessThanSign )=>this_TypeArguments_6= ruleTypeArguments[$current] )?
int alt96 = 2;
alt96 = dfa96.predict(input);
switch(alt96) {
case 1:
// InternalTypesParser.g:4820:4: ( LessThanSign )=>this_TypeArguments_6= ruleTypeArguments[$current]
{
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getParameterizedTypeRefStructuralRule());
}
newCompositeNode(grammarAccess.getParameterizedTypeRefStructuralAccess().getTypeArgumentsParserRuleCall_1());
}
pushFollow(FOLLOW_71);
this_TypeArguments_6 = ruleTypeArguments(current);
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
current = this_TypeArguments_6;
afterParserOrEnumRuleCall();
}
}
break;
}
// InternalTypesParser.g:4833:3: (otherlv_7= With this_TStructMemberList_8= ruleTStructMemberList[$current] )?
int alt97 = 2;
int LA97_0 = input.LA(1);
if ((LA97_0 == With)) {
int LA97_1 = input.LA(2);
if ((LA97_1 == LeftCurlyBracket)) {
alt97 = 1;
}
}
switch(alt97) {
case 1:
// InternalTypesParser.g:4834:4: otherlv_7= With this_TStructMemberList_8= ruleTStructMemberList[$current]
{
otherlv_7 = (Token) match(input, With, FOLLOW_15);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(otherlv_7, grammarAccess.getParameterizedTypeRefStructuralAccess().getWithKeyword_2_0());
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getParameterizedTypeRefStructuralRule());
}
newCompositeNode(grammarAccess.getParameterizedTypeRefStructuralAccess().getTStructMemberListParserRuleCall_2_1());
}
pushFollow(FOLLOW_2);
this_TStructMemberList_8 = ruleTStructMemberList(current);
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
current = this_TStructMemberList_8;
afterParserOrEnumRuleCall();
}
}
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 ruleTSetter.
// $ANTLR end "entryRuleTSetter"
// $ANTLR start "ruleTSetter"
// InternalTypesParser.g:2983:1: ruleTSetter returns [EObject current=null] : ( ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? Set ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Set ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ) ) ( (lv_optional_6_0= QuestionMark ) )? otherlv_7= LeftParenthesis ( (lv_fpar_8_0= ruleTFormalParameter ) ) otherlv_9= RightParenthesis ) ;
public final EObject ruleTSetter() throws RecognitionException {
EObject current = null;
Token lv_declaredAbstract_1_0 = null;
Token lv_declaredStatic_2_0 = null;
Token otherlv_3 = null;
Token lv_optional_6_0 = null;
Token otherlv_7 = null;
Token otherlv_9 = null;
Enumerator lv_declaredMemberAccessModifier_0_0 = null;
AntlrDatatypeRuleToken lv_name_4_0 = null;
AntlrDatatypeRuleToken lv_name_5_0 = null;
EObject lv_fpar_8_0 = null;
enterRule();
try {
// InternalTypesParser.g:2989:2: ( ( ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? Set ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Set ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ) ) ( (lv_optional_6_0= QuestionMark ) )? otherlv_7= LeftParenthesis ( (lv_fpar_8_0= ruleTFormalParameter ) ) otherlv_9= RightParenthesis ) )
// InternalTypesParser.g:2990:2: ( ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? Set ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Set ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ) ) ( (lv_optional_6_0= QuestionMark ) )? otherlv_7= LeftParenthesis ( (lv_fpar_8_0= ruleTFormalParameter ) ) otherlv_9= RightParenthesis )
{
// InternalTypesParser.g:2990:2: ( ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? Set ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Set ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ) ) ( (lv_optional_6_0= QuestionMark ) )? otherlv_7= LeftParenthesis ( (lv_fpar_8_0= ruleTFormalParameter ) ) otherlv_9= RightParenthesis )
// InternalTypesParser.g:2991:3: ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? Set ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Set ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ) ) ( (lv_optional_6_0= QuestionMark ) )? otherlv_7= LeftParenthesis ( (lv_fpar_8_0= ruleTFormalParameter ) ) otherlv_9= RightParenthesis
{
// InternalTypesParser.g:2991:3: ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? Set ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Set ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ) )
// InternalTypesParser.g:2992:4: ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? Set ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Set ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) )
{
// InternalTypesParser.g:3027:4: ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Set ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) )
// InternalTypesParser.g:3028:5: ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Set ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) )
{
// InternalTypesParser.g:3028:5: ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) )
// InternalTypesParser.g:3029:6: (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier )
{
// InternalTypesParser.g:3029:6: (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier )
// InternalTypesParser.g:3030:7: lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTSetterAccess().getDeclaredMemberAccessModifierMemberAccessModifierEnumRuleCall_0_0_0_0());
}
pushFollow(FOLLOW_61);
lv_declaredMemberAccessModifier_0_0 = ruleMemberAccessModifier();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTSetterRule());
}
set(current, "declaredMemberAccessModifier", lv_declaredMemberAccessModifier_0_0, "org.eclipse.n4js.ts.Types.MemberAccessModifier");
afterParserOrEnumRuleCall();
}
}
}
// InternalTypesParser.g:3047:5: ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )?
int alt65 = 3;
int LA65_0 = input.LA(1);
if ((LA65_0 == Abstract)) {
alt65 = 1;
} else if ((LA65_0 == Static)) {
alt65 = 2;
}
switch(alt65) {
case 1:
// InternalTypesParser.g:3048:6: ( (lv_declaredAbstract_1_0= Abstract ) )
{
// InternalTypesParser.g:3048:6: ( (lv_declaredAbstract_1_0= Abstract ) )
// InternalTypesParser.g:3049:7: (lv_declaredAbstract_1_0= Abstract )
{
// InternalTypesParser.g:3049:7: (lv_declaredAbstract_1_0= Abstract )
// InternalTypesParser.g:3050:8: lv_declaredAbstract_1_0= Abstract
{
lv_declaredAbstract_1_0 = (Token) match(input, Abstract, FOLLOW_62);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(lv_declaredAbstract_1_0, grammarAccess.getTSetterAccess().getDeclaredAbstractAbstractKeyword_0_0_1_0_0());
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTSetterRule());
}
setWithLastConsumed(current, "declaredAbstract", true, "abstract");
}
}
}
}
break;
case 2:
// InternalTypesParser.g:3063:6: ( (lv_declaredStatic_2_0= Static ) )
{
// InternalTypesParser.g:3063:6: ( (lv_declaredStatic_2_0= Static ) )
// InternalTypesParser.g:3064:7: (lv_declaredStatic_2_0= Static )
{
// InternalTypesParser.g:3064:7: (lv_declaredStatic_2_0= Static )
// InternalTypesParser.g:3065:8: lv_declaredStatic_2_0= Static
{
lv_declaredStatic_2_0 = (Token) match(input, Static, FOLLOW_62);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(lv_declaredStatic_2_0, grammarAccess.getTSetterAccess().getDeclaredStaticStaticKeyword_0_0_1_1_0());
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTSetterRule());
}
setWithLastConsumed(current, "declaredStatic", true, "static");
}
}
}
}
break;
}
otherlv_3 = (Token) match(input, Set, FOLLOW_52);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(otherlv_3, grammarAccess.getTSetterAccess().getSetKeyword_0_0_2());
}
// InternalTypesParser.g:3082:5: ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) )
int alt66 = 2;
int LA66_0 = input.LA(1);
if ((LA66_0 == AssignmnentCompatible || (LA66_0 >= AutoboxedType && LA66_0 <= Finally) || (LA66_0 >= Private && LA66_0 <= False) || (LA66_0 >= Super && LA66_0 <= With) || (LA66_0 >= Any && LA66_0 <= Var) || (LA66_0 >= As && LA66_0 <= Of) || LA66_0 == RULE_IDENTIFIER)) {
alt66 = 1;
} else if ((LA66_0 == LeftSquareBracket)) {
alt66 = 2;
} else {
if (state.backtracking > 0) {
state.failed = true;
return current;
}
NoViableAltException nvae = new NoViableAltException("", 66, 0, input);
throw nvae;
}
switch(alt66) {
case 1:
// InternalTypesParser.g:3083:6: ( (lv_name_4_0= ruleTypesIdentifier ) )
{
// InternalTypesParser.g:3083:6: ( (lv_name_4_0= ruleTypesIdentifier ) )
// InternalTypesParser.g:3084:7: (lv_name_4_0= ruleTypesIdentifier )
{
// InternalTypesParser.g:3084:7: (lv_name_4_0= ruleTypesIdentifier )
// InternalTypesParser.g:3085:8: lv_name_4_0= ruleTypesIdentifier
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTSetterAccess().getNameTypesIdentifierParserRuleCall_0_0_3_0_0());
}
pushFollow(FOLLOW_59);
lv_name_4_0 = ruleTypesIdentifier();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTSetterRule());
}
set(current, "name", lv_name_4_0, "org.eclipse.n4js.ts.Types.TypesIdentifier");
afterParserOrEnumRuleCall();
}
}
}
}
break;
case 2:
// InternalTypesParser.g:3103:6: ( (lv_name_5_0= ruleTypesComputedPropertyName ) )
{
// InternalTypesParser.g:3103:6: ( (lv_name_5_0= ruleTypesComputedPropertyName ) )
// InternalTypesParser.g:3104:7: (lv_name_5_0= ruleTypesComputedPropertyName )
{
// InternalTypesParser.g:3104:7: (lv_name_5_0= ruleTypesComputedPropertyName )
// InternalTypesParser.g:3105:8: lv_name_5_0= ruleTypesComputedPropertyName
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTSetterAccess().getNameTypesComputedPropertyNameParserRuleCall_0_0_3_1_0());
}
pushFollow(FOLLOW_59);
lv_name_5_0 = ruleTypesComputedPropertyName();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTSetterRule());
}
set(current, "name", lv_name_5_0, "org.eclipse.n4js.ts.Types.TypesComputedPropertyName");
afterParserOrEnumRuleCall();
}
}
}
}
break;
}
}
}
// InternalTypesParser.g:3125:3: ( (lv_optional_6_0= QuestionMark ) )?
int alt67 = 2;
int LA67_0 = input.LA(1);
if ((LA67_0 == QuestionMark)) {
alt67 = 1;
}
switch(alt67) {
case 1:
// InternalTypesParser.g:3126:4: (lv_optional_6_0= QuestionMark )
{
// InternalTypesParser.g:3126:4: (lv_optional_6_0= QuestionMark )
// InternalTypesParser.g:3127:5: lv_optional_6_0= QuestionMark
{
lv_optional_6_0 = (Token) match(input, QuestionMark, FOLLOW_53);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(lv_optional_6_0, grammarAccess.getTSetterAccess().getOptionalQuestionMarkKeyword_1_0());
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTSetterRule());
}
setWithLastConsumed(current, "optional", true, "?");
}
}
}
break;
}
otherlv_7 = (Token) match(input, LeftParenthesis, FOLLOW_51);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(otherlv_7, grammarAccess.getTSetterAccess().getLeftParenthesisKeyword_2());
}
// InternalTypesParser.g:3143:3: ( (lv_fpar_8_0= ruleTFormalParameter ) )
// InternalTypesParser.g:3144:4: (lv_fpar_8_0= ruleTFormalParameter )
{
// InternalTypesParser.g:3144:4: (lv_fpar_8_0= ruleTFormalParameter )
// InternalTypesParser.g:3145:5: lv_fpar_8_0= ruleTFormalParameter
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTSetterAccess().getFparTFormalParameterParserRuleCall_3_0());
}
pushFollow(FOLLOW_60);
lv_fpar_8_0 = ruleTFormalParameter();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTSetterRule());
}
set(current, "fpar", lv_fpar_8_0, "org.eclipse.n4js.ts.TypeExpressions.TFormalParameter");
afterParserOrEnumRuleCall();
}
}
}
otherlv_9 = (Token) match(input, RightParenthesis, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(otherlv_9, grammarAccess.getTSetterAccess().getRightParenthesisKeyword_4());
}
}
}
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 ruleBindingTypesIdentifier.
// $ANTLR end "entryRuleBindingTypesIdentifier"
// $ANTLR start "ruleBindingTypesIdentifier"
// InternalTypesParser.g:947:1: ruleBindingTypesIdentifier returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_TypesSpecificKeywords_0= ruleTypesSpecificKeywords | this_BindingIdentifier_1= ruleBindingIdentifier ) ;
public final AntlrDatatypeRuleToken ruleBindingTypesIdentifier() throws RecognitionException {
AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
AntlrDatatypeRuleToken this_TypesSpecificKeywords_0 = null;
AntlrDatatypeRuleToken this_BindingIdentifier_1 = null;
enterRule();
try {
// InternalTypesParser.g:953:2: ( (this_TypesSpecificKeywords_0= ruleTypesSpecificKeywords | this_BindingIdentifier_1= ruleBindingIdentifier ) )
// InternalTypesParser.g:954:2: (this_TypesSpecificKeywords_0= ruleTypesSpecificKeywords | this_BindingIdentifier_1= ruleBindingIdentifier )
{
// InternalTypesParser.g:954:2: (this_TypesSpecificKeywords_0= ruleTypesSpecificKeywords | this_BindingIdentifier_1= ruleBindingIdentifier )
int alt15 = 2;
int LA15_0 = input.LA(1);
if ((LA15_0 == AssignmnentCompatible || LA15_0 == AutoboxedType || LA15_0 == VirtualBase || LA15_0 == Primitive || LA15_0 == Undefined || LA15_0 == Object || LA15_0 == Any)) {
alt15 = 1;
} else if (((LA15_0 >= Intersection && LA15_0 <= Constructor) || LA15_0 == Implements || (LA15_0 >= Promisify && LA15_0 <= Interface) || LA15_0 == Protected || LA15_0 == Abstract || LA15_0 == External || (LA15_0 >= Private && LA15_0 <= Project) || LA15_0 == Public || LA15_0 == Static || LA15_0 == Target || (LA15_0 >= Async && LA15_0 <= Await) || LA15_0 == Union || (LA15_0 >= Yield && LA15_0 <= This) || LA15_0 == From || LA15_0 == Type || (LA15_0 >= Get && LA15_0 <= Let) || (LA15_0 >= Out && LA15_0 <= Set) || LA15_0 == As || LA15_0 == Of || LA15_0 == RULE_IDENTIFIER)) {
alt15 = 2;
} else {
if (state.backtracking > 0) {
state.failed = true;
return current;
}
NoViableAltException nvae = new NoViableAltException("", 15, 0, input);
throw nvae;
}
switch(alt15) {
case 1:
// InternalTypesParser.g:955:3: this_TypesSpecificKeywords_0= ruleTypesSpecificKeywords
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getBindingTypesIdentifierAccess().getTypesSpecificKeywordsParserRuleCall_0());
}
pushFollow(FOLLOW_2);
this_TypesSpecificKeywords_0 = ruleTypesSpecificKeywords();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(this_TypesSpecificKeywords_0);
}
if (state.backtracking == 0) {
afterParserOrEnumRuleCall();
}
}
break;
case 2:
// InternalTypesParser.g:966:3: this_BindingIdentifier_1= ruleBindingIdentifier
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getBindingTypesIdentifierAccess().getBindingIdentifierParserRuleCall_1());
}
pushFollow(FOLLOW_2);
this_BindingIdentifier_1 = ruleBindingIdentifier();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(this_BindingIdentifier_1);
}
if (state.backtracking == 0) {
afterParserOrEnumRuleCall();
}
}
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 ruleTypesSpecificKeywords.
// $ANTLR end "entryRuleTypesSpecificKeywords"
// $ANTLR start "ruleTypesSpecificKeywords"
// InternalTypesParser.g:1022:1: ruleTypesSpecificKeywords returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (kw= Any | kw= Undefined | kw= Object | kw= VirtualBase | kw= Primitive | kw= AutoboxedType | kw= AssignmnentCompatible ) ;
public final AntlrDatatypeRuleToken ruleTypesSpecificKeywords() throws RecognitionException {
AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
Token kw = null;
enterRule();
try {
// InternalTypesParser.g:1028:2: ( (kw= Any | kw= Undefined | kw= Object | kw= VirtualBase | kw= Primitive | kw= AutoboxedType | kw= AssignmnentCompatible ) )
// InternalTypesParser.g:1029:2: (kw= Any | kw= Undefined | kw= Object | kw= VirtualBase | kw= Primitive | kw= AutoboxedType | kw= AssignmnentCompatible )
{
// InternalTypesParser.g:1029:2: (kw= Any | kw= Undefined | kw= Object | kw= VirtualBase | kw= Primitive | kw= AutoboxedType | kw= AssignmnentCompatible )
int alt17 = 7;
switch(input.LA(1)) {
case Any:
{
alt17 = 1;
}
break;
case Undefined:
{
alt17 = 2;
}
break;
case Object:
{
alt17 = 3;
}
break;
case VirtualBase:
{
alt17 = 4;
}
break;
case Primitive:
{
alt17 = 5;
}
break;
case AutoboxedType:
{
alt17 = 6;
}
break;
case AssignmnentCompatible:
{
alt17 = 7;
}
break;
default:
if (state.backtracking > 0) {
state.failed = true;
return current;
}
NoViableAltException nvae = new NoViableAltException("", 17, 0, input);
throw nvae;
}
switch(alt17) {
case 1:
// InternalTypesParser.g:1030:3: kw= Any
{
kw = (Token) match(input, Any, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getTypesSpecificKeywordsAccess().getAnyKeyword_0());
}
}
break;
case 2:
// InternalTypesParser.g:1036:3: kw= Undefined
{
kw = (Token) match(input, Undefined, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getTypesSpecificKeywordsAccess().getUndefinedKeyword_1());
}
}
break;
case 3:
// InternalTypesParser.g:1042:3: kw= Object
{
kw = (Token) match(input, Object, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getTypesSpecificKeywordsAccess().getObjectKeyword_2());
}
}
break;
case 4:
// InternalTypesParser.g:1048:3: kw= VirtualBase
{
kw = (Token) match(input, VirtualBase, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getTypesSpecificKeywordsAccess().getVirtualBaseKeyword_3());
}
}
break;
case 5:
// InternalTypesParser.g:1054:3: kw= Primitive
{
kw = (Token) match(input, Primitive, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getTypesSpecificKeywordsAccess().getPrimitiveKeyword_4());
}
}
break;
case 6:
// InternalTypesParser.g:1060:3: kw= AutoboxedType
{
kw = (Token) match(input, AutoboxedType, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getTypesSpecificKeywordsAccess().getAutoboxedTypeKeyword_5());
}
}
break;
case 7:
// InternalTypesParser.g:1066:3: kw= AssignmnentCompatible
{
kw = (Token) match(input, AssignmnentCompatible, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getTypesSpecificKeywordsAccess().getAssignmnentCompatibleKeyword_6());
}
}
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 ruleTStructGetter.
// $ANTLR end "entryRuleTStructGetter"
// $ANTLR start "ruleTStructGetter"
// InternalTypesParser.g:5538:1: ruleTStructGetter returns [EObject current=null] : ( ( ( ( () Get ( ( ruleIdentifierName ) ) ) )=> ( () otherlv_1= Get ( (lv_name_2_0= ruleIdentifierName ) ) ) ) ( (lv_optional_3_0= QuestionMark ) )? otherlv_4= LeftParenthesis otherlv_5= RightParenthesis (this_ColonSepDeclaredTypeRef_6= ruleColonSepDeclaredTypeRef[$current] )? ) ;
public final EObject ruleTStructGetter() throws RecognitionException {
EObject current = null;
Token otherlv_1 = null;
Token lv_optional_3_0 = null;
Token otherlv_4 = null;
Token otherlv_5 = null;
AntlrDatatypeRuleToken lv_name_2_0 = null;
EObject this_ColonSepDeclaredTypeRef_6 = null;
enterRule();
try {
// InternalTypesParser.g:5544:2: ( ( ( ( ( () Get ( ( ruleIdentifierName ) ) ) )=> ( () otherlv_1= Get ( (lv_name_2_0= ruleIdentifierName ) ) ) ) ( (lv_optional_3_0= QuestionMark ) )? otherlv_4= LeftParenthesis otherlv_5= RightParenthesis (this_ColonSepDeclaredTypeRef_6= ruleColonSepDeclaredTypeRef[$current] )? ) )
// InternalTypesParser.g:5545:2: ( ( ( ( () Get ( ( ruleIdentifierName ) ) ) )=> ( () otherlv_1= Get ( (lv_name_2_0= ruleIdentifierName ) ) ) ) ( (lv_optional_3_0= QuestionMark ) )? otherlv_4= LeftParenthesis otherlv_5= RightParenthesis (this_ColonSepDeclaredTypeRef_6= ruleColonSepDeclaredTypeRef[$current] )? )
{
// InternalTypesParser.g:5545:2: ( ( ( ( () Get ( ( ruleIdentifierName ) ) ) )=> ( () otherlv_1= Get ( (lv_name_2_0= ruleIdentifierName ) ) ) ) ( (lv_optional_3_0= QuestionMark ) )? otherlv_4= LeftParenthesis otherlv_5= RightParenthesis (this_ColonSepDeclaredTypeRef_6= ruleColonSepDeclaredTypeRef[$current] )? )
// InternalTypesParser.g:5546:3: ( ( ( () Get ( ( ruleIdentifierName ) ) ) )=> ( () otherlv_1= Get ( (lv_name_2_0= ruleIdentifierName ) ) ) ) ( (lv_optional_3_0= QuestionMark ) )? otherlv_4= LeftParenthesis otherlv_5= RightParenthesis (this_ColonSepDeclaredTypeRef_6= ruleColonSepDeclaredTypeRef[$current] )?
{
// InternalTypesParser.g:5546:3: ( ( ( () Get ( ( ruleIdentifierName ) ) ) )=> ( () otherlv_1= Get ( (lv_name_2_0= ruleIdentifierName ) ) ) )
// InternalTypesParser.g:5547:4: ( ( () Get ( ( ruleIdentifierName ) ) ) )=> ( () otherlv_1= Get ( (lv_name_2_0= ruleIdentifierName ) ) )
{
// InternalTypesParser.g:5558:4: ( () otherlv_1= Get ( (lv_name_2_0= ruleIdentifierName ) ) )
// InternalTypesParser.g:5559:5: () otherlv_1= Get ( (lv_name_2_0= ruleIdentifierName ) )
{
// InternalTypesParser.g:5559:5: ()
// InternalTypesParser.g:5560:6:
{
if (state.backtracking == 0) {
current = forceCreateModelElement(grammarAccess.getTStructGetterAccess().getTStructGetterAction_0_0_0(), current);
}
}
otherlv_1 = (Token) match(input, Get, FOLLOW_23);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(otherlv_1, grammarAccess.getTStructGetterAccess().getGetKeyword_0_0_1());
}
// InternalTypesParser.g:5570:5: ( (lv_name_2_0= ruleIdentifierName ) )
// InternalTypesParser.g:5571:6: (lv_name_2_0= ruleIdentifierName )
{
// InternalTypesParser.g:5571:6: (lv_name_2_0= ruleIdentifierName )
// InternalTypesParser.g:5572:7: lv_name_2_0= ruleIdentifierName
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTStructGetterAccess().getNameIdentifierNameParserRuleCall_0_0_2_0());
}
pushFollow(FOLLOW_59);
lv_name_2_0 = ruleIdentifierName();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTStructGetterRule());
}
set(current, "name", lv_name_2_0, "org.eclipse.n4js.ts.TypeExpressions.IdentifierName");
afterParserOrEnumRuleCall();
}
}
}
}
}
// InternalTypesParser.g:5591:3: ( (lv_optional_3_0= QuestionMark ) )?
int alt109 = 2;
int LA109_0 = input.LA(1);
if ((LA109_0 == QuestionMark)) {
alt109 = 1;
}
switch(alt109) {
case 1:
// InternalTypesParser.g:5592:4: (lv_optional_3_0= QuestionMark )
{
// InternalTypesParser.g:5592:4: (lv_optional_3_0= QuestionMark )
// InternalTypesParser.g:5593:5: lv_optional_3_0= QuestionMark
{
lv_optional_3_0 = (Token) match(input, QuestionMark, FOLLOW_53);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(lv_optional_3_0, grammarAccess.getTStructGetterAccess().getOptionalQuestionMarkKeyword_1_0());
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTStructGetterRule());
}
setWithLastConsumed(current, "optional", true, "?");
}
}
}
break;
}
otherlv_4 = (Token) match(input, LeftParenthesis, FOLLOW_60);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(otherlv_4, grammarAccess.getTStructGetterAccess().getLeftParenthesisKeyword_2());
}
otherlv_5 = (Token) match(input, RightParenthesis, FOLLOW_90);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(otherlv_5, grammarAccess.getTStructGetterAccess().getRightParenthesisKeyword_3());
}
// InternalTypesParser.g:5613:3: (this_ColonSepDeclaredTypeRef_6= ruleColonSepDeclaredTypeRef[$current] )?
int alt110 = 2;
int LA110_0 = input.LA(1);
if ((LA110_0 == Colon)) {
alt110 = 1;
}
switch(alt110) {
case 1:
// InternalTypesParser.g:5614:4: this_ColonSepDeclaredTypeRef_6= ruleColonSepDeclaredTypeRef[$current]
{
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTStructGetterRule());
}
newCompositeNode(grammarAccess.getTStructGetterAccess().getColonSepDeclaredTypeRefParserRuleCall_4());
}
pushFollow(FOLLOW_2);
this_ColonSepDeclaredTypeRef_6 = ruleColonSepDeclaredTypeRef(current);
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
current = this_ColonSepDeclaredTypeRef_6;
afterParserOrEnumRuleCall();
}
}
break;
}
}
}
if (state.backtracking == 0) {
leaveRule();
}
} catch (RecognitionException re) {
recover(input, re);
appendSkippedTokens();
} finally {
}
return current;
}
Aggregations