Exemple #1
0
  // $ANTLR start "line"
  // /home/jon/flume/src/antlr/FlumeShell.g:88:1: line : command EOF -> command ;
  public final FlumeShellParser.line_return line() throws RecognitionException {
    FlumeShellParser.line_return retval = new FlumeShellParser.line_return();
    retval.start = input.LT(1);

    Object root_0 = null;

    Token EOF6 = null;
    FlumeShellParser.command_return command5 = null;

    Object EOF6_tree = null;
    RewriteRuleTokenStream stream_EOF = new RewriteRuleTokenStream(adaptor, "token EOF");
    RewriteRuleSubtreeStream stream_command = new RewriteRuleSubtreeStream(adaptor, "rule command");
    try {
      // /home/jon/flume/src/antlr/FlumeShell.g:88:6: ( command EOF -> command )
      // /home/jon/flume/src/antlr/FlumeShell.g:88:8: command EOF
      {
        pushFollow(FOLLOW_command_in_line107);
        command5 = command();

        state._fsp--;

        stream_command.add(command5.getTree());
        EOF6 = (Token) match(input, EOF, FOLLOW_EOF_in_line109);
        stream_EOF.add(EOF6);

        // AST REWRITE
        // elements: command
        // token labels:
        // rule labels: retval
        // token list labels:
        // rule list labels:
        // wildcard labels:
        retval.tree = root_0;
        RewriteRuleSubtreeStream stream_retval =
            new RewriteRuleSubtreeStream(
                adaptor, "rule retval", retval != null ? retval.tree : null);

        root_0 = (Object) adaptor.nil();
        // 88:20: -> command
        {
          adaptor.addChild(root_0, stream_command.nextTree());
        }

        retval.tree = root_0;
      }

      retval.stop = input.LT(-1);

      retval.tree = (Object) adaptor.rulePostProcessing(root_0);
      adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

    } catch (RecognitionException re) {
      reportError(re);
      recover(input, re);
      retval.tree = (Object) adaptor.errorNode(input, retval.start, input.LT(-1), re);

    } finally {
    }
    return retval;
  }
  // $ANTLR start "nonSwitchOption"
  // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:279:1: nonSwitchOption : t= TEXT ->;
  public final CommandLineParser.nonSwitchOption_return nonSwitchOption()
      throws RecognitionException {
    CommandLineParser.nonSwitchOption_return retval =
        new CommandLineParser.nonSwitchOption_return();
    retval.start = input.LT(1);

    CommonTree root_0 = null;

    Token t = null;

    CommonTree t_tree = null;
    RewriteRuleTokenStream stream_TEXT = new RewriteRuleTokenStream(adaptor, "token TEXT");

    try {
      // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:280:2: (t= TEXT ->)
      // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:280:4: t= TEXT
      {
        t = (Token) match(input, TEXT, FOLLOW_TEXT_in_nonSwitchOption359);
        stream_TEXT.add(t);

        // AST REWRITE
        // elements:
        // token labels:
        // rule labels: retval
        // token list labels:
        // rule list labels:
        // wildcard labels:
        retval.tree = root_0;
        RewriteRuleSubtreeStream stream_retval =
            new RewriteRuleSubtreeStream(
                adaptor, "rule retval", retval != null ? retval.tree : null);

        root_0 = (CommonTree) adaptor.nil();
        // 280:11: ->
        {
          adaptor.addChild(root_0, new UnknownOption(t));
        }

        retval.tree = root_0;
      }

      retval.stop = input.LT(-1);

      retval.tree = (CommonTree) adaptor.rulePostProcessing(root_0);
      adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

    } catch (RecognitionException re) {
      reportError(re);
      recover(input, re);
      retval.tree = (CommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);

    } finally {
    }
    return retval;
  }
  // $ANTLR start "switchOption"
  // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:257:1: switchOption : ({...}? =>t= TEXT -> | {...}? =>t= TEXT -> | {...}? =>t= TEXT -> | {...}? =>t= TEXT -> | {...}? =>t= TEXT -> | {...}? =>t= TEXT '=' eText -> | {...}? =>t= TEXT -> | {...}? =>t= TEXT -> | {...}? =>t= TEXT WS eText -> | t= TEXT ->);
  public final CommandLineParser.switchOption_return switchOption() throws RecognitionException {
    CommandLineParser.switchOption_return retval = new CommandLineParser.switchOption_return();
    retval.start = input.LT(1);

    CommonTree root_0 = null;

    Token t = null;
    Token char_literal7 = null;
    Token WS9 = null;
    CommandLineParser.eText_return eText8 = null;

    CommandLineParser.eText_return eText10 = null;

    CommonTree t_tree = null;
    CommonTree char_literal7_tree = null;
    CommonTree WS9_tree = null;
    RewriteRuleTokenStream stream_WS = new RewriteRuleTokenStream(adaptor, "token WS");
    RewriteRuleTokenStream stream_TEXT = new RewriteRuleTokenStream(adaptor, "token TEXT");
    RewriteRuleTokenStream stream_8 = new RewriteRuleTokenStream(adaptor, "token 8");
    RewriteRuleSubtreeStream stream_eText = new RewriteRuleSubtreeStream(adaptor, "rule eText");

    int index = 0;
    String name = null;
    String value = null;

    try {
      // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:263:2: ({...}? =>t= TEXT -> | {...}? =>t= TEXT -> | {...}? =>t= TEXT -> | {...}? =>t= TEXT -> | {...}? =>t= TEXT -> | {...}? =>t= TEXT '=' eText -> | {...}? =>t= TEXT -> | {...}? =>t= TEXT -> | {...}? =>t= TEXT WS eText -> | t= TEXT ->)
      int alt5 = 10;
      alt5 = dfa5.predict(input);
      switch (alt5) {
        case 1:
          // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:263:4: {...}? =>t= TEXT
          {
            if (!((switchOptions.contains(input.LT(1).getText())))) {
              throw new FailedPredicateException(
                  input, "switchOption", "switchOptions.contains(input.LT(1).getText())");
            }
            t = (Token) match(input, TEXT, FOLLOW_TEXT_in_switchOption135);
            stream_TEXT.add(t);

            // AST REWRITE
            // elements:
            // token labels:
            // rule labels: retval
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval =
                new RewriteRuleSubtreeStream(
                    adaptor, "rule retval", retval != null ? retval.tree : null);

            root_0 = (CommonTree) adaptor.nil();
            // 263:78: ->
            {
              adaptor.addChild(root_0, new SwitchNode(t));
            }

            retval.tree = root_0;
          }
          break;
        case 2:
          // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:264:3: {...}? =>t= TEXT
          {
            if (!((VERBOSE.equals(input.LT(1).getText())
                || input.LT(1).getText().startsWith(VERBOSE + ':')))) {
              throw new FailedPredicateException(
                  input,
                  "switchOption",
                  "VERBOSE.equals(input.LT(1).getText()) || input.LT(1).getText().startsWith(VERBOSE+':')");
            }
            t = (Token) match(input, TEXT, FOLLOW_TEXT_in_switchOption166);
            stream_TEXT.add(t);

            // AST REWRITE
            // elements:
            // token labels:
            // rule labels: retval
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval =
                new RewriteRuleSubtreeStream(
                    adaptor, "rule retval", retval != null ? retval.tree : null);

            root_0 = (CommonTree) adaptor.nil();
            // 264:107: ->
            {
              adaptor.addChild(root_0, new SwitchNode(t));
            }

            retval.tree = root_0;
          }
          break;
        case 3:
          // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:265:3: {...}? =>t= TEXT
          {
            if (!((VERSION.equals(input.LT(1).getText())
                || input.LT(1).getText().startsWith(VERSION + ':')))) {
              throw new FailedPredicateException(
                  input,
                  "switchOption",
                  "VERSION.equals(input.LT(1).getText()) || input.LT(1).getText().startsWith(VERSION+':')");
            }
            t = (Token) match(input, TEXT, FOLLOW_TEXT_in_switchOption186);
            stream_TEXT.add(t);

            index = t.getText().indexOf(':');
            if (index > 0) {
              name = t.getText().substring(0, index);
              value = (index + 1) == t.getText().length() ? "" : t.getText().substring(index + 1);
            } else {
              name = t.getText();
            }

            // AST REWRITE
            // elements:
            // token labels:
            // rule labels: retval
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval =
                new RewriteRuleSubtreeStream(
                    adaptor, "rule retval", retval != null ? retval.tree : null);

            root_0 = (CommonTree) adaptor.nil();
            // 265:304: ->
            {
              adaptor.addChild(
                  root_0,
                  index < 0 ? new SwitchNode(t) : new ParametrizedNode(t, name, ":", value));
            }

            retval.tree = root_0;
          }
          break;
        case 4:
          // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:266:3: {...}? =>t= TEXT
          {
            if (!((input.LT(1).getText().startsWith(XSHARE + ':')))) {
              throw new FailedPredicateException(
                  input, "switchOption", "input.LT(1).getText().startsWith(XSHARE+':')");
            }
            t = (Token) match(input, TEXT, FOLLOW_TEXT_in_switchOption203);
            stream_TEXT.add(t);

            // AST REWRITE
            // elements:
            // token labels:
            // rule labels: retval
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval =
                new RewriteRuleSubtreeStream(
                    adaptor, "rule retval", retval != null ? retval.tree : null);

            root_0 = (CommonTree) adaptor.nil();
            // 266:60: ->
            {
              adaptor.addChild(root_0, new SwitchNode(t));
            }

            retval.tree = root_0;
          }
          break;
        case 5:
          // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:267:3: {...}? =>t= TEXT
          {
            if (!((input.LT(1).getText().startsWith(XCJNI + ':')))) {
              throw new FailedPredicateException(
                  input, "switchOption", "input.LT(1).getText().startsWith(XCJNI+':')");
            }
            t = (Token) match(input, TEXT, FOLLOW_TEXT_in_switchOption218);
            stream_TEXT.add(t);

            // AST REWRITE
            // elements:
            // token labels:
            // rule labels: retval
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval =
                new RewriteRuleSubtreeStream(
                    adaptor, "rule retval", retval != null ? retval.tree : null);

            root_0 = (CommonTree) adaptor.nil();
            // 267:61: ->
            {
              adaptor.addChild(root_0, new SwitchNode(t));
            }

            retval.tree = root_0;
          }
          break;
        case 6:
          // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:268:3: {...}? =>t= TEXT '=' eText
          {
            if (!((input.LT(1).getText().charAt(0) == 'D'))) {
              throw new FailedPredicateException(
                  input, "switchOption", "input.LT(1).getText().charAt(0) == 'D'");
            }
            t = (Token) match(input, TEXT, FOLLOW_TEXT_in_switchOption235);
            stream_TEXT.add(t);

            char_literal7 = (Token) match(input, 8, FOLLOW_8_in_switchOption237);
            stream_8.add(char_literal7);

            pushFollow(FOLLOW_eText_in_switchOption239);
            eText8 = eText();

            state._fsp--;

            stream_eText.add(eText8.getTree());

            // AST REWRITE
            // elements:
            // token labels:
            // rule labels: retval
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval =
                new RewriteRuleSubtreeStream(
                    adaptor, "rule retval", retval != null ? retval.tree : null);

            root_0 = (CommonTree) adaptor.nil();
            // 268:67: ->
            {
              adaptor.addChild(
                  root_0,
                  new UserPropertyNode(
                      t,
                      (eText8 != null ? input.toString(eText8.start, eText8.stop) : null),
                      (t != null ? t.getCharPositionInLine() : 0)));
            }

            retval.tree = root_0;
          }
          break;
        case 7:
          // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:269:3: {...}? =>t= TEXT
          {
            if (!((isParamOption(input.LT(1).getText())))) {
              throw new FailedPredicateException(
                  input, "switchOption", "isParamOption(input.LT(1).getText())");
            }
            t = (Token) match(input, TEXT, FOLLOW_TEXT_in_switchOption257);
            stream_TEXT.add(t);

            index = t.getText().indexOf(':');
            if (index > 0) {
              name = t.getText().substring(0, index);
              value = (index + 1) == t.getText().length() ? "" : t.getText().substring(index + 1);
            }

            // AST REWRITE
            // elements:
            // token labels:
            // rule labels: retval
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval =
                new RewriteRuleSubtreeStream(
                    adaptor, "rule retval", retval != null ? retval.tree : null);

            root_0 = (CommonTree) adaptor.nil();
            // 269:227: ->
            {
              adaptor.addChild(root_0, new ParametrizedNode(t, name, ":", value));
            }

            retval.tree = root_0;
          }
          break;
        case 8:
          // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:270:3: {...}? =>t= TEXT
          {
            if (!((memOptions.matcher(input.LT(1).getText()).matches()))) {
              throw new FailedPredicateException(
                  input, "switchOption", "memOptions.matcher(input.LT(1).getText()).matches()");
            }
            t = (Token) match(input, TEXT, FOLLOW_TEXT_in_switchOption274);
            stream_TEXT.add(t);

            // AST REWRITE
            // elements:
            // token labels:
            // rule labels: retval
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval =
                new RewriteRuleSubtreeStream(
                    adaptor, "rule retval", retval != null ? retval.tree : null);

            root_0 = (CommonTree) adaptor.nil();
            // 270:69: ->
            {
              adaptor.addChild(root_0, new ParametrizedNode(t, 3));
            }

            retval.tree = root_0;
          }
          break;
        case 9:
          // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:271:3: {...}? =>t= TEXT WS eText
          {
            if (!((CLASSPATH.equals(input.LT(1).getText())
                || CLASSPATH_LONG.equals(input.LT(1).getText())))) {
              throw new FailedPredicateException(
                  input,
                  "switchOption",
                  "CLASSPATH.equals(input.LT(1).getText()) || CLASSPATH_LONG.equals(input.LT(1).getText())");
            }
            t = (Token) match(input, TEXT, FOLLOW_TEXT_in_switchOption291);
            stream_TEXT.add(t);

            WS9 = (Token) match(input, WS, FOLLOW_WS_in_switchOption293);
            stream_WS.add(WS9);

            pushFollow(FOLLOW_eText_in_switchOption295);
            eText10 = eText();

            state._fsp--;

            stream_eText.add(eText10.getTree());

            // AST REWRITE
            // elements:
            // token labels:
            // rule labels: retval
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval =
                new RewriteRuleSubtreeStream(
                    adaptor, "rule retval", retval != null ? retval.tree : null);

            root_0 = (CommonTree) adaptor.nil();
            // 271:112: ->
            {
              adaptor.addChild(
                  root_0,
                  new ParametrizedNode(
                      t,
                      " ",
                      (eText10 != null ? input.toString(eText10.start, eText10.stop) : null),
                      false));
            }

            retval.tree = root_0;
          }
          break;
        case 10:
          // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:272:3: t= TEXT
          {
            t = (Token) match(input, TEXT, FOLLOW_TEXT_in_switchOption307);
            stream_TEXT.add(t);

            // AST REWRITE
            // elements:
            // token labels:
            // rule labels: retval
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval =
                new RewriteRuleSubtreeStream(
                    adaptor, "rule retval", retval != null ? retval.tree : null);

            root_0 = (CommonTree) adaptor.nil();
            // 272:10: ->
            {
              adaptor.addChild(root_0, new UnrecognizedOption(t));
            }

            retval.tree = root_0;
          }
          break;
      }
      retval.stop = input.LT(-1);

      retval.tree = (CommonTree) adaptor.rulePostProcessing(root_0);
      adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

    } catch (RecognitionException re) {
      reportError(re);
      recover(input, re);
      retval.tree = (CommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);

    } finally {
    }
    return retval;
  }
  // $ANTLR start "option"
  // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:254:1: option : ( '-' switchOption -> switchOption | nonSwitchOption -> nonSwitchOption );
  public final CommandLineParser.option_return option() throws RecognitionException {
    CommandLineParser.option_return retval = new CommandLineParser.option_return();
    retval.start = input.LT(1);

    CommonTree root_0 = null;

    Token char_literal4 = null;
    CommandLineParser.switchOption_return switchOption5 = null;

    CommandLineParser.nonSwitchOption_return nonSwitchOption6 = null;

    CommonTree char_literal4_tree = null;
    RewriteRuleTokenStream stream_7 = new RewriteRuleTokenStream(adaptor, "token 7");
    RewriteRuleSubtreeStream stream_switchOption =
        new RewriteRuleSubtreeStream(adaptor, "rule switchOption");
    RewriteRuleSubtreeStream stream_nonSwitchOption =
        new RewriteRuleSubtreeStream(adaptor, "rule nonSwitchOption");
    try {
      // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:254:8: ( '-' switchOption -> switchOption | nonSwitchOption -> nonSwitchOption )
      int alt4 = 2;
      int LA4_0 = input.LA(1);

      if ((LA4_0 == 7)) {
        alt4 = 1;
      } else if ((LA4_0 == TEXT)) {
        alt4 = 2;
      } else {
        NoViableAltException nvae = new NoViableAltException("", 4, 0, input);

        throw nvae;
      }
      switch (alt4) {
        case 1:
          // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:254:10: '-' switchOption
          {
            char_literal4 = (Token) match(input, 7, FOLLOW_7_in_option95);
            stream_7.add(char_literal4);

            pushFollow(FOLLOW_switchOption_in_option97);
            switchOption5 = switchOption();

            state._fsp--;

            stream_switchOption.add(switchOption5.getTree());

            // AST REWRITE
            // elements: switchOption
            // token labels:
            // rule labels: retval
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval =
                new RewriteRuleSubtreeStream(
                    adaptor, "rule retval", retval != null ? retval.tree : null);

            root_0 = (CommonTree) adaptor.nil();
            // 254:27: -> switchOption
            {
              adaptor.addChild(root_0, stream_switchOption.nextTree());
            }

            retval.tree = root_0;
          }
          break;
        case 2:
          // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:255:3: nonSwitchOption
          {
            pushFollow(FOLLOW_nonSwitchOption_in_option107);
            nonSwitchOption6 = nonSwitchOption();

            state._fsp--;

            stream_nonSwitchOption.add(nonSwitchOption6.getTree());

            // AST REWRITE
            // elements: nonSwitchOption
            // token labels:
            // rule labels: retval
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval =
                new RewriteRuleSubtreeStream(
                    adaptor, "rule retval", retval != null ? retval.tree : null);

            root_0 = (CommonTree) adaptor.nil();
            // 255:20: -> nonSwitchOption
            {
              adaptor.addChild(root_0, stream_nonSwitchOption.nextTree());
            }

            retval.tree = root_0;
          }
          break;
      }
      retval.stop = input.LT(-1);

      retval.tree = (CommonTree) adaptor.rulePostProcessing(root_0);
      adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

    } catch (RecognitionException re) {
      reportError(re);
      recover(input, re);
      retval.tree = (CommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);

    } finally {
    }
    return retval;
  }
  // $ANTLR start "vmOptions"
  // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:251:1: vmOptions : ( ( WS )? option )* ( WS )? -> ( option )* ;
  public final CommandLineParser.vmOptions_return vmOptions() throws RecognitionException {
    CommandLineParser.vmOptions_return retval = new CommandLineParser.vmOptions_return();
    retval.start = input.LT(1);

    CommonTree root_0 = null;

    Token WS1 = null;
    Token WS3 = null;
    CommandLineParser.option_return option2 = null;

    CommonTree WS1_tree = null;
    CommonTree WS3_tree = null;
    RewriteRuleTokenStream stream_WS = new RewriteRuleTokenStream(adaptor, "token WS");
    RewriteRuleSubtreeStream stream_option = new RewriteRuleSubtreeStream(adaptor, "rule option");
    try {
      // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:252:2: ( ( ( WS )? option )* ( WS )? -> ( option )* )
      // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:252:4: ( ( WS )? option )* ( WS )?
      {
        // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:252:4: ( ( WS )? option )*
        loop2:
        do {
          int alt2 = 2;
          int LA2_0 = input.LA(1);

          if ((LA2_0 == WS)) {
            int LA2_1 = input.LA(2);

            if ((LA2_1 == TEXT || LA2_1 == 7)) {
              alt2 = 1;
            }

          } else if ((LA2_0 == TEXT || LA2_0 == 7)) {
            alt2 = 1;
          }

          switch (alt2) {
            case 1:
              // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:252:5: ( WS )? option
              {
                // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:252:5: ( WS )?
                int alt1 = 2;
                int LA1_0 = input.LA(1);

                if ((LA1_0 == WS)) {
                  alt1 = 1;
                }
                switch (alt1) {
                  case 1:
                    // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:252:5: WS
                    {
                      WS1 = (Token) match(input, WS, FOLLOW_WS_in_vmOptions75);
                      stream_WS.add(WS1);
                    }
                    break;
                }

                pushFollow(FOLLOW_option_in_vmOptions77);
                option2 = option();

                state._fsp--;

                stream_option.add(option2.getTree());
              }
              break;

            default:
              break loop2;
          }
        } while (true);

        // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:252:16: ( WS )?
        int alt3 = 2;
        int LA3_0 = input.LA(1);

        if ((LA3_0 == WS)) {
          alt3 = 1;
        }
        switch (alt3) {
          case 1:
            // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:252:16: WS
            {
              WS3 = (Token) match(input, WS, FOLLOW_WS_in_vmOptions80);
              stream_WS.add(WS3);
            }
            break;
        }

        // AST REWRITE
        // elements: option
        // token labels:
        // rule labels: retval
        // token list labels:
        // rule list labels:
        // wildcard labels:
        retval.tree = root_0;
        RewriteRuleSubtreeStream stream_retval =
            new RewriteRuleSubtreeStream(
                adaptor, "rule retval", retval != null ? retval.tree : null);

        root_0 = (CommonTree) adaptor.nil();
        // 252:20: -> ( option )*
        {
          // /Users/tom/Projects/netbeans/jet-main/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/vmo/gen/CommandLine.g:252:23: ( option )*
          while (stream_option.hasNext()) {
            adaptor.addChild(root_0, stream_option.nextTree());
          }
          stream_option.reset();
        }

        retval.tree = root_0;
      }

      retval.stop = input.LT(-1);

      retval.tree = (CommonTree) adaptor.rulePostProcessing(root_0);
      adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

    } catch (RecognitionException re) {
      reportError(re);
      recover(input, re);
      retval.tree = (CommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);

    } finally {
    }
    return retval;
  }
  // $ANTLR start "named_argument"
  // AnnotationParser.g:112:1: named_argument : param= STRING ASIG rhtype -> ^( NAMED_ARG $param
  // rhtype ) ;
  public final AnnotationParser.named_argument_return named_argument() throws RecognitionException {
    AnnotationParser.named_argument_return retval = new AnnotationParser.named_argument_return();
    retval.start = input.LT(1);

    AnnotationCommonTree root_0 = null;

    CommonToken param = null;
    CommonToken ASIG16 = null;
    AnnotationParser.rhtype_return rhtype17 = null;

    AnnotationCommonTree param_tree = null;
    AnnotationCommonTree ASIG16_tree = null;
    RewriteRuleTokenStream stream_ASIG = new RewriteRuleTokenStream(adaptor, "token ASIG");
    RewriteRuleTokenStream stream_STRING = new RewriteRuleTokenStream(adaptor, "token STRING");
    RewriteRuleSubtreeStream stream_rhtype = new RewriteRuleSubtreeStream(adaptor, "rule rhtype");
    try {
      // AnnotationParser.g:113:3: (param= STRING ASIG rhtype -> ^( NAMED_ARG $param rhtype ) )
      // AnnotationParser.g:113:5: param= STRING ASIG rhtype
      {
        param = (CommonToken) match(input, STRING, FOLLOW_STRING_in_named_argument310);
        stream_STRING.add(param);

        ASIG16 = (CommonToken) match(input, ASIG, FOLLOW_ASIG_in_named_argument312);
        stream_ASIG.add(ASIG16);

        pushFollow(FOLLOW_rhtype_in_named_argument314);
        rhtype17 = rhtype();

        state._fsp--;

        stream_rhtype.add(rhtype17.getTree());

        // AST REWRITE
        // elements: rhtype, param
        // token labels: param
        // rule labels: retval
        // token list labels:
        // rule list labels:
        // wildcard labels:
        retval.tree = root_0;
        RewriteRuleTokenStream stream_param =
            new RewriteRuleTokenStream(adaptor, "token param", param);
        RewriteRuleSubtreeStream stream_retval =
            new RewriteRuleSubtreeStream(
                adaptor, "rule retval", retval != null ? retval.tree : null);

        root_0 = (AnnotationCommonTree) adaptor.nil();
        // 114:5: -> ^( NAMED_ARG $param rhtype )
        {
          // AnnotationParser.g:114:8: ^( NAMED_ARG $param rhtype )
          {
            AnnotationCommonTree root_1 = (AnnotationCommonTree) adaptor.nil();
            root_1 =
                (AnnotationCommonTree)
                    adaptor.becomeRoot(
                        (AnnotationCommonTree) adaptor.create(NAMED_ARG, "NAMED_ARG"), root_1);

            adaptor.addChild(root_1, stream_param.nextNode());
            adaptor.addChild(root_1, stream_rhtype.nextTree());

            adaptor.addChild(root_0, root_1);
          }
        }

        retval.tree = root_0;
      }

      retval.stop = input.LT(-1);

      retval.tree = (AnnotationCommonTree) adaptor.rulePostProcessing(root_0);
      adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

    } catch (RecognitionException re) {
      reportError(re);
      recover(input, re);
      retval.tree = (AnnotationCommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);

    } finally {
    }
    return retval;
  }
  // $ANTLR start "literal_argument"
  // AnnotationParser.g:107:1: literal_argument : param= STRING_LITERAL -> ^( LITERAL_ARG $param) ;
  public final AnnotationParser.literal_argument_return literal_argument()
      throws RecognitionException {
    AnnotationParser.literal_argument_return retval =
        new AnnotationParser.literal_argument_return();
    retval.start = input.LT(1);

    AnnotationCommonTree root_0 = null;

    CommonToken param = null;

    AnnotationCommonTree param_tree = null;
    RewriteRuleTokenStream stream_STRING_LITERAL =
        new RewriteRuleTokenStream(adaptor, "token STRING_LITERAL");

    try {
      // AnnotationParser.g:108:3: (param= STRING_LITERAL -> ^( LITERAL_ARG $param) )
      // AnnotationParser.g:108:5: param= STRING_LITERAL
      {
        param =
            (CommonToken)
                match(input, STRING_LITERAL, FOLLOW_STRING_LITERAL_in_literal_argument282);
        stream_STRING_LITERAL.add(param);

        // AST REWRITE
        // elements: param
        // token labels: param
        // rule labels: retval
        // token list labels:
        // rule list labels:
        // wildcard labels:
        retval.tree = root_0;
        RewriteRuleTokenStream stream_param =
            new RewriteRuleTokenStream(adaptor, "token param", param);
        RewriteRuleSubtreeStream stream_retval =
            new RewriteRuleSubtreeStream(
                adaptor, "rule retval", retval != null ? retval.tree : null);

        root_0 = (AnnotationCommonTree) adaptor.nil();
        // 109:5: -> ^( LITERAL_ARG $param)
        {
          // AnnotationParser.g:109:8: ^( LITERAL_ARG $param)
          {
            AnnotationCommonTree root_1 = (AnnotationCommonTree) adaptor.nil();
            root_1 =
                (AnnotationCommonTree)
                    adaptor.becomeRoot(
                        (AnnotationCommonTree) adaptor.create(LITERAL_ARG, "LITERAL_ARG"), root_1);

            adaptor.addChild(root_1, stream_param.nextNode());

            adaptor.addChild(root_0, root_1);
          }
        }

        retval.tree = root_0;
      }

      retval.stop = input.LT(-1);

      retval.tree = (AnnotationCommonTree) adaptor.rulePostProcessing(root_0);
      adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

    } catch (RecognitionException re) {
      reportError(re);
      recover(input, re);
      retval.tree = (AnnotationCommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);

    } finally {
    }
    return retval;
  }
  // $ANTLR start "arguments"
  // AnnotationParser.g:97:1: arguments : argument ( COMMA arguments )? -> argument ( arguments )? ;
  public final AnnotationParser.arguments_return arguments() throws RecognitionException {
    AnnotationParser.arguments_return retval = new AnnotationParser.arguments_return();
    retval.start = input.LT(1);

    AnnotationCommonTree root_0 = null;

    CommonToken COMMA11 = null;
    AnnotationParser.argument_return argument10 = null;

    AnnotationParser.arguments_return arguments12 = null;

    AnnotationCommonTree COMMA11_tree = null;
    RewriteRuleTokenStream stream_COMMA = new RewriteRuleTokenStream(adaptor, "token COMMA");
    RewriteRuleSubtreeStream stream_argument =
        new RewriteRuleSubtreeStream(adaptor, "rule argument");
    RewriteRuleSubtreeStream stream_arguments =
        new RewriteRuleSubtreeStream(adaptor, "rule arguments");
    try {
      // AnnotationParser.g:98:3: ( argument ( COMMA arguments )? -> argument ( arguments )? )
      // AnnotationParser.g:98:5: argument ( COMMA arguments )?
      {
        pushFollow(FOLLOW_argument_in_arguments230);
        argument10 = argument();

        state._fsp--;

        stream_argument.add(argument10.getTree());
        // AnnotationParser.g:98:15: ( COMMA arguments )?
        int alt4 = 2;
        int LA4_0 = input.LA(1);

        if ((LA4_0 == COMMA)) {
          alt4 = 1;
        }
        switch (alt4) {
          case 1:
            // AnnotationParser.g:98:16: COMMA arguments
            {
              COMMA11 = (CommonToken) match(input, COMMA, FOLLOW_COMMA_in_arguments234);
              stream_COMMA.add(COMMA11);

              pushFollow(FOLLOW_arguments_in_arguments236);
              arguments12 = arguments();

              state._fsp--;

              stream_arguments.add(arguments12.getTree());
            }
            break;
        }

        // AST REWRITE
        // elements: arguments, argument
        // token labels:
        // rule labels: retval
        // token list labels:
        // rule list labels:
        // wildcard labels:
        retval.tree = root_0;
        RewriteRuleSubtreeStream stream_retval =
            new RewriteRuleSubtreeStream(
                adaptor, "rule retval", retval != null ? retval.tree : null);

        root_0 = (AnnotationCommonTree) adaptor.nil();
        // 99:5: -> argument ( arguments )?
        {
          adaptor.addChild(root_0, stream_argument.nextTree());
          // AnnotationParser.g:99:17: ( arguments )?
          if (stream_arguments.hasNext()) {
            adaptor.addChild(root_0, stream_arguments.nextTree());
          }
          stream_arguments.reset();
        }

        retval.tree = root_0;
      }

      retval.stop = input.LT(-1);

      retval.tree = (AnnotationCommonTree) adaptor.rulePostProcessing(root_0);
      adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

    } catch (RecognitionException re) {
      reportError(re);
      recover(input, re);
      retval.tree = (AnnotationCommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);

    } finally {
    }
    return retval;
  }
  // $ANTLR start "classname"
  // AnnotationParser.g:92:1: classname : cn= STRING -> ^( CLASSNAME $cn) ;
  public final AnnotationParser.classname_return classname() throws RecognitionException {
    AnnotationParser.classname_return retval = new AnnotationParser.classname_return();
    retval.start = input.LT(1);

    AnnotationCommonTree root_0 = null;

    CommonToken cn = null;

    AnnotationCommonTree cn_tree = null;
    RewriteRuleTokenStream stream_STRING = new RewriteRuleTokenStream(adaptor, "token STRING");

    try {
      // AnnotationParser.g:93:3: (cn= STRING -> ^( CLASSNAME $cn) )
      // AnnotationParser.g:93:5: cn= STRING
      {
        cn = (CommonToken) match(input, STRING, FOLLOW_STRING_in_classname205);
        stream_STRING.add(cn);

        // AST REWRITE
        // elements: cn
        // token labels: cn
        // rule labels: retval
        // token list labels:
        // rule list labels:
        // wildcard labels:
        retval.tree = root_0;
        RewriteRuleTokenStream stream_cn = new RewriteRuleTokenStream(adaptor, "token cn", cn);
        RewriteRuleSubtreeStream stream_retval =
            new RewriteRuleSubtreeStream(
                adaptor, "rule retval", retval != null ? retval.tree : null);

        root_0 = (AnnotationCommonTree) adaptor.nil();
        // 94:5: -> ^( CLASSNAME $cn)
        {
          // AnnotationParser.g:94:7: ^( CLASSNAME $cn)
          {
            AnnotationCommonTree root_1 = (AnnotationCommonTree) adaptor.nil();
            root_1 =
                (AnnotationCommonTree)
                    adaptor.becomeRoot(
                        (AnnotationCommonTree) adaptor.create(CLASSNAME, "CLASSNAME"), root_1);

            adaptor.addChild(root_1, stream_cn.nextNode());

            adaptor.addChild(root_0, root_1);
          }
        }

        retval.tree = root_0;
      }

      retval.stop = input.LT(-1);

      retval.tree = (AnnotationCommonTree) adaptor.rulePostProcessing(root_0);
      adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

    } catch (RecognitionException re) {
      reportError(re);
      recover(input, re);
      retval.tree = (AnnotationCommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);

    } finally {
    }
    return retval;
  }
  // $ANTLR start "namespace"
  // AnnotationParser.g:87:1: namespace : ns= STRING BSLASH -> ^( NSPART $ns) ;
  public final AnnotationParser.namespace_return namespace() throws RecognitionException {
    AnnotationParser.namespace_return retval = new AnnotationParser.namespace_return();
    retval.start = input.LT(1);

    AnnotationCommonTree root_0 = null;

    CommonToken ns = null;
    CommonToken BSLASH9 = null;

    AnnotationCommonTree ns_tree = null;
    AnnotationCommonTree BSLASH9_tree = null;
    RewriteRuleTokenStream stream_BSLASH = new RewriteRuleTokenStream(adaptor, "token BSLASH");
    RewriteRuleTokenStream stream_STRING = new RewriteRuleTokenStream(adaptor, "token STRING");

    try {
      // AnnotationParser.g:88:3: (ns= STRING BSLASH -> ^( NSPART $ns) )
      // AnnotationParser.g:88:5: ns= STRING BSLASH
      {
        ns = (CommonToken) match(input, STRING, FOLLOW_STRING_in_namespace175);
        stream_STRING.add(ns);

        BSLASH9 = (CommonToken) match(input, BSLASH, FOLLOW_BSLASH_in_namespace177);
        stream_BSLASH.add(BSLASH9);

        // AST REWRITE
        // elements: ns
        // token labels: ns
        // rule labels: retval
        // token list labels:
        // rule list labels:
        // wildcard labels:
        retval.tree = root_0;
        RewriteRuleTokenStream stream_ns = new RewriteRuleTokenStream(adaptor, "token ns", ns);
        RewriteRuleSubtreeStream stream_retval =
            new RewriteRuleSubtreeStream(
                adaptor, "rule retval", retval != null ? retval.tree : null);

        root_0 = (AnnotationCommonTree) adaptor.nil();
        // 89:4: -> ^( NSPART $ns)
        {
          // AnnotationParser.g:89:6: ^( NSPART $ns)
          {
            AnnotationCommonTree root_1 = (AnnotationCommonTree) adaptor.nil();
            root_1 =
                (AnnotationCommonTree)
                    adaptor.becomeRoot(
                        (AnnotationCommonTree) adaptor.create(NSPART, "NSPART"), root_1);

            adaptor.addChild(root_1, stream_ns.nextNode());

            adaptor.addChild(root_0, root_1);
          }
        }

        retval.tree = root_0;
      }

      retval.stop = input.LT(-1);

      retval.tree = (AnnotationCommonTree) adaptor.rulePostProcessing(root_0);
      adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

    } catch (RecognitionException re) {
      reportError(re);
      recover(input, re);
      retval.tree = (AnnotationCommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);

    } finally {
    }
    return retval;
  }
  // $ANTLR start "argument_list"
  // AnnotationParser.g:78:1: argument_list : ( PARAM_START ( arguments )? PARAM_END )? -> ^(
  // ARGUMENT_LIST ( arguments )? ) ;
  public final AnnotationParser.argument_list_return argument_list() throws RecognitionException {
    AnnotationParser.argument_list_return retval = new AnnotationParser.argument_list_return();
    retval.start = input.LT(1);

    AnnotationCommonTree root_0 = null;

    CommonToken PARAM_START4 = null;
    CommonToken PARAM_END6 = null;
    AnnotationParser.arguments_return arguments5 = null;

    AnnotationCommonTree PARAM_START4_tree = null;
    AnnotationCommonTree PARAM_END6_tree = null;
    RewriteRuleTokenStream stream_PARAM_START =
        new RewriteRuleTokenStream(adaptor, "token PARAM_START");
    RewriteRuleTokenStream stream_PARAM_END =
        new RewriteRuleTokenStream(adaptor, "token PARAM_END");
    RewriteRuleSubtreeStream stream_arguments =
        new RewriteRuleSubtreeStream(adaptor, "rule arguments");
    try {
      // AnnotationParser.g:79:3: ( ( PARAM_START ( arguments )? PARAM_END )? -> ^( ARGUMENT_LIST (
      // arguments )? ) )
      // AnnotationParser.g:79:5: ( PARAM_START ( arguments )? PARAM_END )?
      {
        // AnnotationParser.g:79:5: ( PARAM_START ( arguments )? PARAM_END )?
        int alt2 = 2;
        int LA2_0 = input.LA(1);

        if ((LA2_0 == PARAM_START)) {
          alt2 = 1;
        }
        switch (alt2) {
          case 1:
            // AnnotationParser.g:79:6: PARAM_START ( arguments )? PARAM_END
            {
              PARAM_START4 =
                  (CommonToken) match(input, PARAM_START, FOLLOW_PARAM_START_in_argument_list122);
              stream_PARAM_START.add(PARAM_START4);

              // AnnotationParser.g:79:18: ( arguments )?
              int alt1 = 2;
              int LA1_0 = input.LA(1);

              if ((LA1_0 == JSON_START || LA1_0 == STRING || LA1_0 == STRING_LITERAL)) {
                alt1 = 1;
              }
              switch (alt1) {
                case 1:
                  // AnnotationParser.g:79:18: arguments
                  {
                    pushFollow(FOLLOW_arguments_in_argument_list124);
                    arguments5 = arguments();

                    state._fsp--;

                    stream_arguments.add(arguments5.getTree());
                  }
                  break;
              }

              PARAM_END6 =
                  (CommonToken) match(input, PARAM_END, FOLLOW_PARAM_END_in_argument_list127);
              stream_PARAM_END.add(PARAM_END6);
            }
            break;
        }

        // AST REWRITE
        // elements: arguments
        // token labels:
        // rule labels: retval
        // token list labels:
        // rule list labels:
        // wildcard labels:
        retval.tree = root_0;
        RewriteRuleSubtreeStream stream_retval =
            new RewriteRuleSubtreeStream(
                adaptor, "rule retval", retval != null ? retval.tree : null);

        root_0 = (AnnotationCommonTree) adaptor.nil();
        // 80:5: -> ^( ARGUMENT_LIST ( arguments )? )
        {
          // AnnotationParser.g:80:8: ^( ARGUMENT_LIST ( arguments )? )
          {
            AnnotationCommonTree root_1 = (AnnotationCommonTree) adaptor.nil();
            root_1 =
                (AnnotationCommonTree)
                    adaptor.becomeRoot(
                        (AnnotationCommonTree) adaptor.create(ARGUMENT_LIST, "ARGUMENT_LIST"),
                        root_1);

            // AnnotationParser.g:80:24: ( arguments )?
            if (stream_arguments.hasNext()) {
              adaptor.addChild(root_1, stream_arguments.nextTree());
            }
            stream_arguments.reset();

            adaptor.addChild(root_0, root_1);
          }
        }

        retval.tree = root_0;
      }

      retval.stop = input.LT(-1);

      retval.tree = (AnnotationCommonTree) adaptor.rulePostProcessing(root_0);
      adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

    } catch (RecognitionException re) {
      reportError(re);
      recover(input, re);
      retval.tree = (AnnotationCommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);

    } finally {
    }
    return retval;
  }
  // $ANTLR start "annotation"
  // AnnotationParser.g:72:1: annotation : AT ann_class argument_list -> ^( ANNOTATION ann_class
  // argument_list ) ;
  public final AnnotationParser.annotation_return annotation() throws RecognitionException {
    AnnotationParser.annotation_return retval = new AnnotationParser.annotation_return();
    retval.start = input.LT(1);

    AnnotationCommonTree root_0 = null;

    CommonToken AT1 = null;
    AnnotationParser.ann_class_return ann_class2 = null;

    AnnotationParser.argument_list_return argument_list3 = null;

    AnnotationCommonTree AT1_tree = null;
    RewriteRuleTokenStream stream_AT = new RewriteRuleTokenStream(adaptor, "token AT");
    RewriteRuleSubtreeStream stream_argument_list =
        new RewriteRuleSubtreeStream(adaptor, "rule argument_list");
    RewriteRuleSubtreeStream stream_ann_class =
        new RewriteRuleSubtreeStream(adaptor, "rule ann_class");
    try {
      // AnnotationParser.g:73:3: ( AT ann_class argument_list -> ^( ANNOTATION ann_class
      // argument_list ) )
      // AnnotationParser.g:73:5: AT ann_class argument_list
      {
        AT1 = (CommonToken) match(input, AT, FOLLOW_AT_in_annotation90);
        stream_AT.add(AT1);

        pushFollow(FOLLOW_ann_class_in_annotation92);
        ann_class2 = ann_class();

        state._fsp--;

        stream_ann_class.add(ann_class2.getTree());
        pushFollow(FOLLOW_argument_list_in_annotation94);
        argument_list3 = argument_list();

        state._fsp--;

        stream_argument_list.add(argument_list3.getTree());

        // AST REWRITE
        // elements: argument_list, ann_class
        // token labels:
        // rule labels: retval
        // token list labels:
        // rule list labels:
        // wildcard labels:
        retval.tree = root_0;
        RewriteRuleSubtreeStream stream_retval =
            new RewriteRuleSubtreeStream(
                adaptor, "rule retval", retval != null ? retval.tree : null);

        root_0 = (AnnotationCommonTree) adaptor.nil();
        // 74:5: -> ^( ANNOTATION ann_class argument_list )
        {
          // AnnotationParser.g:74:7: ^( ANNOTATION ann_class argument_list )
          {
            AnnotationCommonTree root_1 = (AnnotationCommonTree) adaptor.nil();
            root_1 =
                (AnnotationCommonTree)
                    adaptor.becomeRoot(
                        (AnnotationCommonTree) adaptor.create(ANNOTATION, "ANNOTATION"), root_1);

            adaptor.addChild(root_1, stream_ann_class.nextTree());
            adaptor.addChild(root_1, stream_argument_list.nextTree());

            adaptor.addChild(root_0, root_1);
          }
        }

        retval.tree = root_0;
      }

      retval.stop = input.LT(-1);

      retval.tree = (AnnotationCommonTree) adaptor.rulePostProcessing(root_0);
      adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

    } catch (RecognitionException re) {
      reportError(re);
      recover(input, re);
      retval.tree = (AnnotationCommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);

    } finally {
    }
    return retval;
  }
  // $ANTLR start "rhtype"
  // AnnotationParser.g:129:1: rhtype : (param= STRING -> ^( RHTYPE $param) | param= STRING_LITERAL
  // -> ^( RHTYPE $param) | json );
  public final AnnotationParser.rhtype_return rhtype() throws RecognitionException {
    AnnotationParser.rhtype_return retval = new AnnotationParser.rhtype_return();
    retval.start = input.LT(1);

    AnnotationCommonTree root_0 = null;

    CommonToken param = null;
    AnnotationParser.json_return json27 = null;

    AnnotationCommonTree param_tree = null;
    RewriteRuleTokenStream stream_STRING_LITERAL =
        new RewriteRuleTokenStream(adaptor, "token STRING_LITERAL");
    RewriteRuleTokenStream stream_STRING = new RewriteRuleTokenStream(adaptor, "token STRING");

    try {
      // AnnotationParser.g:130:3: (param= STRING -> ^( RHTYPE $param) | param= STRING_LITERAL -> ^(
      // RHTYPE $param) | json )
      int alt8 = 3;
      switch (input.LA(1)) {
        case STRING:
          {
            alt8 = 1;
          }
          break;
        case STRING_LITERAL:
          {
            alt8 = 2;
          }
          break;
        case JSON_START:
          {
            alt8 = 3;
          }
          break;
        default:
          NoViableAltException nvae = new NoViableAltException("", 8, 0, input);

          throw nvae;
      }

      switch (alt8) {
        case 1:
          // AnnotationParser.g:130:5: param= STRING
          {
            param = (CommonToken) match(input, STRING, FOLLOW_STRING_in_rhtype411);
            stream_STRING.add(param);

            // AST REWRITE
            // elements: param
            // token labels: param
            // rule labels: retval
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleTokenStream stream_param =
                new RewriteRuleTokenStream(adaptor, "token param", param);
            RewriteRuleSubtreeStream stream_retval =
                new RewriteRuleSubtreeStream(
                    adaptor, "rule retval", retval != null ? retval.tree : null);

            root_0 = (AnnotationCommonTree) adaptor.nil();
            // 131:5: -> ^( RHTYPE $param)
            {
              // AnnotationParser.g:131:8: ^( RHTYPE $param)
              {
                AnnotationCommonTree root_1 = (AnnotationCommonTree) adaptor.nil();
                root_1 =
                    (AnnotationCommonTree)
                        adaptor.becomeRoot(
                            (AnnotationCommonTree) adaptor.create(RHTYPE, "RHTYPE"), root_1);

                adaptor.addChild(root_1, stream_param.nextNode());

                adaptor.addChild(root_0, root_1);
              }
            }

            retval.tree = root_0;
          }
          break;
        case 2:
          // AnnotationParser.g:132:5: param= STRING_LITERAL
          {
            param = (CommonToken) match(input, STRING_LITERAL, FOLLOW_STRING_LITERAL_in_rhtype432);
            stream_STRING_LITERAL.add(param);

            // AST REWRITE
            // elements: param
            // token labels: param
            // rule labels: retval
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleTokenStream stream_param =
                new RewriteRuleTokenStream(adaptor, "token param", param);
            RewriteRuleSubtreeStream stream_retval =
                new RewriteRuleSubtreeStream(
                    adaptor, "rule retval", retval != null ? retval.tree : null);

            root_0 = (AnnotationCommonTree) adaptor.nil();
            // 133:5: -> ^( RHTYPE $param)
            {
              // AnnotationParser.g:133:8: ^( RHTYPE $param)
              {
                AnnotationCommonTree root_1 = (AnnotationCommonTree) adaptor.nil();
                root_1 =
                    (AnnotationCommonTree)
                        adaptor.becomeRoot(
                            (AnnotationCommonTree) adaptor.create(RHTYPE, "RHTYPE"), root_1);

                adaptor.addChild(root_1, stream_param.nextNode());

                adaptor.addChild(root_0, root_1);
              }
            }

            retval.tree = root_0;
          }
          break;
        case 3:
          // AnnotationParser.g:134:5: json
          {
            root_0 = (AnnotationCommonTree) adaptor.nil();

            pushFollow(FOLLOW_json_in_rhtype451);
            json27 = json();

            state._fsp--;

            adaptor.addChild(root_0, json27.getTree());
          }
          break;
      }
      retval.stop = input.LT(-1);

      retval.tree = (AnnotationCommonTree) adaptor.rulePostProcessing(root_0);
      adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

    } catch (RecognitionException re) {
      reportError(re);
      recover(input, re);
      retval.tree = (AnnotationCommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);

    } finally {
    }
    return retval;
  }
Exemple #14
0
  // $ANTLR start "literal"
  // /home/jon/flume/src/antlr/FlumeShell.g:93:1: literal : ( DQuoteLiteral -> ^( DQUOTE
  // DQuoteLiteral ) | SQuoteLiteral -> ^( SQUOTE SQuoteLiteral ) | Argument -> ^( STRING Argument )
  // );
  public final FlumeShellParser.literal_return literal() throws RecognitionException {
    FlumeShellParser.literal_return retval = new FlumeShellParser.literal_return();
    retval.start = input.LT(1);

    Object root_0 = null;

    Token DQuoteLiteral8 = null;
    Token SQuoteLiteral9 = null;
    Token Argument10 = null;

    Object DQuoteLiteral8_tree = null;
    Object SQuoteLiteral9_tree = null;
    Object Argument10_tree = null;
    RewriteRuleTokenStream stream_Argument = new RewriteRuleTokenStream(adaptor, "token Argument");
    RewriteRuleTokenStream stream_DQuoteLiteral =
        new RewriteRuleTokenStream(adaptor, "token DQuoteLiteral");
    RewriteRuleTokenStream stream_SQuoteLiteral =
        new RewriteRuleTokenStream(adaptor, "token SQuoteLiteral");

    try {
      // /home/jon/flume/src/antlr/FlumeShell.g:94:5: ( DQuoteLiteral -> ^( DQUOTE DQuoteLiteral ) |
      // SQuoteLiteral -> ^( SQUOTE SQuoteLiteral ) | Argument -> ^( STRING Argument ) )
      int alt3 = 3;
      switch (input.LA(1)) {
        case DQuoteLiteral:
          {
            alt3 = 1;
          }
          break;
        case SQuoteLiteral:
          {
            alt3 = 2;
          }
          break;
        case Argument:
          {
            alt3 = 3;
          }
          break;
        default:
          NoViableAltException nvae = new NoViableAltException("", 3, 0, input);

          throw nvae;
      }

      switch (alt3) {
        case 1:
          // /home/jon/flume/src/antlr/FlumeShell.g:94:9: DQuoteLiteral
          {
            DQuoteLiteral8 =
                (Token) match(input, DQuoteLiteral, FOLLOW_DQuoteLiteral_in_literal150);
            stream_DQuoteLiteral.add(DQuoteLiteral8);

            // AST REWRITE
            // elements: DQuoteLiteral
            // token labels:
            // rule labels: retval
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval =
                new RewriteRuleSubtreeStream(
                    adaptor, "rule retval", retval != null ? retval.tree : null);

            root_0 = (Object) adaptor.nil();
            // 94:23: -> ^( DQUOTE DQuoteLiteral )
            {
              // /home/jon/flume/src/antlr/FlumeShell.g:94:26: ^( DQUOTE DQuoteLiteral )
              {
                Object root_1 = (Object) adaptor.nil();
                root_1 =
                    (Object) adaptor.becomeRoot((Object) adaptor.create(DQUOTE, "DQUOTE"), root_1);

                adaptor.addChild(root_1, stream_DQuoteLiteral.nextNode());

                adaptor.addChild(root_0, root_1);
              }
            }

            retval.tree = root_0;
          }
          break;
        case 2:
          // /home/jon/flume/src/antlr/FlumeShell.g:95:9: SQuoteLiteral
          {
            SQuoteLiteral9 =
                (Token) match(input, SQuoteLiteral, FOLLOW_SQuoteLiteral_in_literal170);
            stream_SQuoteLiteral.add(SQuoteLiteral9);

            // AST REWRITE
            // elements: SQuoteLiteral
            // token labels:
            // rule labels: retval
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval =
                new RewriteRuleSubtreeStream(
                    adaptor, "rule retval", retval != null ? retval.tree : null);

            root_0 = (Object) adaptor.nil();
            // 95:23: -> ^( SQUOTE SQuoteLiteral )
            {
              // /home/jon/flume/src/antlr/FlumeShell.g:95:26: ^( SQUOTE SQuoteLiteral )
              {
                Object root_1 = (Object) adaptor.nil();
                root_1 =
                    (Object) adaptor.becomeRoot((Object) adaptor.create(SQUOTE, "SQUOTE"), root_1);

                adaptor.addChild(root_1, stream_SQuoteLiteral.nextNode());

                adaptor.addChild(root_0, root_1);
              }
            }

            retval.tree = root_0;
          }
          break;
        case 3:
          // /home/jon/flume/src/antlr/FlumeShell.g:96:9: Argument
          {
            Argument10 = (Token) match(input, Argument, FOLLOW_Argument_in_literal188);
            stream_Argument.add(Argument10);

            // AST REWRITE
            // elements: Argument
            // token labels:
            // rule labels: retval
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval =
                new RewriteRuleSubtreeStream(
                    adaptor, "rule retval", retval != null ? retval.tree : null);

            root_0 = (Object) adaptor.nil();
            // 96:21: -> ^( STRING Argument )
            {
              // /home/jon/flume/src/antlr/FlumeShell.g:96:24: ^( STRING Argument )
              {
                Object root_1 = (Object) adaptor.nil();
                root_1 =
                    (Object) adaptor.becomeRoot((Object) adaptor.create(STRING, "STRING"), root_1);

                adaptor.addChild(root_1, stream_Argument.nextNode());

                adaptor.addChild(root_0, root_1);
              }
            }

            retval.tree = root_0;
          }
          break;
      }
      retval.stop = input.LT(-1);

      retval.tree = (Object) adaptor.rulePostProcessing(root_0);
      adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

    } catch (RecognitionException re) {
      reportError(re);
      recover(input, re);
      retval.tree = (Object) adaptor.errorNode(input, retval.start, input.LT(-1), re);

    } finally {
    }
    return retval;
  }
Exemple #15
0
  // $ANTLR start "lines"
  // /home/jon/flume/src/antlr/FlumeShell.g:86:1: lines : command ( ';' command )* EOF -> ( command
  // )+ ;
  public final FlumeShellParser.lines_return lines() throws RecognitionException {
    FlumeShellParser.lines_return retval = new FlumeShellParser.lines_return();
    retval.start = input.LT(1);

    Object root_0 = null;

    Token char_literal2 = null;
    Token EOF4 = null;
    FlumeShellParser.command_return command1 = null;

    FlumeShellParser.command_return command3 = null;

    Object char_literal2_tree = null;
    Object EOF4_tree = null;
    RewriteRuleTokenStream stream_19 = new RewriteRuleTokenStream(adaptor, "token 19");
    RewriteRuleTokenStream stream_EOF = new RewriteRuleTokenStream(adaptor, "token EOF");
    RewriteRuleSubtreeStream stream_command = new RewriteRuleSubtreeStream(adaptor, "rule command");
    try {
      // /home/jon/flume/src/antlr/FlumeShell.g:86:7: ( command ( ';' command )* EOF -> ( command )+
      // )
      // /home/jon/flume/src/antlr/FlumeShell.g:86:9: command ( ';' command )* EOF
      {
        pushFollow(FOLLOW_command_in_lines85);
        command1 = command();

        state._fsp--;

        stream_command.add(command1.getTree());
        // /home/jon/flume/src/antlr/FlumeShell.g:86:17: ( ';' command )*
        loop1:
        do {
          int alt1 = 2;
          int LA1_0 = input.LA(1);

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

          switch (alt1) {
            case 1:
              // /home/jon/flume/src/antlr/FlumeShell.g:86:18: ';' command
              {
                char_literal2 = (Token) match(input, 19, FOLLOW_19_in_lines88);
                stream_19.add(char_literal2);

                pushFollow(FOLLOW_command_in_lines90);
                command3 = command();

                state._fsp--;

                stream_command.add(command3.getTree());
              }
              break;

            default:
              break loop1;
          }
        } while (true);

        EOF4 = (Token) match(input, EOF, FOLLOW_EOF_in_lines94);
        stream_EOF.add(EOF4);

        // AST REWRITE
        // elements: command
        // token labels:
        // rule labels: retval
        // token list labels:
        // rule list labels:
        // wildcard labels:
        retval.tree = root_0;
        RewriteRuleSubtreeStream stream_retval =
            new RewriteRuleSubtreeStream(
                adaptor, "rule retval", retval != null ? retval.tree : null);

        root_0 = (Object) adaptor.nil();
        // 86:36: -> ( command )+
        {
          if (!(stream_command.hasNext())) {
            throw new RewriteEarlyExitException();
          }
          while (stream_command.hasNext()) {
            adaptor.addChild(root_0, stream_command.nextTree());
          }
          stream_command.reset();
        }

        retval.tree = root_0;
      }

      retval.stop = input.LT(-1);

      retval.tree = (Object) adaptor.rulePostProcessing(root_0);
      adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

    } catch (RecognitionException re) {
      reportError(re);
      recover(input, re);
      retval.tree = (Object) adaptor.errorNode(input, retval.start, input.LT(-1), re);

    } finally {
    }
    return retval;
  }