Skip to content

Are older Antlr capabilities implemented in Antlr4 #4354

Closed Answered by kaby76
SteveHespelt asked this question in Q&A
Discussion options

You must be logged in to vote

The -> ... is called a tree rewrite. Antlr3 had tree rewriting, but Antlr4 does not, at least not in the Antlr4 grammar syntax. Yes, you could implement a tree rewrite with a parser listener. Or, you could use a tree listener with a token stream rewrite. Note, the Python3 target is very slow, so you may want to implement this with a compiled language target. For a command-line solution, use my Trash toolkit.

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@ericvergnaud
Comment options

@SteveHespelt
Comment options

Comment options

You must be logged in to vote
2 replies
@SteveHespelt
Comment options

@kaby76
Comment options

Answer selected by SteveHespelt
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants