<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>After the non-answer of Albert Y. C. Lai about the associativity
of logical connectives: <br>
</p>
<p>
<blockquote type="cite"><font color="#660000">a compiler writer
already knows it's "(and x y z t)" and generates the correct
code and not bother to split hair. </font></blockquote>
</p>
<p>I issued a bit acrimonious remark pointing out that a parsing
question should not be answered that a compiler writer "knows". <br>
</p>
<p>
<blockquote type="cite"> <font color="#000099">imagine that your
students ask you: <b><i>HOW </i></b><b><i>"x && y
&& z && t" is transformed into </i></b><b><i>"(and
x y z t)</i></b></font></blockquote>
</p>
<p>I got my reward...<br>
</p>
<blockquote type="cite"
cite="mid:1027f9b0-155f-9acf-d5c8-8f9a0dd24901@vex.net">
<p><font color="#660000">What would you tell students about commas
and semicolons in the following? Are these commas and
semicolons left associating? Right associating? Both?
Neither? Has anyone even asked? How to parse them? I would
tell the same.</font></p>
<font color="#660000"> </font>
<p><font color="#660000">Pascal's "begin foo() ; tora() ; tigger()
end"<br>
C's "x = (y=10 , y=f(y) , y=g(y) , y);"<br>
Haskell's "f x | g x > 0 , h x < 0 , sin x > 0 = ()"<br>
Prolog's "g(X,Y) :- parent(X,C1) , parent(C1,C2) ,
parent(C2,Y)."<br>
Matlab's "[3+4i , 3 , 5-i ; 1-i , 1+i , 1 ; 7+8i , 4-3i , -i]"</font><br>
</p>
</blockquote>
<p>Now I don't know whether Albert Y. C. Lai is pulling my leg, or
he really confuses the operator grammars and other ways of
parsing... Everybody who taught Prolog knows that commas and
semicolons in this language ARE logical connectives, so replacing
one non-answer by another one "I would tell the same" is not an
appropriate response. There IS a concrete answer to this
question, both operators are xfy with well defined precedence.<br>
</p>
<p>In Pascal commas and semicolons are not operators at all, and the
standard parsing is a recursive top-down old machinery (well, it
was, when I studied the Wirth & Amman compiler sources). The
associativity is implicitly specified by the grammar productions.
In Matlab the syntactic connectives in matrices are not operators
either.<br>
</p>
<p>In one detail Albert Y. C. Lai is absolutely right, namely that
this discussion is completely pointless.</p>
<p>Jerzy Karczmarczuk</p>
<p><br>
</p>
</body>
</html>