corth-lang / Corth

A self-hosted stack based language like Forth
MIT License
7 stars 1 forks source link

Creating a tokens list #37

Open HuseyinSimsek7904 opened 8 months ago

HuseyinSimsek7904 commented 8 months ago

Currently, every time we need a token, we just ask the lexer to get the next token, we work with it and the cycle repeats. Instead what we need is for the lexer to run ONCE before the compiler and generate a list of tokens. We can then work on these tokens.

This will allow us to ignore unused procedures, add preprocessing and add better debugging information.