Reputation: 145
How can i prevent that the "," literal in the structure rule is parsed as a operator in the following EBNF grammar for Instaparse?
Grammar:
structure = atom <"("> term ("," term)* <")">
term = atom | number | structure | variable | "(" term ")" | term operator term
operator = "," | ";" | "\\=" | "=="
Upvotes: 1
Views: 154
Reputation: 141
Using the comma as a separator and as an operator like you do makes comma context sensitive which Ebnf on its own can't deal with.
Upvotes: 0