if (file.getName().endsWith(".ceylon")) {
//System.out.println("Parsing " + file.getName());
CeylonLexer lexer = new CeylonLexer(new ANTLRInputStream(file.getInputStream(), getEncoding()));
CommonTokenStream tokenStream = new CommonTokenStream(lexer);
CeylonParser parser = new CeylonParser(tokenStream);
Tree.CompilationUnit cu = parser.compilationUnit();
List<CommonToken> tokens = new ArrayList<CommonToken>(tokenStream.getTokens().size());
tokens.addAll(tokenStream.getTokens());
PhasedUnit phasedUnit = new PhasedUnit(file, srcDir, cu,
moduleManager.getCurrentPackage(), moduleManager,
context, tokens);
addPhasedUnit(file, phasedUnit);
List<LexError> lexerErrors = lexer.getErrors();
for (LexError le : lexerErrors) {
//System.out.println("Lexer error in " + file.getName() + ": " + le.getMessage());
cu.addLexError(le);
}
lexerErrors.clear();
List<ParseError> parserErrors = parser.getErrors();
for (ParseError pe : parserErrors) {
//System.out.println("Parser error in " + file.getName() + ": " + pe.getMessage());
cu.addParseError(pe);
}
parserErrors.clear();