|How does the UCB pascal compiler handle optional semi-colons? email@example.com (A. Michael Burbidge) (1990-10-08)|
|From:||A. Michael Burbidge <firstname.lastname@example.org>|
|Keywords:||parse, Pascal, question|
|Date:||Mon, 8 Oct 90 08:49:05 -0700|
Does anyone know how optional semi-colons are handled in the UCB
pascal compiler? The yacc specification does not appear to handle
them, but the compiler accepts them. For example, the yacc
specification for a record definition looks similar to the following.
record: RECORD_TOKEN fields END_TOKEN
fields: : field
| fields ';' field
The specification does not appear to accept a record definition whos
last field ends with a semi-colon.
[Not having seen the grammar, I'd expect to find either that it permits a
null field declaration, or that there's a gross lexical hack such as looking
ahead when it has a semicolon and discarding it if the next token is some sort
of end delimiter. -John]
Return to the
Search the comp.compilers archives again.