public static ModuleDeclaration parseSourceModule(Reader in)
throws IOException
{
CompilerAstLexer lexer = new CompilerAstLexer(in);
TwigAstParser parser = new TwigAstParser(lexer);
// parser.setFileName(fileName);
try {
parser.parse();
} catch (Exception e) {
// TODO: add recovery
e.printStackTrace();
return new ModuleDeclaration(0);
}
return parser.getModuleDeclaration();
}