One of the most common tokens in SQL is the <identifier>. It is ubiquitous, mentioned in hundreds of productions.
And there are three kinds of identifiers, like so:
<Identifier:
<RegularIdentifier> |
<DelimitedIdentifier> |
<UnicodeDelimitedIdentifier>
>
I attempted to use the <Identifier> in a production, like so:
TableName:
LocalOrSchemaQualifiedName
;
LocalOrSchemaQualifiedName:
[LocalOrSchemaQualifier <Period>] <Identifier>
;
And ran the following test case
new JpParser("Alphabet").TableName();
Which produced the following error:
Encountered an error at (or somewhere around) input:1:1
Was expecting one of the following:
Identifier
Found string "Alphabet" of type RegularIdentifier
So here's my question. RegularIdentifier is of type Identifier. What's the best way of handling this without explicitly expanding every instance of <Identifier> in the grammar?