Commit Graph

7 Commits (d9edbab10c05e51aa727d147207c72ea5a9fcc1f)

Author SHA1 Message Date
James T. Martin 8808c41250
Factor out executable format handling into a new file. 2022-09-10 22:06:21 -07:00
James T. Martin fcd61f6c5f
Wrote IR gen!! (Literally untested, though.)
Next stages are to wire it into the parser so I can test it,
to implement operator precedence so exprs actually exist,
and then implement operators and builtins until I can
start writing basic programs.
2022-09-08 21:07:40 -07:00
James T. Martin 9b41081c71
Indentation-sensitive syntax! 2022-09-08 16:02:30 -07:00
James T. Martin d7c0eef7ae
Implemented parser! Recognition only, no output.
Also no top-level declarations or operator precedence.

The syntax is LL(1). LL syntax seems necessary because
our codegen requires emitting certain code (e.g. entering control)
prior to any codegen inside that context, whereas something like
LR would presumably parse the inner expression before recognizing
the control structure. There may be some way to work around this;
I don't know, I'm not a parsing expert.

Certain parts of the syntax are wonky, e.g. juxtaposition as
function application means a missing semicolon can give confusing
results. I suspect indentation-sensitive syntax would work
more nicely, and intend to implement it some time in the future.
2022-09-07 20:42:37 -07:00
James T. Martin 162683d63e
Hacked together a god-awful hand-written lexer. 2022-09-07 11:07:05 -07:00
James T. Martin 4e06f8d00f
Separate instruction encoding into a separate file.
I describe the intended file structure in comments
at the top of each file.
2022-09-06 02:20:10 -07:00
James T. Martin b5667c61ec
Initial commit. 2022-09-05 23:48:56 -07:00