throw new FileNotFoundException("No script found in location [" + scriptLocation + "]");
}
CharStream st = new ANTLRInputStream(scriptInputStream, scriptEncoding);
RutaLexer lexer = new RutaLexer(st);
CommonTokenStream tokens = new CommonTokenStream(lexer);
RutaParser parser = new RutaParser(tokens);
parser.setExternalFactory(factory);
parser.setResourcePaths(resourcePaths);
String name = scriptLocation;
if (scriptLocation.indexOf("/") != -1) {
String[] split = scriptLocation.split("[/]");
name = split[split.length - 1];
}
int lastIndexOf = name.lastIndexOf(SCRIPT_FILE_EXTENSION);
if (lastIndexOf != -1) {
name = name.substring(0, lastIndexOf);
}
RutaModule script = parser.file_input(name);
return script;
}