Re: Turing syntax, was Low-Rent Syntax

Theo Norvell <>
Mon, 13 Aug 90 01:59:04 GMT

          From comp.compilers

Related articles
Re: Turing syntax, was Low-Rent Syntax (Theo Norvell) (1990-08-13)
| List of all articles for this month |

Newsgroups: comp.compilers
From: Theo Norvell <>
In-Reply-To: <>
Keywords: parse, design
Organization: CSRI, University of Toronto
References: <> <> <> <> <>
Date: Mon, 13 Aug 90 01:59:04 GMT

In article <> you write:

>[Any idea whether it's particularly easy or hard to diagnose syntax errors
>in Turing programs? -John]

Since the grammar is LL(1), _detection_ is theoretically as easy as in e.g.

But some errors do transform legal syntax to legal syntax where this would
not be the case if semicolons were mandatory. For example, if the comma is
accidentally omitted from the statement

put a(i), b(i)

it becomes two statements "put a(i)" and "b(i)" the latter being
(syntactically) a procedure call. Such a mistake would always cause a
context-constraint error (in this case, because "b" would not be a
procedure). A similar case is if you write

for i : 1..10 do
end for

rather than the correct

for i : 1..10
end for

The "do" is treated as a procedure call.

In most cases that come up in practice, though, syntax error detection,
diagnoses, and recovery are well done in the Turing compilers. One
effective (but heuristic) recovery strategy used is to skip everything up to
the end of the line.

After you have programmed in Turing for a while, you never again want to use
semicolons. The simplicity of the syntax reduces the number of syntax
errors by such a degree that it is easy to put up with the occasional

Theo Norvell

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.