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


Groups > comp.compilers > #2458

Re: Languages with optional spaces

Path csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From Martin Ward <martin@gkc.org.uk>
Newsgroups comp.compilers
Subject Re: Languages with optional spaces
Date Tue, 25 Feb 2020 17:00:57 +0000
Organization Compilers Central
Lines 35
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <20-02-020@comp.compilers> (permalink)
References <20-02-015@comp.compilers> <20-02-017@comp.compilers>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 8bit
Injection-Info gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="4024"; mail-complaints-to="abuse@iecc.com"
Keywords lex, Basic, history
Posted-Date 27 Feb 2020 17:33:10 EST
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
In-Reply-To <20-02-017@comp.compilers>
Xref csiph.com comp.compilers:2458

Show key headers only | View raw


On 23/02/20 10:33, Ev. Drikos wrote:
> [You can try start states but in my experience if the tokenizing rules
> are very context sensitive, it's easier to give up and hand-code the
> lexer.  The lexical syntax of Basic isn't that big. -John]

The BASIC for the Compukit UK101 and Ohio Superboard stores
each line as a sequence of characters. As a line is entered
any keywords appearing anywhere on the line are replaced
by control characters. Keywords are not allowed anywhere
within a variable name. So any statement either starts
with a keyword (a control character), which determines
the statement type, or it is an assignment with the LET
keyword omitted.

Due to the small amount of memory available, variable names
are typically kept short and spaces are omitted. Short variable
names are less likely to include an embedded keyword.
Also, only the first two characters of a variable name are significant.
The program will also run faster with short variable names:
since the BASIC interpreter scans each line as it is interpreted.

More information and some sample BASIC software:

http://www.gkc.org.uk/martin/software/#UK101

A procedurally generated, open world, RTS (real time strategy) game
with destructable environments which runs in 8K of RAM:

http://www.gkc.org.uk/martin/software/startrek.html

--
			Martin

Dr Martin Ward | Email: martin@gkc.org.uk | http://www.gkc.org.uk
G.K.Chesterton site: http://www.gkc.org.uk/gkc | Erdos number: 4

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