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.
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.
You can use http://ironcreek.net/phpsyntaxtree/ .
Example:
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]]]]] [. .]]]
Source: https://habr.com/ru/post/1339392/More articles:LINQ to SQL - problem with the Xml field - how low can you intercept the generated TSQL? - sql-serverThread safety using OCX from C # .NET - multithreadingPython WMI not working under Windows 7 - pythonWord VBA to Get IP Silently - vbaDate Range Merge / Merge Algorithm - algorithmHAML & SASS / COMPASS: Can variables be shared between? - sassTool for drawing automata and syntax trees - windowsGraphically view the difference of a long string that basically matches - diffCreating a new array with a class object in GWT - arraysGetting menu options from Joomla - phpAll Articles