Skip to content

Instantly share code, notes, and snippets.

@micrypt
Created July 9, 2012 06:37
Show Gist options
  • Save micrypt/3074634 to your computer and use it in GitHub Desktop.
Save micrypt/3074634 to your computer and use it in GitHub Desktop.
Ampify notes
Program ::= Statements
Statements ::= Statement [EOL] | Statement Statements
Statement ::= Assignment | Procedure | If | While | 'return' [Expr]
Assignment ::= Variable '=' Expr
Variable ::= /[A-Za-z_0-9]+/
Expr ::= Literal | Variable | Procedure | Variable Operator Variable
Literal ::= " String " | ' String ' | /[0-9]+/
Procedure ::= Identifier '(' [param1 param2 ... paramN] ')'
Identifier ::= 'commit' | 'rollback' | 'save'
If ::= ‘if’ Expr ‘{‘ ( [EOL] Statements ‘}’ [ 'else' '{' [EOL] Statements '}' ]
While ::= 'while' Expr '{' [EOL] Statements '}'
String ::= /[A-Za-z_0-9/s]+/
Operator ::= '+' | '-' | '/' | '*' | '>' | '<' | '>=' | '<=' | '=='
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment