Skip to content

Instantly share code, notes, and snippets.

@jeremytregunna
Created May 17, 2010 02:30
Show Gist options
  • Select an option

  • Save jeremytregunna/403336 to your computer and use it in GitHub Desktop.

Select an option

Save jeremytregunna/403336 to your computer and use it in GitHub Desktop.
IDENT ::= [A-Za-z`~!@$%^&*_-+=|:/?.><][A-Za-z0-9`~!@$%^&*_-+=|:/?.><]*
sep ::= '\r' '\n' | '\n'
expressions ::= expression+
expression ::= call | string_lit | number_lit | sep
argument_list ::= expression [ ',' expressions ]*
call ::= IDENT? ( '(' argument_list? ')' )?
string_lit ::= '"' ( ANY - '"' ) '"'
sci_notation ::= 'e' ( '+' | '-' )? [0-9]+
hex_lit ::= '0' 'x' [0-9A-Fa-f]+ sci_notation?
number_lit ::= ('0' | [1-9]) [0-9]* sci_notation? | ( '0' | [1-9]) [0-9]* '.' [0-9]* sci_notation? | ( '0' | [1-9] ) [0-9]*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment