That's the real purpose of this module; it's not really generating an
AST since ARL's syntax isn't tree like whatsoever.
The next stage will be something closer to an AST, in the sense we'll
be introducing:
- Syntactical analysis
- Type Checking
LOG, LOG_ERR. LOG_ERR will always compile to a /stderr/ print. LOG,
on the other hand, may not actually do anything if VERBOSE_LOGS is
not 1. By default it is 0, so it must be defined when compiling to
enable - hence the adjustment of the Makefile.
Main reason is so we don't have that stupid arl prefix directory in
our source code. Now our source code is flat, and we can still
reference headers by linking from root.
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.
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.