It's a recurrent question that's come up in other forums "can yacc be bootstrapped in yacc?" Now, I'm adding a twist.
I'll repeat one of my recent replies here. In the syntax for yacc files, laid out by the POSIX standard, there is no mandatory semi-colon at the ends of rules, so an extra look-ahead is required to determine whether an identifier is followed by a colon. If so, then this indicates the left-hand side of a new
rule.
A grammar rule has the form
left-hand-side ":" stuff on the right optional ";"'s.
If you see a ":" in the middle of the rules on the right, then you've actually
sneaked on over into the *next* rule.
Bison hacks the syntax, by making left-hand-side + ":" into a single token.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 10:49:37 |
Calls: | 6,645 |
Calls today: | 5 |
Files: | 12,190 |
Messages: | 5,326,610 |