[comp.compilers] How does the UCB pascal compiler handle optional semi-colons?

amb@apple.com (A. Michael Burbidge) (10/08/90)

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.

Mike Burbidge
apple.com
[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]
-- 
Send compilers articles to compilers@esegue.segue.boston.ma.us
{ima | spdcc | world}!esegue.  Meta-mail to compilers-request@esegue.