aboutsummaryrefslogtreecommitdiff
path: root/asm/preprocesser.cpp
AgeCommit message (Collapse)Author
2024-04-15preprocesser publicly exposes only preprocesser functionAryadev Chavali
The preprocess_* functions are now privately contained within the implementation file to help the preprocesser outer function. Furthermore I've simplified the API of the preprocess_* functions by making them only return pp_err_t and store their results in a vector parameter taken by reference.
2024-04-15Propagate changes to lerr_t into preprocesserAryadev Chavali
2024-04-15preprocesser function now only returns a pp_err_tAryadev Chavali
We leave the parameter tokens alone, considering it constant, while the parameter vec_out is used to hold the new stream of tokens. This allows the caller to have a before and after view on the token stream and reduces the worry of double frees.
2024-04-15Fix some off by one errorsAryadev Chavali
2024-04-15Fix issue with use_blocks not being preprocessedAryadev Chavali
2024-04-15fix memory leak through vec.clearAryadev Chavali
vec.clear() doesn't delete pointers (unless they're smart) so I need to do it myself.
2024-04-15Implemented preprocesser function.Aryadev Chavali
2024-04-15Default constructor for pp_err_tAryadev Chavali
2024-04-15preprocess_* now uses const references to tokensAryadev Chavali
They copy and construct new token vectors and just read the token inputs.
2024-04-15Implemented preprocess_const_blocksAryadev Chavali
Once again quite similar to preprocess_macro_blocks but shorter, easier to use and easier to read. (76 vs 109)
2024-04-15Implement printing of pp_err_tAryadev Chavali
Another great thing for C++: the ability to tell it how to print structures the way I want. In C it's either: 1) Write a function to print the structure out (preferably to a file pointer) 2) Write a function to return a string (allocated on the heap) which represents it Both are not fun to write, whereas it's much easier to write this.
2024-04-15Implement constructors for pp_err_tAryadev Chavali
2024-04-15Implement preprocess_use_blocksAryadev Chavali
While being very similar in style to the C version, it takes 27 lines of code less to implement it due to the niceties of C++ (41 lines vs 68).
2024-04-14parser -> preprocesser + parserAryadev Chavali
I've decided to split the module parsing into two modules, one for the preprocessing stage which only deals with tokens and the parsing stage which generates bytecode.