New Features of Eli Version 4.7
Some abstract grammars have several rules with different names and
identical signatures (this is relatively common in computed trees,
see Computed Subtrees of LIDO - Reference Manual).
If such rules are represented in an unambiguous manner in text, and that
text is parsed, one must be able to map the disambiguated concrete rules
into the appropriate abstract rules.
Because the abstract rules have identical signatures, pattern matching
won't work.
In order to solve this problem, the Maptool now accepts an optional rule
name in a rule mapping
(see Specifying rule mappings of Syntactic Analysis).
A simple example might be a representation of dyadic expressions without
explicit operators:
RULE Add: Expression ::= Expression Expression END;
RULE Mul: Expression ::= Expression Expression END;
...
Suppose that such nodes are represented in text by fully-parenthesized
arithmetic expressions in the standard notation.
Rule mappings specifying the rule names explicitly would then be needed
to disambiguate the pattern match:
MAPRULE
Expression: '(' Expression '+' Expression ')' < $1 $2 >: Add .
Expression: '(' Expression '*' Expression ')' < $1 $2 >: Mul .
...
|