public static ScriptOrFnNode parseVariables(Context cx, Scriptable scope, String source, String sourceName, int lineno, Object securityDomain){ // Interpreter compiler = new Interpreter(); CompilerEnvirons evn = new CompilerEnvirons(); //evn.setLanguageVersion(Context.VERSION_1_5); evn.setOptimizationLevel(-1); evn.setGeneratingSource(true); evn.setGenerateDebugInfo(true); ErrorReporter errorReporter = new ToolErrorReporter(false); Parser p = new Parser(evn, errorReporter); ScriptOrFnNode tree = p.parse(source, "",0); // IOException new NodeTransformer().transform(tree); //Script result = (Script)compiler.compile(scope, evn, tree, p.getEncodedSource(),false, null); return tree; }
public static ScriptNode parseVariables(Context cx, Scriptable scope, String source, String sourceName, int lineno, Object securityDomain){ // Interpreter compiler = new Interpreter(); CompilerEnvirons evn = new CompilerEnvirons(); //evn.setLanguageVersion(Context.VERSION_1_5); evn.setOptimizationLevel(-1); evn.setGeneratingSource(true); evn.setGenerateDebugInfo(true); ErrorReporter errorReporter = new ToolErrorReporter(false); Parser p = new Parser(evn, errorReporter); ScriptNode tree = p.parse(source, "",0); // IOException new NodeTransformer().transform(tree); //Script result = (Script)compiler.compile(scope, evn, tree, p.getEncodedSource(),false, null); return tree; }
public static ScriptNode parseVariables(Context cx, Scriptable scope, String source, String sourceName, int lineno, Object securityDomain){ // Interpreter compiler = new Interpreter(); CompilerEnvirons evn = new CompilerEnvirons(); //evn.setLanguageVersion(Context.VERSION_1_5); evn.setOptimizationLevel(-1); evn.setGeneratingSource(true); evn.setGenerateDebugInfo(true); ErrorReporter errorReporter = new ToolErrorReporter(false); Parser p = new Parser(evn, errorReporter); ScriptNode tree = p.parse(source, "",0); // IOException new NodeTransformer().transform(tree); //GremlinScript result = (GremlinScript)compiler.compile(scope, evn, tree, p.getEncodedSource(),false, null); return tree; }
public static ScriptNode parseVariables( Context cx, Scriptable scope, String source, String sourceName, int lineno, Object securityDomain ) { // Interpreter compiler = new Interpreter(); CompilerEnvirons evn = new CompilerEnvirons(); // evn.setLanguageVersion(Context.VERSION_1_5); evn.setOptimizationLevel( -1 ); evn.setGeneratingSource( true ); evn.setGenerateDebugInfo( true ); ErrorReporter errorReporter = new ToolErrorReporter( false ); Parser p = new Parser( evn, errorReporter ); ScriptNode tree = p.parse( source, "", 0 ); // IOException new NodeTransformer().transform( tree ); // Script result = (Script)compiler.compile(scope, evn, tree, p.getEncodedSource(),false, null); return tree; }