pretty-ast

Pretty-print an abstract syntax tree (AST)

John J. Camilleri

317

0

1.2.0

MIT

GitHub

Pretty AST

Pretty-print an abstract syntax tree (AST). Primarily written with GF ASTs in mind, but probably useful for other things.

Before:

PhrUtt otherwise_PConj (UttImpSg PNeg (ImpVP (ComplSlash (Slash2V3 talk_V3 something_NP) (DetNP every_Det)))) (VocNP something_NP)

After:

PhrUtt
  otherwise_PConj
  UttImpSg
    PNeg
    ImpVP
      ComplSlash
        Slash2V3
          talk_V3
          something_NP
        DetNP
          every_Det
  VocNP
    something_NP

Usage