-
Notifications
You must be signed in to change notification settings - Fork 15
AddV
Nonterminal definitions can be extended (“added to”) vertically and horizontally. In the former case, a given production rule is added to an existing definition. In the latter case (cf. AddH), a given branch is added to a given expression. The horizontal mode is there for convenience only because it could be simulated by a sequence of extraction, vertical addition, and inlining.
There are two operators that are very similar to the vertical add operator: define and introduce. The define operator should be used when an the definition of an undefined nonterminal is added. The introduce operator should be used when a fresh nonterminal is to be defined.
[vertical] add:
production
Vertical addition operates on the level of productions: it adds one more production for some nonterminal to any number of productions that are already present in the grammar.
Given the input:
expr:
int
After using this transformation:
addV(
expr:
id
);
The result will look like this:
expr:
int
expr:
id
- AddV is a part of XBGF