[Mono-list] Re: [Mono-hackers-list] MonoBasic again
Miguel de Icaza
miguel@ximian.com
03 Jan 2003 20:31:24 -0500
Hello,
> a language for years and never really notice it?) and, while C# syntax has
> some clever "tricks" which make it easier to implement a language parser,
> VB.NET seems to do the opposite. For instance, given the following
> statement:
>
> a = MyExample(1,2)
>
> MyExample can be a property reference, a method call or an array reference,
> and there's no way to tell which is which in the parser until you start
> resolving.
Yes, the C# compiler also faces some of those problems.
For instance:
MyExample (1, 2)
It could be either a Delegate invocation, or a method call. As you
point out, during the parsing stage, it is not possible to tell them
apart, you have to do this during the resolution stage.
Another nice example is ElementAccess:
a [10]
This could be an array access, or an indexer access. This can only be
known when you know what the type of `a' is. During the resolution
process, the ElementAccess class is turned into either an IndexerAccess
or an ArrayAccess.
Miguel