| 1621 | } |
| 1622 | |
| 1623 | void read_grammar() |
| 1624 | { |
| 1625 | register int c; |
| 1626 | |
| 1627 | initialize_grammar(); |
| 1628 | advance_to_start(); |
| 1629 | |
| 1630 | for (;;) { |
| 1631 | c = nextc(); |
| 1632 | if (c == EOF) break; |
| 1633 | if (isalpha(c) || c == '_' || c == '.' || c == '$' || c == '\'' || |
| 1634 | c == '"') |
| 1635 | add_symbol(); |
| 1636 | else if (c == '{' || c == '=' || c == '[') |
| 1637 | copy_action(); |
| 1638 | else if (c == '|') { |
| 1639 | end_rule(); |
| 1640 | start_rule(plhs[nrules-1], 0); |
| 1641 | ++cptr; } |
| 1642 | else if (c == '%') { |
| 1643 | if (mark_symbol()) break; } |
| 1644 | else |
| 1645 | syntax_error(lineno, line, cptr); } |
| 1646 | end_rule(); |
| 1647 | if (goal->args > 0) |
| 1648 | error(0, 0, 0, "start symbol %s requires arguments", goal->name); |
| 1649 | } |
| 1650 | |
| 1651 | void free_tags() |
| 1652 | { |
no test coverage detected