Commit b6992871 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Merge branch 'master' of git+ssh://

parents 1b9ef0c4 3ab4ddb9
......@@ -4,6 +4,12 @@
and document them. The non-inline version allows embedding an action in the
middle of a rule.
* Should we always avoid querying the lexer before a default reduction?
Would that be difficult/possible? Would that help people who want to
trigger changes in the lexer?
* Produce well-chosen (predictable) names for anonymous rules?
* ErrorReporting: experiment with merging several symbols
so as to reduce the noise (e.g. operators, expressions,
etc.). Or just print the same way, but don't quotient
......@@ -374,6 +374,7 @@ must be fully qualified.
\nt{actual} \is
\nt{id} \optional{\dlpar\sepcommalist{\nt{actual}}\drpar} \\
&& \nt{actual} \optional{\dquestion \barre \dplus \barre \dstar} \\
&& \seplist{\ \barre}{\nt{group}} % not really allowed everywhere
......@@ -563,11 +564,40 @@ keyword (\kw{\$1}, etc.).
In its simplest form, an actual is just a terminal or nonterminal
symbol. The optional actual parameters
$\dlpar\sepcommalist{\nt{actual}}\drpar$ and the optional modifier
(\dquestion, \dplus, or \dstar) are explained further on
(see \sref{sec:templates} and \fref{fig:sugar}).
In its simplest form, an actual is just a terminal or nonterminal symbol
$\nt{id}$. If it is a parameterized non-terminal symbol (see
\sref{sec:templates}), then it should be applied:
An actual may be followed with a modifier (\dquestion, \dplus, or
\dstar). This is explained further on (see \sref{sec:templates} and
An actual may also be an ``anonymous rule''. In that case, one writes
just the rule's right-hand side, which takes the form $\seplist{\ \barre\
(This form is allowed only as an argument in an application.)
This form is expanded on the fly to a definition of a fresh non-terminal
symbol, which is declared \dinline.
For instance, providing an anonymous rule as an argument to \nt{list}:
\nt{list} \dlpar \basic{e} = \nt{expression}; \basic{SEMICOLON} \dpaction{\basic{e}} \drpar
is equivalent to writing this:
\nt{list} \dlpar \nt{expression\_SEMICOLON} \drpar
where the non-terminal symbol \nt{expression\_SEMICOLON} is chosen fresh and is defined as follows:
\dinline \nt{expression\_SEMICOLON}:
\newprod \basic{e} = \nt{expression}; \basic{SEMICOLON} \dpaction{\basic{e}}
\section{Advanced features}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment