Bill Currie
ea3895805b
Rewrite much to use symbols and symtabs. Gut emit.c. Massive breakage.
...
That which isn't rewritten is horribly broken. However, this does include a
nice mechanism for building QC structs for emitting data.
emit.c has been gutted in the spirit of "throw one away".
There is much work to be done to get even variables emitted, let alone
code. Things should be a little more fun from here on.
2011-01-17 22:34:41 +09:00
Bill Currie
fb8b3d1211
Rework the lexer and parser to use symbols instead of defs.
...
Currently parses the test program just fine, but code generation is very
very broken.
2011-01-13 14:58:16 +09:00
Bill Currie
3c9991364b
Add a "void return" instruction.
...
I got fed up with always having to explicty return something.
2011-01-13 00:29:56 +09:00
Bill Currie
9ce9b70484
Add variadic functions.
...
Already extending QuakePascal, and many basics aren't there yet :P
2011-01-12 23:39:59 +09:00
Bill Currie
02b3dde83b
Make QuakePascal programs runnable.
...
Generate a mini-main function (".main", to avoid namespace pollution) that
calls the function named by "program", and make qwaq check for ".main" as
well as "main". If both are present, ".main" will take priority.
2011-01-12 23:39:22 +09:00
Bill Currie
332b7da127
Minor header cleanup.
2011-01-12 23:34:15 +09:00
Bill Currie
75ec6bf244
Clean out some unnecessary types from the progs engine and clean up the mess.
...
This is a nasty commit, sorry, but 99% of the commit is interdependent.
2011-01-10 12:25:31 +09:00
Bill Currie
c69ac1f56f
Don't segfault when build_builtin_function detects an error.
2011-01-10 12:25:31 +09:00
Bill Currie
a17e73c863
Generate code.
...
It's now time to work on the revamp of the symbols, trees, etc.
2011-01-10 12:25:31 +09:00
Bill Currie
e34f7caeb0
Use op instead of integer_val for ADDOP etc.
2011-01-10 12:25:31 +09:00
Bill Currie
edaa6235e7
Get functions/procedures emitted.
...
No actual code is emitted, though.
2011-01-10 12:25:31 +09:00
Bill Currie
fed82466cc
The first stages of Quake-Pascal.
...
At present, this parses a subset of the pascal language with a few type
extensions. There is already work on the type system.
2011-01-10 12:25:31 +09:00