Commit Graph

46 Commits

Author SHA1 Message Date
eb118db872
Major rewrite of the symbol parsing
Moved from a static double-ended list to individual singly-linked lists for easier and faster parsing
2021-01-20 01:05:41 +00:00
a52779e379
Place AST Dumping behind the option 2021-01-18 01:52:20 +00:00
cce059b9dc
Add errno header for linux build 2021-01-18 01:49:46 +00:00
bcd313270f
Rework compiler command line parsing, it can now assemble and link automatically 2021-01-18 01:47:42 +00:00
263e9d443a
Remove Print<x> functions. We can printf, baby. 2021-01-18 00:26:30 +00:00
52134784a4
Add function prototyping - we can now call cstdlib functions 2021-01-18 00:20:58 +00:00
813a6c7827
Add parsing for function calls 2021-01-17 21:56:37 +00:00
389d4b47ff
Working towards functions.. We have parameters and function local types 2021-01-17 06:37:39 +00:00
0c148f6e0c
Add overrides for aliasing int types to their bit width (int->i32) 2021-01-17 06:36:11 +00:00
39ee1b6028
Working local variables.
Next up: multiple function parameters..
2020-11-30 20:01:00 +00:00
384f46054a
Local Variables.
Still got issues with code generation, and for some reason identifier IDs are always 1.
2020-11-27 21:16:50 +00:00
e2120bb171
Working on the refactor for local symbols. 2020-11-25 22:53:50 +00:00
6ce26709de
Start refactoring Symbols for scoping rework 2020-11-25 17:03:33 +00:00
b540d5ef1b
Cleanup data, prepare for local vars 2020-11-25 02:11:09 +00:00
627839aa5d
Implement code generation for new operators. 2020-11-24 13:17:01 +00:00
eab4d51f25
Tweaked parser to allow implicit conversion of type checks to bool 2020-11-24 00:21:08 +00:00
473af8d54e
Add new symbols to the parser. They are not currently handled 2020-11-23 21:42:32 +00:00
e44158f3b7
Prepare for bitwise, boolean and PPMM operators 2020-11-23 20:01:36 +00:00
245daeb6f9
Clean up generated assembly - the switch takes care of the primitive size so we need only pass a length of 1 for variables. 2020-11-23 19:23:41 +00:00
4f75085348
Refactor symbols, enforce size argument.
Fixes string parsing. tests/strings now runs flawlessly.
2020-11-23 19:12:13 +00:00
86b1688035
Start work on string parsing.
Generates a valid AST tree, but the program segfaults. Need to look into it.
2020-11-22 01:44:54 +00:00
0dc444acfc
Fix typo
Lost my train of thought while typing this.
2020-11-22 00:43:32 +00:00
b384973379
Prepare for string literal parsing 2020-11-22 00:42:13 +00:00
9ff658615b
Add character literal parsing 2020-11-22 00:41:48 +00:00
2345931528
Fix wrong type in check inside OperatorPrecedence 2020-11-21 23:15:24 +00:00
72fa2127c8
Add a little extra output during tree dump to make it easier to figure out what's going on with parser errors. 2020-11-21 22:17:02 +00:00
28c349726e
Fix array parsing properly. 2020-11-21 22:16:10 +00:00
8d2f98aa53
Oops! Missed something in the refactor for arrays. 2020-11-21 02:37:01 +00:00
cf5f58f1bc
Small cleanup of print output. 2020-11-21 02:32:46 +00:00
c2c4d2f1d5
Brute force fix for arrays. TODO: Investigate this. 2020-11-21 02:32:22 +00:00
83959b4793
More work on arrays. Fixed some bugs.
Still need to figure out why AsStrDeref isn't working.
2020-11-21 02:07:44 +00:00
999f8dc267
Begin cleanup of array parsing
TODO: debug segfault
2020-11-19 02:31:40 +00:00
985f02723e
Start work on array parsing 2020-11-18 20:49:08 +00:00
bc1bac8a63
Big cleanup and fixes.
We have pointer arithmetic!
2020-11-15 06:40:05 +00:00
d8abe6fec0
Add code for printing the AST tree after generation 2020-11-15 06:36:25 +00:00
764f89bb88
Add missing functions, fix missing breaks on switch 2020-11-14 22:26:12 +00:00
610c45e3e1
Adjust ASM generation to account for c11 pointer arithmetic standards 2020-09-14 02:08:14 +01:00
a0d2575a83
Refactor pointer arithmetic 2020-09-14 02:05:24 +01:00
264c50509e
Allow global-scope declarations
Function-local scope is still WIP, but you can now define things outside of function blocks.
2020-09-13 23:41:46 +01:00
a27d3dd782
Add support for pointers of char, int and long types 2020-09-13 02:26:49 +01:00
822376d142
Add new tests to help debugging 2020-09-13 02:26:18 +01:00
c2b396b853
Fix bug in loading values into variables 2020-09-13 00:04:38 +01:00
7fe6a34613
Fix functions all having the same ID on call. Closes #1
Honestly, this is why i want =? in this lang. This bug is silly and i hate it
2020-09-12 02:54:12 +01:00
a3ca8e621b
Add debugging messages to help track down issue 1 2020-09-12 02:52:51 +01:00
84fbd5bd61
Fix stupid bug. Closes #2 2020-09-11 03:30:09 +01:00
59329d963f
First files.
Currently has two bugs.

First, all functions are resolved to index 0 (currently PrintInteger)

Second, the register used for returning is immediately overwritten by the next allocated register. This means addition of function return values is a little silly.

Also, commit signing!
2020-09-10 02:01:18 +01:00