Map<String, Object> options) {
String contents = getFileContents(stream);
LapgTree<AstRoot> tree = LapgTree.parse(new TextSource(sourceName, contents.toCharArray(), 1));
Grammar result = null;
if (!tree.hasErrors()) {
result = new LapgResolver(tree, options).resolve();
}
if (tree.hasErrors()) {
result = null;
for (LapgProblem s : tree.getErrors()) {
err.error(s.getMessage() + "\n");