Re: Languages with optional spaces

"Ev. Drikos" <drikosev@gmail.com>
Sat, 29 Feb 2020 21:38:14 +0200

          From comp.compilers

Related articles
[4 earlier articles]
Re: Languages with optional spaces maury.markowitz@gmail.com (Maury Markowitz) (2020-02-25)
Re: Languages with optional spaces martin@gkc.org.uk (Martin Ward) (2020-02-25)
Re: Languages with optional spaces 493-878-3164@kylheku.com (Kaz Kylheku) (2020-02-26)
Re: Languages with optional spaces awanderin@gmail.com (awanderin) (2020-02-26)
Re: Languages with optional spaces drikosev@gmail.com (Ev. Drikos) (2020-02-28)
Re: Languages with optional spaces christopher.f.clark@compiler-resources.com (Christopher F Clark) (2020-02-29)
Re: Languages with optional spaces drikosev@gmail.com (Ev. Drikos) (2020-02-29)
Re: Languages with optional spaces DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2020-03-01)
Re: Languages with optional spaces christopher.f.clark@compiler-resources.com (Christopher F Clark) (2020-03-01)
Re: Languages with optional spaces drikosev@gmail.com (Ev. Drikos) (2020-03-01)
Re: Languages with optional spaces christopher.f.clark@compiler-resources.com (Christopher F Clark) (2020-03-02)
Re: Languages with optional spaces drikosev@gmail.com (Ev. Drikos) (2020-03-02)
Re: Languages with optional spaces gah4@u.washington.edu (2020-03-02)
[4 later articles]
| List of all articles for this month |

From: "Ev. Drikos" <drikosev@gmail.com>
Newsgroups: comp.compilers
Date: Sat, 29 Feb 2020 21:38:14 +0200
Organization: Aioe.org NNTP Server
References: 20-02-015 20-02-017 20-02-033
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="86678"; mail-complaints-to="abuse@iecc.com"
Keywords: lex, Basic
Posted-Date: 29 Feb 2020 15:11:30 EST
Content-Language: en-US

On 29/02/2020 11:48, Christopher F Clark wrote:
> "Ev. Drikos" <drikosev@gmail.com> posted an interesting albeit partial solution
> to the problem of keywords being part of identifiers in languages with
> optional spaces.


It's only an example for the beginning of statements, based on the
description I read in other postings. It couldn't be the solution of
an unspecified problem. The terms "usually" & "in theory" aren't specs.


In contrast, one who wants to code a parser for the particular dialect
of BASIC should know ie what the 6502 or the Compukit UK101 code did.


> The problem is that some keywords can appear at places other than the
> beginning of an identifier.
> In fact, in the worst case scenario, the language can be ambiguous.
>...
>
> With a GLR parser (or something equivalent in power, e.g. an Earley
> parser or CYK) and a lexer that returns all possible sets of
> tokenizations one can find all the relevant parse trees and then see
> if only 1 makes semantic sense.


Obviously, those who coded such BASIC parsers had some simpler rules,
ie the position of the first 'TO' might be used for the statement 50.
Such ruling may comply with the description given by Dr Martin Ward.


Ev. Drikos



Post a followup to this message

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