Home | Download | ANTLRWorks | Wiki | About ANTLR | Contact | Support | Bugs | v2

Latest version is 3.4
Download now! »

» Home
» Download
» ANTLRWorks
» News
»Using ANTLR
» Documentation
» Articles
» Grammars
» File Sharing
» Runtime API
» Tech Support
» Bug Tracking
»About ANTLR
» What is ANTLR
» Why use ANTLR
» Showcase
» Testimonials
» Getting Started
» Software License
» ANTLR WebLogs
» ANTLR Workshops

Support StringTemplate, ANTLR Project by making a donation! Terence often pays for things like the antlr.org server, conference travel, and this site design (that alone cost US$1000). Buy him a beer and pizza remotely ;)


Grammar List

Add Grammar


Java 1.6 grammar
Yang Jiang Fri Jan 16, 2009 12:01
ANTLR-based Java grammar from openjdk project to develop an experimental...

C Preprocessor
Youngki KU Wed Dec 20, 2006 17:38
C preprocessor grammar and tree.

ANSI C grammar for ANTLR v3
Terence Parr Wed Jul 19, 2006 18:18
Haven't tested a bunch, but it's a good start. :)

Chris Lambrou Fri Mar 28, 2008 13:38
I couldn't get the ECMAScript by Greg Clemenson on the Grammar List page...

ANTLR v3 Grammar
Terence Parr Fri Jul 13, 2007 17:32
ANTLR v3 written in its own words. Builds ASTs used by ANTLR tool itself....

RSS Feed

mysql Parser
wangmin Thu Sep 13, 2012 02:27
parse mysql, should has some errors in the grammer parser, if any pazzle, please reffrence http://dev.mysql.com/doc/refman/5.6/en/index.html

Unicode Character Classes
Roger Jack Thu Aug 16, 2012 12:16
This file contains lexer fragments to support 16-bit Unicode Character Classes.

George S. Cowan Sun Jul 22, 2012 08:26
The Java 6 grammar separated into a lexer grammar and a parser grammar, complete with an ant build file for generating and testing.

Command Line Grammar
Wed Jul 11, 2012 06:10
Command Line Grammar is used to parse command lines of Softabar Command Line Program, an extensible platform to build command line applications.

First Order Logic Grammar
Stephan Opfer Fri May 4, 2012 11:32
A simple grammar for first order logic formulas.

PSharp - Portugol implementation
Ricardo Borges Wed May 2, 2012 21:04
Simplified scripting language using portuguese syntax for educational purposes.

C# 4.0 preprocessor, lexer, and parser
Christian Wulf Mon Apr 30, 2012 06:32
I developed a C# 4.0 lexer (incl. preprocessor) grammar and a C# 4.0 parser grammar. In addition to the pure parser, I added a parser grammar with rewrite rules and operands defining an AST structure. Moreover, I included JUnit test cases.

SPARQL Grammar 1.1
Juergen Pfundt, Michele Mostarda, Simone Tripodi Thu Jan 5, 2012 19:19
SPARQL (pronounced "sparkle") is the query language for the Semantic Web and today is a W3C recommendation (http://www.w3.org/News/2008#item6).

PowerBuilder Powerscript
Ivan Brezina Wed Dec 21, 2011 08:30
Sybase PowerBuilder grammar

VHDL and SystemVerilog grammars
gburdell77@gmail.com Thu Dec 15, 2011 16:48
These are antlr v2 grammars.

PHP Parser
sidharth kuruvila Tue Dec 13, 2011 08:07
an antlr grammar for parsing php source files

Verilog VCD (Value Change Dump) body interpreter
Tue Nov 29, 2011 11:00
Process VCD file abstract syntax trees (from ValueChangeDump.g grammar) to extract simulation commands. See complete project at https://github.com/ewa/ad9510spi . GPL v3 license. ANTLR 3 grammar, Python target.

Verilog VCD (Value Change Dump) header interpreter
Eric Anderson Tue Nov 29, 2011 10:59
Process VCD file abstract syntax trees (from ValueChangeDump.g grammar) to extract definitions. See complete project at https://github.com/ewa/ad9510spi .

Verilog VCD (Value Change Dump) parser
Eric Anderson Tue Nov 29, 2011 10:54
Parses VCD files to an abstract syntax tree. GPL v3 license. Note that some minor liberties have been taken with the grammar specification; see documentation in the file or at https://github.com/ewa/ad9510spi .

Eric W. Anderson Thu Nov 24, 2011 08:43
Parses VCD (Value Change Dump) files generated by Verilog and VHDL simulators and some logic analyzers. Accompanying code to interpret the AST is available at https://github.com/ewa/ad9510spi .

KUKA Robot Language (KRL)
Jan Schlößin Mon Oct 3, 2011 03:31
The grammar of the industrial robots of KUKA. This grammar has been reverse engineered based on a set of KRL programs.

Sat Oct 1, 2011 19:44
Dominik Dietrich Wed Jul 27, 2011 07:59
A grammar to parse a declarative proof language including a dynamic formula

PL/SQL 11g Full Feature Parser - Apache License
Alexandre Porcelli Wed Jun 1, 2011 11:38
This is a full feature PL/SQL parser that includes Lexer, Parser (with and without AST generation) and a TreeWalker.

CSV grammar
Nathaniel Harward Fri May 13, 2011 10:08
While looking for a simple CSV grammar I saw the one in the ANTLR wiki but wanted a cleaner version, plus one that didn't eat white space (not allowed per RFC4180).

ISO SQL 2003 Grammar
Douglas Godfrey Sun May 1, 2011 19:53
The ISO SQL 2003 grammar will now build successfully but it requires a HUGE heap size.

updated ISO SQL 2003 Grammar
Douglas Godfrey Wed Apr 27, 2011 20:42
here is an updated version of my ISO SQL 2003 grammar.

ISO SQL 2003 Grammar
Douglas Godfrey Wed Apr 13, 2011 08:38
This is an initial pass at converting the ISO SQL 2003 grammar to Antlr. The Lexer works but the Parser grammar cannot compile due to infinite look-ahead. If someone would like to work on resolving the problems I encountered, please do so and post your fixes so everyone can use them.

Zoneinfo parser
Christopher Hunt Sun Apr 3, 2011 15:57
Zoneinfo TZ is a Java time zone library that parses zoneinfo files and produces a JDK compatible facade for returning time zone information. The library uses ANTLR to parse the zoneinfo files. The grammar it defines can be used beyond just this project.

C++ grammar
Aurelian Melinte Mon Jan 24, 2011 17:58
Version 4.1 for ANTLR 3.2.

Jingguo Yao Wed Jan 5, 2011 00:35
This ANTLR grammar for HTTP URL is based on RFC 2397. But it does not strictly adhere to the RFC. It only handles common formats for HTTP URL. But it could be easily extended to handle all the URL formats specified by the RFC.

Clojure ANTLR Grammar
Jingguo Yao Sat Jan 1, 2011 06:13

ADSP 2106x SHARC assembly language
topmint@gmail.com Sun Nov 28, 2010 18:31
ADSP 2106x SHARC assembly language grammar for ANTLR3.

Free MPS Grammar
Tue Nov 16, 2010 05:58
The grammar defines the structure of the mps format.

Ivan Brezina Fri Sep 3, 2010 07:19
Oracle SQL grammar, including 11g features.

CUDA PTX assembly language
Ken Domino Thu Aug 26, 2010 14:55
This Antlr v3 grammar recognizes the Nvidia CUDA PTX (parallel thread execution) assembly language v2.1, and creates a tree. This grammar is used in an emulator for CUDA programs.

C++ grammar and code tracer for ANTLR 3.2
Ramin Zaghi Thu Aug 26, 2010 03:46
Version 4.0.1 August 2010. Compatible with ANTLR 3.2. Please note that this is the first public release for ANTLR 3.2; This does not comiple with any older versions of ANTLR. This may also have some missing features compared to the 2007 update by David Wigg. I am publishing this work only to make this first ANTLR 3.2 update available to the community however if you are interested in a more complete work please take a look at David's 2007 update. Feedbacks are welcome. You may send your comments to Ramin Zaghi antlr3_cpp_parser-at-taggedprogramming-dot-com.

Patrick Higgins Fri Jul 16, 2010 15:20
Parser for Oracle PL/SQL. Works with 11g. More details can be found in the header of the grammar.

XPath 1.0 grammar
Jan-Willem van den Broek Thu Jul 15, 2010 17:09
XPath 1.0 grammar. Should conform to the official spec at http://www.w3.org/TR/1999/REC-xpath-19991116. The grammar rules have been kept as close as possible to those in the spec, but some adjustmewnts were unavoidable. These were mainly removing left recursion (spec seems to be based on LR), and to deal with the double nature of the '*' token (node wildcard and multiplication operator). See also section 3.7 in the spec. These rule changes should make no difference to the strings accepted by the grammar.

Pascal grammar in ANTLR 3
Marton Papp Thu Jul 15, 2010 11:04
It contains a Pascal grammar file in ANTLR 3 format. It was made by exising ANTLR 2 grammar file that can be downloaded at ANTLR site. There is Eclipse project that can be opened in Eclipse and run.

Extended GQL Parser (Google App Engine - Java)
Vaclav Bartacek Thu Jun 10, 2010 08:37
Lexer+Parser and TreeParser grammars allow to evaluate SELECT, INSERT, UPDATE and DELETE statements, nested queries, expressions in the Google App Engine's Java environment - tested on both local (development) and production.

GraphViz DOT grammar for ANTLR3
Tobias Smolka Tue May 25, 2010 07:49
GraphViz DOT grammar for ANTLR3. Both parser and tree parser. Tree parser produces graph object, which is ready to use. Part of CesTa project.

pdf importer
andria Sun May 16, 2010 18:36
pdf importer

Fortran 2008
Craig Rasmussen Fri Mar 26, 2010 13:02
The Open Fortran Parser (OFP) has been updated to Fortran 2008. The OFP project provides a Fortran 2008 compliant parser and associated tools. These tools provide a Java and C API for actions that are called when parser rules are completed.

GQL Dynamic Parser (Google App Engine)
Vaclav Bartacek Wed Feb 17, 2010 07:27
Combined lexer+parser grammar for Java target. Allows to dynamically convert GQL to GAE low-level datastore API (Query). All GQL features are supported except operands '!=' and 'IN'.

Fortran 2003
Craig Rasmussen Thu Feb 11, 2010 17:23
The Open Fortran Parser (OFP) project provides a Fortran 2003 compliant parser and associated tools. These tools provide a Java and C API for actions that are called when parser rules are completed.

XPath 2.0
Paul Bober and Stephen Tu Mon Jan 25, 2010 14:54
An implementation of the XPath 2.0 grammar

C# 4.0 for Antlr v3
Andrew Bradnan Mon Nov 23, 2009 14:52
ANTLR 3 grammar for CSharp 4.0 with preprocessor.

Python 3 grammar for C target
Ales Teska Fri Oct 9, 2009 14:52
ANTLR grammar with supporting C code and test/demo application. The only missing part I know is PEP 3131 (Supporting Non-ASCII Identifiers).

XQGrammar - 1.1.0
Nikolay Ognyanov Sat Aug 8, 2009 16:08
ANTLR 3 grammar for XQuery with Update, Scripting and Full Text.

Nikolay Ognyanov Mon Aug 3, 2009 16:25
ANTLR 3 grammar for XQuery with Update and Scripting.

SQLJet (SQLite Compatible)
Dmitry Stadnik Mon Aug 3, 2009 06:41
This grammar is derived from the description available at http://sqlite.org/lang.html and covers most of the features. This is a work in progress so there should be bugs.

Modula-2 (PIM4)
Benjamin Kowarsch Fri Jul 10, 2009 01:12
ANTLR v3 grammar for Modula-2 adapted from the syntax given in the fourth edition of "Programming in Modula-2" by N. Wirth, refactored to satisfy LL(1) constraints.

Pete Siemsen Thu Jun 25, 2009 09:36
TranslateCIM is an ANTLR 3 translator that translates CIM (the DMTF's Common Information Model) specification files into Java source code. Input is the ~1200 MOF files distributed by the DMTF, output is ~1200 Java files. TranslateCIM's back-end uses StringTemplate, so other output than Java might be possible someday.

XPath 1.0 updated grammar
Jesus Zazueta Mon Jun 15, 2009 10:46
This grammar is an ANTLR v3 port of the XPath 1.0 grammar defined by the W3C.

Smalltalk Message Passing Syntax (subset)
Benjamin Kowarsch Fri May 22, 2009 08:59
This grammar describes the basic syntax of Smalltalk message passing with nested receivers, colon and non-colon identifiers but without operators. It could serve as a base for a complete Smalltalk grammar or as is for a Smalltalk inline facility in a hybrid language (such as Objective-C).

Objective Modula-2
Benjamin Kowarsch Tue May 19, 2009 07:58
ANTLR v3 grammar for Objective Modula-2, a hybrid of Modula-2 and Smalltalk, using Objective-C as a blueprint. The grammar may still get a few minor tweaks but is mostly final as of May 2009. Any minor updates will be posted to the same URL. The Objective Modula-2 reference compiler is being written by hand, but ANTLRworks has been used in the design stage as a rapid grammar prototyping and validation tool.

Modula-2 (PIM3)
Benjamin Kowarsch Tue May 19, 2009 07:26
ANTLR v3 grammar for Modula-2 adapted from the syntax given in the third edition of "Programming in Modula-2" by N. Wirth, refactored to satisfy LL(1) constraints.

SQL grammar for MySQL dialect (ANTLR v3)
Maciej Gawinecki Wed May 13, 2009 01:18
I've started to work on MySQL dialect of SQL grammar as I haven't found anything like this on the net. Unfortunately, the grammer is currently incomplete as I don't have time to continue the project due some deadlines and other projects.

JP-QL 1.0
Alexander Kunkel Wed May 6, 2009 12:58

Gramatica en espaol con objetos
Yury Euceda Mon May 4, 2009 15:33
Lenguaje en español con objetos

CSS 2.1 from the Spec
Jim Idle Tue Apr 28, 2009 10:53
Written for a customer who cancelled, this is a commercial level parser, which I am now donating for ANTLR users. It follows the spec for CSS 2.1 exactly, but has not had extensive testing. It should easily adapt to CSS3 as it was intended to do so. Please report any bugs so that all may benefit.

Lenguaje en español
Yury Euceda Mon Apr 20, 2009 12:27
Este es un pequeño ejemplo de un lenguaje en español. muy ilustrativo.

MDX Grammer(Updated for 3.0)
Mayur B.M Wed Apr 15, 2009 04:28
updated MDX grammer for V 3.XX from V 2.XXX.please add your custom actions and help in making it better...

Verilog netlist parser
Karl W. Pfalzer Fri Apr 3, 2009 12:28
nldb is an ANTLR-based Verilog netlist parser which builds an intermediate representation in Java.

VTEDS Grammar
Peizhao Hu Tue Mar 24, 2009 22:45
This grammar is for parsing the IEEE 1451.4 Virtual TEDS templates.

Verilog 200x parser project
Karl W. Pfalzer Wed Feb 18, 2009 13:46
The v2kparse project includes ANTLR files (grammar and preprocessor) for the Verilog 2005 (synthesizable subset) language.

JSON Grammar
Taro L. Saito Mon Jan 26, 2009 17:42
JSON (http://json.org/ ) format grammar, used in Xerial Project (http://www.xerial.org )

Java 1.6 grammar
Yang Jiang Fri Jan 16, 2009 12:01
ANTLR-based Java grammar from openjdk project to develop an experimental version of the javac compiler based upon a grammar written in ANTLR. Derived from Terence Parr's Java 1.5 grammar. NOTE:: Use ANTLR -Xconversiontimeout 100000 option. If it still doesn't work or the compilation process takes too long, try to comment out the following two lines:
| {isValidSurrogateIdentifierStart((char)input.LT(1), (char)input.LT(2))}?=>('\ud800'..'\udbff') ('\udc00'..'\udfff')
| {isValidSurrogateIdentifierPart((char)input.LT(1), (char)input.LT(2))}?=>('\ud800'..'\udbff') ('\udc00'..'\udfff')

Stefan Taranu Thu Jan 8, 2009 08:49
An ASN.1 grammar compiled with antlr3.1.1.

Verilog grammar for ANTLR v3.
Arik Ter-Galstyan Wed Nov 26, 2008 22:19
Verilog grammar for ANTLR v3 converted from ANTLR v2 verilog grammar written by Steve Eckmann.

PDDL 3.0 grammar for ANTLR 3.1
Zeyn Saigol Thu Oct 2, 2008 08:40
Grammar for parsing PDDL 3.0. Not quite complete, as it doesn't cope with preference preconditions or goals. Also doesn't yet create friendly named nodes in the AST for all of the rules. (Now fixed so works with ANTLR 3.1.1)

S-Expression Parser
Robert Stehwien Thu Sep 25, 2008 13:10
A Lisp s-expression parser that is part of a lisp interpreter I'm working on. Dot notation isn't yet working (A . B) but other expressions should work. Updates will be posted or made available as time permits. Feel free to use under the MIT/X license.

trihus Tue Jul 1, 2008 13:43
This CSS parser handles valid CSS syntax. It will also accept property values not defined by CSS without giving an error. It has been debugged with ANTLRWorks and tested on a number of CSS files. (You must comment out language=CSharp for it to work with ANTLRWorks). I don't think it handles the full syntax of @import or @include.

Cedric Cuche Thu Jun 5, 2008 14:06
Antlr3 Grammar for ObjectiveC (based on grammar found in the Appendix of "The Objective-C 2.0 Programming Language").

C/C++ Grammar by Sun Microsystems
Sun Microsystems / NetBeans Tue Jun 3, 2008 14:29
ANTLR v2 Grammar for C/C++

C/C++ Preprocessor Grammar by Sun Microsystems
Sun Microsystems / NetBeans Tue Jun 3, 2008 14:29
ANTLR v2 Grammar for C/C++ Preprocessor

XQuery XML Query language
Martin Probst Sun May 18, 2008 11:51
XQuery parser and formatter / pretty printer. Implements multiple syntaxes within one language using separate lexers.

Micro Xpath
Jes?s Zazueta Tue May 6, 2008 15:40
XPath subset. Implements forward axis navigation and attribute access.

Oracle PL/SQL Grammar for ANTLR v3
Andrey Kharitonkin Sat Apr 26, 2008 08:59
Based on PL/SQL grammar for ANTLR v2 published here.

Java 1.5 grammar for ANTLR v3 that builds trees
Dieter Habelitz Fri Apr 11, 2008 09:43
A Java 1.5 grammar that builds trees and a tree grammar. Not derived from Java grammar Terence wrote.

A complete ECMAScript 3 grammar
Xebic Research B.V. (Patrick Hulsmeijer) Wed Apr 9, 2008 05:08
Combined lexer/parser and treeparser grammars written from scratch with the ES3 specification in hand. Includes support for auto semicolon insertion and regular expression literals.

Chris Lambrou Fri Mar 28, 2008 13:38
I couldn't get the ECMAScript by Greg Clemenson on the Grammar List page to work. It's supposed to run in v3.0 without any issues, but I ran into a whole host of problems. Since I'm fairly new to ANTLR, I thought I'd work my way through Terence's book and have a stab at writing a JavaScript grammar from scratch as a learning exercise. Well, I've reached a point where the script may be useful to others. It compiles cleanly, without any warnings.

Memcached protocol grammar
Nathaniel Harward Fri Mar 21, 2008 17:53
A basic grammar for the memcached network protocol as described at http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt. Please email me (address is inside the grammar itself) if you find any problems with it.

Java StackTrace Grammar
Luca Dall'Olio Sun Mar 9, 2008 09:07
This grammar was written to parse serialized Java Stack Trace Text

CORBA 3.x IDL grammer for ANTLR v3
Dong Nguyen Fri Feb 22, 2008 05:52
Translated from OMG IDL spec at http://www.omg.org/docs/formal/02-06-07.pdf.

DCM Calibration File
Donn Shull Tue Feb 19, 2008 10:31
antlr 3.0 grammar for DCM 2.0 calibration data files

C# VHDL grammer
Mike Lodder Mon Feb 11, 2008 09:26
This is a modified version of the VHDL AMS grammar file to work in C#

Python 2.5 Grammar
Frank Wierzbicki Fri Jan 18, 2008 20:09
This grammar is an update to the Python 2.3 grammar in the antlr examples. It adds the new features from Python 2.5, and also supports more lexing corner cases (for example """foo\""""). This grammar recognizes all but eight .py files in the Lib directory of release25-maint branch of Python. The .py files that it cannot match are either deliberately bad files for testing or .py files that use 'as' as an identifier (this will not be allowed in Python 2.5 so I didn't worry about it for now)

ASM grammar
Los olvidados Tue Jan 1, 2008 19:26
This is a very simple grammar of a pentium asm. You will find the lexical and parser specifications in the file and obviously it still lacks many rules. It is intended to be used only for educational purposes. It was written by my teamwork (Hugo Garza and Joaqu?n Moreno) and me (Miguel Ugalde), for a computational theory class project. We all attend Monterrey Tech in Cuernavaca. We will appreciate so much your feedback at A00378918@itesm.mx

David Wigg Wed Dec 19, 2007 03:48
This is my final update of the CPP_parser (V3.2) using ANTLR V2.7 to generate C++ parser in C++. I now wish to hand it on to someone else for maintenance and further development (eg. to use ANTLR V3.0). David Wigg, wiggjd@bcs.org.uk

Sat Dec 1, 2007 22:57

SPARQL Grammar
Michele Mostarda, Simone Tripodi Tue Oct 30, 2007 10:30
The SPARQL query language for RDF is designed to meet the use cases and requirements identified by the RDF Data Access Working Group in RDF Data Access Use Cases and Requirements.

CIM 2.3
Nicolas Jouanin Mon Aug 6, 2007 09:11
A CIM 2.3 spec parser, working with ANTLR3. The output is an AST tree which can be walked easily after parsing.

ANTLR v3 Grammar
Terence Parr Fri Jul 13, 2007 17:32
ANTLR v3 written in its own words. Builds ASTs used by ANTLR tool itself. Good example of how to build complicated ASTs with a complicated grammar.

Fortran 77 grammar
Olivier Dragon Thu Jun 28, 2007 17:32
A Fortran 77 grammar for ANTLR v2

Update Oracle Net Services configuration file grammar (ANTLR v3.0)
Nathaniel Harward Mon Jun 18, 2007 10:51
A grammar for Oracle Net Services configuration files, like tnsnames.ora, sqlnet.ora, listener.ora, etc. Based on the syntax for Oracle 10g.

Wavefront OBJ grammer
Edward Ames Thu Jun 14, 2007 20:38
Recognizes Wavefront .obj files. These are ASCII files for exchanging 3D graphical information. Blender can import/export these type of files as well.

Lua 5.1
Nicolai Mainiero Tue May 8, 2007 00:20
A grammar for the Lua programming language version 5.1 for ANTLR 3

Oracle Net Services configuration file grammar
Nathaniel Harward Sun May 6, 2007 17:30
A grammar for Oracle Net Services configuration files, like tnsnames.ora, sqlnet.ora, listener.ora, etc. Based on the syntax for Oracle 10g.

ORACLE PL/SQL Grammar With Code Counting Hooks
David Edwards Fri Mar 16, 2007 12:17
Developed from the PL/SQL Grammar that was already present on the site, this version works better with more recent versions of PL/SQL. Nevertheless, it is far from being complete.

PDDL 3.0 grammar for ANTLR v3
Zeyn Saigol Fri Feb 23, 2007 08:03
Grammar for parsing PDDL 3.0. Not quite complete, as it doesn't cope with preference preconditions or goals. Also doesn't yet create friendly named nodes in the AST for all of the rules.

C Preprocessor
Youngki KU Wed Dec 20, 2006 17:38
C preprocessor grammar and tree.

Ruby Grammar (semplified)
Sara di Gregorio and Pasquale De Medio Sat Oct 14, 2006 03:03
This grammar is a simplified Ruby grammar.

Java 1.5 (for C++)
Arjen 'credmp' Wiersma Mon Oct 2, 2006 00:37
This is the mashup of the existing Java 1.5 syntaxes for ANTLR 2.7.x. It has both generics and annotations.

ECMAScript (Javascript) Grammar for Antlr 3.0
Greg Clemenson Wed Jul 26, 2006 22:01
This is basically the grammar submitted by Kaleb Pederson Tue Jun 7, 2005 06:44, except cleaned up and problems cleared. It should run without issues in v3.0. However, the grammar has two semantic issues: many of the lexical classes are incompletely or incorrectly defined. The other issue is that ECMAScript requires extra-syntactic techniques to handle "automatic semicolon insertion". See the description in section 7.9 of the ECMAScript specification, 24 March 2000 version.

ANSI C grammar for ANTLR v3
Terence Parr Wed Jul 19, 2006 18:18
Haven't tested a bunch, but it's a good start. :)

Java 1.5 grammar for ANTLR v3
Terence Parr Wed Jul 5, 2006 16:20
A Java 1.5 grammar written from the spec. Very clean and pretty fast. I have not tried to optimize for speed.

Updated C# grammar file (CSharpParser.g) for KCSParse (csharp_v1 example in ANTLR 2.7.6+)
Quentin Gregory Thu Jun 29, 2006 13:22
This updated grammar file (CSharpParser.g) includes a fix for parsing interface event declarations.

Java .class file grammar
Andreas Rueckert Sun May 14, 2006 13:38
A Java class file and jar parser with tree parser. Submitted by: Linus Tolke. [Hosting at antlr.org now; TJP]

Java 1.5 + Java preprocessor
Luca Colombi Fri May 12, 2006 10:46
The grammar submitted by Michael Studman and revised by Scott Wisniewski, adapted to compile without error also in eclipse with antlr plugin and jdk 1.5, and the java preprocessor ported in Java as a subclass of Reader.

Gregory W. Bond Wed May 3, 2006 20:51
A grammar written with PyANTLR 2.7.6. ECharts is a state machine-based programming language for event-driven systems derived from the standardized UML Statecharts language.

Updated C# grammar file for KCSParse (a.k.a csharp_v1 example included in ANTLR 2.7.6+)
Kunle Odutola Fri Feb 10, 2006 02:31
This updated grammar file includes a fix for parsing nested #region and #if preprocessor directive blocks. Thanks to Paul Foster for reporting the issue (and supplying test cases).

GraphViz Dot grammar
Jose San Leandro Armendariz Tue Jan 24, 2006 07:29
Grammar to make ANTLR generate GraphViz's Dot parsers.

XPath 1.0 Grammar
Rodney Aiglstorfer Tue Dec 13, 2005 19:59
A literal translation of the XPath 1.0 specification.

Service Language Layer (SLL) Parser
Flexible XML-based Languages (FXL) Project Tue Dec 13, 2005 01:35
A complete SLL v1.1.2 grammar (includes SLL.g). SLL is a "high level" description language for (web) service-based applications which leverages xQuery as expression language and supports semantic descriptions of web services. The parser builds an AST which can easily be converted to the underlying XML-based model of SLL.

kcsparse - an ECMA-334 C# Grammar Sample for ANTLR v2.7.6 (C#)
Kunle Odutola Thu Dec 8, 2005 06:37
Yet Another C# Grammar For ANTLR implemented in C#. It is probably more complete and includes both an ANTLR and a C# Flex lexer. With kcsparse, you can (a) Parse C# 1.x source code including some with C# preprocessing directives, (b)Build and display an AST from C# source and, (c) Unparse the AST (i.e. pretty prints the AST).

David Wigg Wed Nov 16, 2005 06:44
C++ grammar with C++ output. Version 3.1 Nov 2005 for use with ANTLR 2.7

C# Grammar with minimal lookaheads
Todd King Mon Sep 26, 2005 00:48
This C# antlr grammar implements most of the C# spec except for a few of the unsafe elements. I designed this grammar for speed so I avoided using arbitrary lookaheads where I could. I got it down to just 7 lookaheads. This grammar can parse large files very fast because it doesn?t waste time spinning in arbitrary lookaheads. (It can parse the entire NAnt project in 5 seconds, that is 90986 LOC)

Miguel Oliveira e Silva Fri Sep 23, 2005 10:27
This parser works, and is being used in the implementation of a prototype language named MP-Eiffel for evaluation of concurrent object-oriented language mechanisms. Eiffel's grammar is not context free (not even close), and that makes it very hard to fully implement with antlr (or any other context-free based grammar generator such as yacc/bison). In this grammar I was "forced" to impose instruction separation with ";", instead of making it optional (as ETL2 specifies). Also, I've used two antlr's semantic predicates ("<< >>?"), and one syntactic predicate ("( )?") for the debug instruction. A look-ahead of *three* tokens (antlr -k 3) is required!

Grammar for CSS 2.1
hawkis Fri Sep 16, 2005 07:47
First shot at a CSS 2.1 grammar. Have 'translated' the grammar provided at http://www.w3.org/TR/CSS21/grammar.html

ECMAScript (Javascript) Grammar
Kaleb Pederson Tue Jun 7, 2005 06:44
I haven't done much on the included grammar. Most of the work originally came from http://scriptonite.sourceforge.net but was adapted for ANTLR. ANTLR will run against it, but generates a lot of warnings most of which haven't been verified. I hope this proves useful to somebody.

Updated Java 1.5 Grammar
Scott Wisniewski Thu Mar 3, 2005 10:25
Contains modifications to the Michael Studman's Java 1.5 gramamr to provider better conformance to the Java Language Specification. In particular it includes the following enhancements:

1. Regonozies full range of Java Identifiers
2. Provides full support for unicode escape processing

Unicode escape processing is provided via the means of the attached pre processor that provides full unicode escape processing. Java allows unicode escape sequences to appear at any point in the input, not just inside of strings. The preprocessor is written in C#, and provides a TextReader implementation that scans an existing TextReader and replaces unicode escape sequences with the appropriate unicode character.

It is essentally a hand written DFA. However, it uses coroutines (for my sanity), so in order to build it you will need version 2.0 of the .NET Framework (or Visual Studio 2005), which is currently still in beta. Hopefully its easy to port if you need to use it with other langauges.

PL/SQL Grammar
Krupa Benhur Sun Feb 6, 2005 21:04
This file contains the grammar for PL/SQL language. This grammar can be used to extract information from PL/SQL programs

SMI/SPPI/ASN.1 parser
Nigel Sheridan-Smith Fri Jan 14, 2005 22:32
Parser for SMI v1 and v2, SPPI and ASN.1 (derived from Vivek Gupta's ASN.1 grammar, with a few bugs removed). These can be used for management of many network devices using SNMP or COPS. Correctly parses all standard MIBs/PIBs provided with "libsmi 0.4.1", except for some that have integers greater than 2^63.

Common Intermediate Language Parser
Pascal Lacroix Sun Dec 26, 2004 11:44
This is my first release of the parser from the Common Intermediate Language (high level assembly used by the .NET Framework). The grammar is based on the ECMA 335 specification. Please send your comments or updates. placr@hotmail.com. Pascal Lacroix.

MDX Grammar (Update)
Vitaly Shelest Mon Nov 29, 2004 07:51
Microsoft MDX Grammar

Anakreon Mejdi Wed Sep 15, 2004 03:24
The grammar of asp contains lexers for plaintext and JScript and VBScript. It also contains the Parsers and TreeParsers of JScript and VBScript. The grammars are released under GPL. Download and extract the aspParser-*.tar.gz file and the grammars are in the grama directory.

yet another java 1.5 grammar
Michael Stahl Wed Aug 25, 2004 10:23
a recognizer and tree parser for java 1.5, developed independently from the one by michael studman

Java 5 (aka 1.5) grammar update
Michael Studman Sat Jul 24, 2004 16:51
An update to the Java 1.3/1.4 grammar (incorporating Cortex's generics additions) to support all Java 1.5 language changes.

Nathaniel Harward ( at gmail dot com) Fri Jul 2, 2004 15:52
A very simple parser for Oracle JDBC URLs, includes production rules for parsing a TNSNAMES.ORA stream as well since TNS entries and JDBC URLs can potentially share the same format, so I figured why not include that as well.

MDX Grammar
Vitaly Shelest Fri Jun 11, 2004 11:45
Microsoft MDX Grammar

VHDL-AMS (IEEE Std 1076.1-1999)
Erhard Fehlauer Tue Jun 8, 2004 05:15
A VHDL-AMS 1076.1-1999 grammar with C++ main() and readable parse tree and derivations output. The grammar was checked on Linux and Solaris with Southampton VHDL-AMS Validation Suite (http://www.syssim.ecs.soton.ac.uk/).

muMath grammer
Dan Stanger Wed Mar 10, 2004 16:49
This is a crude parser for muMath, a almost extinct language which has evolved into Derive. It can be used under the same license as Antlr.

C# grammar (based on ecma-334 spec)
Robin Debreuil Fri Mar 5, 2004 11:50
A (mostly) complete cs parser. It parses into a tree structure loosely based on the CodeDom. Does not yet do #if preprocessor segments, and no unsafe code (as of yet). You can test by downloading the CSharp.zip file and dragging cs files into CSharp.exe. The zip includes the grammar file, as well as the cs token classes (the grammar uses a heterogeneous tree, though that should be simple to turn off). permalink: http://www.debreuil.com/CSharp. TJP: copied src, exe to antlr.org and changed link as debreuil's links are dead.

Java 1.4 grammar update
Terence Parr (submitter) Mon Mar 1, 2004 11:41
Cortex eBusiness, makers of Clover code coverate tool for java, have provided this update on their site. :)

Python 2.3.3 grammar
Terence Parr and Loring Craymer Sat Feb 28, 2004 17:26
My first attempt at a python grammar. It seems to grok all of jython 2.1. The whitespace/comments/newlines/indentation thing is a nightmare to implement, but I think I got it right. Very close to Python 2.3.3 distribution grammar (minus the wackiness in the lexer). Updated 3-17-2004. Now requires 2.7.3rc3 at least to work.

Informix 4GL Grammar (flg.g)
Gregorio Momm Mon Jan 5, 2004 18:17
A 1st attempt of a Infomix 4GL Grammar, works with all the files i tried, but needs some improvements.

CORBA 3.x IDL Grammar
Gary Duzan Wed Dec 31, 2003 09:27
Jim Coker's IDL grammar updated to add CORBA 3.x and AST support.

RCS files ( CVS ) grammar
Lucas Bruand Wed Dec 3, 2003 06:21
RCS files grammar in Java. I created this as an exercise to learn ANTLR but I might use it to create yet an other WebCVS.

Ck an educational language
Frederik Holljen and Raymond Bosman Mon Dec 1, 2003 12:28
Ck is an educational language that features C like syntax and output for the Java Virtual Machine. The grammar is LL(1) and the treewalkers are implemented in C++. The package contains the grammar, implementation of the treewalkers and supporting classes, an extensive test set, GNU Makefiles and documentation of the classes and the language.

Updated ASN.1 Grammar
Vivek Gupta Tue Nov 11, 2003 14:29
Improved ASN.1 grammar. Also attached are the Java class files which stores the parsed ASN.1 objects. These java objects can be used as an input for other applications.

C# Grammar File
Rajendra Kumar Komandur Wed Oct 29, 2003 20:07
Grammar file for cSharp language which supports most part of the cSharp language spec.

Parameterized Types (ala C++ templates) For Java
Jamie Herre Mon Sep 8, 2003 10:37
Class project for Terence's graduate programming language class Spring 2003. Java-to-Java translator that adds parameterized types to Java like Stack<String> and Vector<Vector<String>>. Mimics C++ style macro-like templates where a reference to Stack<T> causes a new output class definition for every T. The related project definition is here.

MS SQL Select Statement
Tomasz Jastrzebski Sat Aug 30, 2003 11:00
Microsoft SQL Server 2000 Select Statement.

Oliver kellogg Mon Aug 4, 2003 12:43
By Oliver Kellogg. Tested on several Ada projects totalling a few ten thousand lines of code. Has tree construction. The parser and tree parser have successfully translated ACES, one of the large standard test suites for Ada compilers.

B method
Boulanger Jean-Louis Thu Jul 31, 2003 11:51
The B method is a formal langage like Z and/or VDM. ABTools is a free environment developped in JAVA with ANTLR. It provides a grammar, typing and Proof obligation generation for the B langaguage and somes extension such Bprime, B Event or B system.

Lubos Vnuk Fri Jul 11, 2003 08:14
Standard ISO/ANSI SQL2 grammar by Lubos Vnuk. DML subset of the Full SQL Level.

Lubos Vnuk Thu Jul 10, 2003 11:56
Standard ISO/ANSI SQL2 grammar by Lubos Vnuk. The Full SQL Level extending DmlSQL2 grammar.

HTML Indexer
Terence Parr Sat Jun 14, 2003 13:38
Simple program that indexes files and/or directories by looking for HTML <h1>...<h5> tags. It spits out a list of links to each tag and writes out new versions of your files (optionally overwriting your old ones) that contain anchors.

Link Checker
Terence Parr and Alexis Hinds Sat Jun 14, 2003 13:36
A simplistic HTML link checker that only chases local file references rather than http: references and so on. I built this because I needed a link checker that actually checked the case of the path and filenames on a PC, with its brain-dead case-insensitivity.

Michael Schmitt Sat Jun 14, 2003 13:35
Probably one of the biggest ANTLR grammars around and it features line/column tracking for ASTs; ANTLR 2.7.2-compliant.

Oracle 7 SQL
Brent Wiese Sat Jun 14, 2003 13:34
ORACLE 7 SQL. Derived/improved from old PCCTS SQL grammar.

Frederic FONDEMENT Sat Jun 14, 2003 13:33
A grammar for the Object Constraint Language from UML 1.3

Handol Park Sat Jun 14, 2003 13:33
A VRML grammar written apparently by Handol Park; has lots of nondeterminisms, but might help somebody get started [Comment says "(c) 1996 by Gavin Bell and Daniel Woods at SGI", which I assume means authorship of the language]

Steve Eckmann Sat Jun 14, 2003 13:32
A verilog grammar from Argonne National Lab.

Jim Coker Sat Jun 14, 2003 13:31
This is a complete parser for the IDL language as defined by the CORBA 2.0 specification.

Terence Parr and Alexis Hinds Sat Jun 14, 2003 13:30
A grammar for HTML written by Alexis Hinds, updated by Terence Parr to handle HTML much better. Uses the new lexical filtering feature of 2.6.0 and beyond.

Pedro Assis Sat Jun 14, 2003 13:30
A CIM parser by Pedro Assis in Oporto. A very nice write-up too. Based on Antlr 2.7.1 (also work for 2.6.0) and it targets CIM based MOF models. This is full compliant with the CIM present specs (2.2) and it's working for all DMTF models (based on that specs, yes this have been tested). Includes the grammar file, the java main file, and some ms-dos batch file. Also I've included a mini-howto (17 pages long) addressing CIM, ANTLR (I've use some of your articles about ANTLR, Sorcerer and the on-line material, please if you see anything terrible wrong let me know), and the package itself. Ah, since English is not my mother language you can find the text a little hard to read, if this is the case let me know. The CIM Schemata V2.6 are included (and yes, it is possible to run some examples automatically based on the go.bat batch file).

John Mitchell and Monty Zukowski Sat Jun 14, 2003 13:25
A complete GNU C parser and translator. If you ever wanted to see a professionally done, complete translator for a real language problem, look at this.

Piet Schoutteten Sat Jun 14, 2003 12:22
A pascal parser by Piet Schoutteten (derived from previous version by Hakki Dogusan) with some guidance from Terence Parr.

Java parser and tree parser
Terence Parr Sun Jan 19, 2003 00:00
A Java 1.3 grammar written originally by (alphabetically) John Lilley, John Mitchell, Terence Parr, and Scott Stanchfield from the language spec; parses, builds trees, and walks the trees (includes java.tree.g).  Updated to 2.7.2. Last updated 1/19/2003.