1

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 = "," | ";" | "\\=" | "=="
Aruscher
  • 153
  • 1
  • 10

1 Answers1

0

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.

Uran
  • 141
  • 2
  • 12