|
From: | Paolo Bonzini |
Subject: | Re: [RFC] %language declaration |
Date: | Tue, 12 Sep 2006 10:11:07 +0200 |
User-agent: | Thunderbird 1.5.0.5 (Macintosh/20060719) |
In fact, since the mechanism is mainly supposed to simplify skeleton selection, why not have a tuple like (language, grammartype, skeleton)? This would make it quite easy to add new grammar/parser types to bison.
Yes, but... :-)
Right now, it is. In the future, AFAIU, %nondeterministic-parser may build a backtracking parser.Even with current bison capabilities, does %nondeterministic-parser always mean the GLR skeleton should be used (for any language)?
Agreed. But then, I think it could be sensible to have all the skeletons named "GRAMMAR.LANGUAGE", or "GRAMMAR-LANGUAGE.m4", or something like that. In which case, the language table will not need to contain the skeleton names anymore, but only information on availability of the skeletons (a bitmask), and file extensions (so that .y will map to .cc if you are using %language "C++").As such, perhaps the current %xxx-parser directives could then become aliases for "%parser-type xxx" (or "%grammar-type xxx", whichever is more appropriate).
For the two grammar types currently available, let's keep it simple. Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |