-
Notifications
You must be signed in to change notification settings - Fork 15
Abridge
Given a reflexive chain production rule, i.e., a production rule whose defined nonterminal equals its body, this production rule is simply removed from the grammar, even if it contains some potentially valuable information (like labels and selectors).
abridge:
production
Reflexive chain productions are rarely encountered explicitly in the base-line grammars, but sometimes series of transformations result in them, and usually they are not needed. An example of a transformation sequence that yields a reflexive chain production can be a step from concrete syntax definition to abstract syntax definition. Concrete syntax usually needs explicit bracketing constructions for recursive composition, and after stripping away terminals and merging layers, these bracketing constructions become reflexive chain productions. The Factorial Language case study has shown the need for it.
Consider this abstract syntax:
[constant] expr:
int
[neg] expr:
expr
[bracket] expr:
expr
After performing this transformation step:
abridge(
[bracket] expr:
expr
);
The grammar will be the same, but without the reflexive chain production labelled as “bracket” previously:
[constant] expr:
int
[neg] expr:
expr
shared/prolog/xbgf1.pro
shared/prolog/xbgf2.pro
shared/rascal/src/transform/library/Chaining.rsc
shared/xsd/xbgf.xsd
- Abridge is a part of XBGF