Re: language design implications for variant records in a pascal-like language

Tony Finch <dot@dotat.at>
17 Jan 2011 17:28:25 +0000 (GMT)

          From comp.compilers

Related articles
[50 earlier articles]
Re: language design implications for variant records in a pascal-like cfc@shell01.TheWorld.com (Chris F Clark) (2011-01-14)
Re: language design implications for variant records in a pascal-like robin51@dodo.com.au (robin) (2011-01-15)
Re: language design implications for variant records in a pascal-like compilers@is-not-my.name (2011-01-16)
Re: language design implications for variant records in a pascal-like gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-01-16)
Re: language design implications for variant records in a pascal-like robin51@dodo.com.au (robin) (2011-01-17)
Re: language design implications for variant records in a pascal-like torbenm@diku.dk (2011-01-17)
Re: language design implications for variant records in a pascal-like dot@dotat.at (Tony Finch) (2011-01-17)
Re: language design implications for variant records in a pascal-like genew@ocis.net (Gene Wirchenko) (2011-01-17)
Re: language design implications for variant records in a pascal-like mcr@wildcard.demon.co.uk (Martin Rodgers) (2011-01-18)
Re: language design implications for variant records in a pascal-like robin51@dodo.com.au (robin) (2011-01-19)
Re: language design implications for variant records in a pascal-like 9cn6w6402@sneakemail.com (Peter Canning) (2011-01-18)
Re: language design implications for variant records in a pascal-like martin@gkc.org.uk (Martin Ward) (2011-01-24)
| List of all articles for this month |

From: Tony Finch <dot@dotat.at>
Newsgroups: comp.compilers
Date: 17 Jan 2011 17:28:25 +0000 (GMT)
Organization: dotat labs
References: 10-12-040 11-01-009 11-01-027 11-01-057
Keywords: design, syntax
Posted-Date: 18 Jan 2011 01:02:39 EST

Chris F Clark <cfc@shell01.TheWorld.com> wrote:
>
>Froma a grammar writing point of view, it is not particularly
>difficult to introduce PL/I style keywords to any LR grammar. The
>same changes should generally work for LL grammars also. If people
>are interested I can document them here.
>
>The harder question one has to ask is whether they make writing
>correct programs easier or harder. They certainly make more programs
>legal and lessen the burden of remembering all the keywords for a
>given language.


If you want this feature to work well then you have to design other
parts of the grammar to accommodate it.


Explicit statement delimiters help, because most keywords can only
occur at the start of a statement, or are only valid after a
particular statement-introducing keyword.


If you are using keywords to delimit blocks then block-dependent end
keywords are better, e.g. if..fi rather than if..end, so that the end
keyword doesn't become de facto reserved because it's special in so
many contexts. Or just use {..} punctuation.


>[IF THEN = ELSE THEN IF = ELSE; ELSE IF = THEN; -John]


Maybe we should re-introduce stropping using U+0332 COMBINING LOW LINE :-)


Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/


Post a followup to this message

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