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


Groups > comp.compilers > #2493

Re: Applesoft tokenization phases?

From Christopher F Clark <christopher.f.clark@compiler-resources.com>
Newsgroups comp.compilers
Subject Re: Applesoft tokenization phases?
Date 2020-03-20 07:06 -0400
Organization Compilers Central
Message-ID <20-03-022@comp.compilers> (permalink)
References <20-03-013@comp.compilers> <20-03-016@comp.compilers> <20-03-017@comp.compilers>

Show all headers | View raw


Jerry Awanderin wrote:
> > Also, an online AppleSoft simulator at calormen.com [3] accepts ie both
> > DIFF and FEND as valid variable names.
>
> It is doing things differently than actual Applesoft.
>
> > As it seems, this issue can affect a design choice for the tokenization
> > phases of an Applesoft front-end. Is the manual just informative or the
> > online simulator does not accept (precisely) the particular dialect?
>
> The latter; the simulator accepts a different dialect.

For situations like this, we added classes (and inheritance) to Yacc++
lexers and parsers, so that one could define a common subset and then
extend it to cover the cases that are unique or different dialects.
However, one can do similar things with lexer states, flag/switch
variables, or a host of other techniques.  You just have to decide how
much mess you are willing to handle and how important supporting the
variations are.

There is a reason, BASIC compilers that remove spaces often restrict
variables (like the original Basic version did) to a letter optionally
followed by a digit (and a dollar sign to indicate strings).  It makes
the lexing much simpler, even without spaces.

--
******************************************************************************
Chris Clark                  email: christopher.f.clark@compiler-resources.com
Compiler Resources, Inc.  Web Site: http://world.std.com/~compres
23 Bailey Rd                 voice: (508) 435-5016
Berlin, MA  01503 USA      twitter: @intel_chris

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


Thread

Applesoft tokenization phases? "Ev. Drikos" <drikosev@gmail.com> - 2020-03-12 17:46 +0200
  Re: Applesoft tokenization phases? George Neuner <gneuner2@comcast.net> - 2020-03-13 17:55 -0400
  Re: Applesoft tokenization phases? awanderin <awanderin@gmail.com> - 2020-03-16 00:07 -0600
    Re: Applesoft tokenization phases? "Ev. Drikos" <drikosev@gmail.com> - 2020-03-18 00:14 +0200
      Re: Applesoft tokenization phases? Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2020-03-20 07:06 -0400
        Re: Applesoft tokenization phases? Martin Ward <martin@gkc.org.uk> - 2020-03-21 19:42 +0000

csiph-web