Ejemplo n.º 1
0
  protected void parse() throws EvaluatorException {
    // Parse script source
    CompilerEnvirons ce = new CompilerEnvirons();
    ScriptParserErrorReporter errorReporter = new ScriptParserErrorReporter();

    ce.setGenerateDebugInfo(true);
    ce.initFromContext(ContextFactory.getGlobal().enterContext());
    ce.setErrorReporter(errorReporter);

    Parser p = new Parser(ce, errorReporter);
    ScriptOrFnNode ast = p.parse(this.scriptSource, "script", 0);

    recursiveParse(ast);

    this.scriptParsed = true;
  }