Skip to content
Discussion options

You must be logged in to vote

You can certainly reindex each token in the token stream after an edit. However, I do know tokens are referenced in at least the start and stop pointers of a tree node. If you remove a token in the token stream that a parse tree node referenced, you will need to update the start/stop pointers, too. But it depends on what you are planning to do with the tree editing. The data structure is not designed to support fast, extensive, independent tree-to-tree edits. You'll need a tree representation if you cannot reconstruct the tree from a serialized representation, or if you can't do so quickly.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@The-Futurist
Comment options

Answer selected by The-Futurist
Comment options

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants