metaborg / mb-rep

Apache License 2.0
2 stars 4 forks source link

Add TermWriter interface and TextTermWriter implementation #16

Closed Virtlink closed 4 years ago

Virtlink commented 4 years ago

I needed to do some debugging and needed a way to print terms with their attachments. I put the code I used in an extensible class TextTermWriter that can write terms, their annotations, and their attachments. Other implementations of TermWriter can be used to write terms in other formats. The current TextTermWriter implementation writes similar to how the terms implemented toString(), but can be overridden to do write terms differently. This code does not impact any existing code.