[antlr-interest] Delphi request

Barry Kelly barry.j.kelly at gmail.com
Sat Oct 30 08:41:33 PDT 2004


On Fri, 29 Oct 2004 10:49:30 -0000, wolfy10002000
<wolfy10002000 at yahoo.co.uk> wrote:
> I am looking to write a Delphi grammer for a college project.
> [...]
> 1. Using the pascal grammar for inspiration and building a new
> Delphi grammar from that.
> 
> or 2. Build a Delphi grammar of the differences between Pascal and
> Delphi and use the two grammars at the same time with the same state.
> 
> Does anyone foresee a problem with approach 2? 

I would suggest, unless you have a strong reason to keep separate
Delphi and Pascal parsing capability, that you'd be much better off
squishing an existing Pascal grammar into shape.

> I have some
> experience with Pascal but not Delphi so I am not sure whether
> approach 2 is actually possible.

I've written a parser for Delphi, and the only tricky part that I can
recall was parsing typed constants. You'll need symbol table
information with the layout of records and arrays along with semantic
predicates if you want to parse typed constants unambiguously.

-- Barry


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list