// $ANTLR start "ruleNode"
  // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalPartialSerializationTestLanguage.g:149:1: ruleNode returns [EObject current=null] : (otherlv_0= 'node' ( (lv_name_1_0= RULE_ID ) ) (otherlv_2= '(' ( (lv_children_3_0= ruleNode ) )+ otherlv_4= ')' )? ) ;
  public final EObject ruleNode() throws RecognitionException {
    EObject current = null;

    Token otherlv_0 = null;
    Token lv_name_1_0 = null;
    Token otherlv_2 = null;
    Token otherlv_4 = null;
    EObject lv_children_3_0 = null;

    enterRule();

    try {
      // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalPartialSerializationTestLanguage.g:152:28: ( (otherlv_0= 'node' ( (lv_name_1_0= RULE_ID ) ) (otherlv_2= '(' ( (lv_children_3_0= ruleNode ) )+ otherlv_4= ')' )? ) )
      // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalPartialSerializationTestLanguage.g:153:1: (otherlv_0= 'node' ( (lv_name_1_0= RULE_ID ) ) (otherlv_2= '(' ( (lv_children_3_0= ruleNode ) )+ otherlv_4= ')' )? )
      {
        // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalPartialSerializationTestLanguage.g:153:1: (otherlv_0= 'node' ( (lv_name_1_0= RULE_ID ) ) (otherlv_2= '(' ( (lv_children_3_0= ruleNode ) )+ otherlv_4= ')' )? )
        // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalPartialSerializationTestLanguage.g:153:3: otherlv_0= 'node' ( (lv_name_1_0= RULE_ID ) ) (otherlv_2= '(' ( (lv_children_3_0= ruleNode ) )+ otherlv_4= ')' )?
        {
          otherlv_0 = (Token) match(input, 12, FollowSets000.FOLLOW_12_in_ruleNode316);

          newLeafNode(otherlv_0, grammarAccess.getNodeAccess().getNodeKeyword_0());

          // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalPartialSerializationTestLanguage.g:157:1: ( (lv_name_1_0= RULE_ID ) )
          // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalPartialSerializationTestLanguage.g:158:1: (lv_name_1_0= RULE_ID )
          {
            // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalPartialSerializationTestLanguage.g:158:1: (lv_name_1_0= RULE_ID )
            // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalPartialSerializationTestLanguage.g:159:3: lv_name_1_0= RULE_ID
            {
              lv_name_1_0 =
                  (Token) match(input, RULE_ID, FollowSets000.FOLLOW_RULE_ID_in_ruleNode333);

              newLeafNode(
                  lv_name_1_0, grammarAccess.getNodeAccess().getNameIDTerminalRuleCall_1_0());

              if (current == null) {
                current = createModelElement(grammarAccess.getNodeRule());
              }
              setWithLastConsumed(current, "name", lv_name_1_0, "ID");
            }
          }

          // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalPartialSerializationTestLanguage.g:175:2: (otherlv_2= '(' ( (lv_children_3_0= ruleNode ) )+ otherlv_4= ')' )?
          int alt2 = 2;
          int LA2_0 = input.LA(1);

          if ((LA2_0 == 13)) {
            alt2 = 1;
          }
          switch (alt2) {
            case 1:
              // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalPartialSerializationTestLanguage.g:175:4: otherlv_2= '(' ( (lv_children_3_0= ruleNode ) )+ otherlv_4= ')'
              {
                otherlv_2 = (Token) match(input, 13, FollowSets000.FOLLOW_13_in_ruleNode351);

                newLeafNode(
                    otherlv_2, grammarAccess.getNodeAccess().getLeftParenthesisKeyword_2_0());

                // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalPartialSerializationTestLanguage.g:179:1: ( (lv_children_3_0= ruleNode ) )+
                int cnt1 = 0;
                loop1:
                do {
                  int alt1 = 2;
                  int LA1_0 = input.LA(1);

                  if ((LA1_0 == 12)) {
                    alt1 = 1;
                  }

                  switch (alt1) {
                    case 1:
                      // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalPartialSerializationTestLanguage.g:180:1: (lv_children_3_0= ruleNode )
                      {
                        // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalPartialSerializationTestLanguage.g:180:1: (lv_children_3_0= ruleNode )
                        // ../org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalPartialSerializationTestLanguage.g:181:3: lv_children_3_0= ruleNode
                        {
                          newCompositeNode(
                              grammarAccess.getNodeAccess().getChildrenNodeParserRuleCall_2_1_0());

                          pushFollow(FollowSets000.FOLLOW_ruleNode_in_ruleNode372);
                          lv_children_3_0 = ruleNode();

                          state._fsp--;

                          if (current == null) {
                            current = createModelElementForParent(grammarAccess.getNodeRule());
                          }
                          add(current, "children", lv_children_3_0, "Node");
                          afterParserOrEnumRuleCall();
                        }
                      }
                      break;

                    default:
                      if (cnt1 >= 1) break loop1;
                      EarlyExitException eee = new EarlyExitException(1, input);
                      throw eee;
                  }
                  cnt1++;
                } while (true);

                otherlv_4 = (Token) match(input, 14, FollowSets000.FOLLOW_14_in_ruleNode385);

                newLeafNode(
                    otherlv_4, grammarAccess.getNodeAccess().getRightParenthesisKeyword_2_2());
              }
              break;
          }
        }
      }

      leaveRule();
    } catch (RecognitionException re) {
      recover(input, re);
      appendSkippedTokens();
    } finally {
    }
    return current;
  }