Skip to content

Incremental update of parse tree? #403

Answered by pdubroy
mblinsitu asked this question in Help
Discussion options

You must be logged in to vote

The documentation is somewhat vague about this1, but the arguments to semantic actions aren't actually the parse tree nodes themselves, but rather wrappers around the parse tree (i.e., CST) nodes. You can access the raw CST node via the _node property of the wrapper.

While the wrappers will all be freshly created, the underlying CST nodes will be re-used where possible. So you should be able to use the raw CST nodes for the purposes you're describing here.

An interesting thing about our use of wrappers is that it allows us to track dependencies within the semantic actions (i.e., we can see which operations/attributes of which nodes were used). So theoretically, it should be possible to im…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@mblinsitu
Comment options

Answer selected by mblinsitu
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants