How does the UCB pascal compiler handle optional semi-colons?

A. Michael Burbidge <amb@apple.com>
Mon, 8 Oct 90 08:49:05 -0700

          From comp.compilers

Related articles
How does the UCB pascal compiler handle optional semi-colons? amb@apple.com (A. Michael Burbidge) (1990-10-08)
| List of all articles for this month |

Newsgroups: comp.compilers
From: A. Michael Burbidge <amb@apple.com>
Keywords: parse, Pascal, question
Organization: Compilers Central
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.


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]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.