Languages Features Creators CSV Resources Challenges Add Language
GitHub icon

ANTLR

ANTLR - Grammar language

< >

ANTLR is a grammar language created in 1992.

#119on PLDB 31Years Old 3.0kUsers
1Books 1Papers 1kRepos

In computer-based language recognition, ANTLR (pronounced Antler), or Another Tool For Language Recognition, is a parser generator that uses LL(*) for parsing. ANTLR is the successor to the Purdue Compiler Construction Tool Set (PCCTS), first developed in 1989, and is under active development. Its maintainer is Professor Terence Parr of the University of San Francisco.. Read more on Wikipedia...


Example from the web:
/** Taken from "The Definitive ANTLR 4 Reference" by Terence Parr */ // Derived from http://json.org grammar JSON; json : value ; obj : '{' pair (',' pair)* '}' | '{' '}' ; pair : STRING ':' value ; arr : '[' value (',' value)* ']' | '[' ']' ; value : STRING | NUMBER | obj | arr | 'true' | 'false' | 'null' ; STRING : '"' (ESC | SAFECODEPOINT)* '"' ; fragment ESC : '\\' (["\\/bfnrt] | UNICODE) ; fragment UNICODE : 'u' HEX HEX HEX HEX ; fragment HEX : [0-9a-fA-F] ; fragment SAFECODEPOINT : ~ ["\\\u0000-\u001F] ; NUMBER : '-'? INT ('.' [0-9] +)? EXP? ; fragment INT : '0' | [1-9] [0-9]* ; // no leading zeros fragment EXP : [Ee] [+\-]? INT ; // \- since - means "range" inside [...] WS : [ \t\n\r] + -> skip ;
Example from Wikipedia:
TextReader reader; // (...) Fill TextReader with character SumLexer lexer = new SumLexer(reader); SumParser parser = new SumParser(lexer); parser.expression();

Language features

Feature Supported Token Example
Booleans ✓ true false
MultiLine Comments ✓ /* */
/* A comment
*/
Comments ✓
// A comment
Line Comments ✓ //
// A comment
Semantic Indentation X

Books about ANTLR from ISBNdb

title authors year publisher
The Definitive ANTLR 4 Reference Terence Parr 20130115 O'Reilly Media, Inc.

Publications about ANTLR from Semantic Scholar

title authors year citations influentialCitations
Multilingual Detection of Code Clones Using ANTLR Grammar Definitions Yuichi Semura and Norihiro Yoshida and Eunjong Choi and Katsuro Inoue 2018 7 0
lfe.html · antlr.html · purebasic.html

View source

- Build the next great programming language · Search · Day 214 · About · Blog · Acknowledgements · Traffic · Traffic Today · GitHub · feedback@pldb.com