Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ax003d
Created October 27, 2013 04:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ax003d/7178096 to your computer and use it in GitHub Desktop.
Save ax003d/7178096 to your computer and use it in GitHub Desktop.
sample codes
// Define a grammar called Hello
grammar Hello;
r : 'hello' ID ; // match keyword hello followed by an identifier
ID : [a-z]+ ; // match lower-case identifiers
WS : [ \t\r\n]+ -> skip ; // skip spaces, tabs, newlines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment