326 |
complain (_("invalid $ value")); |
complain (_("invalid $ value")); |
327 |
return NULL; |
return NULL; |
328 |
} |
} |
329 |
i++; |
++i; |
330 |
} |
} |
331 |
|
|
332 |
return rp->sym->type_name; |
return rp->sym->type_name; |
369 |
obstack_1grow (oout, c); |
obstack_1grow (oout, c); |
370 |
|
|
371 |
if (c == '\n') |
if (c == '\n') |
372 |
lineno++; |
++lineno; |
373 |
} |
} |
374 |
|
|
375 |
c = getc (fin); |
c = getc (fin); |
452 |
} |
} |
453 |
else if (c == '\n') |
else if (c == '\n') |
454 |
{ |
{ |
455 |
lineno++; |
++lineno; |
456 |
obstack_1grow (oout, c); |
obstack_1grow (oout, c); |
457 |
if (cplus_comment) |
if (cplus_comment) |
458 |
ended = 1; |
ended = 1; |
614 |
{ |
{ |
615 |
case '\n': |
case '\n': |
616 |
obstack_1grow (&attrs_obstack, c); |
obstack_1grow (&attrs_obstack, c); |
617 |
lineno++; |
++lineno; |
618 |
break; |
break; |
619 |
|
|
620 |
case '%': |
case '%': |
826 |
char *name = NULL; |
char *name = NULL; |
827 |
int prev = 0; |
int prev = 0; |
828 |
|
|
829 |
lastprec++; /* Assign a new precedence level, never 0. */ |
/* Assign a new precedence level, never 0. */ |
830 |
|
++lastprec; |
831 |
|
|
832 |
for (;;) |
for (;;) |
833 |
{ |
{ |
932 |
switch (c) |
switch (c) |
933 |
{ |
{ |
934 |
case '\n': |
case '\n': |
935 |
lineno++; |
++lineno; |
936 |
break; |
break; |
937 |
|
|
938 |
case '/': |
case '/': |
940 |
break; |
break; |
941 |
|
|
942 |
case '{': |
case '{': |
943 |
count++; |
++count; |
944 |
break; |
break; |
945 |
|
|
946 |
case '}': |
case '}': |
1277 |
{ |
{ |
1278 |
case '\n': |
case '\n': |
1279 |
obstack_1grow (&action_obstack, c); |
obstack_1grow (&action_obstack, c); |
1280 |
lineno++; |
++lineno; |
1281 |
break; |
break; |
1282 |
|
|
1283 |
case '{': |
case '{': |
1284 |
obstack_1grow (&action_obstack, c); |
obstack_1grow (&action_obstack, c); |
1285 |
count++; |
++count; |
1286 |
break; |
break; |
1287 |
|
|
1288 |
case '\'': |
case '\'': |
1432 |
} |
} |
1433 |
/* start a new rule and record its lhs. */ |
/* start a new rule and record its lhs. */ |
1434 |
|
|
1435 |
nrules++; |
++nrules; |
1436 |
nitems++; |
++nitems; |
1437 |
|
|
1438 |
p = symbol_list_new (lhs); |
p = symbol_list_new (lhs); |
1439 |
|
|
1452 |
{ |
{ |
1453 |
lhs->class = nterm_sym; |
lhs->class = nterm_sym; |
1454 |
lhs->number = nvars; |
lhs->number = nvars; |
1455 |
nvars++; |
++nvars; |
1456 |
} |
} |
1457 |
else if (lhs->class == token_sym) |
else if (lhs->class == token_sym) |
1458 |
complain (_("rule given for %s, which is a token"), lhs->tag); |
complain (_("rule given for %s, which is a token"), lhs->tag); |
1510 |
/* Make a new rule, whose body is empty, before the |
/* Make a new rule, whose body is empty, before the |
1511 |
current one, so that the action just read can |
current one, so that the action just read can |
1512 |
belong to it. */ |
belong to it. */ |
1513 |
nrules++; |
++nrules; |
1514 |
nitems++; |
++nitems; |
1515 |
p = symbol_list_new (sdummy); |
p = symbol_list_new (sdummy); |
1516 |
/* Attach its lineno to that of the host rule. */ |
/* Attach its lineno to that of the host rule. */ |
1517 |
p->line = crule->line; |
p->line = crule->line; |
1532 |
|
|
1533 |
/* Insert the dummy generated by that rule into this |
/* Insert the dummy generated by that rule into this |
1534 |
rule. */ |
rule. */ |
1535 |
nitems++; |
++nitems; |
1536 |
p = symbol_list_new (sdummy); |
p = symbol_list_new (sdummy); |
1537 |
p1->next = p; |
p1->next = p; |
1538 |
p1 = p; |
p1 = p; |
1542 |
|
|
1543 |
if (t == tok_identifier) |
if (t == tok_identifier) |
1544 |
{ |
{ |
1545 |
nitems++; |
++nitems; |
1546 |
p = symbol_list_new (symval); |
p = symbol_list_new (symval); |
1547 |
p1->next = p; |
p1->next = p; |
1548 |
p1 = p; |
p1 = p; |
1551 |
{ |
{ |
1552 |
parse_action (crule, rulelength); |
parse_action (crule, rulelength); |
1553 |
action_flag = 1; |
action_flag = 1; |
1554 |
xactions++; /* JF */ |
++xactions; /* JF */ |
1555 |
} |
} |
1556 |
rulelength++; |
++rulelength; |
1557 |
} /* end of read rhs of rule */ |
} /* end of read rhs of rule */ |
1558 |
|
|
1559 |
/* Put an empty link in the list to mark the end of this rule */ |
/* Put an empty link in the list to mark the end of this rule */ |
1585 |
complain (_("two actions at end of one rule")); |
complain (_("two actions at end of one rule")); |
1586 |
parse_action (crule, rulelength); |
parse_action (crule, rulelength); |
1587 |
action_flag = 1; |
action_flag = 1; |
1588 |
xactions++; /* -wjh */ |
++xactions; /* -wjh */ |
1589 |
t = lex (); |
t = lex (); |
1590 |
} |
} |
1591 |
/* If $$ is being set in default way, report if any type |
/* If $$ is being set in default way, report if any type |
1786 |
rules[ruleno].prec = ruleprec; |
rules[ruleno].prec = ruleprec; |
1787 |
} |
} |
1788 |
ritem[itemno++] = -ruleno; |
ritem[itemno++] = -ruleno; |
1789 |
ruleno++; |
++ruleno; |
1790 |
|
|
1791 |
if (p) |
if (p) |
1792 |
p = p->next; |
p = p->next; |