Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract Syntax Tree #4

Open
Kroc opened this issue Jul 4, 2015 · 0 comments
Open

Abstract Syntax Tree #4

Kroc opened this issue Jul 4, 2015 · 0 comments

Comments

@Kroc
Copy link
Owner

Kroc commented Jul 4, 2015

At the moment OZ80 uses a very simple linear list of word tokens. This is efficient at walking, but it means that we are doing a lot of structural validation as we execute the user-program. Execution and assembling are already very fast compared to tokenisation, but to speed things up more (especially when we introduce loops and macros) I want to be able to do away with the validation during execution.

The solution to this is to build an Abstract Syntax Tree instead of a linear token list and do a large amount of structural validation during the tokenisation stage. This will also allow us to pre-allocate Label and Value names and link those to the tokens in question, sparing us from the painful Dictionary object lookups currently used throughout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant