Commit Graph

9 Commits

Author SHA1 Message Date
Aryadev Chavali
dc96e12145 parser -> lexer
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
2026-01-29 03:43:04 +00:00
Aryadev Chavali
84996130b7 base: Added some extra logging macros
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.
2026-01-28 08:59:29 +00:00
Aryadev Chavali
85f5502681 Makefile: Added recipe for generating compile_commands.json 2026-01-24 14:17:40 +00:00
Aryadev Chavali
76872179f9 *: Split off headers into their own folder
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.
2026-01-24 03:02:54 +00:00
Aryadev Chavali
10613f4a75 Makefile: factor out modules to make directory generation easier 2026-01-24 01:29:50 +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
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