ANTLR TestRig Graphical Output

Q

How to generate Graphical Output from parser using TestRig?

✍: FYIcenter

A

ANTLR TestRig can generate graphical output instead of text tree, if you use the "-gui" option instead of "-tree":

\fyicenter>java -cp .;antlr-4.7.1-complete.jar \
   org.antlr.v4.gui.TestRig Hello r -gui

hello you
^Z

The above test session will result the following graphical window alled "Parse Tree Inspector", displaying the parser output:
ANTLR TestRig - Parse Tree Inspector

 

⇒ ANTLR "Arithmetic" Grammar

⇐ ANTLR "Hello" Lexer and Parser Error

⇑ ANTLR Commands and Examples

⇑⇑ FAQ for ANTLR Parser Generator

2021-01-09, 6538👍, 0💬