[antlr-interest] Multiplication and pointers in C-style language

David Olsson vonolsson at gmail.com
Sun Apr 13 12:29:09 PDT 2008

Gavin Lambert wrote:
> I don't know offhand, but I think C# gets around the problem by 
> declaring that expressions cannot be statements in their own right; 
> combining this with the fixed signatures for operator overloading 
> means that a * on the left of an assignment or on its own can only 
> possibly be a pointer declaration, not a multiplication, since a 
> multiplication cannot produce an lvalue.  (Unlike in C++, where you 
> can overload it to return whatever you want.)
Thanks a lot! C# solves(?) the problem very nicely indeed. This is 
definitely the way to go for me (since I won't have operator 
overloading, at least not overloading as liberal as C++'s).

/David Olsson

More information about the antlr-interest mailing list