Re: Delphi formal grammar?

Barry Kelly <>
19 Aug 2006 10:35:18 -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: Barry Kelly <>
Newsgroups: comp.compilers
Date: 19 Aug 2006 10:35:18 -0400
Organization: Compilers Central
References: 06-08-119
Keywords: Basic, parse
Posted-Date: 19 Aug 2006 10:35:18 EDT

VergissMeinNicht wrote:

> The Delphi Help's formal grammar does not have some non-terminal
> definitions for example
> ConstExpr

Yes, you can't (easily) parse ConstExprs using LL(1) without type
information. Specifically, structured constants are somewhat awkward
to distinguish from parenthesized expressions:

        x: Integer = (Foo + Bar);
        y: TRecord = (Foo : Bar);
        z: TArray = (Foo , Bar);

> AssemblyLanguage

Basically, all the tokens between 'asm' and 'end' get sent off to the

> Where can I found a "working" grammar?

I can't help you with that, sorry. To get a quality parse for Delphi,
I expect you'll either need a relatively powerful parser generator or
a fair amount of ad-hockery and symbol table info in a manually
written parser.

-- Barry


Post a followup to this message

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