On Monday, January 14, 2002, at 07:30 AM, Hans Aberg wrote:

> Specifically, in the rule
>   x -> ANSWER expr WITH expr OR expr
> is "OR" allowed in the "expr" of the "ANSWER expr WITH" part?

You have the rule wrong. That is a list of expressions, 
delimited by the word  "or".

So, the intended parsing is that in the state derived from those 
rules, a reduce is to be performed on "or", not a shift. Which 
is, after reading the source, exactly what %prec on the rule 
does.

>
> And, how do you want
>   ANSWER expr WITH expr OR expr OR expr OR expr
> to be interpreted? Possibilities:

ANSWER expr WITH (expr) OR (expr) OR (expr) OR (expr)

where, of course, expr above did not contain any 
non-parenthesis-enclosed ORs.

And the difference is very important. "answer" displays a 
dialogue box displaying the first expression (evaluated) giving 
the user the choice of clicking on any of the other expr's 
(evaluted). So, it is important that:

        answer "Hello, world" with "Cancel" or "OK"

becomes
        
        ANSWER expr WITH (expr) OR (expr)

which yields ywo buttons. Yes, strings are expressions... On the 
other hand,

        answer "Hello, world" with ("True" or "False")

would have one button.

%prec on the appropriate rule, AFAICT, does this.


_______________________________________________
Freecard-general mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freecard-general

Reply via email to