Re:Parsers don't have to be complicated
by zabzonk on Friday August 07, 2026 @07:36AM
(#49208857)
FORTH parsers are ultra simple - get the next space-separated token, if it is a number, push it on the stack, otherwise it's a word - look it up in the dictionary and (if it exists there) execute it.
[ Parent
| on HN ]
Re:Parsers don't have to be complicated
by roaringrocky on Friday August 07, 2026 @08:16AM
(#49209250)
Even simpler is you go the colorforth route, part of the source code is "pre parsed" by the editor, a prefix byte is added to each word (which is shown as different colors), then a simple dispatch loop with that prefix as a sort of opcode.
Re:Parsers don't have to be complicated
by conartist6 on Friday August 07, 2026 @10:09AM
(#49210700)
This feels like a precursor to the project I'm doing, which I us to make an editor whose state and output are expressed as such "pre-parsed" syntax trees. I'm trying to make mine fully language agnostic though