aboutsummaryrefslogtreecommitdiffstats
path: root/docs/grammar.txt
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-01-02 19:25:04 +0800
committerGitHub <noreply@github.com>2017-01-02 19:25:04 +0800
commit37799683a781c7a89b2509a86e11d2cb6b9b3500 (patch)
tree39a08a973f4fda93b9b154214347534e340477b5 /docs/grammar.txt
parent2176dae82e02625e4df3fee38f0117fa538fd9e6 (diff)
parent28550ac9ff52237ac2c9cf1919dd3adac017eca0 (diff)
downloaddexon-solidity-37799683a781c7a89b2509a86e11d2cb6b9b3500.tar.gz
dexon-solidity-37799683a781c7a89b2509a86e11d2cb6b9b3500.tar.zst
dexon-solidity-37799683a781c7a89b2509a86e11d2cb6b9b3500.zip
Merge pull request #1528 from federicobond/userdefinedtypename
Add UserDefinedTypeName to grammar.txt
Diffstat (limited to 'docs/grammar.txt')
-rw-r--r--docs/grammar.txt12
1 files changed, 10 insertions, 2 deletions
diff --git a/docs/grammar.txt b/docs/grammar.txt
index c9f7f448..f18ef2f3 100644
--- a/docs/grammar.txt
+++ b/docs/grammar.txt
@@ -14,7 +14,7 @@ ContractDefinition = ( 'contract' | 'library' ) Identifier
ContractPart = StateVariableDeclaration | UsingForDeclaration
| StructDefinition | ModifierDefinition | FunctionDefinition | EventDefinition | EnumDefinition
-InheritanceSpecifier = Identifier ( '(' Expression ( ',' Expression )* ')' )?
+InheritanceSpecifier = UserDefinedTypeName ( '(' Expression ( ',' Expression )* ')' )?
StateVariableDeclaration = TypeName ( 'public' | 'internal' | 'private' )? Identifier ('=' Expression)? ';'
UsingForDeclaration = 'using' Identifier 'for' ('*' | TypeName) ';'
@@ -36,7 +36,15 @@ TypeNameList = '(' ( TypeName (',' TypeName )* )? ')'
// semantic restriction: mappings and structs (recursively) containing mappings
// are not allowed in argument lists
VariableDeclaration = TypeName Identifier
-TypeName = ElementaryTypeName | Identifier StorageLocation? | Mapping | ArrayTypeName | FunctionTypeName
+
+TypeName = ElementaryTypeName
+ | UserDefinedTypeName StorageLocation?
+ | Mapping
+ | ArrayTypeName
+ | FunctionTypeName
+
+UserDefinedTypeName = Identifier ( '.' Identifier )*
+
Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')'
ArrayTypeName = TypeName '[' Expression? ']' StorageLocation?
FunctionTypeName = 'function' TypeNameList ( 'internal' | 'external' | 'constant' | 'payable' )*