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

Compiler, Parser, Executor separation #1

Open
rmccullagh opened this issue Sep 13, 2016 · 2 comments
Open

Compiler, Parser, Executor separation #1

rmccullagh opened this issue Sep 13, 2016 · 2 comments
Assignees

Comments

@rmccullagh
Copy link
Collaborator

Write now como_compiler.c is really sloppy and includes the ast construction stage, compiling stage, and execution stage. What needs to happen is that the como_compiler.c needs to only do compiling onto a new struct which is just an array of ComoByteCode blocks.

After that, the executor can be cleaner by implementing it as a series of function pointers.

@rmccullagh rmccullagh self-assigned this Sep 14, 2016
@rmccullagh
Copy link
Collaborator Author

rmccullagh commented Sep 14, 2016

The design of the executor, the executor will have an array of ComoOpCode structs embedded in the main ExecutionEnvironment structure. The ExecutionEnvrionment structure will contain the program counter, and the stack.

The ExecutionEnvironment structure will also contain the symbol tables for each frame. A frame is a ComoByteCode struct.

The ExecutionEnvrionment structure implements the Virtual Machine for this language.

@rmccullagh
Copy link
Collaborator Author

Update: I am working on implementing this.

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

No branches or pull requests

1 participant