Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When it was released, PCCTS supported C++ as it's exclusive only 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 for 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 generates - the source code for - language processing tools from a grammatical description. 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 ANTLR 3 can generate the source code for various tools that can processing be used to analyze and transform input in that the language defined by the input grammar. The basic types of language processing tools that ANTLR can generates are LexerLexers (a.k.a scanners, tokenizers), Parsers and TreeParsers (a.k.a tree walkers, c.f. visitors).

Why should I use ANTLR 3?

...

?

Because it can save you time and resources by automating significant portions of the effort involved in building language processing tools. It is a well established fact that generative tools such as compiler compilers have a major, positive impact on developer 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 over other comparable generative language tools processing toolkits.

How do I use ANTLR 3?

1. Get ANTLR

...

3

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

2. Get the AntlrWorks IDE for ANTLR 3

Download and install AntlrWorks from the AntlrWorks page of the ANTLR website

...

3. Learn some basic ANTLR 3 syntax


To be written. Volunteers?

ANTLR 3 parser grammar syntax

Java

Code Block

parser grammar MyLangParser;

@header
{
    package antlr3.tutorial.mylang;
}

OR : '||' ;

ANTLR 3 lexer grammar syntax

Java

Code Block
lexer grammar MyLangLexer;

@header
{
    package antlr3.tutorial.mylang;
}

OR : '||' ;

...