This library is meant to replicate the behavior of ATerms in Spoofax. ATerms, by definition, are annotated terms. So annotations need to be added to the terms.
[x] Add lazy collection for annotations.
[x] Add getAnnotations to trees.
[x] Add parent collection field to red tree (subterms vs annotations).
[x] Write example for working with annotations.
[ ] Add addAnnotation and removeAnnotation methods to terms.
This library is meant to replicate the behavior of ATerms in Spoofax. ATerms, by definition, are annotated terms. So annotations need to be added to the terms.
getAnnotations
to trees.addAnnotation
andremoveAnnotation
methods to terms.