[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The problem with Mid-Rule Action
From: |
Ramaswamy |
Subject: |
Re: The problem with Mid-Rule Action |
Date: |
Fri, 20 Jun 2003 16:06:23 +0530 |
Hi,
You mentioned that the grammar has lot many rules. The description given
is not sufficient. And what do you mean by $3 giving 2 values?? Further
explanation on that would be great.
Rgd Embedded rules they are fine if they do not generate shift/reduce or
such warnings (to check this if ur already getting s/r errors comment the
embedded action to see if it reduces), otherwise their behaviour might not
be as we expect (in the crude sense not when u want things that way and ur
sure of what u r doin). Bye.
Regds
Ram
----- Original Message -----
From: "praveen thakur" <address@hidden>
To: <address@hidden>
Sent: Friday, June 20, 2003 2:49 PM
Subject: The problem with Mid-Rule Action
> Hi,
> I am giving the mid-rule action in my parser which
> is like this...
>
> Non-term1: TOKEN1 {// some code to create objects}
> Non-term2 {//using the value of $3 and it
> gives correct value of Non-term2}
> TOKEN2 {// Now when I use $3(for Non-term2)
>
> here, it's not
> giving the correct value...
> rather it gives the value of Non-
> term2 as well as of TOKEN2.. I want
> to access the value of
> Non-term2 here.}
>
> Non-term2: STRING {$$=$1;}
>
> < The Parser has lot many rules... I just wanted to be
> specific about the problem, that's why instead of real
> code I wrote like the above..>
>
> What is the reason behind this ?? How the value in
> "yyvsp" changes and used by $ values ??
> More specific, how can I get the desired result ??
>
>
> I am using Flex++2.3.8 -7 and Bison++ 1.21-8 from GNU.
>
>
> Thanking you all,
>
> praveen
>
> __________________________________________________
> Yahoo! Plus
> For a better Internet experience
> http://www.yahoo.co.uk/btoffer
>
>
> _______________________________________________
> address@hidden http://mail.gnu.org/mailman/listinfo/help-bison
>