{
PushbackInputStream stream = new PushbackInputStream(contentStream, BOM_MAX_LENGTH);
Charset encoding = getEncoding(stream);
if (encoding != null)
{
HaxeLexer lexer =
new HaxeLexer(new ANTLRInputStream(contentStream, encoding.toString()));
return parseFileContents(lexer);
}
HaxeLexer lexer = new HaxeLexer(new ANTLRInputStream(stream));
return parseFileContents(lexer);
}