-
I have an identifier described by:
This grammar is working:
But when I try to insert the Identifier_underscore_prefix expression into the Identifier rule directly, I got an error. Is this supposed to happen? Is there some limit to nesting the rules expressions? Rule does not work example :
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey @rempAut, even though we use EBNF syntax for most of our grammar DSL, the assignment syntax is a bit more limited, and doesn't allow for arbitrary amount of tokens in there. In your case, it looks as though your
I've simplified the Identifier rule, but it still parses the same input. Please note that your |
Beta Was this translation helpful? Give feedback.
Hey @rempAut,
even though we use EBNF syntax for most of our grammar DSL, the assignment syntax is a bit more limited, and doesn't allow for arbitrary amount of tokens in there. In your case, it looks as though your
Identifier
rule is actually supposed to be a data type rule. This change would address your problem:I've simplified the Identifier rule, but it still parses the same input. Please note that your
ID
terminal at the bottom of your grammar is already able to parse the input that would be parsed by theIdentifier
rule.