Search in sources :

Example 1 with ReaderInputStream

use of org.develnext.jphp.scripting.util.ReaderInputStream in project jphp by jphp-compiler.

the class JPHPScriptEngine method compile.

@Override
public CompiledScript compile(Reader reader) throws ScriptException {
    try {
        InputStream is = new ReaderInputStream(reader);
        Context context = new Context(is);
        ModuleEntity module = environment.importModule(context);
        return new JPHPCompiledScript(module, environment);
    } catch (IOException e) {
        throw new ScriptException(e);
    } catch (Throwable e) {
        throw new ScriptException(new Exception(e));
    }
}
Also used : Context(php.runtime.env.Context) ReaderInputStream(org.develnext.jphp.scripting.util.ReaderInputStream) ReaderInputStream(org.develnext.jphp.scripting.util.ReaderInputStream) ModuleEntity(php.runtime.reflection.ModuleEntity)

Aggregations

ReaderInputStream (org.develnext.jphp.scripting.util.ReaderInputStream)1 Context (php.runtime.env.Context)1 ModuleEntity (php.runtime.reflection.ModuleEntity)1