* examples/bddcalc/parser.yxx (actionSeq, varlist): Rewrite as
left-recursive rules.
This commit is contained in:
parent
4cbc1d8856
commit
7abc2604f3
2 changed files with 16 additions and 11 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2004-07-12 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
||||
|
||||
* examples/bddcalc/parser.yxx (actionSeq, varlist): Rewrite as
|
||||
left-recursive rules.
|
||||
|
||||
2004-06-28 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
||||
|
||||
Merge BuDDy 2.3.
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
/* Definitions for storing and caching of identifiers */
|
||||
#define inputTag 0
|
||||
#define exprTag 1
|
||||
|
||||
|
||||
struct nodeData
|
||||
{
|
||||
nodeData(const nodeData &d) { tag=d.tag; name=sdup(d.name); val=d.val; }
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
int linenum;
|
||||
|
||||
bddgbchandler gbcHandler = bdd_default_gbchandler;
|
||||
|
||||
|
||||
/* Prototypes */
|
||||
void actInit(token *nodes, token *cache);
|
||||
void actInputs(void);
|
||||
|
|
@ -48,7 +48,7 @@ void actAssign(token *id, token *expr);
|
|||
void actOpr2(token *res, token *left, token *right, int opr);
|
||||
void actNot(token *res, token *right);
|
||||
void actId(token *res, token *id);
|
||||
void actConst(token *res, int);
|
||||
void actConst(token *res, int);
|
||||
void actSize(token *id);
|
||||
void actDot(token *fname, token *id);
|
||||
void actAutoreorder(token *times, token *method);
|
||||
|
|
@ -59,7 +59,7 @@ void actForall(token *res, token *var, token *expr);
|
|||
void actQuantVar2(token *res, token *id, token *list);
|
||||
void actQuantVar1(token *res, token *id);
|
||||
void actPrint(token *id);
|
||||
|
||||
|
||||
%}
|
||||
|
||||
/*************************************************************************
|
||||
|
|
@ -119,7 +119,7 @@ actions:
|
|||
;
|
||||
|
||||
actionSeq:
|
||||
action T_semi actionSeq
|
||||
actionSeq action T_semi
|
||||
| action T_semi
|
||||
;
|
||||
|
||||
|
|
@ -159,7 +159,7 @@ quantifier:
|
|||
;
|
||||
|
||||
varlist:
|
||||
T_id varlist { actQuantVar2(&$$,&$1,&$2); }
|
||||
varlist T_id { actQuantVar2(&$$,&$2,&$1); }
|
||||
| T_id { actQuantVar1(&$$,&$1); }
|
||||
;
|
||||
|
||||
|
|
@ -212,7 +212,7 @@ void usage(void)
|
|||
int main(int ac, char **av)
|
||||
{
|
||||
int c;
|
||||
|
||||
|
||||
while ((c=getopt(ac, av, "hg")) != EOF)
|
||||
{
|
||||
switch (c)
|
||||
|
|
@ -225,7 +225,7 @@ int main(int ac, char **av)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (optind >= ac)
|
||||
usage();
|
||||
|
||||
|
|
@ -242,7 +242,7 @@ int main(int ac, char **av)
|
|||
|
||||
bdd_printstat();
|
||||
bdd_done();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -279,7 +279,7 @@ void actInputs(void)
|
|||
{
|
||||
if (names.exists((*i).name))
|
||||
yyerror("Redefinition of input %s", (*i).name);
|
||||
|
||||
|
||||
(*i).val = bdd_ithvar(vnum);
|
||||
hashData hd((*i).name, 0, &(*i));
|
||||
names.add(hd);
|
||||
|
|
@ -299,7 +299,7 @@ void actAssign(token *id, token *expr)
|
|||
{
|
||||
if (names.exists(id->id))
|
||||
yyerror("Redefinition of %s", id->id);
|
||||
|
||||
|
||||
nodeData *d = new nodeData(exprTag, sdup(id->id), *expr->bval);
|
||||
hashData hd(d->name, 0, d);
|
||||
names.add(hd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue