Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #2471

Re: Languages with optional spaces

From "Ev. Drikos" <drikosev@gmail.com>
Newsgroups comp.compilers
Subject Re: Languages with optional spaces
Date 2020-02-29 21:38 +0200
Organization Aioe.org NNTP Server
Message-ID <20-02-034@comp.compilers> (permalink)
References <20-02-015@comp.compilers> <20-02-017@comp.compilers> <20-02-033@comp.compilers>

Show all headers | View raw


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

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Languages with optional spaces Maury Markowitz <maury.markowitz@gmail.com> - 2020-02-19 07:35 -0800
  Re: Languages with optional spaces Jerry <awanderin@gmail.com> - 2020-02-20 23:38 -0700
    Re: Languages with optional spaces Maury Markowitz <maury.markowitz@gmail.com> - 2020-02-25 06:13 -0800
      Re: Languages with optional spaces awanderin <awanderin@gmail.com> - 2020-02-26 10:03 -0700
    Re: Languages with optional spaces "Ev. Drikos" <drikosev@gmail.com> - 2020-03-12 17:45 +0200
  Re: Languages with optional spaces "Ev. Drikos" <drikosev@gmail.com> - 2020-02-23 12:33 +0200
    Re: Languages with optional spaces Martin Ward <martin@gkc.org.uk> - 2020-02-25 17:00 +0000
      Re: Languages with optional spaces "Ev. Drikos" <drikosev@gmail.com> - 2020-02-28 13:34 +0200
    Re: Languages with optional spaces Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2020-02-29 11:48 +0200
      Re: Languages with optional spaces "Ev. Drikos" <drikosev@gmail.com> - 2020-02-29 21:38 +0200
        Re: Languages with optional spaces Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2020-03-01 10:07 +0200
        Re: Languages with optional spaces "Ev. Drikos" <drikosev@gmail.com> - 2020-03-01 19:41 +0200
          Re: Languages with optional spaces Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2020-03-02 08:33 +0200
            Re: Languages with optional spaces "Ev. Drikos" <drikosev@gmail.com> - 2020-03-02 20:04 +0200
      Re: Languages with optional spaces Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2020-03-01 00:28 +0100
  Re: Languages with optional spaces Maury Markowitz <maury.markowitz@gmail.com> - 2020-02-25 06:11 -0800
  Re: Languages with optional spaces Kaz Kylheku <493-878-3164@kylheku.com> - 2020-02-26 08:06 +0000
  Re: Languages with optional spaces and tools Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2020-02-28 20:16 +0100
  Re: Languages with optional spaces gah4@u.washington.edu - 2020-03-02 21:12 -0800
  Re: Languages with optional spaces Gene <gene.ressler@gmail.com> - 2020-04-14 10:08 -0700
  Re: Languages with optional spaces mertesthomas@gmail.com - 2020-04-19 04:04 -0700
  Re: Languages with optional spaces aston.goldsmith@gmail.com - 2020-05-05 13:05 -0700

csiph-web