Examples of addGrammarFile()


Examples of org.antlr.Tool.addGrammarFile()

public class GenerateLexer {
 
  public static void main(String[] args) {
    final Tool tool = new Tool();
    URL resource = GenerateLexer.class.getResource("Common.g");
    tool.addGrammarFile(resource.getFile());
    String path = resource.getPath().replace(File.separator+"bin"+File.separator, File.separator+"/src/"+File.separator);
    path = path.substring(0, path.length()-"/Common.g".length());
    tool.setOutputDirectory(path);
    tool.process();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.