Package beaver.comp.io

Examples of beaver.comp.io.SrcReader


    }
    try
    {
      Options opts = parseOptions(args);
      File src_file = getSrcFile(args[args.length - 1]);
      SrcReader src_reader = new SrcReader(src_file);
     
      Log log = new Log();
      compile(src_reader, opts, log);
      boolean logHasErrors = log.hasErrors();
     
View Full Code Here


      throw new BuildException("Cannot read grammar file " + grammar_file);
   
    if (options.dest_dir != null && !options.dest_dir.isDirectory())
      throw new IllegalArgumentException (options.dest_dir.getPath() + " is not a directory.");
   
    SrcReader src = getSrcReader(grammar_file);
    try
    {
      if (existsCurrentOutput(getOutputFileName(src)))
        return;
    }
    catch (Exception e)
    {
      // Error(s) in source. Try to build anyway and compiler will print erorr reports.
    }
    src.reset();
    Log log = new Log();
    compile(src, options, log);
    log.report(grammar_file.getName(), src);
  }
View Full Code Here

 
  static private SrcReader getSrcReader(File file) throws BuildException
  {
    try
    {
      return new SrcReader(file);
    }
    catch (IOException e)
    {
      throw new BuildException("Failed to read grammar file " + file);
    }
View Full Code Here

    private FileCollection beaverClasspath;

    @TaskAction
    public void generate() throws IOException, Parser.Exception, Grammar.Exception {
        for (final File file : source.getFiles()) {
            final SrcReader srcReader = new SrcReader(file);
            final Options options = new Options();
            options.dest_dir = getOutputDirectory();
            ParserGenerator.compile(srcReader, options, new Log());
        }
    }
View Full Code Here

TOP

Related Classes of beaver.comp.io.SrcReader

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.