Antlr - Idea Plugin

Card Puncher Data Processing

About

The Idea plugin is a plugin for Idea that install the Antlr tool.

Installation

Create a grammar file with the extension g4 and Idea should propose you to install the Antlr plugin

Options

Right click on your g4 file, you should see the Antlr option.

Idea Antlr Right Click Options

Antlr Recognizer

Antlr Recognizer run antlr.

Default run with the default configuration gives:

antlr4 ^
    -o %ProjectRoot%\gen ^ 
    -listener ^
    -visitor ^
    -lib %ProjectRoot%/src/main/antlr4/com/group/package/lexer ^ # output dir
    %ProjectRoot%src/main/antlr4/grammar.g4

where:

Configure Antlr

The Configure Antlr are the options of antlr

Antlr Idea Options

Test Antlr Rule

Test a rule

Antlr Idea Test Rule

start typing the text to see the tree in the Antlr panel

Antlr Idea Test Rule Panel

Generate

Antlr Generate Intellij





Discover More
Card Puncher Data Processing
ANTLR - Tool

The ANTLR tool helps create the grammar and generate its corresponding lexer+parser code. It can be run from the following application: ANTLR Intellij plug-in ANTLRWorks antlr4 - the command...
Card Puncher Data Processing
Antlr - (Lexical) Rule

in Antlr. Antlr has two types of rule: Name Case Type Description Example from the getting started uppercase letter lexer rule (known as Token name, they defines the token that the lexer...
Idea Antlr Right Click Options
Antlr - Getting Started (Hello World)

A getting started page that brings you in the world of Antlr. antlr/antlr4/blob/master/doc/getting-started.mdantlr4 getting-started Create a grammar file called Hello.g4 and define the grammar...
Idea Antlr Right Click Options
Antlr - Installation (Version 4)

Installation of Antlr tool on . on Idea Create a grammar file with the extension g4 and Idea should propose you to install the Antlr plugin Right click on your g4 file, you should see the...
Antlr Idea Plugin
Antlr - Parse Tree (AST)

The tree parser is an AST that is created by the parser from a text input. with grun, see the -tree of -gui option of Example: Type your text and end with a End of File character (Ctrl+Z or...



Share this page:
Follow us:
Task Runner