[plsql] remove BOM token, skip BOM in parser

This commit is contained in:
Andreas Dangel
2020-03-20 10:49:13 +01:00
parent f6d27c6c61
commit 2f93795609
2 changed files with 5 additions and 3 deletions

View File

@ -227,8 +227,6 @@ PARSER_END(PLSQLParserImpl)
*/
ASTInput Input() : {}
{
[<BOM>] // Unicode BOM
// SRT 2011-04-17 This syntax breaks the parser when fields of record.attach* are referenced (attachLibrary())*
(
(LOOKAHEAD(7) PackageSpecification()
@ -4505,7 +4503,6 @@ void AlterTrigger() :
// Copyright (C) 2002 Albert Tumanov
/* WHITE SPACE */
TOKEN : { <BOM: "\ufeff" > }
SKIP :
{

View File

@ -30,6 +30,11 @@ public class PLSQLParser extends JjtreeParserAdapter<ASTInput> {
return new JavaccTokenDocument(fullText);
}
@Override
public ASTInput parse(String fileName, Reader source) throws ParseException {
return super.parse(fileName, IOUtil.skipBOM(source));
}
@Override
protected ASTInput parseImpl(CharStream cs, ParserOptions options) throws ParseException {
return new PLSQLParserImpl(cs).Input();