[antlr-interest] Remote Debugging with C#

Johannes Luber jaluber at gmx.de
Tue Jul 3 14:25:02 PDT 2007


Gavin Lambert wrote:
> At 05:11 4/07/2007, Johannes Luber wrote:
>>The location of dbg. dbg is a member of DebugParser, the parent
>>parent class. And in Ecma 334 is written:
>>
>>"A variable initializer for an instance field cannot reference the
>>instance being created. Thus, it is a compile-time error to
>>reference *this* in a variable initializer, as it is a compile-
>>time error for a variable initializer to reference any instance
>>member through a simple-name."
>>
>>The simple-name part is violated.
> 
> That doesn't seem to prohibit base-class fields, though.  They should
> have already been constructed by the time derived class initializers are
> called.
> 
> I guess it's a matter of interpretation, though :)

True. In the strict sense any instance variable is available over
*this*, even if it merely a base class. I suppose the reason is
consistency. A new programmer may be confused may be confused if one
instance variable can be assigned this way, but not another one. I've
tested *base* instead, but *base* may be only used inside of a method,
property, or constructor. What a pity...

Best regards,
Johannes Luber



More information about the antlr-interest mailing list