Package beaver.spec.parser

Examples of beaver.spec.parser.GrammarScanner


    }
  }

  static public Grammar parseGrammar(SrcReader reader, Log log) throws IOException, Parser.Exception, Grammar.Exception
  {
    GrammarTreeRoot root = (GrammarTreeRoot) new GrammarParser(log).parse(new GrammarScanner(reader));
    if (log.hasErrors())
      throw new Grammar.Exception("cannot parse grammar");
    GrammarBuilder maker = new GrammarBuilder(log);
    root.accept(maker);
    return maker.getGrammar();
View Full Code Here


    if (dot_index > 0)
    {
      output_file_name = output_file_name.substring(0, dot_index);
    }

    GrammarScanner scanner = new GrammarScanner(src);
    for (Symbol sym = scanner.nextToken(); sym.getId() != Terminals.EOF; sym = scanner.nextToken())
    {
      if (sym.getId() == Terminals.CLASS)
      {
        if ((sym = scanner.nextToken()).getId() == Terminals.TEXT)
        {
          String class_name = (String) sym.value;
          if (class_name != null && (class_name = class_name.trim()).length() > 0)
          {
            return class_name;
View Full Code Here

TOP

Related Classes of beaver.spec.parser.GrammarScanner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.