|Low-Rent Syntax Donald.Lindsay@MATHOM.GANDALF.CS.CMU.EDU (1990-08-09)|
|Re: Low-Rent Syntax firstname.lastname@example.org (Theo Norvell) (1990-08-12)|
|Re: Low-Rent Syntax doug@nixtdc.UUCP (1990-08-12)|
|Low-Rent Syntax email@example.com (Stephen D. Clamage) (1990-08-12)|
|From:||doug@nixtdc.UUCP (Doug Moen)|
|Organization:||Nixdorf Computer Engineering Company|
|References:||<firstname.lastname@example.org> <email@example.com> <1990Jul26.firstname.lastname@example.org> <1990Jul27.email@example.com> <1990Aug09.firstname.lastname@example.org>|
|Date:||Sun, 12 Aug 90 13:54:36 GMT|
>The Icon language (Arizona) and the Turing language (Toronto) both
>have "low rent" syntax - that is, the ";" is only needed (as a
>separator) when one writes multiple statements on a single line. In
>all other cases, it can be omitted.
>Is there now a "usual" way to implement this ?
Actually, Icon and Turing are quite different in this respect.
In Icon, ";" is required as a separator in order to write multiple
statements on a single line. If you need to split a single statement over
several lines, you must be careful about where you put the line break: the
part of the statement which preceeds the newline must not look like a
Turing, on the other hand, doesn't rely on such kludges. Turing does not
use ";" as a statement separator or terminator, and it treats newline as
ordinary white space. Instead, the grammar is designed so that you can
always unambigously tell when one statement stops and another begins.
- an if statement always begins with "if", and ends with "end if".
- a procedure call statement begins with an identifier,
and ends with a ) or an identifier.
- an assignment statement begins with an identifier,
and ends with an identifier, a literal constant, or ).
Note that in Turing, you can't write an arbitrary expression as a statement,
as you can in Icon or C. If you could, then the grammar would
be highly ambiguous. For example, you would not be able to
tell if "a - b" were one statement (ie, a-b;) or two (ie, a; -b;).
[Any idea whether it's particularly easy or hard to diagnose syntax errors
in Turing programs? -John]
Return to the
Search the comp.compilers archives again.