URL:
https://svn.lrde.epita.fr/svn/scool/branches/scool-ng
ChangeLog:
2009-02-12 Matthieu Martin <matthieu.mar(a)gmail.com>
Fix Method Call.
* src/scl-syn/Expression.sdf: Add Method Call.
* tests/examples/scool_ast/sample_2.aterm: New.
---
src/scl-syn/Expression.sdf | 4 +++-
tests/examples/scool_ast/sample_2.aterm | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
Index: branches/scool-ng/tests/examples/scool_ast/sample_2.aterm
===================================================================
--- branches/scool-ng/tests/examples/scool_ast/sample_2.aterm (revision 0)
+++ branches/scool-ng/tests/examples/scool_ast/sample_2.aterm (revision 140)
@@ -0,0 +1 @@
+Program([FunctionDefinition(None,Identifier("f"),FunctionType(None,ArgumentsDeclaration([]),SimpleType("void")),FunctionBlock([SimpleDeclaration(Some("var"),Identifier("a"),StaticFunctionCall(Identifier("array"),Parameters([SimpleType("int"),Integer("2")])),None),SimpleDeclaration(Some("var"),Identifier("i"),SimpleType("int"),Some(Initialiser(MethodCall(Identifier("a"),Identifier("at"),SimpleFunctionArguments(Integer("0"))))))]))])
Index: branches/scool-ng/src/scl-syn/Expression.sdf
===================================================================
--- branches/scool-ng/src/scl-syn/Expression.sdf (revision 139)
+++ branches/scool-ng/src/scl-syn/Expression.sdf (revision 140)
@@ -41,7 +41,9 @@
%%Expression "." Identifier -> Expression {cons("Field")}
- %%Identifier "." Identifier SimpleFunctionArguments ->
Expression {cons("MethodCall")}
+ Identifier "." Identifier SimpleFunctionArguments ->
Expression {cons("MethodCall")}
+
+ "(" Expression ")" -> SimpleFunctionArguments
{cons("SimpleFunctionArguments")}
%%"(" Expression ")" ->
Expression {cons("Parenthesis")}