August Karlstrom
2008-08-08 15:04:22 UTC
In the chapter "Compiler Construction" from the book "The School of
Niklaus Wirth"(*) Hanspeter Mössenböck writes:
"Unfortunately even Wirth's languages contain a few constructs which are
not LL(1). To analyze such constructs, it is not sufficient to rely on
syntactic information. One must also take semantic information into
account. For example, a type guard x(T) in Oberon cannot be
distinguished from a procedure call syntactically. One has to consult
the symbol table to find out if x is a procedure or a variable. This
ambiguity could have easily been avoided, for example by using curly
brackets instead of round brackets."
Does anyone here know the motivation for the mentioned irregularity,
i.e. why not write x{T} instead of x(T)? Are there more examples of
non-LL(1) constructs in Oberon?
August
(*) This article is also available at
ftp://ftp.ssw.uni-linz.ac.at/pub/Papers/Moe00b.pdf
Niklaus Wirth"(*) Hanspeter Mössenböck writes:
"Unfortunately even Wirth's languages contain a few constructs which are
not LL(1). To analyze such constructs, it is not sufficient to rely on
syntactic information. One must also take semantic information into
account. For example, a type guard x(T) in Oberon cannot be
distinguished from a procedure call syntactically. One has to consult
the symbol table to find out if x is a procedure or a variable. This
ambiguity could have easily been avoided, for example by using curly
brackets instead of round brackets."
Does anyone here know the motivation for the mentioned irregularity,
i.e. why not write x{T} instead of x(T)? Are there more examples of
non-LL(1) constructs in Oberon?
August
(*) This article is also available at
ftp://ftp.ssw.uni-linz.ac.at/pub/Papers/Moe00b.pdf