Logo Search packages:      
Sourcecode: jasmin-sable version File versions  Download package

static void java_cup::Main::parse_grammar_spec (  )  throws java.lang.Exception [inline, static, protected]

Parse the grammar specification from standard input. This produces sets of terminal, non-terminals, and productions which can be accessed via static variables of the respective classes, as well as the setting of various variables (mostly in the emit class) for small user supplied items such as the code to scan with.

Definition at line 423 of file Main.java.

References java_cup::runtime::lr_parser::debug_parse(), opt_do_debug, and java_cup::runtime::lr_parser::parse().

Referenced by main().

    {
      parser parser_obj;

      /* create a parser and parse with it */
      parser_obj = new parser();
      try {
      if (opt_do_debug)
          parser_obj.debug_parse();
      else
          parser_obj.parse();
      } catch (Exception e)
      {
      /* something threw an exception.  catch it and emit a message so we 
         have a line number to work with, then re-throw it */
      lexer.emit_error("Internal error: Unexpected exception");
      throw e;
      }
    }


Generated by  Doxygen 1.6.0   Back to index