Re: Delphi formal grammar?

Hans-Peter Diettrich <>
20 Aug 2006 23:51:44 -0400

          From comp.compilers

Related articles
Delphi formal grammar? (VergissMeinNicht) (2006-08-19)
Re: Delphi formal grammar? (Barry Kelly) (2006-08-19)
Re: Delphi formal grammar? (Hans-Peter Diettrich) (2006-08-19)
Re: Delphi formal grammar? (Luca Masini) (2006-08-19)
Re: Delphi formal grammar? (Marco van de Voort) (2006-08-20)
Re: Delphi formal grammar? (Hans-Peter Diettrich) (2006-08-20)
Re: Delphi formal grammar? (Joachim Pimiskern) (2006-08-22)
| List of all articles for this month |

From: Hans-Peter Diettrich <>
Newsgroups: comp.compilers
Date: 20 Aug 2006 23:51:44 -0400
Organization: Compilers Central
References: 06-08-119 06-08-122
Keywords: Pascal, parse
Posted-Date: 20 Aug 2006 23:51:44 EDT

Barry Kelly wrote:

> Yes, you can't (easily) parse ConstExprs using LL(1) without type
> information. Specifically, structured constants are somewhat awkward
> to distinguish from parenthesized expressions:
> var
> x: Integer = (Foo + Bar);
> y: TRecord = (Foo : Bar);
> z: TArray = (Foo , Bar);

Good example of the difficulties. Nontheless all these can be summarized
as Initializers, with optional elements or repetitions, as indicated by
the ":" or ",". If required, a finer distinction between the various
initializers can be made when processing the parse trees.

In contrast to C, I never found symbol table information required for
properly parsing OPL sources. More problems arise from the semicolons,
introduced by unreflected extensions of the Pascal grammar :-(


Post a followup to this message

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