use of org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken in project n4js by eclipse.
the class InternalTypesParser method entryRuleTypesSymbolLiteralComputedName.
// $ANTLR end "ruleTypesComputedPropertyName"
// $ANTLR start "entryRuleTypesSymbolLiteralComputedName"
// InternalTypesParser.g:1127:1: entryRuleTypesSymbolLiteralComputedName returns [String current=null] : iv_ruleTypesSymbolLiteralComputedName= ruleTypesSymbolLiteralComputedName EOF ;
public final String entryRuleTypesSymbolLiteralComputedName() throws RecognitionException {
String current = null;
AntlrDatatypeRuleToken iv_ruleTypesSymbolLiteralComputedName = null;
try {
// InternalTypesParser.g:1127:70: (iv_ruleTypesSymbolLiteralComputedName= ruleTypesSymbolLiteralComputedName EOF )
// InternalTypesParser.g:1128:2: iv_ruleTypesSymbolLiteralComputedName= ruleTypesSymbolLiteralComputedName EOF
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTypesSymbolLiteralComputedNameRule());
}
pushFollow(FOLLOW_1);
iv_ruleTypesSymbolLiteralComputedName = ruleTypesSymbolLiteralComputedName();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
current = iv_ruleTypesSymbolLiteralComputedName.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 ruleTypingStrategyDefSiteOperator.
// $ANTLR end "entryRuleTypingStrategyDefSiteOperator"
// $ANTLR start "ruleTypingStrategyDefSiteOperator"
// InternalTypesParser.g:5781:1: ruleTypingStrategyDefSiteOperator returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : kw= Tilde ;
public final AntlrDatatypeRuleToken ruleTypingStrategyDefSiteOperator() throws RecognitionException {
AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
Token kw = null;
enterRule();
try {
// InternalTypesParser.g:5787:2: (kw= Tilde )
// InternalTypesParser.g:5788:2: kw= Tilde
{
kw = (Token) match(input, Tilde, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getTypingStrategyDefSiteOperatorAccess().getTildeKeyword());
}
}
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 ruleN4Keyword.
// $ANTLR end "entryRuleN4Keyword"
// $ANTLR start "ruleN4Keyword"
// InternalTypesParser.g:6537:1: ruleN4Keyword returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (kw= Get | kw= Set | kw= Let | kw= Project | kw= External | kw= Abstract | kw= Static | kw= As | kw= From | kw= Constructor | kw= Of | kw= Target | kw= Type | kw= Union | kw= Intersection | kw= This | kw= Promisify | kw= Await | kw= Async | kw= Implements | kw= Interface | kw= Private | kw= Protected | kw= Public | kw= Out ) ;
public final AntlrDatatypeRuleToken ruleN4Keyword() throws RecognitionException {
AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
Token kw = null;
enterRule();
try {
// InternalTypesParser.g:6543:2: ( (kw= Get | kw= Set | kw= Let | kw= Project | kw= External | kw= Abstract | kw= Static | kw= As | kw= From | kw= Constructor | kw= Of | kw= Target | kw= Type | kw= Union | kw= Intersection | kw= This | kw= Promisify | kw= Await | kw= Async | kw= Implements | kw= Interface | kw= Private | kw= Protected | kw= Public | kw= Out ) )
// InternalTypesParser.g:6544:2: (kw= Get | kw= Set | kw= Let | kw= Project | kw= External | kw= Abstract | kw= Static | kw= As | kw= From | kw= Constructor | kw= Of | kw= Target | kw= Type | kw= Union | kw= Intersection | kw= This | kw= Promisify | kw= Await | kw= Async | kw= Implements | kw= Interface | kw= Private | kw= Protected | kw= Public | kw= Out )
{
// InternalTypesParser.g:6544:2: (kw= Get | kw= Set | kw= Let | kw= Project | kw= External | kw= Abstract | kw= Static | kw= As | kw= From | kw= Constructor | kw= Of | kw= Target | kw= Type | kw= Union | kw= Intersection | kw= This | kw= Promisify | kw= Await | kw= Async | kw= Implements | kw= Interface | kw= Private | kw= Protected | kw= Public | kw= Out )
int alt122 = 25;
switch(input.LA(1)) {
case Get:
{
alt122 = 1;
}
break;
case Set:
{
alt122 = 2;
}
break;
case Let:
{
alt122 = 3;
}
break;
case Project:
{
alt122 = 4;
}
break;
case External:
{
alt122 = 5;
}
break;
case Abstract:
{
alt122 = 6;
}
break;
case Static:
{
alt122 = 7;
}
break;
case As:
{
alt122 = 8;
}
break;
case From:
{
alt122 = 9;
}
break;
case Constructor:
{
alt122 = 10;
}
break;
case Of:
{
alt122 = 11;
}
break;
case Target:
{
alt122 = 12;
}
break;
case Type:
{
alt122 = 13;
}
break;
case Union:
{
alt122 = 14;
}
break;
case Intersection:
{
alt122 = 15;
}
break;
case This:
{
alt122 = 16;
}
break;
case Promisify:
{
alt122 = 17;
}
break;
case Await:
{
alt122 = 18;
}
break;
case Async:
{
alt122 = 19;
}
break;
case Implements:
{
alt122 = 20;
}
break;
case Interface:
{
alt122 = 21;
}
break;
case Private:
{
alt122 = 22;
}
break;
case Protected:
{
alt122 = 23;
}
break;
case Public:
{
alt122 = 24;
}
break;
case Out:
{
alt122 = 25;
}
break;
default:
if (state.backtracking > 0) {
state.failed = true;
return current;
}
NoViableAltException nvae = new NoViableAltException("", 122, 0, input);
throw nvae;
}
switch(alt122) {
case 1:
// InternalTypesParser.g:6545:3: kw= Get
{
kw = (Token) match(input, Get, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getGetKeyword_0());
}
}
break;
case 2:
// InternalTypesParser.g:6551:3: kw= Set
{
kw = (Token) match(input, Set, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getSetKeyword_1());
}
}
break;
case 3:
// InternalTypesParser.g:6557:3: kw= Let
{
kw = (Token) match(input, Let, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getLetKeyword_2());
}
}
break;
case 4:
// InternalTypesParser.g:6563:3: kw= Project
{
kw = (Token) match(input, Project, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getProjectKeyword_3());
}
}
break;
case 5:
// InternalTypesParser.g:6569:3: kw= External
{
kw = (Token) match(input, External, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getExternalKeyword_4());
}
}
break;
case 6:
// InternalTypesParser.g:6575:3: kw= Abstract
{
kw = (Token) match(input, Abstract, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getAbstractKeyword_5());
}
}
break;
case 7:
// InternalTypesParser.g:6581:3: kw= Static
{
kw = (Token) match(input, Static, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getStaticKeyword_6());
}
}
break;
case 8:
// InternalTypesParser.g:6587:3: kw= As
{
kw = (Token) match(input, As, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getAsKeyword_7());
}
}
break;
case 9:
// InternalTypesParser.g:6593:3: kw= From
{
kw = (Token) match(input, From, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getFromKeyword_8());
}
}
break;
case 10:
// InternalTypesParser.g:6599:3: kw= Constructor
{
kw = (Token) match(input, Constructor, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getConstructorKeyword_9());
}
}
break;
case 11:
// InternalTypesParser.g:6605:3: kw= Of
{
kw = (Token) match(input, Of, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getOfKeyword_10());
}
}
break;
case 12:
// InternalTypesParser.g:6611:3: kw= Target
{
kw = (Token) match(input, Target, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getTargetKeyword_11());
}
}
break;
case 13:
// InternalTypesParser.g:6617:3: kw= Type
{
kw = (Token) match(input, Type, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getTypeKeyword_12());
}
}
break;
case 14:
// InternalTypesParser.g:6623:3: kw= Union
{
kw = (Token) match(input, Union, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getUnionKeyword_13());
}
}
break;
case 15:
// InternalTypesParser.g:6629:3: kw= Intersection
{
kw = (Token) match(input, Intersection, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getIntersectionKeyword_14());
}
}
break;
case 16:
// InternalTypesParser.g:6635:3: kw= This
{
kw = (Token) match(input, This, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getThisKeyword_15());
}
}
break;
case 17:
// InternalTypesParser.g:6641:3: kw= Promisify
{
kw = (Token) match(input, Promisify, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getPromisifyKeyword_16());
}
}
break;
case 18:
// InternalTypesParser.g:6647:3: kw= Await
{
kw = (Token) match(input, Await, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getAwaitKeyword_17());
}
}
break;
case 19:
// InternalTypesParser.g:6653:3: kw= Async
{
kw = (Token) match(input, Async, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getAsyncKeyword_18());
}
}
break;
case 20:
// InternalTypesParser.g:6659:3: kw= Implements
{
kw = (Token) match(input, Implements, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getImplementsKeyword_19());
}
}
break;
case 21:
// InternalTypesParser.g:6665:3: kw= Interface
{
kw = (Token) match(input, Interface, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getInterfaceKeyword_20());
}
}
break;
case 22:
// InternalTypesParser.g:6671:3: kw= Private
{
kw = (Token) match(input, Private, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getPrivateKeyword_21());
}
}
break;
case 23:
// InternalTypesParser.g:6677:3: kw= Protected
{
kw = (Token) match(input, Protected, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getProtectedKeyword_22());
}
}
break;
case 24:
// InternalTypesParser.g:6683:3: kw= Public
{
kw = (Token) match(input, Public, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getPublicKeyword_23());
}
}
break;
case 25:
// InternalTypesParser.g:6689:3: kw= Out
{
kw = (Token) match(input, Out, FOLLOW_2);
if (state.failed)
return current;
if (state.backtracking == 0) {
current.merge(kw);
newLeafNode(kw, grammarAccess.getN4KeywordAccess().getOutKeyword_24());
}
}
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 ruleTGetter.
// $ANTLR end "entryRuleTGetter"
// $ANTLR start "ruleTGetter"
// InternalTypesParser.g:2797:1: ruleTGetter returns [EObject current=null] : ( ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? Get ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Get ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ) ) ( (lv_optional_6_0= QuestionMark ) )? otherlv_7= LeftParenthesis otherlv_8= RightParenthesis this_ColonSepDeclaredTypeRef_9= ruleColonSepDeclaredTypeRef[$current] ) ;
public final EObject ruleTGetter() 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_8 = null;
Enumerator lv_declaredMemberAccessModifier_0_0 = null;
AntlrDatatypeRuleToken lv_name_4_0 = null;
AntlrDatatypeRuleToken lv_name_5_0 = null;
EObject this_ColonSepDeclaredTypeRef_9 = null;
enterRule();
try {
// InternalTypesParser.g:2803:2: ( ( ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? Get ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Get ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ) ) ( (lv_optional_6_0= QuestionMark ) )? otherlv_7= LeftParenthesis otherlv_8= RightParenthesis this_ColonSepDeclaredTypeRef_9= ruleColonSepDeclaredTypeRef[$current] ) )
// InternalTypesParser.g:2804:2: ( ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? Get ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Get ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ) ) ( (lv_optional_6_0= QuestionMark ) )? otherlv_7= LeftParenthesis otherlv_8= RightParenthesis this_ColonSepDeclaredTypeRef_9= ruleColonSepDeclaredTypeRef[$current] )
{
// InternalTypesParser.g:2804:2: ( ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? Get ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Get ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ) ) ( (lv_optional_6_0= QuestionMark ) )? otherlv_7= LeftParenthesis otherlv_8= RightParenthesis this_ColonSepDeclaredTypeRef_9= ruleColonSepDeclaredTypeRef[$current] )
// InternalTypesParser.g:2805:3: ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? Get ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Get ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ) ) ( (lv_optional_6_0= QuestionMark ) )? otherlv_7= LeftParenthesis otherlv_8= RightParenthesis this_ColonSepDeclaredTypeRef_9= ruleColonSepDeclaredTypeRef[$current]
{
// InternalTypesParser.g:2805:3: ( ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? Get ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Get ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) ) )
// InternalTypesParser.g:2806:4: ( ( ( ( ruleMemberAccessModifier ) ) ( ( ( Abstract ) ) | ( ( Static ) ) )? Get ( ( ( ruleTypesIdentifier ) ) | ( ( ruleTypesComputedPropertyName ) ) ) ) )=> ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Get ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) )
{
// InternalTypesParser.g:2841:4: ( ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Get ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) ) )
// InternalTypesParser.g:2842:5: ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) ) ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )? otherlv_3= Get ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) )
{
// InternalTypesParser.g:2842:5: ( (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier ) )
// InternalTypesParser.g:2843:6: (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier )
{
// InternalTypesParser.g:2843:6: (lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier )
// InternalTypesParser.g:2844:7: lv_declaredMemberAccessModifier_0_0= ruleMemberAccessModifier
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTGetterAccess().getDeclaredMemberAccessModifierMemberAccessModifierEnumRuleCall_0_0_0_0());
}
pushFollow(FOLLOW_57);
lv_declaredMemberAccessModifier_0_0 = ruleMemberAccessModifier();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTGetterRule());
}
set(current, "declaredMemberAccessModifier", lv_declaredMemberAccessModifier_0_0, "org.eclipse.n4js.ts.Types.MemberAccessModifier");
afterParserOrEnumRuleCall();
}
}
}
// InternalTypesParser.g:2861:5: ( ( (lv_declaredAbstract_1_0= Abstract ) ) | ( (lv_declaredStatic_2_0= Static ) ) )?
int alt62 = 3;
int LA62_0 = input.LA(1);
if ((LA62_0 == Abstract)) {
alt62 = 1;
} else if ((LA62_0 == Static)) {
alt62 = 2;
}
switch(alt62) {
case 1:
// InternalTypesParser.g:2862:6: ( (lv_declaredAbstract_1_0= Abstract ) )
{
// InternalTypesParser.g:2862:6: ( (lv_declaredAbstract_1_0= Abstract ) )
// InternalTypesParser.g:2863:7: (lv_declaredAbstract_1_0= Abstract )
{
// InternalTypesParser.g:2863:7: (lv_declaredAbstract_1_0= Abstract )
// InternalTypesParser.g:2864:8: lv_declaredAbstract_1_0= Abstract
{
lv_declaredAbstract_1_0 = (Token) match(input, Abstract, FOLLOW_58);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(lv_declaredAbstract_1_0, grammarAccess.getTGetterAccess().getDeclaredAbstractAbstractKeyword_0_0_1_0_0());
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTGetterRule());
}
setWithLastConsumed(current, "declaredAbstract", true, "abstract");
}
}
}
}
break;
case 2:
// InternalTypesParser.g:2877:6: ( (lv_declaredStatic_2_0= Static ) )
{
// InternalTypesParser.g:2877:6: ( (lv_declaredStatic_2_0= Static ) )
// InternalTypesParser.g:2878:7: (lv_declaredStatic_2_0= Static )
{
// InternalTypesParser.g:2878:7: (lv_declaredStatic_2_0= Static )
// InternalTypesParser.g:2879:8: lv_declaredStatic_2_0= Static
{
lv_declaredStatic_2_0 = (Token) match(input, Static, FOLLOW_58);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(lv_declaredStatic_2_0, grammarAccess.getTGetterAccess().getDeclaredStaticStaticKeyword_0_0_1_1_0());
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTGetterRule());
}
setWithLastConsumed(current, "declaredStatic", true, "static");
}
}
}
}
break;
}
otherlv_3 = (Token) match(input, Get, FOLLOW_52);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(otherlv_3, grammarAccess.getTGetterAccess().getGetKeyword_0_0_2());
}
// InternalTypesParser.g:2896:5: ( ( (lv_name_4_0= ruleTypesIdentifier ) ) | ( (lv_name_5_0= ruleTypesComputedPropertyName ) ) )
int alt63 = 2;
int LA63_0 = input.LA(1);
if ((LA63_0 == AssignmnentCompatible || (LA63_0 >= AutoboxedType && LA63_0 <= Finally) || (LA63_0 >= Private && LA63_0 <= False) || (LA63_0 >= Super && LA63_0 <= With) || (LA63_0 >= Any && LA63_0 <= Var) || (LA63_0 >= As && LA63_0 <= Of) || LA63_0 == RULE_IDENTIFIER)) {
alt63 = 1;
} else if ((LA63_0 == LeftSquareBracket)) {
alt63 = 2;
} else {
if (state.backtracking > 0) {
state.failed = true;
return current;
}
NoViableAltException nvae = new NoViableAltException("", 63, 0, input);
throw nvae;
}
switch(alt63) {
case 1:
// InternalTypesParser.g:2897:6: ( (lv_name_4_0= ruleTypesIdentifier ) )
{
// InternalTypesParser.g:2897:6: ( (lv_name_4_0= ruleTypesIdentifier ) )
// InternalTypesParser.g:2898:7: (lv_name_4_0= ruleTypesIdentifier )
{
// InternalTypesParser.g:2898:7: (lv_name_4_0= ruleTypesIdentifier )
// InternalTypesParser.g:2899:8: lv_name_4_0= ruleTypesIdentifier
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTGetterAccess().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.getTGetterRule());
}
set(current, "name", lv_name_4_0, "org.eclipse.n4js.ts.Types.TypesIdentifier");
afterParserOrEnumRuleCall();
}
}
}
}
break;
case 2:
// InternalTypesParser.g:2917:6: ( (lv_name_5_0= ruleTypesComputedPropertyName ) )
{
// InternalTypesParser.g:2917:6: ( (lv_name_5_0= ruleTypesComputedPropertyName ) )
// InternalTypesParser.g:2918:7: (lv_name_5_0= ruleTypesComputedPropertyName )
{
// InternalTypesParser.g:2918:7: (lv_name_5_0= ruleTypesComputedPropertyName )
// InternalTypesParser.g:2919:8: lv_name_5_0= ruleTypesComputedPropertyName
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTGetterAccess().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.getTGetterRule());
}
set(current, "name", lv_name_5_0, "org.eclipse.n4js.ts.Types.TypesComputedPropertyName");
afterParserOrEnumRuleCall();
}
}
}
}
break;
}
}
}
// InternalTypesParser.g:2939:3: ( (lv_optional_6_0= QuestionMark ) )?
int alt64 = 2;
int LA64_0 = input.LA(1);
if ((LA64_0 == QuestionMark)) {
alt64 = 1;
}
switch(alt64) {
case 1:
// InternalTypesParser.g:2940:4: (lv_optional_6_0= QuestionMark )
{
// InternalTypesParser.g:2940:4: (lv_optional_6_0= QuestionMark )
// InternalTypesParser.g:2941: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.getTGetterAccess().getOptionalQuestionMarkKeyword_1_0());
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTGetterRule());
}
setWithLastConsumed(current, "optional", true, "?");
}
}
}
break;
}
otherlv_7 = (Token) match(input, LeftParenthesis, FOLLOW_60);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(otherlv_7, grammarAccess.getTGetterAccess().getLeftParenthesisKeyword_2());
}
otherlv_8 = (Token) match(input, RightParenthesis, FOLLOW_54);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(otherlv_8, grammarAccess.getTGetterAccess().getRightParenthesisKeyword_3());
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTGetterRule());
}
newCompositeNode(grammarAccess.getTGetterAccess().getColonSepDeclaredTypeRefParserRuleCall_4());
}
pushFollow(FOLLOW_2);
this_ColonSepDeclaredTypeRef_9 = ruleColonSepDeclaredTypeRef(current);
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
current = this_ColonSepDeclaredTypeRef_9;
afterParserOrEnumRuleCall();
}
}
}
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 ruleTAnonymousFormalParameter.
// $ANTLR end "entryRuleTAnonymousFormalParameter"
// $ANTLR start "ruleTAnonymousFormalParameter"
// InternalTypesParser.g:4203:1: ruleTAnonymousFormalParameter returns [EObject current=null] : ( ( (lv_variadic_0_0= FullStopFullStopFullStop ) )? ( ( ( ( ( ( ruleBindingIdentifier ) ) Colon ) )=> ( ( (lv_name_1_0= ruleBindingIdentifier ) ) ( ( Colon )=>this_ColonSepTypeRef_2= ruleColonSepTypeRef[$current] ) ) ) | ( (lv_typeRef_3_0= ruleTypeRef ) ) ) this_DefaultFormalParameter_4= ruleDefaultFormalParameter[$current] ) ;
public final EObject ruleTAnonymousFormalParameter() throws RecognitionException {
EObject current = null;
Token lv_variadic_0_0 = null;
AntlrDatatypeRuleToken lv_name_1_0 = null;
EObject this_ColonSepTypeRef_2 = null;
EObject lv_typeRef_3_0 = null;
EObject this_DefaultFormalParameter_4 = null;
enterRule();
try {
// InternalTypesParser.g:4209:2: ( ( ( (lv_variadic_0_0= FullStopFullStopFullStop ) )? ( ( ( ( ( ( ruleBindingIdentifier ) ) Colon ) )=> ( ( (lv_name_1_0= ruleBindingIdentifier ) ) ( ( Colon )=>this_ColonSepTypeRef_2= ruleColonSepTypeRef[$current] ) ) ) | ( (lv_typeRef_3_0= ruleTypeRef ) ) ) this_DefaultFormalParameter_4= ruleDefaultFormalParameter[$current] ) )
// InternalTypesParser.g:4210:2: ( ( (lv_variadic_0_0= FullStopFullStopFullStop ) )? ( ( ( ( ( ( ruleBindingIdentifier ) ) Colon ) )=> ( ( (lv_name_1_0= ruleBindingIdentifier ) ) ( ( Colon )=>this_ColonSepTypeRef_2= ruleColonSepTypeRef[$current] ) ) ) | ( (lv_typeRef_3_0= ruleTypeRef ) ) ) this_DefaultFormalParameter_4= ruleDefaultFormalParameter[$current] )
{
// InternalTypesParser.g:4210:2: ( ( (lv_variadic_0_0= FullStopFullStopFullStop ) )? ( ( ( ( ( ( ruleBindingIdentifier ) ) Colon ) )=> ( ( (lv_name_1_0= ruleBindingIdentifier ) ) ( ( Colon )=>this_ColonSepTypeRef_2= ruleColonSepTypeRef[$current] ) ) ) | ( (lv_typeRef_3_0= ruleTypeRef ) ) ) this_DefaultFormalParameter_4= ruleDefaultFormalParameter[$current] )
// InternalTypesParser.g:4211:3: ( (lv_variadic_0_0= FullStopFullStopFullStop ) )? ( ( ( ( ( ( ruleBindingIdentifier ) ) Colon ) )=> ( ( (lv_name_1_0= ruleBindingIdentifier ) ) ( ( Colon )=>this_ColonSepTypeRef_2= ruleColonSepTypeRef[$current] ) ) ) | ( (lv_typeRef_3_0= ruleTypeRef ) ) ) this_DefaultFormalParameter_4= ruleDefaultFormalParameter[$current]
{
// InternalTypesParser.g:4211:3: ( (lv_variadic_0_0= FullStopFullStopFullStop ) )?
int alt87 = 2;
int LA87_0 = input.LA(1);
if ((LA87_0 == FullStopFullStopFullStop)) {
alt87 = 1;
}
switch(alt87) {
case 1:
// InternalTypesParser.g:4212:4: (lv_variadic_0_0= FullStopFullStopFullStop )
{
// InternalTypesParser.g:4212:4: (lv_variadic_0_0= FullStopFullStopFullStop )
// InternalTypesParser.g:4213:5: lv_variadic_0_0= FullStopFullStopFullStop
{
lv_variadic_0_0 = (Token) match(input, FullStopFullStopFullStop, FOLLOW_82);
if (state.failed)
return current;
if (state.backtracking == 0) {
newLeafNode(lv_variadic_0_0, grammarAccess.getTAnonymousFormalParameterAccess().getVariadicFullStopFullStopFullStopKeyword_0_0());
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTAnonymousFormalParameterRule());
}
setWithLastConsumed(current, "variadic", true, "...");
}
}
}
break;
}
// InternalTypesParser.g:4225:3: ( ( ( ( ( ( ruleBindingIdentifier ) ) Colon ) )=> ( ( (lv_name_1_0= ruleBindingIdentifier ) ) ( ( Colon )=>this_ColonSepTypeRef_2= ruleColonSepTypeRef[$current] ) ) ) | ( (lv_typeRef_3_0= ruleTypeRef ) ) )
int alt88 = 2;
alt88 = dfa88.predict(input);
switch(alt88) {
case 1:
// InternalTypesParser.g:4226:4: ( ( ( ( ( ruleBindingIdentifier ) ) Colon ) )=> ( ( (lv_name_1_0= ruleBindingIdentifier ) ) ( ( Colon )=>this_ColonSepTypeRef_2= ruleColonSepTypeRef[$current] ) ) )
{
// InternalTypesParser.g:4226:4: ( ( ( ( ( ruleBindingIdentifier ) ) Colon ) )=> ( ( (lv_name_1_0= ruleBindingIdentifier ) ) ( ( Colon )=>this_ColonSepTypeRef_2= ruleColonSepTypeRef[$current] ) ) )
// InternalTypesParser.g:4227:5: ( ( ( ( ruleBindingIdentifier ) ) Colon ) )=> ( ( (lv_name_1_0= ruleBindingIdentifier ) ) ( ( Colon )=>this_ColonSepTypeRef_2= ruleColonSepTypeRef[$current] ) )
{
// InternalTypesParser.g:4236:5: ( ( (lv_name_1_0= ruleBindingIdentifier ) ) ( ( Colon )=>this_ColonSepTypeRef_2= ruleColonSepTypeRef[$current] ) )
// InternalTypesParser.g:4237:6: ( (lv_name_1_0= ruleBindingIdentifier ) ) ( ( Colon )=>this_ColonSepTypeRef_2= ruleColonSepTypeRef[$current] )
{
// InternalTypesParser.g:4237:6: ( (lv_name_1_0= ruleBindingIdentifier ) )
// InternalTypesParser.g:4238:7: (lv_name_1_0= ruleBindingIdentifier )
{
// InternalTypesParser.g:4238:7: (lv_name_1_0= ruleBindingIdentifier )
// InternalTypesParser.g:4239:8: lv_name_1_0= ruleBindingIdentifier
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTAnonymousFormalParameterAccess().getNameBindingIdentifierParserRuleCall_1_0_0_0_0());
}
pushFollow(FOLLOW_56);
lv_name_1_0 = ruleBindingIdentifier();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTAnonymousFormalParameterRule());
}
set(current, "name", lv_name_1_0, "org.eclipse.n4js.ts.TypeExpressions.BindingIdentifier");
afterParserOrEnumRuleCall();
}
}
}
// InternalTypesParser.g:4256:6: ( ( Colon )=>this_ColonSepTypeRef_2= ruleColonSepTypeRef[$current] )
// InternalTypesParser.g:4257:7: ( Colon )=>this_ColonSepTypeRef_2= ruleColonSepTypeRef[$current]
{
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTAnonymousFormalParameterRule());
}
newCompositeNode(grammarAccess.getTAnonymousFormalParameterAccess().getColonSepTypeRefParserRuleCall_1_0_0_1());
}
pushFollow(FOLLOW_83);
this_ColonSepTypeRef_2 = ruleColonSepTypeRef(current);
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
current = this_ColonSepTypeRef_2;
afterParserOrEnumRuleCall();
}
}
}
}
}
break;
case 2:
// InternalTypesParser.g:4273:4: ( (lv_typeRef_3_0= ruleTypeRef ) )
{
// InternalTypesParser.g:4273:4: ( (lv_typeRef_3_0= ruleTypeRef ) )
// InternalTypesParser.g:4274:5: (lv_typeRef_3_0= ruleTypeRef )
{
// InternalTypesParser.g:4274:5: (lv_typeRef_3_0= ruleTypeRef )
// InternalTypesParser.g:4275:6: lv_typeRef_3_0= ruleTypeRef
{
if (state.backtracking == 0) {
newCompositeNode(grammarAccess.getTAnonymousFormalParameterAccess().getTypeRefTypeRefParserRuleCall_1_1_0());
}
pushFollow(FOLLOW_83);
lv_typeRef_3_0 = ruleTypeRef();
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
if (current == null) {
current = createModelElementForParent(grammarAccess.getTAnonymousFormalParameterRule());
}
set(current, "typeRef", lv_typeRef_3_0, "org.eclipse.n4js.ts.Types.TypeRef");
afterParserOrEnumRuleCall();
}
}
}
}
break;
}
if (state.backtracking == 0) {
if (current == null) {
current = createModelElement(grammarAccess.getTAnonymousFormalParameterRule());
}
newCompositeNode(grammarAccess.getTAnonymousFormalParameterAccess().getDefaultFormalParameterParserRuleCall_2());
}
pushFollow(FOLLOW_2);
this_DefaultFormalParameter_4 = ruleDefaultFormalParameter(current);
state._fsp--;
if (state.failed)
return current;
if (state.backtracking == 0) {
current = this_DefaultFormalParameter_4;
afterParserOrEnumRuleCall();
}
}
}
if (state.backtracking == 0) {
leaveRule();
}
} catch (RecognitionException re) {
recover(input, re);
appendSkippedTokens();
} finally {
}
return current;
}
Aggregations