From 261786d909262e6cb4e9602cced76a3a22b7cb88 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 21 Feb 2015 18:25:08 +0100 Subject: Allow conversion to dynamic arrays and update grammar. --- grammar.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'grammar.txt') diff --git a/grammar.txt b/grammar.txt index a3b24687..6503516c 100644 --- a/grammar.txt +++ b/grammar.txt @@ -18,8 +18,9 @@ ParameterList = '(' ( VariableDeclaration (',' VariableDeclaration)* )? ')' // semantic restriction: mappings and structs (recursively) containing mappings // are not allowed in argument lists VariableDeclaration = TypeName Identifier -TypeName = ElementaryTypeName | Identifier | Mapping +TypeName = ElementaryTypeName | Identifier | Mapping | ArrayTypeName Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')' +ArrayTypeName = TypeName '[' (Expression)? ']' Block = '{' Statement* '}' Statement = IfStatement | WhileStatement | Block | @@ -42,5 +43,5 @@ Assignment = Expression (AssignmentOp Expression) FunctionCall = Expression '(' Expression ( ',' Expression )* ')' NewExpression = 'new' Identifier MemberAccess = Expression '.' Identifier -IndexAccess = Expression '[' Expresison ']' +IndexAccess = Expression '[' (Expresison)? ']' PrimaryExpression = Identifier | NumberLiteral | StringLiteral | ElementaryTypeName | '(' Expression ')' -- cgit