A tool for drawing parsing trees?

Does anyone have a good tool for drawing parse trees arising from context-free grammar? There is this question , but it specifically concerned state machines instead of parsing trees. I use graphviz, but it is annoying to have every label of every node, etc.

+4
source share
2 answers

ANTLRWorks will do this automatically, but first you need to write an ANTLR-compatible grammar. Since ANTLR is LL (*), this cannot be trivial. Source code is also available.

+1
source

You can use http://ironcreek.net/phpsyntaxtree/ .

Example:

enter image description here

Entrance was:

[ROOT [S [S [NP [PRP It]] [VP [VBZ is] [NP [QP [RB nearly] [DT half] [JJ past] [CD five]]]]] [, ,] [S [NP [PRP we]] [VP [MD can] [RB not] [VP [VB reach] [NP [NN town]] [PP [IN before] [NP [NN dark]]]]]] [, ,] [S [NP [PRP we]] [VP [MD will] [VP [VB miss] [NP [NN dinner]]]]] [. .]]] 
0
source

Source: https://habr.com/ru/post/1339392/


All Articles