|Current work in compiler/language design. hackeron@Athena.MIT.EDU (Harris L. Gilliam - MIT Project Athena) (1991-11-10)|
|Syntax andy@SAIL.Stanford.EDU (1991-11-27)|
|Re: Syntax email@example.com (1991-12-03)|
|Re: Syntax firstname.lastname@example.org (1991-12-04)|
|Re: Syntax email@example.com (Raul Deluth Miller-Rockwell) (1991-12-05)|
|Re: Syntax firstname.lastname@example.org (1991-12-05)|
|Re: Syntax email@example.com (Eric A. Anderson) (1991-12-05)|
|Re: Syntax firstname.lastname@example.org (1991-12-05)|
|Re: Syntax email@example.com (1991-12-04)|
|From:||Raul Deluth Miller-Rockwell <firstname.lastname@example.org>|
|Date:||Thu, 5 Dec 91 00:24:31 est|
Dale R Worley:
In article 91-12-004 andy@SAIL.Stanford.EDU (Andy
[...] the "infix" languages don't agree on precedence because
people don't, at least for operators other than *, +, -, and /.
(BTW - There isn't even agreement on how consecutive - and /s
It's worse than that -- in Snobol 4, "-" has a lower precedence
than "+", that is, "a + b - c + d" is parsed as "(a + b) - (c +
d)". Similarly for "*" and "/".
And in J, "%" is used for division, and "/" is a meta-function which
affects how the function it's modifying gets its arguments. Also, "*"
and "%" are at the same precedence as "+" and "-", so that a*b+c*d is
parsed as a * (b + (c * d)).
And let's not forget associativity -- how is "a ** b ** c" to be
In J, it would be parsed a * (* (b * (* c))). [J uses "^" to indicate
exponentiation, monadic "*" indicates signum, "dereferencing a
pointer" is indicated by monadic ">".]
I'm not sure what this has to do with compilers except to point out
yet again that standards are limited in scope.
It's also interesting to note that J allows user defined prefix, infix
and postfix operators. A lot of this can be supported in a YACC based
parser simply by having the lexical analyzer look up identifiers in
the symbol table(s). However, I think an operator precedence parser
is better suited to this task.
Raul Deluth Miller-Rockwell <email@example.com>
[For people unfamiliar with it, J is a new dialect of APL. -John]
Return to the
Search the comp.compilers archives again.