From: Maxime van Noppen <yabo(a)lrde.epita.fr>
To: transformers-patches(a)lrde.epita.fr, olena-patches(a)lrde.epita.fr
Subject: scool r129: Fix tests
URL:
https://svn.lrde.epita.fr/svn/scool/branches/scool-ng
ChangeLog:
2008-11-14 Maxime van Noppen <yabo(a)lrde.epita.fr>
Fix tests.
* examples/c++_ast/point1d_simple.aterm: New.
* examples/c++_ast/sample_1.aterm: New.
* examples/c++_ast/sample_3.aterm: New.
* examples/c++_ast/sample_4.aterm: New.
* examples/c++_build/point1d_simple.g++: New.
* examples/c++_build/sample_3.g++: New.
* examples/c++_build/sample_4.g++: New.
* examples/c++_src/point1d_simple.cc: New.
* examples/c++_src/sample_1.cc: New.
* examples/c++_src/sample_3.cc: New.
* examples/c++_src/sample_4.cc: New.
* examples/scool_ast/point1d_simple.aterm: New.
* examples/scool_ast/sample_1.aterm: New.
* examples/scool_ast/sample_3.aterm: New.
* examples/scool_ast/sample_4.aterm: New.
* examples/scool_ast/sample_animal_hierarchy.aterm: New.
* examples/scool_src/point1d_simple.scl: .
* examples/scool_src/sample_4.scl: .
* examples/scool_src/sample_5.scl: Remove.
* examples/scool_src/sample_animal_hierarchy.scl: .
* function/scool_ast/call_003.aterm: .
* function/scool_src/call_003.scl: .
* type/c++_ast/typedef_001.aterm: New.
* type/c++_build/typedef_001.g++: New.
* type/c++_src/typedef_001.cc: New.
* type/scool_ast/typedef_001.aterm: New.
* variable/scool_ast/declaration_005.aterm: .
* variable/scool_src/declaration_005.scl: .
---
examples/c++_ast/point1d_simple.aterm | 1 +
examples/c++_ast/sample_1.aterm | 1 +
examples/c++_ast/sample_3.aterm | 1 +
examples/c++_ast/sample_4.aterm | 1 +
examples/c++_src/point1d_simple.cc | 16 ++++++++++++++++
examples/c++_src/sample_1.cc | 7 +++++++
examples/c++_src/sample_3.cc | 8 ++++++++
examples/c++_src/sample_4.cc | 5 +++++
examples/scool_ast/point1d_simple.aterm | 1 +
examples/scool_ast/sample_1.aterm | 1 +
examples/scool_ast/sample_3.aterm | 1 +
examples/scool_ast/sample_4.aterm | 1 +
examples/scool_ast/sample_animal_hierarchy.aterm | 1 +
examples/scool_src/point1d_simple.scl | 6 +++---
examples/scool_src/sample_4.scl | 2 ++
examples/scool_src/sample_animal_hierarchy.scl | 2 +-
function/scool_ast/call_003.aterm | 2 +-
function/scool_src/call_003.scl | 2 +-
type/c++_ast/typedef_001.aterm | 1 +
type/c++_src/typedef_001.cc | 1 +
type/scool_ast/typedef_001.aterm | 1 +
variable/scool_ast/declaration_005.aterm | 2 +-
variable/scool_src/declaration_005.scl | 2 +-
23 files changed, 58 insertions(+), 8 deletions(-)
Index: branches/scool-ng/tests/type/c++_ast/typedef_001.aterm
===================================================================
--- branches/scool-ng/tests/type/c++_ast/typedef_001.aterm (revision 0)
+++ branches/scool-ng/tests/type/c++_ast/typedef_001.aterm (revision 129)
@@ -0,0 +1 @@
+CxxProgram([CxxTypedef(CxxType("int"),CxxId("t"))])
Index: branches/scool-ng/tests/type/c++_src/typedef_001.cc
===================================================================
--- branches/scool-ng/tests/type/c++_src/typedef_001.cc (revision 0)
+++ branches/scool-ng/tests/type/c++_src/typedef_001.cc (revision 129)
@@ -0,0 +1 @@
+typedef int t;
Index: branches/scool-ng/tests/type/scool_ast/typedef_001.aterm
===================================================================
--- branches/scool-ng/tests/type/scool_ast/typedef_001.aterm (revision 0)
+++ branches/scool-ng/tests/type/scool_ast/typedef_001.aterm (revision 129)
@@ -0,0 +1 @@
+Program([TypeDefinition(None,Identifier("t"),StaticInitialiser(SimpleType("int")))])
Index: branches/scool-ng/tests/type/c++_build/typedef_001.g++
===================================================================
Index: branches/scool-ng/tests/function/scool_ast/call_003.aterm
===================================================================
--- branches/scool-ng/tests/function/scool_ast/call_003.aterm (revision 128)
+++ branches/scool-ng/tests/function/scool_ast/call_003.aterm (revision 129)
@@ -1 +1 @@
-Program([Cxx("#include <string>\n\nusing
std::string;\n"),FunctionDefinition(None,Identifier("doit"),FunctionType(None,ArgumentsDeclaration([TypedId(Identifier("s"),SimpleType("string")),TypedId(Identifier("i"),SimpleType("int"))]),SimpleType("void")),FunctionBlock([ExpressionStatement(FunctionCall(Identifier("doit"),None,Arguments([String("\"bar\""),Integer("42")])))]))])
+Program([CxxStatement(Cxx("#include <string>\n\nusing
std::string;\n")),FunctionDefinition(None,Identifier("doit"),FunctionType(None,ArgumentsDeclaration([TypedId(Identifier("s"),SimpleType("string")),TypedId(Identifier("i"),SimpleType("int"))]),SimpleType("void")),FunctionBlock([ExpressionStatement(FunctionCall(Identifier("doit"),None,Arguments([String("\"bar\""),Integer("42")])))]))])
Index: branches/scool-ng/tests/function/scool_src/call_003.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/call_003.scl (revision 128)
+++ branches/scool-ng/tests/function/scool_src/call_003.scl (revision 129)
@@ -2,7 +2,7 @@
#include <string>
using std::string;
-]|
+]|;
doit : (s : string, i : int) -> void =
{
Index: branches/scool-ng/tests/variable/scool_ast/declaration_005.aterm
===================================================================
--- branches/scool-ng/tests/variable/scool_ast/declaration_005.aterm (revision 128)
+++ branches/scool-ng/tests/variable/scool_ast/declaration_005.aterm (revision 129)
@@ -1 +1 @@
-Program([Cxx("#include <list>\n\nusing
std::list;\n"),SimpleDeclaration(Some("var"),Identifier("l"),StaticFunctionCall(Identifier("list"),Parameters([SimpleType("int")])),None)])
+Program([CxxStatement(Cxx("#include <list>\n\nusing
std::list;\n")),SimpleDeclaration(Some("var"),Identifier("l"),StaticFunctionCall(Identifier("list"),Parameters([SimpleType("int")])),None)])
Index: branches/scool-ng/tests/variable/scool_src/declaration_005.scl
===================================================================
--- branches/scool-ng/tests/variable/scool_src/declaration_005.scl (revision 128)
+++ branches/scool-ng/tests/variable/scool_src/declaration_005.scl (revision 129)
@@ -2,6 +2,6 @@
#include <list>
using std::list;
-]|
+]|;
var l : list[int];
Index: branches/scool-ng/tests/examples/c++_ast/sample_1.aterm
===================================================================
--- branches/scool-ng/tests/examples/c++_ast/sample_1.aterm (revision 0)
+++ branches/scool-ng/tests/examples/c++_ast/sample_1.aterm (revision 129)
@@ -0,0 +1 @@
+CxxProgram([CxxFun([],CxxType("void"),CxxId("f"),[],None,[CxxDecl(CxxConstType(CxxType("int")),CxxId("i"),CxxInt("3")),CxxExpStm(CxxAssign(CxxId("i"),CxxInt("4"))),CxxDecl(CxxType("int"),CxxId("j"),CxxInt("3")),CxxExpStm(CxxAssign(CxxId("j"),CxxInt("4")))])])
Index: branches/scool-ng/tests/examples/c++_ast/sample_3.aterm
===================================================================
--- branches/scool-ng/tests/examples/c++_ast/sample_3.aterm (revision 0)
+++ branches/scool-ng/tests/examples/c++_ast/sample_3.aterm (revision 129)
@@ -0,0 +1 @@
+CxxProgram([CxxFun([],CxxType("void"),CxxId("f"),[],None,[CxxDecl(CxxType("int"),CxxId("i")),CxxDecl(CxxType("int"),CxxId("j")),CxxExpStm(CxxAssign(CxxId("i"),CxxInt("0"))),CxxExpStm(CxxAssign(CxxId("j"),CxxId("i"))),CxxExpStm(CxxAssign(CxxId("i"),CxxSum(CxxId("j"),CxxId("i"))))])])
Index: branches/scool-ng/tests/examples/c++_ast/sample_4.aterm
===================================================================
--- branches/scool-ng/tests/examples/c++_ast/sample_4.aterm (revision 0)
+++ branches/scool-ng/tests/examples/c++_ast/sample_4.aterm (revision 129)
@@ -0,0 +1 @@
+CxxProgram([CxxProgram("#include
<cmath>"),CxxFun([],CxxType("float"),CxxId("sqrt"),[(CxxType("float"),CxxId("arg"))],None,[CxxExpStm(CxxKeyword("return",CxxProgram("std::sqrt(arg)
")))])])
Index: branches/scool-ng/tests/examples/c++_ast/point1d_simple.aterm
===================================================================
--- branches/scool-ng/tests/examples/c++_ast/point1d_simple.aterm (revision 0)
+++ branches/scool-ng/tests/examples/c++_ast/point1d_simple.aterm (revision 129)
@@ -0,0 +1 @@
+CxxProgram([CxxClassDecl([(CxxType("typename"),"Exact")],CxxId("point1d"),[],[CxxPublic([CxxTypedef(CxxType("int"),CxxId("point_type")),CxxFun([],CxxType("point_type"),CxxId("get_x"),[],Const,[CxxExpStm(CxxKeyword("return",CxxId("x_")))]),CxxFun([],CxxType("point_type"),CxxId("set_x"),[(CxxConstType(CxxRefType(CxxType("point_type"))),CxxId("x"))],None,[CxxExpStm(CxxKeyword("return",CxxAssign(CxxId("x_"),CxxId("x"))))])]),CxxPrivate([CxxDecl(CxxType("point_type"),CxxId("x_"))])])])
Index: branches/scool-ng/tests/examples/c++_src/sample_1.cc
===================================================================
--- branches/scool-ng/tests/examples/c++_src/sample_1.cc (revision 0)
+++ branches/scool-ng/tests/examples/c++_src/sample_1.cc (revision 129)
@@ -0,0 +1,7 @@
+void f()
+{
+ const int i = 3;
+ i = 4;
+ int j = 3;
+ j = 4;
+}
Index: branches/scool-ng/tests/examples/c++_src/sample_3.cc
===================================================================
--- branches/scool-ng/tests/examples/c++_src/sample_3.cc (revision 0)
+++ branches/scool-ng/tests/examples/c++_src/sample_3.cc (revision 129)
@@ -0,0 +1,8 @@
+void f()
+{
+ int i;
+ int j;
+ i = 0;
+ j = i;
+ i = j + i;
+}
Index: branches/scool-ng/tests/examples/c++_src/sample_4.cc
===================================================================
--- branches/scool-ng/tests/examples/c++_src/sample_4.cc (revision 0)
+++ branches/scool-ng/tests/examples/c++_src/sample_4.cc (revision 129)
@@ -0,0 +1,5 @@
+#include <cmath>
+float sqrt(float arg)
+{
+ return std::sqrt(arg) ;
+}
Index: branches/scool-ng/tests/examples/c++_src/point1d_simple.cc
===================================================================
--- branches/scool-ng/tests/examples/c++_src/point1d_simple.cc (revision 0)
+++ branches/scool-ng/tests/examples/c++_src/point1d_simple.cc (revision 129)
@@ -0,0 +1,16 @@
+template < typename Exact >
+class point1d
+{
+ public:
+ typedef int point_type;
+ point_type get_x() const
+ {
+ return x_;
+ }
+ point_type set_x(const point_type& x)
+ {
+ return x_ = x;
+ }
+ private:
+ point_type x_;
+};
Index: branches/scool-ng/tests/examples/scool_ast/sample_animal_hierarchy.aterm
===================================================================
--- branches/scool-ng/tests/examples/scool_ast/sample_animal_hierarchy.aterm (revision 0)
+++ branches/scool-ng/tests/examples/scool_ast/sample_animal_hierarchy.aterm (revision
129)
@@ -0,0 +1 @@
+Program([ClassDefinition(Identifier("Animal"),None,None,ClassBlock([AccessBlock(Public,[FunctionDeclaration(None,Identifier("scream"),FunctionType(None,ArgumentsDeclaration([]),SimpleType("void")))])])),ClassDefinition(Identifier("Cat"),None,Some(ClassWhereClause([Inherits("Cat",SimpleType("Animal"))])),ClassBlock([AccessBlock(Public,[FunctionDefinition(None,Identifier("scream"),FunctionType(None,ArgumentsDeclaration([]),SimpleType("void")),FunctionBlock([amb([ExpressionStatement(Cxx("std::cout
<< \"Miaou\" << std::endl; ")),CxxStatement(Cxx("std::cout
<< \"Miaou\" << std::endl;
"))])]))])])),ClassDefinition(Identifier("Dog"),Some("final"),Some(ClassWhereClause([Inherits("Dog",SimpleType("Animal"))])),ClassBlock([AccessBlock(Public,[FunctionDefinition(None,Identifier("scream"),FunctionType(None,ArgumentsDeclaration([]),SimpleType("void")),FunctionBlock([amb([ExpressionStatement(Cxx("std::cout
<< \"Wouf\" << std::endl; ")),CxxStatement(Cxx("std::cout
<< \"Wouf\" << std::endl;
"))])]))])])),FunctionDefinition(None,Identifier("scream"),FunctionType(None,ArgumentsDeclaration([TypedId(Identifier("animal"),SimpleType("Animal"))]),SimpleType("void")),FunctionBlock([amb([ExpressionStatement(Cxx("animal.scream();
")),CxxStatement(Cxx("animal.scream();
"))])])),FunctionDefinition(None,Identifier("main"),FunctionType(None,ArgumentsDeclaration([]),SimpleType("int")),FunctionBlock([SimpleDeclaration(Some("var"),Identifier("cat"),SimpleType("Cat"),None),SimpleDeclaration(Some("var"),Identifier("dog"),SimpleType("Dog"),None),ExpressionStatement(FunctionCall(Identifier("scream"),None,Arguments([Identifier("cat")]))),ExpressionStatement(FunctionCall(Identifier("scream"),None,Arguments([Identifier("dog")]))),ReturnStatement(Integer("0"))]))])
Index: branches/scool-ng/tests/examples/scool_ast/sample_1.aterm
===================================================================
--- branches/scool-ng/tests/examples/scool_ast/sample_1.aterm (revision 0)
+++ branches/scool-ng/tests/examples/scool_ast/sample_1.aterm (revision 129)
@@ -0,0 +1 @@
+Program([FunctionDefinition(None,Identifier("f"),FunctionType(None,ArgumentsDeclaration([]),SimpleType("void")),FunctionBlock([SimpleDeclaration(None,Identifier("i"),SimpleType("int"),Some(Initialiser(Integer("3")))),ExpressionStatement(Assign(Identifier("i"),Integer("4"))),SimpleDeclaration(Some("var"),Identifier("j"),SimpleType("int"),Some(Initialiser(Integer("3")))),ExpressionStatement(Assign(Identifier("j"),Integer("4")))]))])
Index: branches/scool-ng/tests/examples/scool_ast/sample_3.aterm
===================================================================
--- branches/scool-ng/tests/examples/scool_ast/sample_3.aterm (revision 0)
+++ branches/scool-ng/tests/examples/scool_ast/sample_3.aterm (revision 129)
@@ -0,0 +1 @@
+Program([FunctionDefinition(None,Identifier("f"),FunctionType(None,ArgumentsDeclaration([]),SimpleType("void")),FunctionBlock([SimpleDeclaration(Some("var"),Identifier("i"),SimpleType("int"),None),SimpleDeclaration(Some("var"),Identifier("j"),SimpleType("int"),None),ExpressionStatement(Assign(Identifier("i"),Integer("0"))),ExpressionStatement(Assign(Identifier("j"),Identifier("i"))),ExpressionStatement(Assign(Identifier("i"),Sum(Identifier("j"),Identifier("i"))))]))])
Index: branches/scool-ng/tests/examples/scool_ast/sample_4.aterm
===================================================================
--- branches/scool-ng/tests/examples/scool_ast/sample_4.aterm (revision 0)
+++ branches/scool-ng/tests/examples/scool_ast/sample_4.aterm (revision 129)
@@ -0,0 +1 @@
+Program([CxxStatement(Cxx("#include
<cmath>")),FunctionDefinition(None,Identifier("sqrt"),FunctionType(None,ArgumentsDeclaration([TypedId(Identifier("arg"),SimpleType("float"))]),SimpleType("float")),FunctionBlock([ReturnStatement(Cxx("std::sqrt(arg)
"))]))])
Index: branches/scool-ng/tests/examples/scool_ast/point1d_simple.aterm
===================================================================
--- branches/scool-ng/tests/examples/scool_ast/point1d_simple.aterm (revision 0)
+++ branches/scool-ng/tests/examples/scool_ast/point1d_simple.aterm (revision 129)
@@ -0,0 +1 @@
+Program([ClassDefinition(Identifier("point1d"),None,None,ClassBlock([AccessBlock(Public,[TypeDefinition(None,Identifier("point_type"),StaticInitialiser(SimpleType("int"))),FunctionDefinition(None,Identifier("get_x"),FunctionType(None,ArgumentsDeclaration([]),SimpleType("point_type")),FunctionBlock(Identifier("x_"))),FunctionDefinition(Some("mutable"),Identifier("set_x"),FunctionType(None,ArgumentsDeclaration([TypedId(Identifier("x"),SimpleType("point_type"))]),SimpleType("point_type")),FunctionBlock(Assign(Identifier("x_"),Identifier("x"))))]),AccessBlock(Private,[SimpleDeclaration(Some("var"),Identifier("x_"),SimpleType("point_type"),None)])]))])
Index: branches/scool-ng/tests/examples/scool_src/sample_5.scl (deleted)
===================================================================
Index: branches/scool-ng/tests/examples/scool_src/sample_animal_hierarchy.scl
===================================================================
--- branches/scool-ng/tests/examples/scool_src/sample_animal_hierarchy.scl (revision 128)
+++ branches/scool-ng/tests/examples/scool_src/sample_animal_hierarchy.scl (revision 129)
@@ -14,7 +14,7 @@
}
}
-final Dog : class where Dog -> Animal =
+Dog : final class where Dog -> Animal =
{
public
{
Index: branches/scool-ng/tests/examples/scool_src/sample_4.scl
===================================================================
--- branches/scool-ng/tests/examples/scool_src/sample_4.scl (revision 128)
+++ branches/scool-ng/tests/examples/scool_src/sample_4.scl (revision 129)
@@ -1,3 +1,5 @@
+|[#include <cmath>]|;
+
sqrt : (arg : float) -> float =
{
-> |[ std::sqrt(arg) ]|;
Index: branches/scool-ng/tests/examples/scool_src/point1d_simple.scl
===================================================================
--- branches/scool-ng/tests/examples/scool_src/point1d_simple.scl (revision 128)
+++ branches/scool-ng/tests/examples/scool_src/point1d_simple.scl (revision 129)
@@ -4,12 +4,12 @@
{
point_type : type = int;
- get_x : () -> point_type => x_;
- mutable set_x : (x : point_type) -> point_type => x_ = x;
+ get_x : () -> point_type = x_;
+ mutable set_x : (x : point_type) -> point_type = x_ = x;
}
private
{
- var x : point_type;
+ var x_ : point_type;
}
}
Index: branches/scool-ng/tests/examples/c++_build/sample_4.g++
===================================================================
Index: branches/scool-ng/tests/examples/c++_build/point1d_simple.g++
===================================================================
Index: branches/scool-ng/tests/examples/c++_build/sample_3.g++
===================================================================