🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.forth
Article #79

Re: The curse of parsing words

#79
From: albert
Date: Wed, 14 Oct 2026 08:06
61 lines
3362 bytes
In article <11aj2b0$3pav1$1@dont-email.me>,
Hans Bezemer  <the.beez.speaks@gmail.com> wrote:
>On 12-10-2026 09:56, albert@spenarnc.xs4all.nl wrote:
>> I was to modify the metacompiler of noforth to make it more
>> portable, using i.a. ciforth.
>> https://github.com/WillemOuwerkerk/noForth-T-for-the-RP2040
>>
>> Enters +TO. If you add VALUE to a Forth and you don't have
>> +TO, how would you define it?  ( Fortunately ciforth has it,
>> besides the implementation of TO is in source and hints to
>> the implementation of +TO ).
>>
>> Untested:
>> : +TO    >IN @ >R BL WORD COUNT EVALUATE + R> >IN ! ['] TO EVALUATE ;
>>
>> Compares this to a missing +! .
>> Untested:
>> : +!   SWAP OVER @ + SWAP ! ;
>>
>> Groetjes Albert
>
>Agreed, I don't like parsing words either in 4tH. All of these are hard
>coded in my compiler (fifth column):
>
>...
>   { 2,  0, -2, "#!",          EOL,   DoComment },
>   { 2,  0, -1, ",\"",         "\"",  DoCommaQuote },
>   { 2,  0, -1, ",|",          "|",   DoCommaQuote },
>   { 2,  0, -1, ".\"",         "\"",  DoDotQuote },
>   { 2,  0, -1, ".(",          ")",   DoDotQuote },
>   { 2,  0, -1, ".|",          "|",   DoDotQuote },
>   { 2,  0, -2, "C,",          "",    DoCComma },
>   { 2,  0, -2, "C\"",         "\"",  DoCQuote },
>   { 2,  0, -2, "C|",          "|",   DoCQuote },
>   { 2,  0,  1, ">=",          "",    DoGreaterEqual },
>   { 2,  0,  1, "<=",          "",    DoLessEqual },
>   { 2,  0, -1, "S\"",         "\"",  DoSQuote },
>   { 2,  0, -1, "S|",          "|",   DoSQuote },
>...
>
>Before I had the preprocessor, there was no way to add any new ones
>without adding a token and recompiling the whole shebang. TO, however,
>is *NOT* one of my parsing words in the strictest sense. Still, without
>the preprocessor I cannot handle them without changing the compiler.
>
>I know that not all parsing words can be eradicated, but I wouldn't be
>unhappy if there were less. ;-)

I replace parsing words as much as possible with denotations.
A denotation leaves a constant value on the stack and it behaves
the same in interpret and compile mode
." ape gaar"        -->                 "ape gaar" TYPE
.( ape gaar)        -->                 "ape gaar" TYPE
S\" APE GAAR \n"      -->               "ape gaar%n" FORMATTED

>
>Hans Bezemer
-- 
The Chinese government is satisfied with its military superiority over USA.
The next 5 year plan has as primary goal to advance life expectancy
over 80 years, like Western Europe.
Technical Details
Message-ID: <nnd$5aef48e6$214a099c@3ae3c368d79558dd>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!abo004.abavia.com!feed.abavia.com!abr001.abavia.com!abp001.abavia.com!reseller!not-for-mail
References: <nnd$1f5237c6$175c34ce@0d71f53c3bdb5abf> <11aj2b0$3pav1$1@dont-email.me>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.forth
References: <nnd$1f5237c6$175c34ce@0d71f53c3bdb5abf> <11aj2b0$3pav1$1@dont-email.me>
From: albert@spenarnc.xs4all.nl
Subject: Re: The curse of parsing words
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$5aef48e6$214a099c@3ae3c368d79558dd>
Organization: www.abavia.com
Date: Wed, 14 Oct 2026 10:06:33 +0200
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!abo004.abavia.com!feed.abavia.com!abr001.abavia.com!abp001.abavia.com!reseller!not-for-mail
Lines: 62
Injection-Date: Wed, 14 Oct 2026 10:06:33 +0200
Injection-Info: reseller; mail-complaints-to="abuse@abavia.com"