davidsusu / tree-printer

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

Avoid Root Node, support `ListingTreePrinter().stringify(Node ...)` for multiple nodes (without one root) #11

Open manticore-projects opened 1 year ago

manticore-projects commented 1 year ago

Example: AST of SQL Text with multiple statements:

SQL Text
 ├─Statements: statement.select.PlainSelect
 │  ├─selectItems: statement.select.SelectItem
 │  │  └─AllColumns: *
 │  └─Table: dual
 └─Statements: statement.select.PlainSelect
    ├─selectItems: statement.select.SelectItem
    │  └─AllColumns: *
    └─Table: dual

Would be nice to optionally avoid the Root Node SQL Text and print it out as:

Statements: statement.select.PlainSelect
 ├─selectItems: statement.select.SelectItem
 │  └─AllColumns: *
 └─Table: dual

Statements: statement.select.PlainSelect
 ├─selectItems: statement.select.SelectItem
 │  └─AllColumns: *
 └─Table: dual