Bill Baxter wrote:
On Mon, Oct 27, 2008 at 9:04 AM, Andrei Alexandrescu
<[EMAIL PROTECTED]> wrote:

What's the precedence of your user-defined in-fix operator?

--bb
Yup, I realized this myself as well. Seemed like such a great idea when I
only thought of it for three seconds. :p
An operator could always be defined to have the same precedent as an
existing operator, which it has to specify.

Walter said in a previous post a few days ago when I suggested it that
that would kill D's easy parsability.
You say no?  I'm no parser expert, so hard for me to say.

It can be done, but it's kinda involved. You define a grammar in which all operators have the same precedence. Consequently you compile any expression into a list of operands and operators. That makes the language parsable without semanting info. Then the semantic stage transforms the list into a tree. Cecil does that.

Andrei

Reply via email to