// $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 "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;
  }
Esempio n. 3
0
  // $ANTLR start "command"
  // /home/jon/flume/src/antlr/FlumeShell.g:90:1: command : ( literal )+ -> ^( CMD ( literal )+ ) ;
  public final FlumeShellParser.command_return command() throws RecognitionException {
    FlumeShellParser.command_return retval = new FlumeShellParser.command_return();
    retval.start = input.LT(1);

    Object root_0 = null;

    FlumeShellParser.literal_return literal7 = null;

    RewriteRuleSubtreeStream stream_literal = new RewriteRuleSubtreeStream(adaptor, "rule literal");
    try {
      // /home/jon/flume/src/antlr/FlumeShell.g:90:9: ( ( literal )+ -> ^( CMD ( literal )+ ) )
      // /home/jon/flume/src/antlr/FlumeShell.g:90:11: ( literal )+
      {
        // /home/jon/flume/src/antlr/FlumeShell.g:90:11: ( literal )+
        int cnt2 = 0;
        loop2:
        do {
          int alt2 = 2;
          int LA2_0 = input.LA(1);

          if (((LA2_0 >= DQuoteLiteral && LA2_0 <= Argument))) {
            alt2 = 1;
          }

          switch (alt2) {
            case 1:
              // /home/jon/flume/src/antlr/FlumeShell.g:90:11: literal
              {
                pushFollow(FOLLOW_literal_in_command122);
                literal7 = literal();

                state._fsp--;

                stream_literal.add(literal7.getTree());
              }
              break;

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

        // AST REWRITE
        // elements: literal
        // 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();
        // 90:20: -> ^( CMD ( literal )+ )
        {
          // /home/jon/flume/src/antlr/FlumeShell.g:90:23: ^( CMD ( literal )+ )
          {
            Object root_1 = (Object) adaptor.nil();
            root_1 = (Object) adaptor.becomeRoot((Object) adaptor.create(CMD, "CMD"), root_1);

            if (!(stream_literal.hasNext())) {
              throw new RewriteEarlyExitException();
            }
            while (stream_literal.hasNext()) {
              adaptor.addChild(root_1, stream_literal.nextTree());
            }
            stream_literal.reset();

            adaptor.addChild(root_0, root_1);
          }
        }

        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 "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;
  }
Esempio n. 5
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;
  }