help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Literals and Tokens


From: Jeganatan, Srividhya
Subject: RE: Literals and Tokens
Date: Thu, 26 Jun 2003 09:31:20 -0400

Thanks for the reply.
But I need a bit more information. 

I have some rules like this in my grammar:
A:A SOMEKEYWORD A |
  A ';'

and some other rules like this:
Y  ->  X .                 (rule 555)
Y  ->  X . aclist     (rule 556)
Y  ->  X . ';' aclist (rule 557)

X is all set of terminals.

In the second set of rules I see a conflict,

';'     shift, and go to state 640
';'        [reduce using rule 555 (Y)]

None of these non-terminals can be "empty".

But if I define a token for ';' and use that token in place of the ';', 
I see a conflict in the first set of rules:
';'     shift, and go to state 802
';'     [reduce using rule 494 (A)]

Could you please suggest how to resolve such conflicts?

Thanks
Srividhya.
-----Original Message-----
From: Hans Aberg [mailto:address@hidden
Sent: Thursday, June 26, 2003 4:43 AM
To: Jeganatan, Srividhya
Cc: 'address@hidden'
Subject: Re: Literals and Tokens


At 16:33 -0400 2003/06/25, Jeganatan, Srividhya wrote:
>Is there a difference between using a single character literal in a rule
and
>a token representing the literal?

A character token gets its character number as its external token number.
Other tokens get external token numbers starting at 258. In reality,
though, Bison translates these number to internal ones, using a translation
table.

  Hans Aberg





reply via email to

[Prev in Thread] Current Thread [Next in Thread]