Re: Philosophical question regarding statement terminators

vbdis@aol.com (VBDis)
17 Nov 2000 23:47:08 -0500

          From comp.compilers

Related articles
[3 earlier articles]
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)
Re: Philosophical question regarding statement terminators cfc@world.std.com (Chris F Clark) (2000-11-25)
| List of all articles for this month |

From: vbdis@aol.com (VBDis)
Newsgroups: comp.compilers
Date: 17 Nov 2000 23:47:08 -0500
Organization: AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com
References: 00-11-114
Keywords: design
Posted-Date: 17 Nov 2000 23:47:08 EST

Chris F Clark <cfc@world.std.com> schreibt:


> a = b * c = d /* does this parse as "a = b; *c = d;"
> or "a = (b * (c = d));" */


All your examples are based on ambiguous keywords (characters) for
operators or delimiters. Of course a language should have no such
ambiguous tokens, which can appear before, inside, or after an
expression, unless the next higher frame (line, statement...) is
delimited by other (unambiguous) tokens.


Since we (humans) use line breaks and indentation, to separate items
in source code, a compiler must handle these items, too. At least a
compiler must detect white space and line breaks, and then it doesn't
make a big difference, whether these tokens are ignored, or are
treated as separators or terminators.


AFAIR all existing languages allow for both multiple statements on a
single line, as well as for a single statement extending into
continuation lines. Only the according rules differ, on how to
separate or continue multiple statements, accross lines.


DoDi


[Lots of languages don't permit multiple statements per line. Also,
it seems to me that you want a language to have a certain amount of
syntactic redundancy so that a typo or other small error is less
likely to be something legal but not what you want, e.g. the notorious
Fortran DO 10 I = 1.10 -John]





Post a followup to this message

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