davidsusu / tree-printer

Java library for visualizing tree structures in the command line
Apache License 2.0
39 stars 8 forks source link

node creation #14

Closed amryounis closed 9 months ago

amryounis commented 10 months ago

hello, may i suggest the availability of node creation with empty values.

davidsusu commented 9 months ago

Could you be more specific about what you would like to see? Do you want to achieve something that differ from that can be achieved by new SimpleTreeNode(""), or, do you want to use a simpler dedicated syntax?

(Maybe, you mean a placeholder, see the Placeholders part of the README.)

davidsusu commented 9 months ago

I added a default constructor to SimpleTreeNode. It will be available in version 3.2.0 .

amryounis commented 9 months ago

sorry to come back late. the new SimpleTreeNode("") and placeholder are surely two viable options here. I am using your library in conjunction with ANTLR4 to print out the grammar tree, similar to the one produced by the gui one produced by the ANTLR tool but totally in a text based style. my aim is to ignore the first node as it is not needed in the printout. it could be achieved now but it needed some extra lines of code 😊

davidsusu commented 9 months ago

I see, root is a little bit special. For ListingTreePrinter, there is a displayRoot option (currently, TraditionalTreePrinter doesn't have anything similar).