(I am currently trying to verify my Solidity LALR Parser project syparse with the examples in the Solidity documentation.)
The following example is taken from chapter Visibility and Getters (Getter Functions) in document contracts.rst:
pragma solidity ^0.4.0;
contract C {
uint public data = 42;
}
contract Caller {
C c = new C();
function f() {
uint local = c.data();
}
}
The existing grammar rule
NewExpression = 'new' TypeName
does not cover an expression like
'new' Identifier().
It also lacks support for
uint[] memory x = new uint[](300);
I think it does cover new Identifier(). It's parsed as:
FunctionCall > NewExpression > UserDefinedTypeName > Identifier
new uint[](300) is specified and parsed as:
FunctionCall > NewExpression > ArrayTypeName > ElementaryTypeName
Thanks Frederico.