Open jacquev6 opened 6 years ago
Some grammars have repetitions. Here is a benign example extracted from the OCaml manual:
\begin{syntax} typexpr: '(' typexpr { ',' typexpr } ')' typeconstr | '(' typexpr { ',' typexpr } ')' '#' class-path \end{syntax}
the '(' typexpr { ',' typexpr } ')' part is duplicated.
'(' typexpr { ',' typexpr } ')'
If the user adds a rule like:
\begin{syntax} typexpr-tuple: '(' typexpr { ',' typexpr } ')' \end{syntax}
DrawGrammar could allow her to "outline" it, i.e. draw typeexpr as if it was defined as:
typeexpr
\begin{syntax} typexpr: typexpr-tuple typeconstr | typexpr-tuple '#' class-path \end{syntax}
This is exactly the reverse of what we've done in #2.
Some grammars have repetitions. Here is a benign example extracted from the OCaml manual:
the
'(' typexpr { ',' typexpr } ')'
part is duplicated.If the user adds a rule like:
DrawGrammar could allow her to "outline" it, i.e. draw
typeexpr
as if it was defined as:This is exactly the reverse of what we've done in #2.