diff options
author | Christian <c@ethdev.com> | 2014-10-09 02:53:50 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-10-09 02:53:50 +0800 |
commit | 0a1ebe4f516a5c1e8ebc12798a94529bdda9b6df (patch) | |
tree | dcc068f33caaa625872b1c1e612f6c362b13145f /grammar.txt | |
parent | 56e9cc8db71f8af949123e13e6a97cc056cf766d (diff) | |
download | dexon-solidity-0a1ebe4f516a5c1e8ebc12798a94529bdda9b6df.tar dexon-solidity-0a1ebe4f516a5c1e8ebc12798a94529bdda9b6df.tar.gz dexon-solidity-0a1ebe4f516a5c1e8ebc12798a94529bdda9b6df.tar.bz2 dexon-solidity-0a1ebe4f516a5c1e8ebc12798a94529bdda9b6df.tar.lz dexon-solidity-0a1ebe4f516a5c1e8ebc12798a94529bdda9b6df.tar.xz dexon-solidity-0a1ebe4f516a5c1e8ebc12798a94529bdda9b6df.tar.zst dexon-solidity-0a1ebe4f516a5c1e8ebc12798a94529bdda9b6df.zip |
Parse everything up to function bodies and report parser errors with location.
Diffstat (limited to 'grammar.txt')
-rw-r--r-- | grammar.txt | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/grammar.txt b/grammar.txt index aec02489..1946325f 100644 --- a/grammar.txt +++ b/grammar.txt @@ -1,18 +1,18 @@ ContractDefinition = 'contract' Identifier '{' ContractPart* '}' -ContractPart = VariableDeclaration ';' | StructDefinition ';' | - FunctionDefinition ';' | 'public:' | 'private:' +ContractPart = VariableDeclaration ';' | StructDefinition | + FunctionDefinition | 'public:' | 'private:' StructDefinition = 'struct' Identifier '{' ( VariableDeclaration (';' VariableDeclaration)* )? '} -FunctionDefinition = 'function' Identifier ArgumentList 'const'? - 'returns' ArgumentList Block -ArgumentList = '(' ( VariableDeclaration (',' VariableDeclaration)* )? ')' +FunctionDefinition = 'function' Identifier ParameterList 'const'? + ( 'returns' ParameterList )? Block +ParameterList = '(' ( VariableDeclaration (',' VariableDeclaration)* )? ')' // semantic restriction: mappings and structs (recursively) containing mappings // are not allowed in argument lists VariableDeclaration = TypeName Identifier -TypeName = PredefinedType | Identifier | MappingType -MappingType = 'mapping' '(' SimplePredefinedType '=>' TypeName ')' +TypeName = ElementaryTypeName | Identifier | Mapping +Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')' Block = '{' Statement* '}' Statement = IfStatement | WhileStatement | Continue | Break | Return | VariableAssignment | Expression ';' | Block |