At 17:03 +0000 2005/03/06, Derek M Jones wrote: >>You are not processing the C language, but some other language, with the >>context dependencies of the C language removed. > >Correct. I only claim to be processing C syntax on a >single statement/declaration basis (and then only at the visible >source level)..
>>Alternatively, you might introduce a new token-name both for type-names and >>number-names. I.e., instead of >>%token type-name number-name >>you write >>%token token-type-name >>%% >>type-name: token-type-name; >>number-name: token-type-name; >> >>You then get a correct GLR parse, and can try to sort out the ambiguity >>later. > >I don't understand what you are getting at here. You ignore the context information distinguishing between type-names and number-names. So set these names equal to the same token, and let the GLR parser handle it. It then produces all correct parses, including the possible type-name/number-name choices. You then get the correct parse trees, and need only decide how to select one over the other. Clearly, this choice cannot be done, in general, unless you somehow supply the context information missing. Hans Aberg _______________________________________________ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison