Commit graph

152 commits

Author SHA1 Message Date
pommicket
d0d868433e clean up stb_sprintf; implementation of fprintf et al, remove 2022-02-14 12:04:49 -05:00
pommicket
f7a8a193c2 snprintf now working! (fixed problem will calls inside calls) 2022-02-14 11:39:33 -05:00
pommicket
1f9534d750 cleanup notes 2022-02-13 22:20:49 -05:00
pommicket
b9fd2a2b9c sprintf working! (but not snprintf ...) 2022-02-13 22:12:44 -05:00
pommicket
2fef698195 first C hello world! 2022-02-13 15:07:26 -05:00
pommicket
6acd24e315 C compiler done ? va_list/arg program working :) 2022-02-13 14:35:34 -05:00
pommicket
239a1a3c27 fixed local variables and also structs containing arrays 2022-02-13 14:24:38 -05:00
pommicket
24f260fa16 switch / case / default 2022-02-13 13:42:26 -05:00
pommicket
5dba28b8ba labels, goto 2022-02-13 12:51:21 -05:00
pommicket
a26f0d52d9 break, continue 2022-02-13 12:43:34 -05:00
pommicket
70523ba1bb if, while, do 2022-02-13 12:24:19 -05:00
pommicket
f6ee9bfa66 pre/post increment/decrement 2022-02-13 11:59:18 -05:00
pommicket
6814de1974 comparison operators 2022-02-13 11:24:30 -05:00
pommicket
6b42f4198f compound assignment operators 2022-02-13 10:06:41 -05:00
pommicket
07faf56f7d fix dereferencing function pointer codegen 2022-02-13 09:33:05 -05:00
pommicket
8c82a83778 fix casting arguments to parameter type 2022-02-12 23:44:48 -05:00
pommicket
29a92afcf2 logical and,or 2022-02-12 23:17:50 -05:00
pommicket
47688e0a46 fix generate_function_addr; conditional expressions 2022-02-12 23:05:14 -05:00
pommicket
e0495afd42 function calls mostly working 2022-02-12 21:27:57 -05:00
pommicket
dd8eaee987 bitwise and,or,xor, shifts 2022-02-12 18:58:24 -05:00
pommicket
31aff32423 codegen remainder, fix addition 2022-02-12 18:47:03 -05:00
pommicket
d44625524a multiplication and division 2022-02-12 16:57:40 -05:00
pommicket
8b68a433ff assignments, STATEMENT_EXPRESSIONs 2022-02-12 16:08:58 -05:00
pommicket
3ff998da40 codegen for . -> , 2022-02-12 14:31:14 -05:00
pommicket
864b23702a codegen for address of 2022-02-12 14:12:01 -05:00
pommicket
0ee06ac2c4 codegen for dereference, subscript 2022-02-12 13:53:35 -05:00
pommicket
0a14c8ca2a local variables 2022-02-12 12:03:00 -05:00
pommicket
b69bd8be29 codegen for global variables 2022-02-12 11:37:40 -05:00
pommicket
3db0956b19 subtraction codegen 2022-02-11 23:39:54 -05:00
pommicket
81d6850539 addition 2022-02-11 14:34:54 -05:00
pommicket
b13e16b517 fixed prefix -- parsing; codegen for unary + - ~ ! 2022-02-11 13:52:56 -05:00
pommicket
017a70ee7e generating code for casts! 2022-02-10 21:11:53 -05:00
pommicket
bba56d2b51 return, integer literals 2022-02-10 18:09:44 -05:00
pommicket
d8bb5b8957 first working executable! 2022-02-10 16:06:17 -05:00
pommicket
b88de92fc7 fix some calling convention stuff 2022-02-10 13:24:02 -05:00
pommicket
3d44eba388 start codegen 2022-02-09 22:44:27 -05:00
pommicket
d74dc53b0b more parsing tests, fixed more bugs
- we now handle incomplete structs properly
- small fix in for loop printing
2022-02-09 15:50:02 -05:00
pommicket
c548b12bbb fixed #include -> #include in certain cases, found a new bug 2022-02-08 22:17:28 -05:00
pommicket
d7a9a565a9 fix declaring multiple variables after struct definition 2022-02-08 21:53:14 -05:00
pommicket
0a2d05bdd5 more parsing tests, more fixes
- #elif now actually works properly (hopefully)
- fixed some array decaying bugs (hopefully), and generally simplified typing
2022-02-08 20:09:08 -05:00
pommicket
26fccf7cd7 fix #elif line number problem with parse test 2022-02-07 17:23:26 -05:00
pommicket
aba654c36d fix a bunch of problems from parsing test
- ll suffixes (15ll => 15l)
- newlines between string literals to be concatenated
- fix *x++ = 1;
- default
- printing conditionals & decaying conditional operands
2022-02-07 17:02:57 -05:00
pommicket
16bad1636d fix multi-line fmacro invocations 2022-02-07 16:33:27 -05:00
pommicket
e21c1c39a7 capital number suffixes (oops) 2022-02-07 16:07:55 -05:00
pommicket
0752c66291 handle object macro definitions beginning with ( oops 2022-02-07 16:03:31 -05:00
pommicket
cfe52e2cfe handle fmacros with no parameters 2022-02-07 16:01:35 -05:00
pommicket
ef1100ad08 defined in #if (forgot about that earlier) 2022-02-07 15:53:44 -05:00
pommicket
4b6fe5266a cleanup - declaring functions without defining them, etc. 2022-02-07 15:16:26 -05:00
pommicket
9372a72d43 proper call typing? 2022-02-07 14:52:50 -05:00
pommicket
c2377fa40f parsing calls, mostly 2022-02-07 12:18:41 -05:00