[antlr-interest] ANTLR v4 generates its first parser and lexer!

Terence Parr parrt at cs.usfca.edu
Mon May 17 16:08:14 PDT 2010


Hiya. I am working hard on the code generator infrastructure for v4. I'm extremely pleased with how the internals look and how easy it is to build the templates for source code generation. Also, I'm very happy with how the lexer bytecode interpreter has worked out. Here is the simple parser and lexer I ran through the system:

parser grammar T;
options { tokenVocab = L; }

a : ID '=' expr ;

expr : INT ;

lexer grammar L;

ID : 'a'..'z'+ ;
INT : '0'..'9'+ ;
EQ : '=' ;

Just popping my head up as v4 hits milestones...

v4 runtime is almost exactly the same as v3 runtime.  so far, the v4 grammar syntax is identical as well (hurray!)

I still have a long way to go because ANTLR has so many little features and lots of  implementation details to worry about. I also need to work on an academic paper this summer, which will delay me for a few months.

Ter



More information about the antlr-interest mailing list