[antlr-interest] Writing Delphi Target for Antlr3
Terence Parr
parrt at cs.usfca.edu
Sat May 26 12:56:22 PDT 2007
On May 26, 2007, at 12:08 PM, Luke A. Guest wrote:
> 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.
Should the identical from the machine code point of view. In either
case it is simply decrementing a stack pointer. well, Pascal has a
strange nested scoping rules so maybe you are right. You could just
look at the assembly to see if it's true.
Ter
More information about the antlr-interest
mailing list