Re: Parser for Delphi (object pascal)?

From: Davids (nowhere_at_nowthere.com)
Date: 08/30/04


Date: Mon, 30 Aug 2004 11:28:12 -0700

some parser is better than no parser.

Something I've noticed in the Delphi world is that people tend to stick with older
versions for quite a while. We recently migrated from D4 to D6 where I work, and
we'll probably stay with D6 for the foreseeable future. When MS releases something
new, companies seem to trip over themselves trying to upgrade.

BTW, I have looked at D7 breifly, but not D8. Next time we look at upgrading, a
patch for D9 might be out.

I haven't observed much advancement in Delphi language features since D4. Each
release adds a few new reserved words and some refined semantics, but most of the
evolution seems to happen out in the frontier of vcl class libraries, with few if any
changes to the core stuff regardless of need. The IDE gets enhancements, but I'm
talking about the language here.

In my case, I simply need to be able to recognize type, class, proc and func
declarations in the interface section, and find their corresponding implementation
parts down below. A D2 parser would probably suffice as long as it could ignore
recent additions and keywords like 'overload' and default parameter initializers.
It's easy to parse the interface section with grep-like functions, but the
implementation section gets really tricky without taking some limited context into
account.

-David

Martin Waldenburg wrote:

> Davids schrieb:
> > Thanks, but this is just a lexer. You still need a parser to go with it... (he
> > does include an example for parsing compiler directives, like $IFDEFs, tho).
>
> Borland doesn't have released enough information
> to write a parser for D8.
> The D8 documentation is a shame.
> There isn't enough code available to reconstruct a grammar from it.
>
> Besides of contributions by James Jacobson and automatedqa
> I've never got enough feedback to justify the effort of writing a parser.
>
> Finaly I gave my copy of D8 away and leaved Windows,
> thus it doesn't look like there will be one in the future.
>
> Martin



Relevant Pages

  • Re: IF ELSE ENDIF
    ... Das Ding stammt noch von DOS-Zeiten, und ist in Delphi 7 noch lauffähig. ... So konnte ich noch keinen Parser zu einer yacc Grammatik erzeugen, die angeblich mit dem yacc bzw. bison funktioniert. ...
    (de.comp.lang.delphi.misc)
  • Re: Parser Gen
    ... > The parser is recursive decent. ... DMS has been used for migrations, dead/duplicate code detection, ... It is fully unicode aware. ... It isn't Delphi compatible, but if your issue is to build a serious ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Whats a good strategy for testing keywords for smart code editor?
    ... >comments, etc., like the Delphi editor. ... >About 100 keywords. ... your first lexer and parser with one of them, ...
    (alt.comp.lang.borland-delphi)
  • Re: BabelCode: Delphi to C#?
    ... > generator not of the parser. ... Borland would have to have created their ... > own parsers for C# and Delphi for those products. ...
    (borland.public.delphi.non-technical)
  • Re: Parser for Delphi (object pascal)?
    ... This is old but still now best parser for Pascal syntax language IMHO ... > in Delphi apps AFTER you've built a grammar. ...
    (borland.public.delphi.thirdpartytools.general)