Re: YACC->Bison

Javeed Ahmed <javid@sasi.com>
10 Sep 1999 00:11:21 -0400

          From comp.compilers

Related articles
YACC->Bison kerrr@my-dejanews.com (1999-05-16)
Re: YACC->Bison rkrayhawk@aol.com (1999-05-20)
Re: YACC->Bison javid@sasi.com (Javeed Ahmed) (1999-09-10)
| List of all articles for this month |
From: Javeed Ahmed <javid@sasi.com>
Newsgroups: comp.compilers
Date: 10 Sep 1999 00:11:21 -0400
Organization: Compilers Central
References: 99-05-053
Keywords: yacc

hi bob,


It seems that if the is no action block, bison add the following
as the action
{ $$ = $1 }


Surly enough, $$ type may not match $1 type since you do not
intend to do so.


This can be easily solve by adding an empty action block as
{ }


This solve the problem and also there are no porting problems




In your code something like this can be used


> 102: statements : { }
> 103: | statements statement { }
> 104: ;
> 105:
> 106: statement : END { }
> 107: | command END
> 108: {
> 109: debug_idr_num("statement", "END", "number of entries",
> (Real)cntr);
> 110: .......}




Hope this will solve UR problem. Sorry if the soln is late, since
I cracked it just now


javid


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.