project-langx / X

A placeholder language with shareable bytecode IR.
2 stars 0 forks source link

[IMPL] Add the methods to walk (and print) to the respective nodes #27

Closed frankhart2018 closed 2 years ago

frankhart2018 commented 2 years ago

Describe the change

Currently the tree walking is done separately in the TreeWalker class but that doesn't seem to be a very scalable way to implement it, a better way would be to have the methods (walk_and_print) in the respective nodes and just let dynamic dispatch play its magic.

This requires changes to which of following?

It is not necessary that every change requires changes in all the components, you can uncheck the components as required. Don't worry if you are not sure, just keep all the above components.

A single PR should be submitted for all the parts. The commits need to be separate for all of them.

Note: You can only submit a patch if it is approved by one of the maintainers, otherwise the PR will be rejected.