Skip to content

Instantly share code, notes, and snippets.

@obernardovieira
Created February 20, 2020 11:48
Show Gist options
  • Save obernardovieira/ff7994c2248270cd2d90a5c829ae2a83 to your computer and use it in GitHub Desktop.
Save obernardovieira/ff7994c2248270cd2d90a5c829ae2a83 to your computer and use it in GitHub Desktop.
variableDeclaration
: typeName storageLocation? identifier ;
typeName
: elementaryTypeName
| userDefinedTypeName
| mapping
| typeName '[' expression? ']'
| functionTypeName
| 'address' 'payable' ;
elementaryTypeName
: 'address' | 'bool' | 'string' | 'var' | Int | Uint | 'byte' | Byte | Fixed | Ufixed ;
storageLocation
: 'memory' | 'storage' | 'calldata';
identifier
: ('from' | 'calldata' | Identifier) ;
Identifier
: IdentifierStart IdentifierPart* ;
fragment
IdentifierStart
: [a-zA-Z$_] ;
fragment
IdentifierPart
: [a-zA-Z0–9$_] ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment