// $ANTLR start "entryRuleLookAhead1" // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:196:1: entryRuleLookAhead1 returns [EObject current=null] : iv_ruleLookAhead1= ruleLookAhead1 EOF ; public final EObject entryRuleLookAhead1() throws RecognitionException { EObject current = null; EObject iv_ruleLookAhead1 = null; try { // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:197:2: (iv_ruleLookAhead1= ruleLookAhead1 EOF ) // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:198:2: iv_ruleLookAhead1= ruleLookAhead1 EOF { newCompositeNode(grammarAccess.getLookAhead1Rule()); pushFollow(FollowSets000.FOLLOW_ruleLookAhead1_in_entryRuleLookAhead1426); iv_ruleLookAhead1 = ruleLookAhead1(); state._fsp--; current = iv_ruleLookAhead1; match(input, EOF, FollowSets000.FOLLOW_EOF_in_entryRuleLookAhead1436); } } catch (RecognitionException re) { recover(input, re); appendSkippedTokens(); } finally { } return current; }
public void createSequence(EObject context, EObject semanticObject) { if (semanticObject.eClass().getEPackage() == LookaheadLangPackage.eINSTANCE) switch (semanticObject.eClass().getClassifierID()) { case LookaheadLangPackage.ENTRY: if (context == grammarAccess.getEntryRule()) { sequence_Entry(context, (Entry) semanticObject); return; } else break; case LookaheadLangPackage.LOOK_AHEAD0: if (context == grammarAccess.getAltsRule() || context == grammarAccess.getLookAhead0Rule()) { sequence_LookAhead0(context, (LookAhead0) semanticObject); return; } else break; case LookaheadLangPackage.LOOK_AHEAD1: if (context == grammarAccess.getAltsRule() || context == grammarAccess.getLookAhead1Rule()) { sequence_LookAhead1(context, (LookAhead1) semanticObject); return; } else break; case LookaheadLangPackage.LOOK_AHEAD2: if (context == grammarAccess.getLookAhead2Rule()) { sequence_LookAhead2(context, (LookAhead2) semanticObject); return; } else break; case LookaheadLangPackage.LOOK_AHEAD3: if (context == grammarAccess.getAltsRule() || context == grammarAccess.getLookAhead3Rule()) { sequence_LookAhead3(context, (LookAhead3) semanticObject); return; } else break; case LookaheadLangPackage.LOOK_AHEAD4: if (context == grammarAccess.getLookAhead4Rule()) { sequence_LookAhead4(context, (LookAhead4) semanticObject); return; } else break; } if (errorAcceptor != null) errorAcceptor.accept( diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context)); }
// $ANTLR start "ruleLookAhead1" // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:205:1: ruleLookAhead1 returns [EObject current=null] : (otherlv_0= 'foo' ( (lv_y_1_0= ruleLookAhead2 ) ) ( (lv_x_2_0= 'b' ) ) ( (lv_x_3_0= 'd' ) ) ) ; public final EObject ruleLookAhead1() throws RecognitionException { EObject current = null; Token otherlv_0 = null; Token lv_x_2_0 = null; Token lv_x_3_0 = null; EObject lv_y_1_0 = null; enterRule(); try { // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:208:28: ( (otherlv_0= 'foo' ( (lv_y_1_0= ruleLookAhead2 ) ) ( (lv_x_2_0= 'b' ) ) ( (lv_x_3_0= 'd' ) ) ) ) // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:209:1: (otherlv_0= 'foo' ( (lv_y_1_0= ruleLookAhead2 ) ) ( (lv_x_2_0= 'b' ) ) ( (lv_x_3_0= 'd' ) ) ) { // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:209:1: (otherlv_0= 'foo' ( (lv_y_1_0= ruleLookAhead2 ) ) ( (lv_x_2_0= 'b' ) ) ( (lv_x_3_0= 'd' ) ) ) // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:209:3: otherlv_0= 'foo' ( (lv_y_1_0= ruleLookAhead2 ) ) ( (lv_x_2_0= 'b' ) ) ( (lv_x_3_0= 'd' ) ) { otherlv_0 = (Token) match(input, 13, FollowSets000.FOLLOW_13_in_ruleLookAhead1473); newLeafNode(otherlv_0, grammarAccess.getLookAhead1Access().getFooKeyword_0()); // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:213:1: ( (lv_y_1_0= ruleLookAhead2 ) ) // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:214:1: (lv_y_1_0= ruleLookAhead2 ) { // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:214:1: (lv_y_1_0= ruleLookAhead2 ) // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:215:3: lv_y_1_0= ruleLookAhead2 { newCompositeNode( grammarAccess.getLookAhead1Access().getYLookAhead2ParserRuleCall_1_0()); pushFollow(FollowSets000.FOLLOW_ruleLookAhead2_in_ruleLookAhead1494); lv_y_1_0 = ruleLookAhead2(); state._fsp--; if (current == null) { current = createModelElementForParent(grammarAccess.getLookAhead1Rule()); } set(current, "y", lv_y_1_0, "LookAhead2"); afterParserOrEnumRuleCall(); } } // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:231:2: ( (lv_x_2_0= 'b' ) ) // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:232:1: (lv_x_2_0= 'b' ) { // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:232:1: (lv_x_2_0= 'b' ) // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:233:3: lv_x_2_0= 'b' { lv_x_2_0 = (Token) match(input, 14, FollowSets000.FOLLOW_14_in_ruleLookAhead1512); newLeafNode(lv_x_2_0, grammarAccess.getLookAhead1Access().getXBKeyword_2_0()); if (current == null) { current = createModelElement(grammarAccess.getLookAhead1Rule()); } setWithLastConsumed(current, "x", lv_x_2_0, "b"); } } // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:246:2: ( (lv_x_3_0= 'd' ) ) // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:247:1: (lv_x_3_0= 'd' ) { // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:247:1: (lv_x_3_0= 'd' ) // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalLookaheadTestLanguage.g:248:3: lv_x_3_0= 'd' { lv_x_3_0 = (Token) match(input, 15, FollowSets000.FOLLOW_15_in_ruleLookAhead1543); newLeafNode(lv_x_3_0, grammarAccess.getLookAhead1Access().getXDKeyword_3_0()); if (current == null) { current = createModelElement(grammarAccess.getLookAhead1Rule()); } setWithLastConsumed(current, "x", lv_x_3_0, "d"); } } } } leaveRule(); } catch (RecognitionException re) { recover(input, re); appendSkippedTokens(); } finally { } return current; }