Re: Philosophical question regarding statement terminators

wclodius@aol.com (Wclodius)
14 Nov 2000 13:06:22 -0500

          From comp.compilers

Related articles
Philosophical question regarding statement terminators steve@brazzell.com (Steve Brazzell) (2000-11-07)
Re: Philosophical question regarding statement terminators tmoog@polhode.com (Tom Moog) (2000-11-09)
Re: Philosophical question regarding statement terminators cfc@world.std.com (Chris F Clark) (2000-11-09)
Re: Philosophical question regarding statement terminators jthorn@galileo.thp.univie.ac.at (2000-11-09)
Re: Philosophical question regarding statement terminators vbdis@aol.com (2000-11-11)
Re: Philosophical question regarding statement terminators wclodius@aol.com (2000-11-14)
Re: Philosophical question regarding statement terminators cfc@world.std.com (Chris F Clark) (2000-11-14)
Re: Philosophical question regarding statement terminators jerrold.leichter@smarts.com (Jerry Leichter) (2000-11-14)
Re: Philosophical question regarding statement terminators cfc@world.std.com (Chris F Clark) (2000-11-15)
Re: Philosophical question regarding statement terminators vbdis@aol.com (2000-11-17)
Re: Philosophical question regarding statement terminators vbdis@aol.com (2000-11-19)
Re: Philosophical question regarding statement terminators adrian@sartre.cs.rhbnc.ac.uk (A Johnstone) (2000-11-21)
[1 later articles]
| List of all articles for this month |

From: wclodius@aol.com (Wclodius)
Newsgroups: comp.compilers
Date: 14 Nov 2000 13:06:22 -0500
Organization: AOL http://www.aol.com
References: 00-11-069
Keywords: design
Posted-Date: 14 Nov 2000 13:06:22 EST

>To have a language without statement terminators (or statement
>separators) and without line continuations and still having an
>unambiguous grammar, one must have distinct statement starting tokens
>that can be recognized as starting a new statement (rather than
>continuing the list). Although, if the language does not have to be
>LR(1) or LL(1), you can put the distinct statement starting tokens one
>or two tokens into the rule.


Is this really true?


In some of the languages I am familiar with it appears that a
substantial subset could be parsed into statements using a rule such
as:


If a name is identified (preferably, but not necessarily, after an end
of line) such that no open brackets remain, and the name is not
immediately preceded by an operator or punctuation then a new
statement begins.


Mind you while I believe that it is possible to construct a language
using such a rule, properly reporting some common type of errors may
be more difficult than in languages with explicit terminators or
continuations, particularly if the language allows assignment
expressions as well as assignment statements. This sort of rule also
may not be well suited for most parser generators.


Note also that some forms of some forms of continuations or teminators
need not be obvious, e.g., the use indentation to indicate that the
line contiues the previous statement.


William B. Clodius


Post a followup to this message

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