Commit Graph

12 Commits

Author SHA1 Message Date
Aryadev Chavali
639ceb3c93 README and arl.org 2026-01-24 00:35:38 +00:00
Aryadev Chavali
55640a36ae Makefile: dependency generation
My previous idea was to generate a list of all the headers, and add it
as a dependency for all object files.  This way, any changes in a
header would trigger a rebuild of all object files, which would
in-turn trigger a build of the binary.

This will be a bit of an issue later on when we have stuff that's
independent of others; a change in parser code won't necessarily
affect code generation, but a change in AST will.  We don't want to
re-trigger builds for everything.

This setup forces gcc to generate a clear set of dependencies in the
build folder (in a syntax recognisable by Make), then include that in
the Makefile itself.  These dependencies are specific to each code
unit and so only concern the headers that code unit uses.
2026-01-22 22:38:32 +00:00
Aryadev Chavali
9b7adbbbe1 *: documentation 2026-01-22 22:20:28 +00:00
Aryadev Chavali
2576f04309 main: Update to use the parse_stream_get_line_col function 2026-01-22 21:55:14 +00:00
Aryadev Chavali
c21b4f06d1 parser/ast|parser: Use byte as indicator of position instead of line/col
Much faster than dealing with the line and column as we go.  In the
vast majority of cases this data is completely unnecessary, so this is
wasted effort.  At the point where we need accurate line/column
information, we can compute it - in an error state, it really doesn't
matter that we're spending that extra time to compute it.
2026-01-22 21:53:42 +00:00
Aryadev Chavali
a96c24a553 main: Used pretty printers to present the parsed objects 2026-01-22 21:46:39 +00:00
Aryadev Chavali
737986eb54 parser/ast: Added pretty printers for objects and ASTs 2026-01-22 21:46:35 +00:00
Aryadev Chavali
3354625094 parser/parser.c: parser subroutines prototypes
Even easier to read now: the main routine (parse) is close to the top
of the code unit, and the rest fall underneath in order of importance.
2026-01-22 21:46:35 +00:00
Aryadev Chavali
7955cac4a1 parser/parser.c: stream function prototypes
I've made prototypes for them, put at the top, and moved their
implementations to the bottom.  They're not exposed to anything
outside this code unit.  Now, when reading the code, the parsing
routines (which are the main reason to be here) are at the top and
clear to read.
2026-01-22 21:45:20 +00:00
Aryadev Chavali
a977f01a2a A whole host of stuff
We now have a primitive and not fully tested parser for strings and
symbol sequences.  We record the lines and columns of each object on
the object for better compile time error handling.

I've also structured the code base in a slightly weirder fashion,
which makes my includes look nicer.  I've split up stuff quite a bit
to ensure code units are bit more focused.
2026-01-22 21:25:30 +00:00
Aryadev Chavali
4ec6dd8259 Switch to C instead of C++, added example, program now reads file 2026-01-22 18:08:34 +00:00
Aryadev Chavali
4ac780e3e9 hello world! 2026-01-22 18:06:42 +00:00