Antlr - Parse Tree Visitor

Card Puncher Data Processing

About

The Tree - Visitor (Design Pattern) in Antlr that will visit the parse tree in a depth-first search order

In a visitor, you can:

  • control the order of visite
  • return data from the function

Use mainly when the code is spread around many parts.

The listener can also be used to compile but only when the parse tree is created. There is therefore no control on order and/or context

Example

See gerardnico/antlr/blob/master/src/main/java/com/gerardnico/antlr/sqlite/Sqlites.java





Discover More
Card Puncher Data Processing
Antlr (ANother Tool for Language Recognition)

ANTLR is lexer generator. It translates: a grammar to a lexer and parser. ANTLR is implemented in Java and generates lexer and parser in the following languages: Java, Ruby, Python, C,...
Idea Antlr Right Click Options
Antlr - Idea Plugin

The Idea plugin is a plugin for Idea that install the Antlr tool. Create a grammar file with the extension g4 and Idea should propose you to install the Antlr...
Card Puncher Data Processing
Antlr - Parse Tree Listener

The parse tree listener (or listener) is a class that implements callback methods that are called by the parser when it creates the parse tree. You can overwrite this class to get information when the...
Card Puncher Data Processing
Antlr - antlr4.(bat|sh)

antlr4.(bat|sh) is the command line script of Antlr. See Installation Doc where D... is a grammar options. Example for the language:...



Share this page:
Follow us:
Task Runner