Path: utzoo!attcan!uunet!decwrl!world!esegue!compilers-sender From: amb@apple.com (A. Michael Burbidge) Newsgroups: comp.compilers Subject: How does the UCB pascal compiler handle optional semi-colons? Keywords: parse, Pascal, question Message-ID: <9010081549.AA17410@apple.com> Date: 8 Oct 90 15:49:05 GMT Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: A. Michael Burbidge Organization: Compilers Central Lines: 23 Approved: compilers@esegue.segue.boston.ma.us 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.