Re: Delphi formal grammar?

Hans-Peter Diettrich <DrDiettrich1@aol.com>
20 Aug 2006 23:51:44 -0400

          From comp.compilers

Related articles
Delphi formal grammar? kossey@cablenet.de (VergissMeinNicht) (2006-08-19)
Re: Delphi formal grammar? barry.j.kelly@gmail.com (Barry Kelly) (2006-08-19)
Re: Delphi formal grammar? DrDiettrich1@aol.com (Hans-Peter Diettrich) (2006-08-19)
Re: Delphi formal grammar? luca.masini@ieee.org (Luca Masini) (2006-08-19)
Re: Delphi formal grammar? marcov@stack.nl (Marco van de Voort) (2006-08-20)
Re: Delphi formal grammar? DrDiettrich1@aol.com (Hans-Peter Diettrich) (2006-08-20)
Re: Delphi formal grammar? JoachimPimiskern@web.de (Joachim Pimiskern) (2006-08-22)
| List of all articles for this month |

From: Hans-Peter Diettrich <DrDiettrich1@aol.com>
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 :-(


DoDi



Post a followup to this message

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