Skip to content

Instantly share code, notes, and snippets.

@scott2449
Created February 28, 2011 20:00
Show Gist options
  • Save scott2449/847918 to your computer and use it in GitHub Desktop.
Save scott2449/847918 to your computer and use it in GitHub Desktop.
antlr grammar to support google partial data api
grammar Gdl;
options{
output=AST;
}
start : fieldlist;
fieldlist : field (COMMA field)* -> field*;
field : STRING L fieldlist R -> ^(STRING fieldlist)
| STRING ;
STRING : ('a'..'z' | 'A'..'Z')+;
COMMA : ',' ;
L : '(';
R : ')';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment