Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Five minute introduction to ANTLR 3

This is the home page for the ANTLR 3 space.

What is ANTLR 3?

ANTLR 3 is the latest version of a language processing toolkit that was originally released as PCCTS in the mid-1990s. As was the case then, this release of the ANTLR toolkit advances the state of the art with it's new LL(*) parsing engine. ANTLR (ANother Tool for Language Recognition) provides a framework for the generation of recognizers, compilers, and translators from grammatical descriptions. ANTLR grammatical descriptions can optionally include action code written in what is termed the target language (i.e. the implementation language of the source code artifacts generated by ANTLR).

When it was released, PCCTS supported C++ as it's exclusive target language. It's immediate successor ANTLR 2 supported Java, C# and Python in addition to C+. Although it is still in beta, ANTLR 3 has already demonstrated it's ability to support Java, C#, Objective-C, ANSI C, C+ and Ruby as target languages. As of July 2006, the Java target is complete and the C#, Objective-C, Ruby and ANSI C targets are nearly complete. Support for additional target languages including C++, Perl6 and Oberon (yes, Oberon) is either expected or already in progress.

What does ANTLR 3 do?


To be written. Volunteers?

Put simply, ANTLR 3 is a tool for generating language processing tools. To this end, it is commonly categorised as a compiler generator or compiler compiler in the tradition of tools such as Lex/Flex and Yacc/Bison). Given the grammatical description of a langauge, ANTLR can generate the source code for various tools that can processing and transform input in that language. The basic types of language processing tools that ANTLR can generates are Lexer, Parsers and TreeParsers.

Why should I use ANTLR 3?


To be written. Volunteers?

Because it can you time and resources. It is a well established fact that generative tools such as compiler compilers have a major impact on productivity. In addition, ANTLR v3's improved analysis engine, it's significantly enhanced parsing strength via LL(*) parsing with arbitrary lookahead, it's vastly improved tree construction rewrite rules and the availability of the simply fantastic AntlrWorks IDE offers productivity benefits above other comparable language tools toolkits.

How do I use ANTLR 3?

1. Get ANTLR V3 and the wonderful AntlrWorks IDE

Download and install ANTLR 3 from the V3 page of the ANTLR website

Download and AntlrWorks from the AntlrWorks page of the ANTLR website

2. Learn basic ANTLR 3 syntax


To be written. Volunteers?

Java

lexer grammar MyLangLexer;

@header
{
    package antlr3.tutorial.mylang;
}

OR : '||' ;

3. Build and use a basic ANTLR 3 grammar


To be written. Volunteers?

Java

grammar Simple;

C#

grammar Simple;

options
{
   language=CSharp;
}

Objective-C

grammar Simple;

options
{
   language=ObjC;
}

4. Build and use a more complex ANTLR 3 grammar from the examples-v3 distribution


To be written. Volunteers?

What next?

Read the Antlr 3 Documentation

Browse the list of questions frequently asked about ANTLR 3

Your five minutes are up!

  • No labels