7 Commits

Author SHA1 Message Date
5272fdb227 Add more values to the ast to facilitate encoding
- Add a instruction value that contains the encoding, the address and a
  flag to indicate if this instruction contains label references
- Add label value that contains an address
- Add reference value that contains offset, an absolute address and an
  operand size
- define types for all value options in the union
- define accessor functions for all the values in the union
2025-04-23 15:57:04 +02:00
9c6b69e187 Symbol table now keeps track of label statements
Before it kept track of a more specific node that referenced the symbol
in some way. Now it will only keep track of the actual label defining
statements. This is done to facilitate encoding. The encoder can now go
from a symbol name to the statement that defines the symbol.

Restructure the encoder to deal with this and pass the correct statement
to the symbol update function.
2025-04-18 14:00:08 +02:00
d97cfb97be Implement printing the encoding in main
All checks were successful
Validate the build / validate-build (push) Successful in 33s
2025-04-16 23:10:17 +02:00
8c0e9926c5 Make main properly return with failure on parsing errors 2025-04-16 13:46:19 +02:00
5ea942024f add functionality to main to parse and print the ast 2025-04-02 20:57:02 +02:00
bd37ddaeea Add tokenlist, a linked list of lexer tokens
The linked list is doubly linked so the parser can look forward into it
and error reporting can look backward.

This commmit also reworks main to use the tokenlist instead of dealing
with the lexer manually.
2025-03-31 18:43:34 +02:00
df948b18c6 Initial commit, basic lexer structure 2025-03-30 17:45:51 +02:00