Post #1060645
2026-04-10 23:46 UTC
Oh, yes, we are getting like Scheme or CL here. Parsing takes place in phases.
The first phase will be ... you guessed it ... EXPANSION.
But we really start simple. This actually encompasses the READER phase of Scheme as well. And Scheme is not at all good about letting you work with the reader. Here it will be no problem. Because the initial tokens from the scanner will be just two:
EOF and CODE-POINT
You add rules to the Pratt parser to transform these to new tokens...
Replies (1)
-
@chemoelectric@masto.ai 2026-04-10 23:52
This output then gets fed back into the Pratt parser for another round. The process continues until the token stream reaches a fixed point. Then the Pratt parser’s ruleset is replaced with one for producing parse trees. The rulesets are to be defined by plugins, so the compiler is customizable. Most likely the parse trees will be converted to whole program direct threaded code with proper tail calls, by use of GCC computed goto. Cl*ng supports computed goto.