Path: csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: George Neuner Newsgroups: comp.compilers Subject: Re: Applesoft tokenization phases? Date: Fri, 13 Mar 2020 17:55:54 -0400 Organization: A noiseless patient Spider Lines: 48 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <20-03-015@comp.compilers> References: <20-03-013@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="50755"; mail-complaints-to="abuse@iecc.com" Keywords: Basic, history, comment Posted-Date: 13 Mar 2020 18:06:58 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:2486 On Thu, 12 Mar 2020 17:46:00 +0200, "Ev. Drikos" wrote: >This question relates to thread "Languages with Optional Spaces". > >In an Applesoft II manual I've found at "classiccmp.org" [1], page 7, >we read that in a variable name any alphanumeric characters after the >first two are ignored, unless they contain a reserved world. FEND ie >would be illegal as it contains END. > >To implement such a rule one could first recognize keywords and then >recognize any names. We see in p123 that stmt I is tokenized as II: > I. stmt: 100 FOR A = LOFT OR CAT To 15 >II. tokens: 100 FOR A = LOF TO RC AT To 15 > >Yet, I've found ie a program at "hoist-point.com" [2] that contains: >110 DIFF = ABS(A(I)-N) > >Also, an online AppleSoft simulator at calormen.com [3] accepts ie both >DIFF and FEND as valid variable names. > >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? I recall there being some minor differences between the disk based AppleSoft BASIC on the Apple][ and ][+ (which required the additional language card to run) and the ROM AppleSoft BASIC on the //e, //c, and //gs. But I no longer recall exactly what those differences were. [ISTM the Apple /// also had a different ROM BASIC.] Unfortunately, I no longer have my //e or //gs, or any of my old AppleSoft BASIC code to look at. But my [perhaps faulty] recollection is that they did allow variable names to contain keywords as long as the name did not begin with the keyword. FWIW, I remember the //e AppleSoft manual having a different cover [the //gs did not come with a BASIC manual]. My suspicion is that the manual that is at classiccmp.org is for the original disk based version, but that the simulator is based on the later ROM version. YMMV, George [This is drifting into alt.folklore.computers territory. -John]