2012-04-09 10:43:58 +00:00
|
|
|
This is my work in progress Quake C compiler. There are very few _good_ QC
|
2012-04-09 10:42:06 +00:00
|
|
|
compilers out there on the internet that can be used in the opensource
|
|
|
|
community. There are a lot of mediocre compilers, but no one wants those.
|
2012-04-09 10:43:58 +00:00
|
|
|
This is the solution for that, for once a proper Quake C compiler that is
|
2012-04-09 10:42:06 +00:00
|
|
|
capable of doing proper optimization. The design so far of this compiler
|
|
|
|
is basic, because it doesn't actually compile code yet.
|
|
|
|
|
|
|
|
gmqcc.h
|
|
|
|
This is the common header with all definitions, structures, and
|
|
|
|
constants for everything.
|
|
|
|
|
|
|
|
error.c
|
|
|
|
This is the error subsystem, this handles the output of good detailed
|
|
|
|
error messages (not currently, but will), with colors and such.
|
|
|
|
|
|
|
|
lex.c
|
|
|
|
This is the lexer, a very small basic step-seek lexer that can be easily
|
|
|
|
changed to add new tokens, very retargetable.
|
|
|
|
|
|
|
|
main.c
|
|
|
|
This is the core compiler entry, handles switches (will) to toggle on
|
|
|
|
and off certian compiler features.
|
|
|
|
|
|
|
|
parse.c
|
|
|
|
This is the parser which goes over all tokens and generates a parse tree
|
2012-04-10 05:05:14 +00:00
|
|
|
and check for syntax correctness.
|
2012-04-09 10:42:06 +00:00
|
|
|
|
2012-04-10 00:18:49 +00:00
|
|
|
typedef.c
|
|
|
|
This is the typedef system, this is a seperate file because it's a lot more
|
|
|
|
complicated than it sounds. This handles all typedefs, and even recrusive
|
|
|
|
typedefs.
|
|
|
|
|
2012-04-10 03:46:59 +00:00
|
|
|
alloc.c
|
|
|
|
This is just an allocator for the compiler, it's used for debugging reasons
|
|
|
|
only.
|
|
|
|
|
2012-04-09 10:42:06 +00:00
|
|
|
README
|
|
|
|
This is the file you're currently reading
|
|
|
|
|
|
|
|
Makefile
|
|
|
|
The makefile, when sources are added you should add them to the SRC=
|
|
|
|
line otherwise the build will not pick it up. Trivial stuff, small
|
|
|
|
easy to manage makefile, no need to complicate it.
|
|
|
|
Some targets:
|
|
|
|
#make gmqcc
|
|
|
|
Builds gmqcc, creating a gmqcc binary file in the current
|
|
|
|
directory as the makefile.
|
|
|
|
|
|
|
|
#make clean
|
|
|
|
Cleans the build files left behind by a previous build
|