// $ANTLR start "ruleChild" // InternalBug377311TestLanguage.g:121:1: ruleChild returns [EObject current=null] : (otherlv_0= // 'child' ( (lv_name_1_0= RULE_STRING ) ) ) ; public final EObject ruleChild() throws RecognitionException { EObject current = null; Token otherlv_0 = null; Token lv_name_1_0 = null; enterRule(); HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens("RULE_WS", "RULE_ID"); try { // InternalBug377311TestLanguage.g:125:28: ( (otherlv_0= 'child' ( (lv_name_1_0= RULE_STRING ) // ) ) ) // InternalBug377311TestLanguage.g:126:1: (otherlv_0= 'child' ( (lv_name_1_0= RULE_STRING ) ) // ) { // InternalBug377311TestLanguage.g:126:1: (otherlv_0= 'child' ( (lv_name_1_0= RULE_STRING ) // ) ) // InternalBug377311TestLanguage.g:126:3: otherlv_0= 'child' ( (lv_name_1_0= RULE_STRING ) ) { otherlv_0 = (Token) match(input, 12, FollowSets000.FOLLOW_4); newLeafNode(otherlv_0, grammarAccess.getChildAccess().getChildKeyword_0()); // InternalBug377311TestLanguage.g:130:1: ( (lv_name_1_0= RULE_STRING ) ) // InternalBug377311TestLanguage.g:131:1: (lv_name_1_0= RULE_STRING ) { // InternalBug377311TestLanguage.g:131:1: (lv_name_1_0= RULE_STRING ) // InternalBug377311TestLanguage.g:132:3: lv_name_1_0= RULE_STRING { lv_name_1_0 = (Token) match(input, RULE_STRING, FollowSets000.FOLLOW_2); newLeafNode( lv_name_1_0, grammarAccess.getChildAccess().getNameSTRINGTerminalRuleCall_1_0()); if (current == null) { current = createModelElement(grammarAccess.getChildRule()); } setWithLastConsumed( current, "name", lv_name_1_0, "org.eclipse.xtext.common.Terminals.STRING"); } } } } leaveRule(); } catch (RecognitionException re) { recover(input, re); appendSkippedTokens(); } finally { myHiddenTokenState.restore(); } return current; }
// $ANTLR start "entryRuleRoot" // InternalBug377311TestLanguage.g:67:1: entryRuleRoot returns [EObject current=null] : // iv_ruleRoot= ruleRoot EOF ; public final EObject entryRuleRoot() throws RecognitionException { EObject current = null; EObject iv_ruleRoot = null; try { // InternalBug377311TestLanguage.g:68:2: (iv_ruleRoot= ruleRoot EOF ) // InternalBug377311TestLanguage.g:69:2: iv_ruleRoot= ruleRoot EOF { newCompositeNode(grammarAccess.getRootRule()); pushFollow(FollowSets000.FOLLOW_1); iv_ruleRoot = ruleRoot(); state._fsp--; current = iv_ruleRoot; match(input, EOF, FollowSets000.FOLLOW_2); } } catch (RecognitionException re) { recover(input, re); appendSkippedTokens(); } finally { } return current; }
// $ANTLR start "entryRuleChild" // InternalBug377311TestLanguage.g:106:1: entryRuleChild returns [EObject current=null] : // iv_ruleChild= ruleChild EOF ; public final EObject entryRuleChild() throws RecognitionException { EObject current = null; EObject iv_ruleChild = null; HiddenTokens myHiddenTokenState = ((XtextTokenStream) input).setHiddenTokens("RULE_WS", "RULE_ID"); try { // InternalBug377311TestLanguage.g:110:2: (iv_ruleChild= ruleChild EOF ) // InternalBug377311TestLanguage.g:111:2: iv_ruleChild= ruleChild EOF { newCompositeNode(grammarAccess.getChildRule()); pushFollow(FollowSets000.FOLLOW_1); iv_ruleChild = ruleChild(); state._fsp--; current = iv_ruleChild; match(input, EOF, FollowSets000.FOLLOW_2); } } catch (RecognitionException re) { recover(input, re); appendSkippedTokens(); } finally { myHiddenTokenState.restore(); } return current; }
public InternalBug377311TestLanguageParser( TokenStream input, Bug377311TestLanguageGrammarAccess grammarAccess) { this(input); this.grammarAccess = grammarAccess; registerRules(grammarAccess.getGrammar()); }
// $ANTLR start "ruleRoot" // InternalBug377311TestLanguage.g:76:1: ruleRoot returns [EObject current=null] : ( // (lv_childs_0_0= ruleChild ) )* ; public final EObject ruleRoot() throws RecognitionException { EObject current = null; EObject lv_childs_0_0 = null; enterRule(); try { // InternalBug377311TestLanguage.g:79:28: ( ( (lv_childs_0_0= ruleChild ) )* ) // InternalBug377311TestLanguage.g:80:1: ( (lv_childs_0_0= ruleChild ) )* { // InternalBug377311TestLanguage.g:80:1: ( (lv_childs_0_0= ruleChild ) )* loop1: do { int alt1 = 2; int LA1_0 = input.LA(1); if ((LA1_0 == 12)) { alt1 = 1; } switch (alt1) { case 1: // InternalBug377311TestLanguage.g:81:1: (lv_childs_0_0= ruleChild ) { // InternalBug377311TestLanguage.g:81:1: (lv_childs_0_0= ruleChild ) // InternalBug377311TestLanguage.g:82:3: lv_childs_0_0= ruleChild { newCompositeNode(grammarAccess.getRootAccess().getChildsChildParserRuleCall_0()); pushFollow(FollowSets000.FOLLOW_3); lv_childs_0_0 = ruleChild(); state._fsp--; if (current == null) { current = createModelElementForParent(grammarAccess.getRootRule()); } add( current, "childs", lv_childs_0_0, "org.eclipse.xtext.ui.tests.editor.contentassist.Bug377311TestLanguage.Child"); afterParserOrEnumRuleCall(); } } break; default: break loop1; } } while (true); } leaveRule(); } catch (RecognitionException re) { recover(input, re); appendSkippedTokens(); } finally { } return current; }