Пример #1
0
  public void execute() throws BuildException {
    validateAttributes();

    // TODO: use ANTLR to parse the grammer file to do this.
    if (target.lastModified() > getGeneratedFile().lastModified()) {
      commandline.createArgument().setValue("-o");
      commandline.createArgument().setValue(outputDirectory.toString());
      commandline.createArgument().setValue(target.toString());

      if (fork) {
        log("Forking " + commandline.toString(), Project.MSG_VERBOSE);
        int err = run(commandline.getCommandline());
        if (err == 1) {
          throw new BuildException("ANTLR returned: " + err, location);
        }
      } else {
        Execute.runCommand(this, commandline.getCommandline());
      }
    }
  }
Пример #2
0
 public ANTLR() {
   commandline.setVm("java");
   commandline.setClassname("antlr.Tool");
 }