[antlr-interest] Writing Delphi Target for Antlr3
service
service at sharpplus.com
Sat May 26 17:47:31 PDT 2007
no, Delphi does not allow such syntax.
best regards
Chin Shou
> -------Original Message-------
> From: Jim Idle <jimi at temporal-wave.com>
> Subject: Re: [antlr-interest] Writing Delphi Target for Antlr3
> Sent: 26 May '07 20:06
>
> It would be a weak compiler these days that did not analyze these
> variables and their usage at compile time and construct the most
> efficient stack it can, so I would not worry about that (at least not to
> get things going). Your approach should be to get the .stg file
> generating syntactically correct code, to the point that when you
> compile it, the 'liker' tells you that you are missing the runtime
> functions you have not written yet. I am thinking of producing a C-lite
> output, which does not require runtime and that might help new template
> authors.
>
> What you are looking for here, as I think you have realized is the
> equivalent of this in C:
>
> {
> int x;
> {
> int y;
> }
> }
>
> It's been some time since even looked at a Pascal program, but does it
> allow:
>
> var
> x: Integer;
> begin
> var
> y: Integer;
> begin
> ...
> end
> end
>
>
>
> Jim
>
> > -----Original Message-----
> > From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> > bounces at antlr.org] On Behalf Of Luke A. Guest
> > Sent: Saturday, May 26, 2007 12:08 PM
> > To: Terence Parr
> > Cc: ANTR Interest
> > Subject: Re: [antlr-interest] Writing Delphi Target for Antlr3
> >
> > On Sat, 2007-05-26 at 11:51 -0700, Terence Parr wrote:
> > > On May 26, 2007, at 12:37 AM, service wrote:
> > >
> > > > Dear Friends
> > > >
> > > > I am now writing Delphi Target for Antlr 3 . now I
> encounter
> > > > a problem .Delphi unlike the other language (Java, C#, etc). it
> can
> > > > not declare one variable at function body.
> > >
> > > At the rule level I do not provide a list of all nested blocks. I
> > > could add this, but as others have suggested, I think the easiest
> > > answer is to try to get Delphi to declare things within the method.
> >
> > Although, having to dump out an extra block isn't the best way,
> depends
> > on how the compiler handles it, i.e. extending the stack, which is
> > adding overhead.
> >
> > Luke.
> >
>
>
More information about the antlr-interest
mailing list