Seth Stubbs
a8f36b45d1
Optimized uasm.c:pushScope()
...
- alloc-uxncle isn't called if there's nothing to add to the heap lol
10 months ago
Seth Stubbs
27d90fdc38
Refactored sublabels in uasm.c
...
- added newLbl(), defineSubLbl(), jmpCondSub() and jmpSub()
- switched compileIf() and compileWhile() to use these new functions
10 months ago
Seth Stubbs
a2fce92777
Added '<' and '>' operators
...
- added TOKEN_LESS, TOKEN_GREATER, TOKEN_LESS_EQUAL, and TOKEN_GREATER_EQUAL
- while these are all supported in the parser, the compiler (uasm.c) lacks support for TOKEN_LESS_EQUAL && TOKEN_GREATER_EQUAL
10 months ago
Seth Stubbs
b6403825f9
Optimized uasm.c:popScope()
10 months ago
Seth Stubbs
c21d4e6b42
Added while loops!
...
- Added TOKEN_WHILE and NODE_STATE_WHILE
- Also added UASTWhileNode
10 months ago
Seth Stubbs
1b179716f7
Optimized uasm.c:compileIf()
10 months ago
Seth Stubbs
df52827b72
Added if statements, added TYPE_BOOL
...
- Bug fixes in uasm.c, including tryTypeCast()
- added a couple of new tokens, TOKEN_IF, TOKEN_ELSE, and TOKEN_BOOL
- Refactoring as well as some bug fixes int uparse.c
10 months ago
Seth Stubbs
e93f2d646a
Added hexadecmial support
...
- Added TOKEN_HEX to lexer and parser
10 months ago
Seth Stubbs
5584d746a6
Added TOKEN_EQUAL_EQUAL && TOKEN_BANG_EQUAL
...
- Also added uasm.c:tryTypeCast to automatically convert between types
- Added TOKEN_BANG but left unimplmented
11 months ago
Seth Stubbs
bad7dec335
Added UASTRootNode
...
- This'll let me include more information later, like type info, etc.
11 months ago
Seth Stubbs
457a28c037
Changed the way errors are reported, added TOKEN_CHAR_LIT
...
- basic character parsing support added to ulex.c
- UASTNode now includes it's corresponding UToken so errors can be better reported in uasm.c
11 months ago
Seth Stubbs
01cf747869
Minor refactoring, added NODE_STATE_DECLARE_VAR
...
- renamed uasm.c:compileInt to compileDeclaration
11 months ago
Seth Stubbs
0ca4f9e9a2
Added SIZE_* macros and used them for better readability
11 months ago
Seth Stubbs
af756b451f
Switched "short" to "int", "byte" to "char"
11 months ago
Seth Stubbs
d9ff973da1
Added assignment expressions
...
- Some code paths in casm.c assume a short value is used. This should be fixed before adding support for more datatypes
- Added a new AST Node type, NODE_ASSIGN
11 months ago
Seth Stubbs
ba1b099671
Refactored uasm.c
...
- compileExpression() now returns the datatype of the expression
- Misc. refactoring and bug fixes
11 months ago
Seth Stubbs
d8456793f9
Major refactoring, added short variables, added thin memory management library!
11 months ago
Seth Stubbs
9659675122
Added base scope/variable boilerplate stuff to uparse.c
...
- Also switced to a more modular "struct inheritance" design for UASTNodes
11 months ago
Seth Stubbs
c871f672d7
Minor cparse.[ch] refactoring, removed UStateType
11 months ago
Seth Stubbs
3257ed9041
Added basic statement support ot uparse.c
...
- UM_realloc was moved from a macro to an actual function to handle error results
- NODE_STATE nodes have a new value in the node's union, sType which describes the type of statement the node is.
- 'prntint' statements are the only statement avalible for now, they allow printing the value of expressions to the console.
- fixed a bug in ulex.c/identifierType
- main.c was updated to show the prntint statement.
- uparse.c was refactored a bit, including some debugging prints for now
11 months ago
Seth Stubbs
f29e4a9831
Added UP_freeTree & free'd the AST after use in main.c
11 months ago
Seth Stubbs
1e1491c483
Added some boilerplate to print the evaluated expression to the console
11 months ago
Seth Stubbs
78bd44be88
Added basic AST traversal compiler!
11 months ago
Seth Stubbs
4b34b9a9d5
Fixed various issues with the parser & started uasm.[ch]
11 months ago
Seth Stubbs
109b3e1ff2
removed bin binary
11 months ago
Seth Stubbs
ea934aa55a
Switched to c89
11 months ago
Seth Stubbs
1135e570bc
Minor bug fixes, removed object files
11 months ago
Seth Stubbs
4fb5aab146
Added basic AST parser, printTree() is used to show the generated tree
11 months ago
Seth Stubbs
f17285ec6c
inital commit
11 months ago