mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-27 20:41:58 +03:00
Fix for ticket #134: Change the lemon.c sources to work around a problem with
the AIX C compiler. (CVS 715) FossilOrigin-Name: 07f6020bb56d6d1bffdd936017f61cfae5bd134b
This commit is contained in:
20
tool/lemon.c
20
tool/lemon.c
@ -117,7 +117,7 @@ int SetUnion(/* char *A,char *B */); /* A <- A U B, thru element N */
|
||||
** Principal data structures for the LEMON parser generator.
|
||||
*/
|
||||
|
||||
typedef enum {FALSE=0, TRUE} Boolean;
|
||||
typedef enum {B_FALSE=0, B_TRUE} Boolean;
|
||||
|
||||
/* Symbols (terminals and nonterminals) of the grammar are stored
|
||||
** in the following: */
|
||||
@ -451,7 +451,7 @@ struct lemon *lemp;
|
||||
int progress;
|
||||
|
||||
for(i=0; i<lemp->nsymbol; i++){
|
||||
lemp->symbols[i]->lambda = FALSE;
|
||||
lemp->symbols[i]->lambda = B_FALSE;
|
||||
}
|
||||
for(i=lemp->nterminal; i<lemp->nsymbol; i++){
|
||||
lemp->symbols[i]->firstset = SetNew();
|
||||
@ -463,10 +463,10 @@ struct lemon *lemp;
|
||||
for(rp=lemp->rule; rp; rp=rp->next){
|
||||
if( rp->lhs->lambda ) continue;
|
||||
for(i=0; i<rp->nrhs; i++){
|
||||
if( rp->rhs[i]->lambda==FALSE ) break;
|
||||
if( rp->rhs[i]->lambda==B_FALSE ) break;
|
||||
}
|
||||
if( i==rp->nrhs ){
|
||||
rp->lhs->lambda = TRUE;
|
||||
rp->lhs->lambda = B_TRUE;
|
||||
progress = 1;
|
||||
}
|
||||
}
|
||||
@ -484,10 +484,10 @@ struct lemon *lemp;
|
||||
progress += SetAdd(s1->firstset,s2->index);
|
||||
break;
|
||||
}else if( s1==s2 ){
|
||||
if( s1->lambda==FALSE ) break;
|
||||
if( s1->lambda==B_FALSE ) break;
|
||||
}else{
|
||||
progress += SetUnion(s1->firstset,s2->firstset);
|
||||
if( s2->lambda==FALSE ) break;
|
||||
if( s2->lambda==B_FALSE ) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -782,11 +782,11 @@ struct lemon *lemp;
|
||||
}
|
||||
|
||||
/* Report an error for each rule that can never be reduced. */
|
||||
for(rp=lemp->rule; rp; rp=rp->next) rp->canReduce = FALSE;
|
||||
for(rp=lemp->rule; rp; rp=rp->next) rp->canReduce = B_FALSE;
|
||||
for(i=0; i<lemp->nstate; i++){
|
||||
struct action *ap;
|
||||
for(ap=lemp->sorted[i]->ap; ap; ap=ap->next){
|
||||
if( ap->type==REDUCE ) ap->x.rp->canReduce = TRUE;
|
||||
if( ap->type==REDUCE ) ap->x.rp->canReduce = B_TRUE;
|
||||
}
|
||||
}
|
||||
for(rp=lemp->rule; rp; rp=rp->next){
|
||||
@ -1010,7 +1010,7 @@ struct lemon *lemp;
|
||||
break;
|
||||
}else{
|
||||
SetUnion(newcfp->fws,xsp->firstset);
|
||||
if( xsp->lambda==FALSE ) break;
|
||||
if( xsp->lambda==B_FALSE ) break;
|
||||
}
|
||||
}
|
||||
if( i==rp->nrhs ) Plink_add(&cfp->fplp,newcfp);
|
||||
@ -3625,7 +3625,7 @@ char *x;
|
||||
sp->prec = -1;
|
||||
sp->assoc = UNK;
|
||||
sp->firstset = 0;
|
||||
sp->lambda = FALSE;
|
||||
sp->lambda = B_FALSE;
|
||||
sp->destructor = 0;
|
||||
sp->datatype = 0;
|
||||
Symbol_insert(sp,sp->name);
|
||||
|
Reference in New Issue
Block a user