|Applesoft tokenization phases? email@example.com (Ev. Drikos) (2020-03-12)|
|Re: Applesoft tokenization phases? firstname.lastname@example.org (George Neuner) (2020-03-13)|
|Re: Applesoft tokenization phases? email@example.com (awanderin) (2020-03-16)|
|Re: Applesoft tokenization phases? firstname.lastname@example.org (Ev. Drikos) (2020-03-18)|
|Re: Applesoft tokenization phases? email@example.com (Christopher F Clark) (2020-03-20)|
|Re: Applesoft tokenization phases? firstname.lastname@example.org (Martin Ward) (2020-03-21)|
|From:||Martin Ward <email@example.com>|
|Date:||Sat, 21 Mar 2020 19:42:17 +0000|
|References:||20-03-013 20-03-016 20-03-017 20-03-022|
|Injection-Info:||gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="66018"; mail-complaints-to="firstname.lastname@example.org"|
|Keywords:||Basic, lex, history|
|Posted-Date:||21 Mar 2020 16:50:24 EDT|
On 17/03/20 22:14, Ev. Drikos wrote:
> Another vague point or simply a point where I'm not really sure that I
> translate properly the manual are the reserved keywords before a certain
> delimiter. Likely an Applesoft parser must reject this valid UK101 code:
> 10 X=SHIMEM:
> 20 END
For those less familiar with UK101 BASIC: this code is only
valid because "HIMEM" is not a keyword in UK101 BASIC.
UK101 does not allow keywords as part of a variable.
> 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.
Lexing is not the issue: the real reason for the restriction
is to make the symbol table much simpler. Each variable in the table
takes up a fixed amount of space. For the UK101, only the first two
characters of a variable are significant, so only two characters
are needed in the symbol table. "Lexing" a statement just consists
of replacing all keywords outside strings by special characters.
When the interpreted parses it, each statement either starts
with a keyword or is an assignment and starts with a variable.
Dr Martin Ward | Email: email@example.com | http://www.gkc.org.uk
G.K.Chesterton site: http://www.gkc.org.uk/gkc | Erdos number: 4
Return to the
Search the comp.compilers archives again.