A single-pass compiler for a simple imperative language.
 
 
Go to file
James T. Martin bce39fdc22
Greatly simplify lexer thanks to new knowledge of lookahead.
Now I know that the parser is LL(1) and the lexer also only
needs one-character lookahead, which allows me to dramatically
simplify the interface for IO input, and improve the interface
to the lexer. Even if I did want unbounded peek, I'd want
the interface to be `peek(off)`, not that awful buffer.

I intend to use the new lexer interface to make the parser
states more stateful, and potentially read multiple tokens
in a row. Then, states would only be needed for recursive
structures, without the awkward intermediate states like
ST_LABEL which exists only to let me burn a token.

I also removed the nonsense related to base 64 parsing,
because it was unclear how to handle it, and the advantages
of having it weren't clear. I kept up to base 36, but honestly
I might want to consider getting rid of everything but decimal,
hex, and binary anyway. I'm not sure if I'd want to keep using
the current syntax for the radix either.
2022-09-07 23:02:15 -07:00
src Greatly simplify lexer thanks to new knowledge of lookahead. 2022-09-07 23:02:15 -07:00
.editorconfig Initial commit. 2022-09-05 23:48:56 -07:00
.gitignore Initial commit. 2022-09-05 23:48:56 -07:00
LICENSE.txt Initial commit. 2022-09-05 23:48:56 -07:00
Makefile Implemented parser! Recognition only, no output. 2022-09-07 20:42:37 -07:00
README.md Initial commit. 2022-09-05 23:48:56 -07:00

README.md

Passlang

A one-pass, linear-time compile-and-go compiler.

I'm imposing these restrictions on myself to avoid over-engineering and give myself a design challenge. The goal is to make the absolute best language I can under these constraints, and then incrementally begin to relax the restrictions only when absolutely necessary to make progress.