Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
June 2008
- 9 participants
- 135 discussions
URL: https://svn.lrde.epita.fr/svn/scool/branches/scool-ng
ChangeLog:
Create a new branch to develop the new grammar and the new translator.
2008-06-26 Maxime van Noppen <yabo(a)lrde.epita.fr>
Create a new branch
* .: New.
* AUTHORS: New.
* COPYING: New.
* ChangeLog: New.
* Makefile.am: New.
* Makefile: New.
* NEWS: New.
* README: New.
* bin/pp-cxx: New.
* bin: New.
* bootstrap: New.
* configure.ac: New.
* src/Makefile.am: New.
* src/cxx-syn/Cxx.sdf: New.
* src/cxx-syn/Cxx.str: New.
* src/cxx-syn/CxxDecl.sdf: New.
* src/cxx-syn/CxxExp.sdf: New.
* src/cxx-syn/CxxFun.sdf: New.
* src/cxx-syn/CxxScope.sdf: New.
* src/cxx-syn/CxxStm.sdf: New.
* src/cxx-syn/CxxType.sdf: New.
* src/cxx-syn/Lexical.sdf: New.
* src/cxx-syn/Makefile.am: New.
* src/cxx-syn: New.
* src/parse-scool/parse-scool: New.
* src/parse-scool: New.
* src/pp-cxx/CxxDecl.meta: New.
* src/pp-cxx/CxxDecl.str: New.
* src/pp-cxx/CxxExp.meta: New.
* src/pp-cxx/CxxExp.str: New.
* src/pp-cxx/CxxFun.meta: New.
* src/pp-cxx/CxxFun.str: New.
* src/pp-cxx/CxxId.meta: New.
* src/pp-cxx/CxxId.str: New.
* src/pp-cxx/CxxProgram.meta: New.
* src/pp-cxx/CxxProgram.str: New.
* src/pp-cxx/CxxStm.meta: New.
* src/pp-cxx/CxxStm.str: New.
* src/pp-cxx/CxxType.meta: New.
* src/pp-cxx/CxxType.str: New.
* src/pp-cxx/Makefile.am: New.
* src/pp-cxx/pp-cxx.meta: New.
* src/pp-cxx/pp-cxx.str: New.
* src/pp-cxx: New.
* src/scl-syn/Declaration.sdf: New.
* src/scl-syn/Expression.sdf: New.
* src/scl-syn/Lexical.sdf: New.
* src/scl-syn/Makefile.am: New.
* src/scl-syn/Scool.sdf: New.
* src/scl-syn/Statement.sdf: New.
* src/scl-syn/Type.sdf: New.
* src/scl-syn/b.sh: New.
* src/scl-syn: New.
* src/scoolt/Access.str: New.
* src/scoolt/Concept.str: New.
* src/scoolt/Decl.str: New.
* src/scoolt/Exp.meta.tmp: New.
* src/scoolt/Exp.str: New.
* src/scoolt/Impl.str: New.
* src/scoolt/Makefile.am: New.
* src/scoolt/Program.str: New.
* src/scoolt/Stm.str: New.
* src/scoolt/Tools.str: New.
* src/scoolt/Type.str: New.
* src/scoolt/scoolt.str: New.
* src/scoolt: New.
* src: New.
* tests/check.sh: New.
* tests/class/c++_ast: New.
* tests/class/c++_src: New.
* tests/class/config: New.
* tests/class/run: New.
* tests/class/scool_ast: New.
* tests/class/scool_src/class_attributes_decl_001.scl: New.
* tests/class/scool_src/class_attributes_decl_002.scl: New.
* tests/class/scool_src/class_decl_inh.scl: New.
* tests/class/scool_src/class_decl_inh_abst.scl: New.
* tests/class/scool_src/class_decl_inh_fin.scl: New.
* tests/class/scool_src/class_empty_accessblocks_001.scl: New.
* tests/class/scool_src/class_empty_accessblocks_002.scl: New.
* tests/class/scool_src/class_empty_accessblocks_003.scl: New.
* tests/class/scool_src/class_empty_accessblocks_004.scl: New.
* tests/class/scool_src/class_empty_decl_001.scl: New.
* tests/class/scool_src/class_empty_decl_002.scl: New.
* tests/class/scool_src/class_members_1.scl: New.
* tests/class/scool_src/class_method_decl_001.scl: New.
* tests/class/scool_src/class_method_decl_002.scl: New.
* tests/class/scool_src/class_method_decl_003.scl: New.
* tests/class/scool_src/class_method_decl_004.scl: New.
* tests/class/scool_src/class_method_decl_005.scl: New.
* tests/class/scool_src/class_predecl.scl: New.
* tests/class/scool_src/class_predecl_inh.scl: New.
* tests/class/scool_src/class_template_1.scl: New.
* tests/class/scool_src/class_template_2.scl: New.
* tests/class/scool_src/mutable_1.scl: New.
* tests/class/scool_src/typedef_001.scl: New.
* tests/class/scool_src: New.
* tests/class: New.
* tests/concept/c++_ast: New.
* tests/concept/c++_src: New.
* tests/concept/config: New.
* tests/concept/run: New.
* tests/concept/scool_ast: New.
* tests/concept/scool_src/concept_1.scl: New.
* tests/concept/scool_src/concept_2.scl: New.
* tests/concept/scool_src/concept_3.scl: New.
* tests/concept/scool_src/concept_4.scl: New.
* tests/concept/scool_src/concept_use_1.scl: New.
* tests/concept/scool_src/concept_use_2.scl: New.
* tests/concept/scool_src: New.
* tests/concept: New.
* tests/config: New.
* tests/examples/c++_ast: New.
* tests/examples/c++_src: New.
* tests/examples/config: New.
* tests/examples/run: New.
* tests/examples/scool_ast: New.
* tests/examples/scool_src/point1d_simple.scl: New.
* tests/examples/scool_src/sample_1.scl: New.
* tests/examples/scool_src/sample_2.scl: New.
* tests/examples/scool_src/sample_3.scl: New.
* tests/examples/scool_src/sample_4.scl: New.
* tests/examples/scool_src/sample_5.scl: New.
* tests/examples/scool_src/sample_6.scl: New.
* tests/examples/scool_src/sample_animal_hierarchy.scl: New.
* tests/examples/scool_src/sample_container.scl: New.
* tests/examples/scool_src: New.
* tests/examples: New.
* tests/expression/c++_ast: New.
* tests/expression/c++_src: New.
* tests/expression/config: New.
* tests/expression/run: New.
* tests/expression/scool_ast: New.
* tests/expression/scool_src/foo.scl: New.
* tests/expression/scool_src: New.
* tests/expression: New.
* tests/function/c++_ast: New.
* tests/function/c++_src: New.
* tests/function/config: New.
* tests/function/run: New.
* tests/function/scool_ast/declaration_001.aterm: New.
* tests/function/scool_ast/declaration_002.aterm: New.
* tests/function/scool_ast/declaration_003.aterm: New.
* tests/function/scool_ast/declaration_004.aterm: New.
* tests/function/scool_ast/definition_001.aterm: New.
* tests/function/scool_ast/definition_002.aterm: New.
* tests/function/scool_ast: New.
* tests/function/scool_src/call_001.scl: New.
* tests/function/scool_src/call_002.scl: New.
* tests/function/scool_src/call_003.scl: New.
* tests/function/scool_src/declaration_001.scl: New.
* tests/function/scool_src/declaration_002.scl: New.
* tests/function/scool_src/declaration_003.scl: New.
* tests/function/scool_src/declaration_004.scl: New.
* tests/function/scool_src/definition_001.scl: New.
* tests/function/scool_src/definition_002.scl: New.
* tests/function/scool_src/definition_003.scl: New.
* tests/function/scool_src/definition_004.scl: New.
* tests/function/scool_src/definition_005.scl: New.
* tests/function/scool_src/definition_006.scl: New.
* tests/function/scool_src/definition_007.scl: New.
* tests/function/scool_src/static_dynamic_parameters_001.scl: New.
* tests/function/scool_src/static_dynamic_parameters_002.scl: New.
* tests/function/scool_src/static_dynamic_parameters_003.scl: New.
* tests/function/scool_src/static_parameter_001.scl: New.
* tests/function/scool_src: New.
* tests/function: New.
* tests/misc/c++_ast: New.
* tests/misc/c++_src/empty.cc: New.
* tests/misc/c++_src: New.
* tests/misc/config: New.
* tests/misc/run: New.
* tests/misc/scool_ast/empty.aterm: New.
* tests/misc/scool_ast: New.
* tests/misc/scool_src/empty.scl: New.
* tests/misc/scool_src: New.
* tests/misc: New.
* tests/type/c++_ast: New.
* tests/type/c++_src: New.
* tests/type/config: New.
* tests/type/run: New.
* tests/type/scool_ast: New.
* tests/type/scool_src/function_decl_2.scl: New.
* tests/type/scool_src/typedef_001.scl: New.
* tests/type/scool_src: New.
* tests/type: New.
* tests/variable/c++_ast: New.
* tests/variable/c++_src: New.
* tests/variable/config: New.
* tests/variable/run: New.
* tests/variable/scool_ast/declaration_001.aterm: New.
* tests/variable/scool_ast/declaration_003.aterm: New.
* tests/variable/scool_ast/declaration_007.aterm: New.
* tests/variable/scool_ast: New.
* tests/variable/scool_src/declaration_001.scl: New.
* tests/variable/scool_src/declaration_002.scl: New.
* tests/variable/scool_src/declaration_003.scl: New.
* tests/variable/scool_src/declaration_004.scl: New.
* tests/variable/scool_src/declaration_005.scl: New.
* tests/variable/scool_src/declaration_006.scl: New.
* tests/variable/scool_src/declaration_007.scl: New.
* tests/variable/scool_src/mixed_declarations_001.scl: New.
* tests/variable/scool_src: New.
* tests/variable: New.
* tests: New.
* vcs/scool.rb: New.
* vcs: New.
AUTHORS | 2
COPYING | 340 ++++
Makefile | 918 +++++++++++++
Makefile.am | 10
bin/pp-cxx | 1
bootstrap | 7
configure.ac | 29
src/Makefile.am | 7
src/cxx-syn/Cxx.sdf | 12
src/cxx-syn/Cxx.str | 59
src/cxx-syn/CxxDecl.sdf | 37
src/cxx-syn/CxxExp.sdf | 15
src/cxx-syn/CxxFun.sdf | 24
src/cxx-syn/CxxStm.sdf | 11
src/cxx-syn/CxxType.sdf | 14
src/cxx-syn/Lexical.sdf | 15
src/cxx-syn/Makefile.am | 19
src/parse-scool/parse-scool | 1
src/pp-cxx/CxxDecl.meta | 1
src/pp-cxx/CxxDecl.str | 100 +
src/pp-cxx/CxxExp.meta | 1
src/pp-cxx/CxxExp.str | 43
src/pp-cxx/CxxFun.meta | 1
src/pp-cxx/CxxFun.str | 80 +
src/pp-cxx/CxxId.meta | 1
src/pp-cxx/CxxId.str | 12
src/pp-cxx/CxxProgram.meta | 1
src/pp-cxx/CxxProgram.str | 16
src/pp-cxx/CxxStm.meta | 1
src/pp-cxx/CxxStm.str | 18
src/pp-cxx/CxxType.meta | 1
src/pp-cxx/CxxType.str | 32
src/pp-cxx/Makefile.am | 21
src/pp-cxx/pp-cxx.meta | 1
src/pp-cxx/pp-cxx.str | 6
src/scl-syn/Declaration.sdf | 36
src/scl-syn/Expression.sdf | 66
src/scl-syn/Lexical.sdf | 61
src/scl-syn/Makefile.am | 19
src/scl-syn/Scool.sdf | 11
src/scl-syn/Statement.sdf | 15
src/scl-syn/Type.sdf | 25
src/scl-syn/b.sh | 2
src/scoolt/Access.str | 15
src/scoolt/Concept.str | 77 +
src/scoolt/Decl.str | 257 +++
src/scoolt/Exp.meta.tmp | 1
src/scoolt/Exp.str | 28
src/scoolt/Impl.str | 5
src/scoolt/Makefile.am | 21
src/scoolt/Program.str | 11
src/scoolt/Stm.str | 21
src/scoolt/Tools.str | 29
src/scoolt/Type.str | 32
src/scoolt/scoolt.str | 184 ++
tests/check.sh | 261 +++
tests/class/config | 1
tests/class/scool_src/class_attributes_decl_001.scl | 7
tests/class/scool_src/class_attributes_decl_002.scl | 8
tests/class/scool_src/class_decl_inh.scl | 9
tests/class/scool_src/class_decl_inh_abst.scl | 9
tests/class/scool_src/class_decl_inh_fin.scl | 14
tests/class/scool_src/class_empty_accessblocks_001.scl | 6
tests/class/scool_src/class_empty_accessblocks_002.scl | 6
tests/class/scool_src/class_empty_accessblocks_003.scl | 6
tests/class/scool_src/class_empty_accessblocks_004.scl | 12
tests/class/scool_src/class_empty_decl_001.scl | 3
tests/class/scool_src/class_empty_decl_002.scl | 3
tests/class/scool_src/class_members_1.scl | 6
tests/class/scool_src/class_method_decl_001.scl | 10
tests/class/scool_src/class_method_decl_002.scl | 7
tests/class/scool_src/class_method_decl_003.scl | 8
tests/class/scool_src/class_method_decl_004.scl | 15
tests/class/scool_src/class_method_decl_005.scl | 17
tests/class/scool_src/class_predecl.scl | 1
tests/class/scool_src/class_predecl_inh.scl | 1
tests/class/scool_src/class_template_1.scl | 3
tests/class/scool_src/class_template_2.scl | 3
tests/class/scool_src/mutable_1.scl | 9
tests/class/scool_src/typedef_001.scl | 4
tests/concept/config | 1
tests/concept/scool_src/concept_1.scl | 6
tests/concept/scool_src/concept_2.scl | 6
tests/concept/scool_src/concept_3.scl | 7
tests/concept/scool_src/concept_4.scl | 8
tests/concept/scool_src/concept_use_1.scl | 10
tests/concept/scool_src/concept_use_2.scl | 10
tests/config | 13
tests/examples/config | 1
tests/examples/scool_src/point1d_simple.scl | 15
tests/examples/scool_src/sample_1.scl | 9
tests/examples/scool_src/sample_2.scl | 5
tests/examples/scool_src/sample_3.scl | 9
tests/examples/scool_src/sample_4.scl | 4
tests/examples/scool_src/sample_5.scl | 4
tests/examples/scool_src/sample_6.scl | 4
tests/examples/scool_src/sample_animal_hierarchy.scl | 39
tests/examples/scool_src/sample_container.scl | 26
tests/expression/config | 1
tests/expression/scool_src/foo.scl | 1
tests/function/config | 1
tests/function/scool_ast/declaration_001.aterm | 1
tests/function/scool_ast/declaration_002.aterm | 1
tests/function/scool_ast/declaration_003.aterm | 1
tests/function/scool_ast/declaration_004.aterm | 1
tests/function/scool_ast/definition_001.aterm | 1
tests/function/scool_ast/definition_002.aterm | 1
tests/function/scool_src/call_001.scl | 4
tests/function/scool_src/call_002.scl | 4
tests/function/scool_src/call_003.scl | 4
tests/function/scool_src/declaration_001.scl | 1
tests/function/scool_src/declaration_002.scl | 1
tests/function/scool_src/declaration_003.scl | 1
tests/function/scool_src/declaration_004.scl | 3
tests/function/scool_src/definition_001.scl | 3
tests/function/scool_src/definition_002.scl | 4
tests/function/scool_src/definition_003.scl | 4
tests/function/scool_src/definition_004.scl | 6
tests/function/scool_src/definition_005.scl | 1
tests/function/scool_src/definition_006.scl | 1
tests/function/scool_src/definition_007.scl | 1
tests/function/scool_src/static_dynamic_parameters_001.scl | 1
tests/function/scool_src/static_dynamic_parameters_002.scl | 1
tests/function/scool_src/static_dynamic_parameters_003.scl | 1
tests/function/scool_src/static_parameter_001.scl | 3
tests/misc/config | 1
tests/misc/scool_ast/empty.aterm | 1
tests/type/config | 1
tests/type/scool_src/function_decl_2.scl | 1
tests/type/scool_src/typedef_001.scl | 1
tests/variable/config | 1
tests/variable/scool_ast/declaration_001.aterm | 1
tests/variable/scool_ast/declaration_003.aterm | 1
tests/variable/scool_ast/declaration_007.aterm | 1
tests/variable/scool_src/declaration_001.scl | 1
tests/variable/scool_src/declaration_002.scl | 1
tests/variable/scool_src/declaration_003.scl | 1
tests/variable/scool_src/declaration_004.scl | 1
tests/variable/scool_src/declaration_005.scl | 1
tests/variable/scool_src/declaration_006.scl | 1
tests/variable/scool_src/declaration_007.scl | 1
tests/variable/scool_src/mixed_declarations_001.scl | 4
vcs/scool.rb | 18
143 files changed, 3470 insertions(+)
Index: branches/scool-ng/tests/expression/config
===================================================================
--- branches/scool-ng/tests/expression/config (revision 0)
+++ branches/scool-ng/tests/expression/config (revision 63)
@@ -0,0 +1 @@
+link ../config
\ No newline at end of file
Property changes on: branches/scool-ng/tests/expression/config
___________________________________________________________________
Name: svn:special
+ *
Index: branches/scool-ng/tests/expression/scool_src/foo.scl
===================================================================
--- branches/scool-ng/tests/expression/scool_src/foo.scl (revision 0)
+++ branches/scool-ng/tests/expression/scool_src/foo.scl (revision 63)
@@ -0,0 +1 @@
+toto
Index: branches/scool-ng/tests/type/config
===================================================================
--- branches/scool-ng/tests/type/config (revision 0)
+++ branches/scool-ng/tests/type/config (revision 63)
@@ -0,0 +1 @@
+link ../config
\ No newline at end of file
Property changes on: branches/scool-ng/tests/type/config
___________________________________________________________________
Name: svn:special
+ *
Index: branches/scool-ng/tests/type/scool_src/typedef_001.scl
===================================================================
--- branches/scool-ng/tests/type/scool_src/typedef_001.scl (revision 0)
+++ branches/scool-ng/tests/type/scool_src/typedef_001.scl (revision 63)
@@ -0,0 +1 @@
+t: type = int;
Index: branches/scool-ng/tests/type/scool_src/function_decl_2.scl
===================================================================
--- branches/scool-ng/tests/type/scool_src/function_decl_2.scl (revision 0)
+++ branches/scool-ng/tests/type/scool_src/function_decl_2.scl (revision 63)
@@ -0,0 +1 @@
+f : [i : int where i > 0]() -> void = { }
Index: branches/scool-ng/tests/class/config
===================================================================
--- branches/scool-ng/tests/class/config (revision 0)
+++ branches/scool-ng/tests/class/config (revision 63)
@@ -0,0 +1 @@
+link ../config
\ No newline at end of file
Property changes on: branches/scool-ng/tests/class/config
___________________________________________________________________
Name: svn:special
+ *
Index: branches/scool-ng/tests/class/scool_src/class_members_1.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_members_1.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_members_1.scl (revision 63)
@@ -0,0 +1,6 @@
+final Student : class =
+{
+ public {
+ var money : int;
+ }
+};
Index: branches/scool-ng/tests/class/scool_src/class_predecl_inh.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_predecl_inh.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_predecl_inh.scl (revision 63)
@@ -0,0 +1 @@
+Foo : class < Bar;
Index: branches/scool-ng/tests/class/scool_src/class_decl_inh_abst.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_decl_inh_abst.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_decl_inh_abst.scl (revision 63)
@@ -0,0 +1,9 @@
+abstract Animal: class =
+{
+
+};
+
+Mammal : class < Animal =
+{
+
+};
Index: branches/scool-ng/tests/class/scool_src/class_predecl.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_predecl.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_predecl.scl (revision 63)
@@ -0,0 +1 @@
+Foo : class;
Index: branches/scool-ng/tests/class/scool_src/mutable_1.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/mutable_1.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/mutable_1.scl (revision 63)
@@ -0,0 +1,9 @@
+foo : class =
+{
+ public
+ {
+ mutable f : () -> void = { x = 42; }
+
+ var x : int;
+ }
+}
Index: branches/scool-ng/tests/class/scool_src/class_method_decl_001.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_method_decl_001.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_method_decl_001.scl (revision 63)
@@ -0,0 +1,10 @@
+Foo : class =
+{
+ public
+ {
+ test : () -> int =
+ {
+ -> 42;
+ }
+ }
+}
Index: branches/scool-ng/tests/class/scool_src/class_method_decl_002.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_method_decl_002.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_method_decl_002.scl (revision 63)
@@ -0,0 +1,7 @@
+Foo : class =
+{
+ public
+ {
+ test : () -> int => 42;
+ }
+}
Index: branches/scool-ng/tests/class/scool_src/class_method_decl_003.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_method_decl_003.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_method_decl_003.scl (revision 63)
@@ -0,0 +1,8 @@
+Foo : class =
+{
+ public
+ {
+ test : () -> int => 42;
+ another_test : () -> int => 51;
+ }
+}
Index: branches/scool-ng/tests/class/scool_src/class_method_decl_004.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_method_decl_004.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_method_decl_004.scl (revision 63)
@@ -0,0 +1,15 @@
+Foo : class =
+{
+ public
+ {
+ test : () -> int
+ {
+ -> 42;
+ }
+
+ another_test : () -> int =
+ {
+ -> 51;
+ }
+ }
+}
Index: branches/scool-ng/tests/class/scool_src/class_method_decl_005.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_method_decl_005.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_method_decl_005.scl (revision 63)
@@ -0,0 +1,17 @@
+Foo : class =
+{
+ public
+ {
+ test : () -> int
+ {
+ -> 42;
+ }
+ }
+ private
+ {
+ another_test : () -> int =
+ {
+ -> 51;
+ }
+ }
+}
Index: branches/scool-ng/tests/class/scool_src/class_template_1.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_template_1.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_template_1.scl (revision 63)
@@ -0,0 +1,3 @@
+A : [T : type] -> class =
+{
+}
Index: branches/scool-ng/tests/class/scool_src/typedef_001.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/typedef_001.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/typedef_001.scl (revision 63)
@@ -0,0 +1,4 @@
+foo : class =
+{
+ new_type: type = int;
+}
Index: branches/scool-ng/tests/class/scool_src/class_template_2.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_template_2.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_template_2.scl (revision 63)
@@ -0,0 +1,3 @@
+A : [T : type, B : bool] -> class =
+{
+}
Index: branches/scool-ng/tests/class/scool_src/class_empty_accessblocks_001.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_empty_accessblocks_001.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_empty_accessblocks_001.scl (revision 63)
@@ -0,0 +1,6 @@
+Foo : class =
+{
+ public
+ {
+ }
+}
Index: branches/scool-ng/tests/class/scool_src/class_attributes_decl_001.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_attributes_decl_001.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_attributes_decl_001.scl (revision 63)
@@ -0,0 +1,7 @@
+Point1d : class =
+{
+ public
+ {
+ var x : int;
+ }
+}
Index: branches/scool-ng/tests/class/scool_src/class_empty_accessblocks_002.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_empty_accessblocks_002.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_empty_accessblocks_002.scl (revision 63)
@@ -0,0 +1,6 @@
+Foo : class =
+{
+ protected
+ {
+ }
+}
Index: branches/scool-ng/tests/class/scool_src/class_attributes_decl_002.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_attributes_decl_002.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_attributes_decl_002.scl (revision 63)
@@ -0,0 +1,8 @@
+Point2d : class =
+{
+ public
+ {
+ var x : int;
+ var y : int;
+ }
+}
Index: branches/scool-ng/tests/class/scool_src/class_empty_accessblocks_003.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_empty_accessblocks_003.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_empty_accessblocks_003.scl (revision 63)
@@ -0,0 +1,6 @@
+Foo : class =
+{
+ private
+ {
+ }
+}
Index: branches/scool-ng/tests/class/scool_src/class_empty_accessblocks_004.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_empty_accessblocks_004.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_empty_accessblocks_004.scl (revision 63)
@@ -0,0 +1,12 @@
+Foo : class =
+{
+ public
+ {
+ }
+ protected
+ {
+ }
+ private
+ {
+ }
+}
Index: branches/scool-ng/tests/class/scool_src/class_decl_inh_fin.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_decl_inh_fin.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_decl_inh_fin.scl (revision 63)
@@ -0,0 +1,14 @@
+Animal: class =
+{
+
+};
+
+Mammal : class < Animal =
+{
+
+};
+
+final Monkey : class < Mammal =
+{
+
+};
Index: branches/scool-ng/tests/class/scool_src/class_empty_decl_001.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_empty_decl_001.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_empty_decl_001.scl (revision 63)
@@ -0,0 +1,3 @@
+Foo : class =
+{
+}
Index: branches/scool-ng/tests/class/scool_src/class_decl_inh.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_decl_inh.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_decl_inh.scl (revision 63)
@@ -0,0 +1,9 @@
+Bar: class =
+{
+
+};
+
+Foo : class < Bar =
+{
+
+};
Index: branches/scool-ng/tests/class/scool_src/class_empty_decl_002.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/class_empty_decl_002.scl (revision 0)
+++ branches/scool-ng/tests/class/scool_src/class_empty_decl_002.scl (revision 63)
@@ -0,0 +1,3 @@
+Foo:class=
+{
+}
Index: branches/scool-ng/tests/config
===================================================================
--- branches/scool-ng/tests/config (revision 0)
+++ branches/scool-ng/tests/config (revision 63)
@@ -0,0 +1,13 @@
+number_of_tests=1
+
+test_1 ()
+{
+ cmd='sglri -p ../../../src/scl-syn/Scool.tbl -i $input_file'
+ cmp='diff -EwbB -u $ref $output'
+ print_input_cmd='cat $input_file'
+ print_output_cmd='pp-aterm -i $input_file'
+
+ input_files="scool_src/*.scl"
+ ref_dir="scool_ast"
+ ref_extension=".aterm"
+}
Index: branches/scool-ng/tests/function/config
===================================================================
--- branches/scool-ng/tests/function/config (revision 0)
+++ branches/scool-ng/tests/function/config (revision 63)
@@ -0,0 +1 @@
+link ../config
\ No newline at end of file
Property changes on: branches/scool-ng/tests/function/config
___________________________________________________________________
Name: svn:special
+ *
Index: branches/scool-ng/tests/function/scool_ast/declaration_004.aterm
===================================================================
--- branches/scool-ng/tests/function/scool_ast/declaration_004.aterm (revision 0)
+++ branches/scool-ng/tests/function/scool_ast/declaration_004.aterm (revision 63)
@@ -0,0 +1 @@
+Program([FunctionDeclaration(None,Identifier("foo"),FunctionType([],[],SimpleType("void"))),FunctionDeclaration(None,Identifier("foo"),FunctionType([],[SimplyTypedId(Identifier("arg1"),SimpleType("int"))],SimpleType("float"))),FunctionDeclaration(None,Identifier("foo"),FunctionType([],[SimplyTypedId(Identifier("arg1"),SimpleType("toto")),SimplyTypedId(Identifier("arg2"),ReferenceType(SimpleType("double")))],SimpleType("char")))])
Index: branches/scool-ng/tests/function/scool_ast/definition_001.aterm
===================================================================
--- branches/scool-ng/tests/function/scool_ast/definition_001.aterm (revision 0)
+++ branches/scool-ng/tests/function/scool_ast/definition_001.aterm (revision 63)
@@ -0,0 +1 @@
+Program([FunctionDefinition(None,Identifier("answer"),FunctionType([],[],SimpleType("void")),FunctionBlock([]))])
Index: branches/scool-ng/tests/function/scool_ast/definition_002.aterm
===================================================================
--- branches/scool-ng/tests/function/scool_ast/definition_002.aterm (revision 0)
+++ branches/scool-ng/tests/function/scool_ast/definition_002.aterm (revision 63)
@@ -0,0 +1 @@
+Program([FunctionDefinition(None,Identifier("answer"),FunctionType([],[],SimpleType("void")),FunctionBlock([SimpleDeclaration(None,Identifier("i"),SimpleType("int"),None)]))])
Index: branches/scool-ng/tests/function/scool_ast/declaration_001.aterm
===================================================================
--- branches/scool-ng/tests/function/scool_ast/declaration_001.aterm (revision 0)
+++ branches/scool-ng/tests/function/scool_ast/declaration_001.aterm (revision 63)
@@ -0,0 +1 @@
+Program([FunctionDeclaration(None,Identifier("foo"),FunctionType([],[],SimpleType("void")))])
Index: branches/scool-ng/tests/function/scool_ast/declaration_002.aterm
===================================================================
--- branches/scool-ng/tests/function/scool_ast/declaration_002.aterm (revision 0)
+++ branches/scool-ng/tests/function/scool_ast/declaration_002.aterm (revision 63)
@@ -0,0 +1 @@
+Program([FunctionDeclaration(None,Identifier("foo"),FunctionType([],[SimplyTypedId(Identifier("a"),SimpleType("int"))],SimpleType("void")))])
Index: branches/scool-ng/tests/function/scool_ast/declaration_003.aterm
===================================================================
--- branches/scool-ng/tests/function/scool_ast/declaration_003.aterm (revision 0)
+++ branches/scool-ng/tests/function/scool_ast/declaration_003.aterm (revision 63)
@@ -0,0 +1 @@
+Program([FunctionDeclaration(None,Identifier("foo"),FunctionType([],[SimplyTypedId(Identifier("a"),SimpleType("int")),SimplyTypedId(Identifier("b"),SimpleType("bar"))],SimpleType("void")))])
Index: branches/scool-ng/tests/function/scool_src/static_dynamic_parameters_002.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/static_dynamic_parameters_002.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/static_dynamic_parameters_002.scl (revision 63)
@@ -0,0 +1 @@
+f : [T : type] (a : T) -> void = { -> a; }
Index: branches/scool-ng/tests/function/scool_src/static_dynamic_parameters_003.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/static_dynamic_parameters_003.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/static_dynamic_parameters_003.scl (revision 63)
@@ -0,0 +1 @@
+f : [T : type] (a : T) -> void => a
Index: branches/scool-ng/tests/function/scool_src/declaration_001.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/declaration_001.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/declaration_001.scl (revision 63)
@@ -0,0 +1 @@
+foo : () -> void;
Index: branches/scool-ng/tests/function/scool_src/declaration_002.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/declaration_002.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/declaration_002.scl (revision 63)
@@ -0,0 +1 @@
+foo : (a : int) -> void;
Index: branches/scool-ng/tests/function/scool_src/declaration_003.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/declaration_003.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/declaration_003.scl (revision 63)
@@ -0,0 +1 @@
+foo : (a : int, b : bar) -> void;
Index: branches/scool-ng/tests/function/scool_src/static_parameter_001.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/static_parameter_001.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/static_parameter_001.scl (revision 63)
@@ -0,0 +1,3 @@
+f : [T : type] () -> void =
+{
+}
Index: branches/scool-ng/tests/function/scool_src/definition_001.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/definition_001.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/definition_001.scl (revision 63)
@@ -0,0 +1,3 @@
+answer : () -> void =
+{
+}
Index: branches/scool-ng/tests/function/scool_src/declaration_004.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/declaration_004.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/declaration_004.scl (revision 63)
@@ -0,0 +1,3 @@
+foo : () -> void;
+foo : (arg1 : int) -> float;
+foo : (arg1 : toto, arg2 : ref double) -> char;
Index: branches/scool-ng/tests/function/scool_src/definition_002.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/definition_002.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/definition_002.scl (revision 63)
@@ -0,0 +1,4 @@
+answer : () -> void =
+{
+ i : int;
+}
Index: branches/scool-ng/tests/function/scool_src/definition_003.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/definition_003.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/definition_003.scl (revision 63)
@@ -0,0 +1,4 @@
+answer : () -> int =
+{
+ -> 42;
+}
Index: branches/scool-ng/tests/function/scool_src/definition_004.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/definition_004.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/definition_004.scl (revision 63)
@@ -0,0 +1,6 @@
+answer : () -> int =
+{
+ i : int = 42;
+
+ -> i;
+}
Index: branches/scool-ng/tests/function/scool_src/definition_005.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/definition_005.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/definition_005.scl (revision 63)
@@ -0,0 +1 @@
+answer : () -> int => 42;
Index: branches/scool-ng/tests/function/scool_src/definition_006.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/definition_006.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/definition_006.scl (revision 63)
@@ -0,0 +1 @@
+sum : (a: int, b : int) -> int = { -> a + b; }
Index: branches/scool-ng/tests/function/scool_src/definition_007.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/definition_007.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/definition_007.scl (revision 63)
@@ -0,0 +1 @@
+sum : (a: int, b : int) -> int => a + b;
Index: branches/scool-ng/tests/function/scool_src/call_001.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/call_001.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/call_001.scl (revision 63)
@@ -0,0 +1,4 @@
+doit : () -> void =
+{
+ foo();
+}
Index: branches/scool-ng/tests/function/scool_src/call_002.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/call_002.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/call_002.scl (revision 63)
@@ -0,0 +1,4 @@
+doit : () -> void =
+{
+ foo(42);
+}
Index: branches/scool-ng/tests/function/scool_src/call_003.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/call_003.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/call_003.scl (revision 63)
@@ -0,0 +1,4 @@
+doit : () -> void =
+{
+ foo("bar", 42);
+}
Index: branches/scool-ng/tests/function/scool_src/static_dynamic_parameters_001.scl
===================================================================
--- branches/scool-ng/tests/function/scool_src/static_dynamic_parameters_001.scl (revision 0)
+++ branches/scool-ng/tests/function/scool_src/static_dynamic_parameters_001.scl (revision 63)
@@ -0,0 +1 @@
+f : [T : type] (a : T) -> T => a;
Index: branches/scool-ng/tests/variable/config
===================================================================
--- branches/scool-ng/tests/variable/config (revision 0)
+++ branches/scool-ng/tests/variable/config (revision 63)
@@ -0,0 +1 @@
+link ../config
\ No newline at end of file
Property changes on: branches/scool-ng/tests/variable/config
___________________________________________________________________
Name: svn:special
+ *
Index: branches/scool-ng/tests/variable/scool_ast/declaration_007.aterm
===================================================================
--- branches/scool-ng/tests/variable/scool_ast/declaration_007.aterm (revision 0)
+++ branches/scool-ng/tests/variable/scool_ast/declaration_007.aterm (revision 63)
@@ -0,0 +1 @@
+Program([SimpleDeclaration(None,Identifier("i"),SimpleType("int"),None)])
Index: branches/scool-ng/tests/variable/scool_ast/declaration_001.aterm
===================================================================
--- branches/scool-ng/tests/variable/scool_ast/declaration_001.aterm (revision 0)
+++ branches/scool-ng/tests/variable/scool_ast/declaration_001.aterm (revision 63)
@@ -0,0 +1 @@
+Program([SimpleDeclaration(None,Identifier("i"),SimpleType("int"),None)])
Index: branches/scool-ng/tests/variable/scool_ast/declaration_003.aterm
===================================================================
--- branches/scool-ng/tests/variable/scool_ast/declaration_003.aterm (revision 0)
+++ branches/scool-ng/tests/variable/scool_ast/declaration_003.aterm (revision 63)
@@ -0,0 +1 @@
+Program([SimpleDeclaration(Some("var"),Identifier("i"),SimpleType("int"),None)])
Index: branches/scool-ng/tests/variable/scool_src/declaration_001.scl
===================================================================
--- branches/scool-ng/tests/variable/scool_src/declaration_001.scl (revision 0)
+++ branches/scool-ng/tests/variable/scool_src/declaration_001.scl (revision 63)
@@ -0,0 +1 @@
+i : int;
Index: branches/scool-ng/tests/variable/scool_src/declaration_002.scl
===================================================================
--- branches/scool-ng/tests/variable/scool_src/declaration_002.scl (revision 0)
+++ branches/scool-ng/tests/variable/scool_src/declaration_002.scl (revision 63)
@@ -0,0 +1 @@
+i : int = 42;
Index: branches/scool-ng/tests/variable/scool_src/declaration_003.scl
===================================================================
--- branches/scool-ng/tests/variable/scool_src/declaration_003.scl (revision 0)
+++ branches/scool-ng/tests/variable/scool_src/declaration_003.scl (revision 63)
@@ -0,0 +1 @@
+var i : int;
Index: branches/scool-ng/tests/variable/scool_src/declaration_004.scl
===================================================================
--- branches/scool-ng/tests/variable/scool_src/declaration_004.scl (revision 0)
+++ branches/scool-ng/tests/variable/scool_src/declaration_004.scl (revision 63)
@@ -0,0 +1 @@
+var i : int = 42;
Index: branches/scool-ng/tests/variable/scool_src/declaration_005.scl
===================================================================
--- branches/scool-ng/tests/variable/scool_src/declaration_005.scl (revision 0)
+++ branches/scool-ng/tests/variable/scool_src/declaration_005.scl (revision 63)
@@ -0,0 +1 @@
+var l : list[int];
Index: branches/scool-ng/tests/variable/scool_src/declaration_006.scl
===================================================================
--- branches/scool-ng/tests/variable/scool_src/declaration_006.scl (revision 0)
+++ branches/scool-ng/tests/variable/scool_src/declaration_006.scl (revision 63)
@@ -0,0 +1 @@
+i;
Index: branches/scool-ng/tests/variable/scool_src/declaration_007.scl
===================================================================
--- branches/scool-ng/tests/variable/scool_src/declaration_007.scl (revision 0)
+++ branches/scool-ng/tests/variable/scool_src/declaration_007.scl (revision 63)
@@ -0,0 +1 @@
+i : int ;
Index: branches/scool-ng/tests/variable/scool_src/mixed_declarations_001.scl
===================================================================
--- branches/scool-ng/tests/variable/scool_src/mixed_declarations_001.scl (revision 0)
+++ branches/scool-ng/tests/variable/scool_src/mixed_declarations_001.scl (revision 63)
@@ -0,0 +1,4 @@
+answer : int = 42;
+
+var i : int;
+var j : int = i;
Index: branches/scool-ng/tests/check.sh
===================================================================
--- branches/scool-ng/tests/check.sh (revision 0)
+++ branches/scool-ng/tests/check.sh (revision 63)
@@ -0,0 +1,261 @@
+#! /bin/sh
+
+#FIXME: command line
+
+
+white="\033[33;00;29m"
+black="\033[33;01;30m"
+grey="\033[33;01;30m"
+red="\033[33;00;31m"
+bred="\033[33;01;31m"
+green="\033[33;00;32m"
+bgreen="\033[33;01;32m"
+yell="\033[33;00;33m"
+byell="\033[33;01;33m"
+blue="\033[33;00;34m"
+bblue="\033[33;01;34m"
+
+test_name_indent=3
+utest_name_indent=6
+test_result_indent=42
+
+indent ()
+{
+ echo -e -n "\033[$1G"
+}
+
+perform_test()
+{
+ cexit_val=0
+ test_name=`basename "$1" .scl`
+
+ input_file="$1"
+ ref=${2}/${test_name}${3}
+
+ cmd_log=`mktemp`
+ cmd_err=`mktemp`
+ cmp_log=`mktemp`
+ cmp_err=`mktemp`
+
+ rcmd=`echo $4 | sed s#'$input_file'#$input_file#g`
+
+ rcmp=`echo $5 | sed s#'$ref'#$ref#g`
+ rcmp=`echo $rcmp | sed s#'$output'#$cmd_log#g`
+
+ indent $utest_name_indent
+ echo -e -n ${yell}${test_name}
+
+ if [ ! -r $ref -a $flush_sk -eq 0 ]; then return 1; fi
+
+ $rcmd > $cmd_log 2> $cmd_err
+ cexit_val=$?
+
+ if [ ! -r $ref ]; then
+ if [ $flush_sk -eq 1 -a $gen_ref -eq 2 -a $cexit_val -eq 0 ]; then
+ regen_ref $cmd_log $ref
+ return 4
+ else
+ return 1
+ fi
+ fi
+
+ if [ $cexit_val -ne 0 ]; then return 2; fi
+
+
+ $rcmp > $cmp_log 2> $cmp_err
+ cexit_val=$?
+
+ if [ $gen_ref -eq 2 ]; then
+ regen_ref $cmd_log $ref
+ return 4
+ fi
+
+ if [ $cexit_val -ne 0 ]; then return 3; fi
+
+ return 0;
+}
+
+regen_ref()
+{
+ if [ ! -w $ref ]; then touch $ref || exit 1; fi # FIXME: error msg
+ cp -f $1 $2
+}
+
+print_test_result()
+{
+ echo -ne "$bblue[ "
+
+ if [ "$1" = "ok" ]; then echo -ne "${bgreen}ok";
+ elif [ "$1" = "ko" ]; then echo -ne "${bred}ko";
+ elif [ "$1" = "gen" ]; then echo -ne "${byell}gen";
+ else echo -ne "${byell}sk";
+ fi
+
+ echo -e " $bblue]"
+}
+
+print_output()
+{
+ pcmd=`echo $print_output_cmd | sed s#'$input_file'#$1#g`
+
+ echo -ne $bblue
+ echo '------[ Output ]------'
+ $pcmd
+ echo '----------------------'
+}
+
+print_input()
+{
+ pcmd=`echo $print_input_cmd | sed s#'$input_file'#$1#g`
+
+ echo -ne $bblue
+ echo '------[ Input ]-------'
+ $pcmd
+ echo '----------------------'
+}
+
+perform_test_suite()
+{
+ dir=$1
+
+ cd $dir
+ . config
+
+ indent $test_name_indent
+ echo -e "${bblue}`basename ${dir}`"
+
+ for testnb in `seq 1 $number_of_tests`
+ do
+ test_config="test_$testnb"
+ eval $test_config
+
+ for input_file in `ls $input_files`
+ do
+ perform_test "$input_file" "$ref_dir" "$ref_extension" "$cmd" "$cmp"
+ exit_val=$?
+
+ indent $test_result_indent
+
+ if [ $exit_val -eq 0 ]; then
+ print_test_result "ok"
+ elif [ $exit_val -eq 1 ]; then
+ print_test_result "sk"
+ elif [ $exit_val -eq 4 ]; then
+ print_test_result "gen"
+ else
+ print_test_result "ko"
+
+ if [ $print_diff -eq 1 ]; then
+ if [ $exit_val -eq 2 ]; then
+ echo -ne $grey; cat $cmd_log $cmd_err
+ echo -n
+ else
+ echo -ne $grey; cat $cmp_log $cmp_err
+ fi
+ fi
+ fi
+
+ # Print the output if the -p option was provided
+ if [ $print -eq 1 ]; then
+ if [ $flush_sk -eq 1 ]; then
+ if [ $exit_val -eq 1 -a $cexit_val -eq 0 ]; then
+ print_input $input_file
+ fi
+ else
+ print_input $input_file
+ fi
+ fi
+
+ # Print skips that actually pass
+ if [ $exit_val -eq 1 -a $flush_sk -eq 1 -a $cexit_val -eq 0 ]; then
+ print_output $cmd_log
+ fi
+ done
+ done
+
+ cd ..
+ echo
+}
+
+print_help()
+{
+ echo "
+Usage :
+
+ -d | --diff Print the diff between outputs when different
+ -g | --gen Generates reference files when the command is successful
+ -sk | --flush-skip Print the command output (if any) on successful tests
+ -p | --print Print the output of the command
+ -h | --help Print this help message
+"
+}
+
+print_diff=0
+gen_ref=0
+flush_sk=0
+print=0
+# Parse command line options
+while [ $# -gt 0 ]
+do
+ case "$1" in
+ -d | --diff)
+ print_diff=1
+ ;;
+
+ -g | --gen)
+ gen_ref=1
+ ;;
+
+ -sk | --flush-skip)
+ flush_sk=1
+ ;;
+
+ -p | --print)
+ print=1
+ ;;
+
+ -h | --help)
+ print_help
+ exit 0
+ ;;
+
+ -*)
+ echo Unknown option : $1
+ exit 1
+ ;;
+
+ *)
+ break
+ ;;
+ esac
+ shift
+done
+
+if [ $gen_ref -eq 1 ]; then
+ echo -e $bred ' /!\ WARNING /!\ '
+ echo -e $bred YOU ARE GOING TO REGEN ALL TESTS
+ echo -ne $bred 'DO YOU WANT TO CONTINUE ? [y/N] '
+ read answer || exit 1
+
+ case $answer in
+ y | Y | yes | YES) gen_ref=2;;
+ *) exit 1;;
+ esac
+fi
+
+# Execute only testsuites given on the command line if any
+if [ $# -gt 0 ]; then
+
+ while [ $# -gt 0 ]; do
+ perform_test_suite $1
+ shift
+ done
+
+ exit 0
+fi
+
+# Execute all testsuites we find
+for dir in `find . -maxdepth 1 -type d -regex './[^.].*'`
+do
+ perform_test_suite $dir
+done
Property changes on: branches/scool-ng/tests/check.sh
___________________________________________________________________
Name: svn:executable
+ *
Index: branches/scool-ng/tests/concept/config
===================================================================
--- branches/scool-ng/tests/concept/config (revision 0)
+++ branches/scool-ng/tests/concept/config (revision 63)
@@ -0,0 +1 @@
+link ../config
\ No newline at end of file
Property changes on: branches/scool-ng/tests/concept/config
___________________________________________________________________
Name: svn:special
+ *
Index: branches/scool-ng/tests/concept/scool_src/concept_use_1.scl
===================================================================
--- branches/scool-ng/tests/concept/scool_src/concept_use_1.scl (revision 0)
+++ branches/scool-ng/tests/concept/scool_src/concept_use_1.scl (revision 63)
@@ -0,0 +1,10 @@
+box : concept =
+{
+ value : type;
+
+ decl get_value : () -> value;
+}
+
+foo : [ T : type where (T models box) ] (pbox : T) -> void =
+{
+}
Index: branches/scool-ng/tests/concept/scool_src/concept_use_2.scl
===================================================================
--- branches/scool-ng/tests/concept/scool_src/concept_use_2.scl (revision 0)
+++ branches/scool-ng/tests/concept/scool_src/concept_use_2.scl (revision 63)
@@ -0,0 +1,10 @@
+box : concept =
+{
+ value : type;
+
+ decl get_value : () -> value;
+}
+
+foo : [ T : type where T models box ] (pbox : T) -> void =
+{
+}
Index: branches/scool-ng/tests/concept/scool_src/concept_1.scl
===================================================================
--- branches/scool-ng/tests/concept/scool_src/concept_1.scl (revision 0)
+++ branches/scool-ng/tests/concept/scool_src/concept_1.scl (revision 63)
@@ -0,0 +1,6 @@
+box : concept =
+{
+ value : type;
+
+ decl get_value : () -> value;
+}
Index: branches/scool-ng/tests/concept/scool_src/concept_2.scl
===================================================================
--- branches/scool-ng/tests/concept/scool_src/concept_2.scl (revision 0)
+++ branches/scool-ng/tests/concept/scool_src/concept_2.scl (revision 63)
@@ -0,0 +1,6 @@
+box : concept =
+{
+ value : type;
+
+ decl set_value : (val : value) -> value;
+}
Index: branches/scool-ng/tests/concept/scool_src/concept_3.scl
===================================================================
--- branches/scool-ng/tests/concept/scool_src/concept_3.scl (revision 0)
+++ branches/scool-ng/tests/concept/scool_src/concept_3.scl (revision 63)
@@ -0,0 +1,7 @@
+box : concept =
+{
+ value : type;
+
+ decl set_value : (val : value) -> value;
+ decl get_value : () -> value;
+}
Index: branches/scool-ng/tests/concept/scool_src/concept_4.scl
===================================================================
--- branches/scool-ng/tests/concept/scool_src/concept_4.scl (revision 0)
+++ branches/scool-ng/tests/concept/scool_src/concept_4.scl (revision 63)
@@ -0,0 +1,8 @@
+box : concept =
+{
+ value : type;
+
+ decl set_value : (val : value) -> value;
+ decl get_value : () -> value;
+ decl print_value : () -> void;
+}
Index: branches/scool-ng/tests/misc/c++_src/empty.cc
===================================================================
Index: branches/scool-ng/tests/misc/config
===================================================================
--- branches/scool-ng/tests/misc/config (revision 0)
+++ branches/scool-ng/tests/misc/config (revision 63)
@@ -0,0 +1 @@
+link ../config
\ No newline at end of file
Property changes on: branches/scool-ng/tests/misc/config
___________________________________________________________________
Name: svn:special
+ *
Index: branches/scool-ng/tests/misc/scool_ast/empty.aterm
===================================================================
--- branches/scool-ng/tests/misc/scool_ast/empty.aterm (revision 0)
+++ branches/scool-ng/tests/misc/scool_ast/empty.aterm (revision 63)
@@ -0,0 +1 @@
+Program([])
Index: branches/scool-ng/tests/misc/scool_src/empty.scl
===================================================================
Index: branches/scool-ng/tests/examples/config
===================================================================
--- branches/scool-ng/tests/examples/config (revision 0)
+++ branches/scool-ng/tests/examples/config (revision 63)
@@ -0,0 +1 @@
+link ../config
\ No newline at end of file
Property changes on: branches/scool-ng/tests/examples/config
___________________________________________________________________
Name: svn:special
+ *
Index: branches/scool-ng/tests/examples/scool_src/sample_animal_hierarchy.scl
===================================================================
--- branches/scool-ng/tests/examples/scool_src/sample_animal_hierarchy.scl (revision 0)
+++ branches/scool-ng/tests/examples/scool_src/sample_animal_hierarchy.scl (revision 63)
@@ -0,0 +1,39 @@
+Animal : class =
+{
+ public
+ {
+ decl scream : () -> void;
+ }
+};
+
+Cat : class < Animal =
+{
+ public
+ {
+ scream : () -> void = { |[ std::cout << "Miaou" << std::endl; ]| }
+ }
+};
+
+final Dog : class < Animal =
+{
+ public
+ {
+ scream : () -> void = { |[ std::cout << "Wouf" << std::endl; ]| }
+ }
+};
+
+scream : (animal : Animal) -> void =
+{
+ |[ animal.scream(); ]|
+}
+
+main : () -> int =
+{
+ var cat : Cat;
+ var dog : Dog;
+
+ |[ scream(cat); ]|
+ |[ scream(dog); ]|
+
+ -> 0;
+}
Index: branches/scool-ng/tests/examples/scool_src/sample_1.scl
===================================================================
--- branches/scool-ng/tests/examples/scool_src/sample_1.scl (revision 0)
+++ branches/scool-ng/tests/examples/scool_src/sample_1.scl (revision 63)
@@ -0,0 +1,9 @@
+
+f : () -> void =
+{
+ i : int = 3;
+ i := 4;
+
+ var j : int := 3;
+ j := 4;
+}
Index: branches/scool-ng/tests/examples/scool_src/sample_2.scl
===================================================================
--- branches/scool-ng/tests/examples/scool_src/sample_2.scl (revision 0)
+++ branches/scool-ng/tests/examples/scool_src/sample_2.scl (revision 63)
@@ -0,0 +1,5 @@
+f : () -> void =
+{
+ var a : array[int16, 2];
+ var i : int16 := a.at(0);
+}
Index: branches/scool-ng/tests/examples/scool_src/sample_3.scl
===================================================================
--- branches/scool-ng/tests/examples/scool_src/sample_3.scl (revision 0)
+++ branches/scool-ng/tests/examples/scool_src/sample_3.scl (revision 63)
@@ -0,0 +1,9 @@
+f : () -> void =
+{
+ var i : int;
+ var j : int;
+
+ i := 0;
+ j := i;
+ i := j + i;
+}
Index: branches/scool-ng/tests/examples/scool_src/sample_container.scl
===================================================================
--- branches/scool-ng/tests/examples/scool_src/sample_container.scl (revision 0)
+++ branches/scool-ng/tests/examples/scool_src/sample_container.scl (revision 63)
@@ -0,0 +1,26 @@
+// Container
+
+Container : class =
+{
+ public {
+ value_type : type;
+
+ iterator : type;
+ const_iterator : type;
+
+ reference : type;
+ const_reference : type;
+
+ size_type : type;
+
+ decl begin : () -> iterator;
+ decl begin : const () -> const_iterator;
+
+ decl end : () -> iterator;
+ decl end : const () -> const_iterator;
+
+ decl size : const () -> size_type;
+ decl empty : const () -> bool;
+ }
+};
+
Index: branches/scool-ng/tests/examples/scool_src/sample_4.scl
===================================================================
--- branches/scool-ng/tests/examples/scool_src/sample_4.scl (revision 0)
+++ branches/scool-ng/tests/examples/scool_src/sample_4.scl (revision 63)
@@ -0,0 +1,4 @@
+sqrt : (arg : float) -> float =
+{
+ -> |[ std::sqrt(arg) ]|;
+}
Index: branches/scool-ng/tests/examples/scool_src/sample_5.scl
===================================================================
--- branches/scool-ng/tests/examples/scool_src/sample_5.scl (revision 0)
+++ branches/scool-ng/tests/examples/scool_src/sample_5.scl (revision 63)
@@ -0,0 +1,4 @@
+sqrt : (arg : float) -> float =
+{
+ -> |[ std::sqrt(arg); ]|;
+}
Index: branches/scool-ng/tests/examples/scool_src/sample_6.scl
===================================================================
--- branches/scool-ng/tests/examples/scool_src/sample_6.scl (revision 0)
+++ branches/scool-ng/tests/examples/scool_src/sample_6.scl (revision 63)
@@ -0,0 +1,4 @@
+f : () -> void =
+{
+ 4 := 4;
+}
Index: branches/scool-ng/tests/examples/scool_src/point1d_simple.scl
===================================================================
--- branches/scool-ng/tests/examples/scool_src/point1d_simple.scl (revision 0)
+++ branches/scool-ng/tests/examples/scool_src/point1d_simple.scl (revision 63)
@@ -0,0 +1,15 @@
+point1d : class =
+{
+ public
+ {
+ point_type : type = int;
+
+ get_x : () -> point_type => x_;
+ mutable set_x : (x : point_type) -> point_type => x_ = x;
+ }
+
+ private
+ {
+ var x : point_type;
+ }
+}
Index: branches/scool-ng/configure.ac
===================================================================
--- branches/scool-ng/configure.ac (revision 0)
+++ branches/scool-ng/configure.ac (revision 63)
@@ -0,0 +1,29 @@
+AC_PREREQ(2.59)
+
+AC_INIT([scool], 0.1, [yabo(a)lrde.epita.fr]
+
+# Auxiliary files
+AC_CONFIG_AUX_DIR([config])
+AC_CONFIG_FILES(config/Makefile)
+
+AM_INIT_AUTOMAKE([1.9.5 dist-bzip2])
+
+XT_USE_XT_PACKAGES
+XT_PKG_ATERM
+XT_PKG_SDF
+XT_PKG_STRATEGOXT
+
+# Look for common programs
+AC_LANG_C
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_LIBTOOL
+
+# Output Files
+AC_CONFIG_FILES([Makefile
+ src/Makefile
+ src/cxx-syn/Makefile
+ src/pp-cxx/Makefile
+ src/scl-syn/Makefile
+ src/scoolt/Makefile])
+AC_OUTPUT
Index: branches/scool-ng/AUTHORS
===================================================================
--- branches/scool-ng/AUTHORS (revision 0)
+++ branches/scool-ng/AUTHORS (revision 63)
@@ -0,0 +1,2 @@
+* mefyl <mefyl(a)lrde.epita.fr>
+* yabo <yabo(a)lrde.epita.fr>
Index: branches/scool-ng/src/pp-cxx/CxxProgram.meta
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxProgram.meta (revision 0)
+++ branches/scool-ng/src/pp-cxx/CxxProgram.meta (revision 63)
@@ -0,0 +1 @@
+Meta([Syntax("Stratego-Box")])
Index: branches/scool-ng/src/pp-cxx/CxxDecl.meta
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxDecl.meta (revision 0)
+++ branches/scool-ng/src/pp-cxx/CxxDecl.meta (revision 63)
@@ -0,0 +1 @@
+Meta([Syntax("Stratego-Box")])
Index: branches/scool-ng/src/pp-cxx/CxxFun.str
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxFun.str (revision 0)
+++ branches/scool-ng/src/pp-cxx/CxxFun.str (revision 63)
@@ -0,0 +1,80 @@
+module CxxFun
+
+imports Cxx Box libstratego-lib CxxType CxxExp CxxStm CxxId
+
+rules
+
+ CxxTopLevelToAbox:
+ CxxFun(params, t, idf, args) ->
+ V vs=0
+ [
+ ~<CxxParamsToAbox> params
+ H hs=0
+ [
+ H hs=1 [ ~<CxxTypeToAbox> t ~<CxxIdToAbox> idf ] "(" H hs=1 [ ~*<CxxListToAbox(CxxArgDefToAbox|",")> args ] ")" ";"
+ ]
+ ]
+
+ CxxTopLevelToAbox:
+ CxxFun(params, None(), idf, args) ->
+ V vs=0
+ [
+ ~<CxxParamsToAbox> params
+ H hs=0
+ [
+ H hs=1 [ ~<CxxIdToAbox> idf ] "(" H hs=1 [ ~*<CxxListToAbox(CxxArgDefToAbox|",")> args ] ")" ";"
+ ]
+ ]
+
+ CxxTopLevelToAbox:
+ CxxFun(params, t, idf, args, body) ->
+ V vs=0
+ [
+ ~<CxxParamsToAbox> params
+ H hs=0 [
+ H hs=1 [ ~<CxxTypeToAbox> t ~<CxxIdToAbox> idf] "(" H hs=1 [ ~*<CxxListToAbox(CxxArgDefToAbox|",")> args ] ")"
+ ]
+ V vs=0 is=2
+ [
+ "{"
+ ~*<map(CxxStmToAbox <+ CxxTopLevelToAbox)> body
+ ]
+ "}"
+ ]
+
+ CxxTopLevelToAbox:
+ CxxTypedef(t, idf) ->
+ H hs=0 [ H hs=1 [ "typedef" ~<CxxTypeToAbox> t ~S(idf)] ";" ]
+
+ CxxArgDefToAbox:
+ (t, idf) ->
+ H hs = 1
+ [
+ ~<CxxTypeToAbox>t
+ ~<CxxIdToAbox>idf
+ ]
+
+ CxxListToAbox(sub|sep):
+ [e| [h|tail] ] ->
+ [
+ H hs=1 [
+ H hs=0 [
+ ~<sub>e
+ ~S(sep)
+ ]
+ ~<CxxListToAbox(sub|sep)> [h|tail]
+ ]
+ ]
+
+ CxxListToAbox(sub|sep):
+ [e| [] ] ->
+ [
+ H hs=0 [
+ ~<sub>e
+ ]
+ ]
+
+ CxxListToAbox(sub|sep):
+ [] ->
+ [ H [] ]
+
Index: branches/scool-ng/src/pp-cxx/CxxId.str
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxId.str (revision 0)
+++ branches/scool-ng/src/pp-cxx/CxxId.str (revision 63)
@@ -0,0 +1,12 @@
+module CxxId
+
+imports Cxx Box CxxType libstratego-lib
+
+rules
+
+ CxxIdToAbox:
+ x -> S(x)
+ where <is-string> x
+
+ CxxIdToAbox:
+ x -> <CxxTypeToAbox> x
Index: branches/scool-ng/src/pp-cxx/CxxExp.str
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxExp.str (revision 0)
+++ branches/scool-ng/src/pp-cxx/CxxExp.str (revision 63)
@@ -0,0 +1,43 @@
+module CxxExp
+
+imports Cxx Box libstratego-lib CxxId
+
+rules
+
+ CxxArgListToStr:
+ [ e | [h|tail] ] -> <concat-strings> [ e, ", ", <CxxArgListToStr> [h|tail] ]
+
+ CxxArgListToStr:
+ [e | []] -> e
+
+ CxxArgListToStr:
+ [] -> ""
+
+ CxxExpToStr:
+ CxxInt(i) -> i
+
+ CxxExpToStr:
+ CxxSum(e1, e2) -> <concat-strings> [<CxxExpToStr> e1, " + ", <CxxExpToStr> e2]
+
+ CxxExpToStr:
+ CxxKeyword(idf, exp) -> <concat-strings> [idf, " ", <CxxExpToStr> exp]
+
+ CxxExpToStr:
+ CxxAffect(idf, exp) -> <concat-strings> [idf, " = ", <CxxExpToStr> exp]
+
+ CxxExpToStr:
+ CxxFunCall(idf, args) -> <concat-strings> [ idf, "(", <CxxArgListToStr> args, ")" ]
+
+ CxxExpToStr:
+ CxxProgram(exp) -> exp
+
+ CxxExpToAbox:
+ CxxAdressOf(idf) -> H hs=0 [ "&" ~<CxxIdToAbox> idf ]
+
+ CxxExpToStr:
+ x -> x
+ where <is-string> x
+
+ CxxExpToAbox:
+ x -> S(<CxxExpToStr> x)
+
Index: branches/scool-ng/src/pp-cxx/pp-cxx.str
===================================================================
--- branches/scool-ng/src/pp-cxx/pp-cxx.str (revision 0)
+++ branches/scool-ng/src/pp-cxx/pp-cxx.str (revision 63)
@@ -0,0 +1,6 @@
+module pp-cxx
+
+imports Cxx Box libstratego-lib CxxProgram
+
+strategies
+ pp-cxx = io-wrap(CxxProgramToAbox)
Index: branches/scool-ng/src/pp-cxx/CxxType.meta
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxType.meta (revision 0)
+++ branches/scool-ng/src/pp-cxx/CxxType.meta (revision 63)
@@ -0,0 +1 @@
+Meta([Syntax("Stratego-Box")])
Index: branches/scool-ng/src/pp-cxx/CxxStm.str
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxStm.str (revision 0)
+++ branches/scool-ng/src/pp-cxx/CxxStm.str (revision 63)
@@ -0,0 +1,18 @@
+module CxxStm
+
+imports Cxx Box libstratego-lib CxxType CxxExp CxxId
+
+rules
+
+ CxxStmToAbox:
+ CxxExpStm(e) -> H hs=0 [ ~<CxxExpToAbox> e ~<Semicolon> e]
+
+ // Don't add an extra ';' to verbatim C++ that we insert.
+ // As said on https://trac.lrde.org/scool/wiki/SCOOL/Specs/Misc the C++ inserted
+ // must be valid and so contain an ending ';'
+ Semicolon:
+ _#([_, CxxProgram(exp)]) -> S("")
+
+ Semicolon:
+ _#([_, _]) -> S(";")
+
Index: branches/scool-ng/src/pp-cxx/CxxFun.meta
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxFun.meta (revision 0)
+++ branches/scool-ng/src/pp-cxx/CxxFun.meta (revision 63)
@@ -0,0 +1 @@
+Meta([Syntax("Stratego-Box")])
Index: branches/scool-ng/src/pp-cxx/CxxProgram.str
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxProgram.str (revision 0)
+++ branches/scool-ng/src/pp-cxx/CxxProgram.str (revision 63)
@@ -0,0 +1,16 @@
+module CxxProgram
+
+imports Cxx Box libstratego-lib CxxDecl CxxFun
+
+rules
+
+ CxxProgramToAbox:
+ CxxProgram(l) ->
+ V vs=1 [
+ V vs=0 [
+ // FIXME: includes
+ //"#include <stc/any.hh>"
+ //"#include <stc/find_exact.hh>"
+ ]
+ V vs=0 [ ~*<map(CxxTopLevelToAbox)> l ]
+ ]
Index: branches/scool-ng/src/pp-cxx/CxxDecl.str
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxDecl.str (revision 0)
+++ branches/scool-ng/src/pp-cxx/CxxDecl.str (revision 63)
@@ -0,0 +1,100 @@
+module CxxDecl
+
+imports Cxx Box libstratego-lib CxxType CxxExp CxxId CxxFun
+
+rules
+
+ CxxTopLevelToAbox:
+ l ->
+ V vs=1 [
+ ~*<map(CxxTopLevelToAbox)>l
+ ]
+
+ CxxTopLevelToAbox:
+ CxxDecl(t, idf) -> H hs=0 [ H hs=1 [ ~<CxxTypeToAbox>t ~<CxxIdToAbox>idf ] ";"]
+
+ CxxTopLevelToAbox:
+ CxxDecl(t, idf, v) -> H hs=0 [ H hs=1 [ ~<CxxTypeToAbox>t ~<CxxIdToAbox>idf "=" ~<CxxExpToAbox> v] ";"]
+
+ // Declare a pointer on method : base_type (class::*idf)();
+ CxxTopLevelToAbox:
+ CxxAffect(CxxDecl(base_type, class, idf, args), exp) ->
+ H hs=0 [
+ H hs=1 [
+ ~<CxxTypeToAbox> base_type
+ H hs=0 [
+ "(" ~<CxxTypeToAbox> class "::*" ~<CxxTypeToAbox> idf ")(" ~<map (CxxArgDefToAbox)> args")"
+ ] "=" ~<CxxExpToAbox> exp
+ ] ";"
+ ]
+
+ CxxTopLevelToAbox:
+ CxxArrayDecl(t, idf, n) -> H hs=0 [ H hs=1 [ ~<CxxTypeToAbox> t ~<CxxIdToAbox> idf] "[" ~<CxxExpToAbox> n "]" ";" ]
+
+ CxxTopLevelToAbox:
+ CxxClassDecl(params, idf, parents) ->
+ V vs=0 [
+ ~<CxxParamsToAbox> params
+ H hs=0 [
+ H hs=1 [ "class" ~<CxxIdToAbox>idf ]
+ ~<CxxParentsToAbox>parents
+ ";"
+ ]
+ ]
+
+ CxxTopLevelToAbox:
+ CxxClassDecl(params, idf, parents) ->
+ V vs=0 [
+ ~<CxxParamsToAbox> params
+ H hs=0 [
+ H hs=1 [ "class" ~<CxxIdToAbox>idf ]
+ ~<CxxParentsToAbox>parents
+ ";"
+ ]
+ ]
+
+ CxxTopLevelToAbox:
+ CxxComment(txt) ->
+ H hs=1 [ "//" ~S(txt) ]
+
+ CxxBodyToAbox:
+ CxxPublic(b) -> V is=2 [ "public:" V [ ~*<map(CxxTopLevelToAbox)> b ] ]
+
+ CxxBodyToAbox:
+ CxxProtected(b) -> V is=2 [ "protected:" V [ ~*<map(CxxTopLevelToAbox)> b ] ]
+
+ CxxBodyToAbox:
+ CxxPrivate(b) -> V is=2 [ "private:" V [ ~*<map(CxxTopLevelToAbox)> b ] ]
+
+ CxxTopLevelToAbox:
+ CxxClassDecl(params, idf, parents, body) ->
+ V vs=0 [
+ ~<CxxParamsToAbox> params
+ H hs=0 [
+ H hs=1 [ "class" ~<CxxIdToAbox> idf ]
+ ~<CxxParentsToAbox> parents
+ ]
+ V vs=0 is=2 [ "{" V vs=0 [ ~*<map (CxxBodyToAbox <+ CxxTopLevelToAbox)> body ] ]
+ H hs=0 [ "}" ";" ]
+ ]
+
+ CxxParamsToAbox:
+ [] -> H []
+
+ CxxParamsToAbox:
+ params -> H hs=1 [ "template" "<" ~<CxxListToAbox(CxxParamToAbox|",")> params ">" ]
+ where not(<?[]> params)
+
+ CxxParamToAbox:
+ (t, idf) -> H hs = 1 [ ~<CxxTypeToAbox> t ~<CxxIdToAbox> idf ]
+
+ CxxParentsToAbox:
+ [] -> H []
+
+ CxxParentsToAbox:
+ parents -> H hs=1 [ ":" ~<CxxListToAbox(CxxParentToAbox|",")>parents ]
+ where not(<?[]> parents)
+
+ CxxParentToAbox:
+ (modifier, t) ->
+ H hs=1 [ ~S(modifier) ~<CxxTypeToAbox>t ]
Index: branches/scool-ng/src/pp-cxx/pp-cxx.meta
===================================================================
--- branches/scool-ng/src/pp-cxx/pp-cxx.meta (revision 0)
+++ branches/scool-ng/src/pp-cxx/pp-cxx.meta (revision 63)
@@ -0,0 +1 @@
+Meta([Syntax("Stratego-Box")])
Index: branches/scool-ng/src/pp-cxx/CxxId.meta
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxId.meta (revision 0)
+++ branches/scool-ng/src/pp-cxx/CxxId.meta (revision 63)
@@ -0,0 +1 @@
+Meta([Syntax("Stratego-Box")])
Index: branches/scool-ng/src/pp-cxx/CxxExp.meta
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxExp.meta (revision 0)
+++ branches/scool-ng/src/pp-cxx/CxxExp.meta (revision 63)
@@ -0,0 +1 @@
+Meta([Syntax("Stratego-Box")])
Index: branches/scool-ng/src/pp-cxx/Makefile.am
===================================================================
--- branches/scool-ng/src/pp-cxx/Makefile.am (revision 0)
+++ branches/scool-ng/src/pp-cxx/Makefile.am (revision 63)
@@ -0,0 +1,21 @@
+# Makefile.am -*-Makefile-*-
+
+MODULES = pp-cxx
+
+include $(top_srcdir)/config/Makefile.xt
+-include $(MODULES:=.c.dep)
+
+SCFLAGS = --main $* --verbose 0
+STRINCLUDES = -I $(top_builddir)/src/scl-syn \
+ -I $(top_builddir)/src/cxx-syn \
+ -I `dirname \`xtc get Stratego-Box.tbl\`` \
+ -I $(srcdir) \
+ -la stratego-lib
+
+libexec_PROGRAMS = pp-cxx
+
+nodist_pp_cxx_SOURCES = pp-cxx.c
+
+EXTRA_DIST = $(MODULES:=.str)
+
+CLEANFILES = $(MODULES:=.c) $(MODULES:=.c.dep)
Index: branches/scool-ng/src/pp-cxx/CxxType.str
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxType.str (revision 0)
+++ branches/scool-ng/src/pp-cxx/CxxType.str (revision 63)
@@ -0,0 +1,32 @@
+module CxxType
+
+imports Cxx Box libstratego-lib CxxId
+
+rules
+
+ CxxTypeToAbox:
+ CxxType(idf) -> <CxxIdToAbox> idf
+
+ CxxTypeToAbox:
+ CxxType(idf, l) -> S(<concat-strings> [ idf, "<", <foldr(!"", conc-strings)> l, ">" ])
+
+ CxxTypeToAbox:
+ CxxRefType(t) -> H hs=0 [ ~<CxxTypeToAbox> t "&" ]
+
+ CxxTypeToAbox:
+ CxxType(idf, params) -> H hs=0 [ ~<CxxIdToAbox> idf "<" ~<CxxListToAbox(CxxTypeToAbox|",")> params ">" ]
+
+ CxxTypeToAbox:
+ CxxConstType(t) -> H [ "const" ~<CxxTypeToAbox> t]
+
+ CxxTypeToAbox:
+ Typename -> S("typename")
+
+ CxxTypeToAbox:
+ CxxFunCall(idf, args) -> H hs=0 [ ~<CxxIdToAbox>idf "(" H hs=1 [ ~*<CxxListToAbox(CxxTypeToAbox <+ CxxExpToAbox|",")>args ] ")"]
+
+ CxxTypeToAbox:
+ CxxScope(idf1, idf2) -> H hs=0 [ ~<CxxTypeToAbox> idf1 "::" ~<CxxIdToAbox> idf2 ]
+
+ CxxTypeToAbox:
+ CxxTypename(t) -> H hs=1 [ "typename" ~<CxxTypeToAbox> t ]
Index: branches/scool-ng/src/pp-cxx/CxxStm.meta
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxStm.meta (revision 0)
+++ branches/scool-ng/src/pp-cxx/CxxStm.meta (revision 63)
@@ -0,0 +1 @@
+Meta([Syntax("Stratego-Box")])
Index: branches/scool-ng/src/scoolt/Exp.meta.tmp
===================================================================
--- branches/scool-ng/src/scoolt/Exp.meta.tmp (revision 0)
+++ branches/scool-ng/src/scoolt/Exp.meta.tmp (revision 63)
@@ -0,0 +1 @@
+Meta([Syntax("Concrete")])
Index: branches/scool-ng/src/scoolt/Concept.str
===================================================================
--- branches/scool-ng/src/scoolt/Concept.str (revision 0)
+++ branches/scool-ng/src/scoolt/Concept.str (revision 63)
@@ -0,0 +1,77 @@
+module Concept
+
+imports libstratego-lib Cxx AsFix Scool Decl
+
+rules
+
+ // FIXME: This is rather the role of the pretty-printer. However, currently
+ // a CxxComment() node only accepts a text parameter, so we have to
+ // build it. An idea would be to extend the CxxComment() node to accept
+ // an AST as parameter and let the pretty printer do the printing stuff.
+
+ TypeToStr:
+ Var(t) -> "typedef"
+ where <eq> (t, "type")
+
+ TypeToStr:
+ FunType(_, Var(t)) -> t
+
+ ArgsToStr:
+ FunType([], _) -> ""
+
+ ArgsToStr:
+ FunType([ e | []], _) -> <ArgToStr> e
+
+ ArgsToStr:
+ FunType([e | l], _) -> <concat-strings> [ <ArgToStr> e, "," ]
+
+ ArgToStr:
+ FunArg(idf, Var(type)) -> <concat-strings> [ type, " ", idf ]
+
+ ConceptBodyToStr:
+ ConstDec([], idf, None(), t) ->
+ CxxComment(<concat-strings>[ <TypeToStr> t, " ", idf, ";" ])
+
+ ConceptBodyToStr:
+ ConstDec(["decl"], idf, None(), t) ->
+ CxxComment(<concat-strings>[
+ <TypeToStr> t, " ", idf, "(", <ArgsToStr> t, ")", ";"
+ ])
+
+ ConceptAddCxxConstructor:
+ idf -> CxxProtected([CxxFun([], None(), idf, [])])
+
+ ConceptToCxxImpl:
+ ConstDec([], idf, None(), Var("type")) -> CxxTypedef(CxxScope(CxxTypename(CxxType("E")), idf), idf)
+
+ ConceptToCxxImpl:
+ ConstDec(["decl"], idf, None(), FunType(args, Var(return_type))) ->
+ [
+ CxxAffect(CxxDecl(CxxType(return_type), CxxType("E"), CxxType(new_idf), <map (ArgDefToCxx)> args), CxxAdressOf(CxxScope(CxxType("E"), idf))),
+ CxxExpStm(CxxAffect(new_idf, CxxInt("0")))
+ ]
+ where <concat-strings> [ "m", <int-to-string> <Count> ] => new_idf
+
+ GetWhereClause_:
+ Some(wclause) -> <GetWhereClause> wclause
+
+ GetWhereClause_:
+ _#([Parenthesis(wclause)]) -> <GetWhereClause> wclause
+
+ GetWhereClause_:
+ _#([wclause]) -> <GetWhereClause> wclause
+ // ((where-clause))
+ where
+ <not (?Parenthesis(x))> wclause
+
+ GetWhereClause:
+ wclause -> <GetWhereClause_ <+ id> wclause
+
+ // FIXME: check that what we declared in the where-clause is consistent with the argument (e.g. : [T : type where (E models my-concept)] is not consistent)
+ WhereClauseToCxx:
+ (wclause, (arg_idf, arg_type)) -> (CxxConstType(CxxRefType(<ModelToCxx> (<GetWhereClause> wclause, (arg_type, arg_idf)))), arg_idf)
+
+
+ ModelToCxx:
+ (Model(t, concept), arg) -> CxxType(concept, [t])
+
Index: branches/scool-ng/src/scoolt/Exp.str
===================================================================
--- branches/scool-ng/src/scoolt/Exp.str (revision 0)
+++ branches/scool-ng/src/scoolt/Exp.str (revision 63)
@@ -0,0 +1,28 @@
+module Exp
+
+imports libstratego-lib Cxx AsFix Scool
+
+rules
+
+ ExpToCxx:
+ Int(i) -> CxxInt(i)
+
+ ExpToCxx:
+ String(s) -> <un-double-quote> s
+
+ ExpToCxx:
+ Var(idf) -> idf
+
+// ExpToCxx:
+// |[ ~exp:lop + ~exp:rop ]| -> CxxSum(<ExpToCxx> lop, <ExpToCxx> rop)
+
+// ExpToCxx:
+// |[ ~exp:rval := ~exp:lval ]| -> CxxAffect(<ExpToCxx> rval, <ExpToCxx> lval)
+
+ ExpToCxx:
+ Cxx(s) -> CxxProgram(s)
+
+ ExpToCxx:
+ FunCall(name, args) -> CxxFunCall(name, <map (ExpToCxx)> args)
+
+
Index: branches/scool-ng/src/scoolt/Tools.str
===================================================================
--- branches/scool-ng/src/scoolt/Tools.str (revision 0)
+++ branches/scool-ng/src/scoolt/Tools.str (revision 63)
@@ -0,0 +1,29 @@
+module Tools
+
+imports libstratego-lib Cxx AsFix Scool
+
+rules
+
+ SclNewIdf:
+ idf -> <conc-strings> (idf, "_")
+
+ CxxTypeToIdf:
+ CxxType(idf) -> idf
+ where <is-string> idf
+
+strategies
+
+ NewCount =
+ rules(count_:- _)
+
+ Count =
+ if count_ => res then
+ rules(count_:- _)
+ ; rules(count_: _ -> <add> (res, 1))
+ else
+ rules(count_: _ -> 1)
+ end
+ ; count_
+
+ GetCount =
+ count_ <+ !0
Index: branches/scool-ng/src/scoolt/Access.str
===================================================================
--- branches/scool-ng/src/scoolt/Access.str (revision 0)
+++ branches/scool-ng/src/scoolt/Access.str (revision 63)
@@ -0,0 +1,15 @@
+module Access
+
+imports libstratego-lib Cxx Type Exp Stm Tools AsFix Scool
+
+rules
+
+ AccessToCxx:
+ Accessblock(Public, l) -> CxxPublic(<map (DeclToCxx)> l)
+
+ AccessToCxx:
+ Accessblock(Private, l) -> CxxPrivate(<map (DeclToCxx)> l)
+
+ AccessToCxx:
+ Accessblock(Protected, l) -> CxxProtected(<map (DeclToCxx)> l)
+
Index: branches/scool-ng/src/scoolt/Impl.str
===================================================================
--- branches/scool-ng/src/scoolt/Impl.str (revision 0)
+++ branches/scool-ng/src/scoolt/Impl.str (revision 63)
@@ -0,0 +1,5 @@
+module Impl
+
+imports libstratego-lib Cxx Type Exp Stm Tools AsFix Scool Access Concept
+
+rules
Index: branches/scool-ng/src/scoolt/Type.str
===================================================================
--- branches/scool-ng/src/scoolt/Type.str (revision 0)
+++ branches/scool-ng/src/scoolt/Type.str (revision 63)
@@ -0,0 +1,32 @@
+module Type
+
+imports libstratego-lib Cxx AsFix Scool
+
+rules
+
+ IsScalar:
+ Var(t) -> t
+ where
+ (
+ <eq> (t, "char")
+ <+ <eq> (t, "bool")
+ <+ <eq> (t, "short")
+ <+ <eq> (t, "int")
+ <+ <eq> (t, "float")
+ <+ <eq> (t, "double")
+ )
+
+ TypeToCxx:
+ Var(x) -> CxxType(x)
+
+ TypeToCxx:
+ RefType(t) -> CxxRefType(<TypeToCxx> t)
+
+ // Constify + Referencify a type
+ TypeToConstRefCxx:
+ t -> CxxConstType(CxxRefType(<TypeToCxx> t))
+ where
+ (
+ <not (IsScalar)> t
+ ; <not (?RefType(x))> t
+ )
Index: branches/scool-ng/src/scoolt/Makefile.am
===================================================================
--- branches/scool-ng/src/scoolt/Makefile.am (revision 0)
+++ branches/scool-ng/src/scoolt/Makefile.am (revision 63)
@@ -0,0 +1,21 @@
+# Makefile.am -*-Makefile-*-
+
+MODULES = scoolt
+
+include $(top_srcdir)/config/Makefile.xt
+-include $(MODULES:=.c.dep)
+
+SCFLAGS = --main $* --verbose 0
+STRINCLUDES = -I $(top_builddir)/src/scl-syn \
+ -I $(top_builddir)/src/cxx-syn \
+ -I `dirname \`xtc get Stratego-Box.tbl\`` \
+ -I $(srcdir) \
+ -la stratego-lib
+
+libexec_PROGRAMS = scoolt
+
+nodist_scoolt_SOURCES = scoolt.c
+
+EXTRA_DIST = $(MODULES:=.str)
+
+CLEANFILES = $(MODULES:=.c) $(MODULES:=.c.dep)
Index: branches/scool-ng/src/scoolt/Stm.str
===================================================================
--- branches/scool-ng/src/scoolt/Stm.str (revision 0)
+++ branches/scool-ng/src/scoolt/Stm.str (revision 63)
@@ -0,0 +1,21 @@
+module Stm
+
+imports libstratego-lib Cxx Type Exp AsFix Scool
+
+rules
+
+ StmToCxx:
+ ExpStm(e) -> CxxExpStm(<ExpToCxx> e)
+ where <debug> e
+
+ /* Handle the 'return' statement */
+ StmToCxx:
+ Return(e) -> CxxExpStm(CxxKeyword("return", <ExpToCxx> e))
+
+ StmToCxx:
+ VarDec([], idf, t, i) -> <DeclToCxx> VarDec([], idf, t, i)
+ where <debug> idf
+
+ StmToCxx:
+ x -> <DeclToCxx> x
+ where <debug> x
Index: branches/scool-ng/src/scoolt/scoolt.str
===================================================================
--- branches/scool-ng/src/scoolt/scoolt.str (revision 0)
+++ branches/scool-ng/src/scoolt/scoolt.str (revision 63)
@@ -0,0 +1,184 @@
+module scoolt
+
+imports libstratego-lib Cxx Program AsFix Scool
+
+strategies
+
+ scoolt = io-wrap(ProgramToCxx)
+
+
+
+/*
+ t-Program:
+ Program(l) -> Cxx(<collect-vtypes> l, <map(t-Decl)> l)
+
+
+
+ t-Decl:
+ VarDec(i, t) -> CxxVarDec(<t-Type> t, i)
+ where not(<?Var("type")> t)
+
+ t-Decl:
+ VarDec(i, t, v) -> CxxVarDec(<t-Type> t, i, <t-Exp> v)
+ where not(<?Var("type")> t)
+
+ t-Decl:
+ ConsDec(_, i, t) -> CxxVarDec(CxxConsType(<t-Type> t), i)
+ where not(<?Var("type")> t)
+
+ t-Decl:
+ ConsDec(_, i, t, v) -> CxxVarDec(CxxConsType(<t-Type> t), i, <t-Exp> v)
+ where not(<?Var("type")> t)
+
+
+
+
+ t-Decl:
+ ConsDec(_, i, t) -> CxxEscape(<concat-strings> ["/", "/ virtual typedef /abstract/ ", i, ";"] )
+ where <?Var("type")> t
+
+ t-Decl: // FIXME : vvvvvv
+ ConsDec(_, i, t, Var(v)) -> CxxEscape(<concat-strings> ["/", "/ virtual typedef ", v, " ", i, ";"] )
+ where <?Var("type")> t
+
+
+
+ t-Decl:
+ ConsDec(qualifiers, name, Class, ClassVal(l)) -> [CxxClassDec([CxxTemplateArg("E")], newname, CxxPublic, CxxTemplateType(CxxScope("stc", "any"), "E"), <map(t-ABlock)> l), CxxTypedef(CxxTemplateType(newname, "itself"), name)] where <conc-strings> (name, "_") => newname
+
+ t-Decl:
+ ConsDec(qualifiers, name, Class(parent), ClassVal(l)) -> [CxxClassDec([CxxTemplateArg("E")], newname, CxxPublic, CxxTemplateType(<t-r-Type> parent, "E"), <map(t-ABlock)> l), CxxTypedef(CxxTemplateType(newname, "itself"), name)] where <conc-strings> (name, "_") => newname; <not(one(?"final"))> qualifiers
+
+ t-Decl:
+ ConsDec(qualifiers, name, Class(parent)) -> [CxxClassDec([CxxTemplateArg("E")], newname, CxxPublic, CxxTemplateType(<t-r-Type> parent, "E"), []), CxxTypedef(CxxTemplateType(newname, "itself"), name)] where <conc-strings> (name, "_") => newname; <not(one(?"final"))> qualifiers
+
+ t-Decl:
+ ConsDec(qualifiers, name, Class) -> [CxxClassDec([CxxTemplateArg("E")], newname, CxxPublic, CxxTemplateType(CxxScope("stc", "any"), "E"), []), CxxTypedef(CxxTemplateType(newname, "itself"), name)] where <conc-strings> (name, "_") => newname
+
+ t-Decl:
+ ConsDec(qualifiers, name, Class(parent), ClassVal(l)) -> [CxxClassDec([CxxTemplateArg("E")], newname, CxxPublic, CxxTemplateType(<t-r-Type> parent, "E"), <map(t-ABlock)> l), CxxTypedef(CxxTemplateType(newname, "itself"), name)] where <conc-strings> (name, "_") => newname
+
+
+
+ t-Decl:
+ ConsDec(qualifiers, name, Class(parent), ClassVal(l)) ->
+ [CxxClassDec (
+ newname,
+ CxxPublic,
+ CxxTemplateType(<t-r-Type> parent, newname),
+ <map(t-ABlock)> l
+ ),
+ CxxTypedef(newname, name)
+ ]
+ where <conc-strings> (name, "_") => newname; <one(?"final")> qualifiers
+
+ t-ABlock:
+ Accessblock(acc, decs) -> CxxAccessBlock(<t-ASpecifier> acc, <map(t-Decl)> decs)
+
+ t-ASpecifier:
+ Public -> CxxPublic
+
+ t-ASpecifier:
+ Private -> CxxPrivate
+
+ t-Decl:
+ FunDec(_, name, args, ret, body) -> CxxFunDec(<t-Type> ret, name, <map(t-Arg)> args, <map(t-Stm + t-Decl)> body)
+
+
+ t-Decl:
+ BiFunDec(qualifiers, name, s-args, args, rettype, body) ->
+ CxxOverloadingCase( name,
+ CxxInt(index),
+ <t-StaticCond>s-args,
+ <t-Type>rettype,
+ <map(t-Arg)>args,
+ <map(t-Stm + t-Decl)>body
+ )
+ where
+ <one(?"overloading")> qualifiers
+ ; if not(<index-over> name) then
+// say(!"first"); debug
+ !1 => index
+ ; rules(index-over: name -> 2)
+ else
+// say(!"not first"); debug
+ <index-over> name => index
+ ; rules(index-over: name -> <add>(index, 1))
+ end
+
+
+
+ t-Arg:
+ (name, type, guard) -> <t-Arg> (name, type)
+
+ t-Arg:
+ (name, type) -> (<t-Type> type, name)
+
+
+
+ t-Type:
+ Var(n) -> n
+
+ t-r-Type:
+ Var(n) -> <conc-strings> (n, "_")
+
+ t-Exp:
+ Int(n) -> CxxInt(n)
+
+ t-Exp:
+ Mul(e1, e2) -> CxxMul(<t-Exp> e1, <t-Exp> e2)
+
+ t-Exp:
+ Var(n) -> CxxVar(n)
+
+ t-Exp:
+ Cpp(cxx) -> CxxEscape(cxx)
+
+ t-Stm:
+ Return(e) -> CxxReturn(<t-Exp> e)
+
+ t-Decl:
+ Cpp(cxx) -> CxxEscape(cxx)
+
+ t-StaticCond:
+ [] -> CxxStaticTrue
+
+ t-StaticCond:
+ [h|[]] -> <t-StaticCond> h
+
+ t-StaticCond:
+ [h|t] -> CxxStaticAnd(<t-StaticCond> h, <t-StaticCond> t)
+ where not(<?[]>t)
+
+ t-StaticCond:
+ (idf, type, Guard(guard)) -> <t-StaticCond> guard
+
+ t-StaticCond:
+ (idf, type) -> CxxStaticTrue
+
+ t-StaticCond:
+ Eq(e1, e2) -> CxxStaticEq(<t-Type> e1, <t-Type> e2)
+
+ t-StaticCond:
+ Or(e1, e2) -> CxxStaticOr(<t-StaticCond> e1, <t-StaticCond> e2)
+
+ t-StaticCond:
+ Inf(e1, e2) -> CxxStaticIsA(<t-Type> e1, <t-Type> e2)
+
+ t-StaticCond:
+ Var("true") -> CxxStaticTrue
+
+ t-StaticCond:
+ Var("false") -> CxxStaticFalse
+
+
+
+ strategies
+
+ collect-vtypes =
+ collect(?ConsDec(attr, _, Var("type")); where (<one(?"decl")> attr) )
+ ; map(?ConsDec(_, <id>, _))
+ ; make-set
+
+
+*/
Index: branches/scool-ng/src/scoolt/Decl.str
===================================================================
--- branches/scool-ng/src/scoolt/Decl.str (revision 0)
+++ branches/scool-ng/src/scoolt/Decl.str (revision 63)
@@ -0,0 +1,257 @@
+module Decl
+
+imports libstratego-lib Cxx Type Exp Stm Tools AsFix Scool Access Concept
+
+rules
+
+ /*
+ * Variable declaration.
+ * Grammar: "var" idf ":" t ";"
+ */
+ DeclToCxx:
+ VarDec([], idf, t) -> CxxDecl(<TypeToCxx> t, idf)
+
+ /*
+ * Array declaration.
+ * Grammar: "var" idf ":" "array" "[" t "," n "]" ";"
+ */
+ DeclToCxx:
+ VarDec([], idf, StaticFunCall(st, [t, n])) ->
+ <if <eq> ("array", st) then
+ ! CxxArrayDecl(<TypeToCxx> t, idf, <ExpToCxx> n)
+ else
+ say(<concat-strings> ["Unkown construction: ", st])
+ ; <exit> 1
+ end>
+
+ /*
+ * Buffer declaration.
+ * Grammar: "var" idf ":" "buffer" "[" t "]" ";"
+ */
+ DeclToCxx:
+ VarDec([], idf, StaticFunCall(st, [t])) ->
+ <if <eq> ("buffer", st) then
+ ! CxxDecl(CxxType(CxxScope("std", "vector"), [<TypeToCxx> t]), idf)
+ else
+ say(<concat-strings> ["Unkown construction: ", st])
+ ; <exit> 1
+ end>
+
+ /*
+ * Variable declaration with initialisation.
+ * Grammar: "var" idf ":" t ":=" v ";"
+ */
+ DeclToCxx:
+ VarDec([], idf, t, v) -> CxxDecl(<TypeToCxx> t, idf, <ExpToCxx> v)
+
+ UnVar:
+ Var(x) -> x
+
+ /*
+ * Constant declaration.
+ * Grammar: idf ":" t ";"
+ */
+ DeclToCxx:
+ ConstDec([], idf, cs, t) ->
+ <if <eq> ("type", <UnVar> t) then
+ ! CxxDecl(<TypeToCxx> t, idf)
+ else
+ ! CxxDecl(CxxConstType(<TypeToCxx> t), idf)
+ end>
+ where not(<?Class> t)
+
+ /*
+ * Constant declaration with initialisation.
+ * Grammar: idf ":" t "=" v ";"
+ */
+ DeclToCxx:
+ ConstDec([], idf, t, v) -> CxxDecl(CxxConstType(<TypeToCxx> t), idf, <ExpToCxx> v)
+ where not(<?Class> t)
+
+ DeclToCxx:
+ ConstDec(["decl"], idf, cs, FunType(args, ret)) -> CxxFun([], <TypeToCxx> ret, idf, <map (ArgDefToCxx)> args)
+
+ /*
+ * Root Class predeclaration
+ * Grammar: idf ":" "class" ";"
+ */
+ DeclToCxx:
+ ConstDec([], idf, cs, Class) ->
+ CxxClassDecl(
+ [(Typename, "T")],
+ idf,
+ []
+ )
+
+ /*
+ * Root Class declaration
+ * Grammar: specs idf ":" "class" "=" "{" v "}" ";"
+ */
+ DeclToCxx:
+ ConstDec(specs, idf, Class, ClassVal(v)) ->
+ <AddClassComment(|idf)>
+ [
+ CxxClassDecl(
+ [(Typename, "E")],
+ idf,
+ [
+ /*(
+ "public",
+ CxxType(CxxScope("stc", "any"), [CxxFunCall("stc_find_exact", [CxxType(nidf), CxxType("T")])])
+ )*/
+ // FIXME: Add a way to specify if a root class should inherit from Object or not
+ ],
+ <map (AccessToCxx)> v
+ //[]
+ )
+ ]
+ where
+ rules(AddTemplate(|T): CxxType(idf) -> CxxType(idf, [T]))
+
+ /*
+ * Final Class declaration
+ * Grammar: final idf ":" "class" "=" "{" v "}" ";"
+ */
+ DeclToCxx:
+ ConstDec(specs, idf, Class(p), v) ->
+ <AddClassComment(|idf)>
+ [
+ CxxClassDecl(
+ params,
+ idf,
+ [
+ (
+ "public",
+ parent
+ )
+ ],
+ [] // fixme
+ )
+ ]
+ where <TypeToCxx> p => cxxp
+ ; if
+ (
+ <one(?"final")> specs
+ ; <AddTemplate(|CxxType(idf))> cxxp => parent
+ )
+ <+
+ <AddTemplate(|CxxType("E"))> cxxp => parent
+ then
+ if <one(?"final")> specs then
+ rules(IsFinal: CxxType(idf) -> <concat-strings> [idf, " is final."])
+ ; ![] => params
+ else
+ rules(AddTemplate(|T): CxxType(idf) -> CxxType(idf, [T]))
+ ; ![(Typename, "E")] => params
+ end
+ else
+ say(!<concat-strings> [idf, " cannot inherit from ", <CxxTypeToIdf> cxxp])
+ ; if <IsFinal> cxxp => error then
+ say(!error)
+ else
+ say(!<concat-strings> [<CxxTypeToIdf>cxxp, " does not exist."])
+ end
+ end
+
+ /*
+ * Handle class declarations with inheritance
+ * Grammar: idf ":" "class" "<" parent ";"
+ */
+ DeclToCxx:
+ ConstDec([], idf, cs, Class(Var(parent))) -> CxxClassDecl([], idf, [("public", CxxType(parent))])
+ where <conc-strings> (idf, "_") => nidf
+
+ /*
+ * Handle functions
+ * Grammar: idf ":" "(" args ")" "->" t "=" "{" body "}"
+ * TODO: Handle templates
+ */
+ DeclToCxx:
+ FunDec([], idf, args, t, body) -> CxxFun([], <TypeToCxx> t, idf, <map(ArgDefToCxx)> args, <map(StmToCxx)> body)
+ //where <debug> body
+ //FunDec([], idf, args, t, body) -> <AddParameters(|<GetCount> 0)> CxxFun([], <TypeToCxx> t, idf, nargs, <map(StmToCxx)>body)
+ //where <NewCount; map(ArgDefToCxx)>args => nargs
+ /*
+ * Handle functions
+ * Grammar: idf ":" "(" args ")" "->" t "=>" Exp
+ * TODO: Handle templates
+ */
+ DeclToCxx:
+ FunDec([], idf, args, t, ExpStm(body)) -> CxxFun([], <TypeToCxx> t, idf, <map(ArgDefToCxx)> args, [<StmToCxx> Return(body)])
+ //where <debug> body
+
+ DeclToCxx:
+ StaticFunDec(l, idf, params, Class(), body) -> CxxClassDecl(<map (ParamToCxx)> params, idf, [], <map (AccessToCxx)> body)
+
+ DeclToCxx:
+ BiFunDec(l, idf, params, args, t, body) -> CxxFun(<map (ParamToCxx)> params, <TypeToCxx> t, idf, <map (ArgDefToCxx)> args, <map (StmToCxx)> body)
+
+ DeclToCxx:
+ BiFunDec(l, idf, params, args, t, ExpStm(body)) -> CxxFun(<map (ParamToCxx)> params, <TypeToCxx> t, idf, <map (ArgDefToCxx)> args, [<StmToCxx> Return(body)])
+
+
+ /*
+ * Handle concept declarations
+ * Grammar : idf ":" "concept" "{" body "}"
+ */
+ DeclToCxx:
+ Concept(idf, body) -> CxxClassDecl([(Typename, "E")], idf, [],
+ <conc>
+ (
+ [ CxxComment("To be provided by classes that model this concept.\n") ],
+ <map (ConceptBodyToStr)> body,
+ [ <ConceptAddCxxConstructor> idf ]
+ ))
+ where
+ rules(
+ ImplToCxx:
+ Concept(idf, body) ->
+ CxxFun([(Typename, "E")], CxxType(""), <concat-strings>[ idf, "<E>::", idf], [], <flatten-list> <map (ConceptToCxxImpl)> body)
+ )
+
+
+ ParamToCxx:
+ (idf1, Var("type"), wclause) -> (CxxType("class"), idf1)
+ where
+ rules(
+ RealTypeToCxx:
+ arg -> <WhereClauseToCxx> (wclause, arg)
+ )
+
+ ParamToCxx:
+ (idf, Var(t), wclause) -> (CxxType(t), idf)
+ where
+ <not(?"test")> t
+
+ ArgDefToCxx:
+ arg -> <RealTypeToCxx> arg
+
+ ArgDefToCxx:
+ (idf, t) -> ((<TypeToConstRefCxx <+ TypeToCxx> t), idf)
+ where
+ <not (RealTypeToCxx)> (idf, t)
+ //(idf, t) -> (<TypeToCxx; try(CxxTypeToStc(|CxxType(p-idf)))> t, idf)
+ //where <concat-strings; SclNewIdf> ["T", <Count; int-to-string> 0] => p-idf
+
+ ArgDefToCxx:
+ FunArg(idf, t) -> <ArgDefToCxx> (idf, t)
+
+ AddTypedef(|specs, idf):
+ [x] -> [x, CxxTypedef(CxxType(<SclNewIdf>idf, [CxxType(CxxScope("stc", "itself"))]), idf)]
+ where <not(one(?"abstract"))> specs
+
+ AddClassComment(|idf):
+ l -> [CxxComment(<concat-strings> ["Class ", idf])|l]
+
+ AddParameters(|n):
+ CxxFun(p, t, idf, args, body) -> CxxFun(<Parameters(|n)> p, t, idf, args, body)
+ //where <debug> n
+
+ Parameters(|n):
+ l -> <Parameters(|<subt>(n, 1))>[(Typename, idf)|l]
+ where <not(?0)> n
+ ; <concat-strings; SclNewIdf> ["T", <int-to-string> n] => idf
+
+ Parameters(|n):
+ l -> l
+ where <?0> n
Index: branches/scool-ng/src/scoolt/Program.str
===================================================================
--- branches/scool-ng/src/scoolt/Program.str (revision 0)
+++ branches/scool-ng/src/scoolt/Program.str (revision 63)
@@ -0,0 +1,11 @@
+module Program
+
+imports libstratego-lib Cxx Decl AsFix Scool
+
+rules
+
+ CxxEmpty:
+ _ -> []
+
+ ProgramToCxx:
+ Program(l) -> CxxProgram(<conc> (<map(DeclToCxx)> l, <map(ImplToCxx <+ CxxEmpty)> l))
Index: branches/scool-ng/src/parse-scool/parse-scool
===================================================================
--- branches/scool-ng/src/parse-scool/parse-scool (revision 0)
+++ branches/scool-ng/src/parse-scool/parse-scool (revision 63)
@@ -0,0 +1 @@
+sglri -p `dirname $0`/../scl-syn/Scool.tbl -i $1
Property changes on: branches/scool-ng/src/parse-scool/parse-scool
___________________________________________________________________
Name: svn:executable
+ *
Index: branches/scool-ng/src/scl-syn/Statement.sdf
===================================================================
--- branches/scool-ng/src/scl-syn/Statement.sdf (revision 0)
+++ branches/scool-ng/src/scl-syn/Statement.sdf (revision 63)
@@ -0,0 +1,15 @@
+module Statement
+
+imports
+ Lexical Declaration
+
+exports
+ sorts Statement
+ context-free syntax
+
+ Expression? ";" -> Statement {cons("ExpressionStatement")}
+ %%"->" Expression ";" -> Statement {cons("ReturnStatement")}
+ Declaration -> Statement
+
+ SimpleDeclaration -> FunctionStatement
+
Index: branches/scool-ng/src/scl-syn/Declaration.sdf
===================================================================
--- branches/scool-ng/src/scl-syn/Declaration.sdf (revision 0)
+++ branches/scool-ng/src/scl-syn/Declaration.sdf (revision 63)
@@ -0,0 +1,36 @@
+module Declaration
+
+imports
+ Lexical Type Statement Expression
+
+exports
+ sorts Declaration Block FunctionBlock SimpleDeclaration
+ context-free syntax
+
+ "{" Statement* "}" -> Block {cons("Block")}
+ "{" FunctionStatement* "}" -> FunctionBlock {cons("FunctionBlock")}
+
+ %%"{" StaticStatement* "}" -> StaticBlock {cons("StaticBlock")}
+ %%"{" StaticClassStatement* "}" -> StaticClassBlock {cons("StaticClassBlock")}
+
+ "=" Expression -> ExpInit {cons("ExpInit")}
+
+ SimpleQualifier? Identifier ":" SimpleType ExpInit? ";" -> SimpleDeclaration {cons("SimpleDeclaration")}
+ SimpleDeclaration -> Declaration
+
+
+ FunctionQualifier? Identifier ":" FunctionType ";" -> Declaration {cons("FunctionDeclaration")}
+
+ FunctionQualifier? Identifier ":" FunctionType "=" FunctionBlock -> Declaration {cons("FunctionDefinition")}
+
+ %%FunctionQualifier? Identifier ":" FunctionType "=>" Expression ";" -> Declaration {cons("FunctionDefinition")}
+
+ %%Identifier ":" StaticFunctionType "=" "type" "="
+ %%"{"
+ %% StaticStatement*
+ %%"}" -> StaticFunction {cons("StaticFunction")}
+
+ %%Identifier ":" StaticFunctionType "=" "class" "="
+ %%"{"
+ %% StaticClassStatement*
+ %%"}" -> StaticFunction {cons("StaticFunction")}
Index: branches/scool-ng/src/scl-syn/Makefile.am
===================================================================
--- branches/scool-ng/src/scl-syn/Makefile.am (revision 0)
+++ branches/scool-ng/src/scl-syn/Makefile.am (revision 63)
@@ -0,0 +1,19 @@
+# Makefile.am -*-Makefile-*-
+
+MODULES = Scool
+SDFS = Class Concept Decl Exp ExpOrType Lexical Scool Stm Type
+
+include $(top_srcdir)/config/Makefile.xt
+-include $(MODULES:=.dep)
+
+PGEN_FLAGS = -m $*
+SDF2RTG_FLAGS = -m $*
+SCFLAGS = -m $* --verbose 0
+
+pkgdata_DATA = $(MODULES:=.def) \
+ $(MODULES:=.tbl) \
+ $(MODULES:=.str) \
+ $(MODULES:=.rtree)
+
+EXTRA_DIST = $(SDFS:=.sdf) $(MODULES:=.sdf)
+CLEANFILES = $(pkgdata_DATA) $(MODULES:=.dep)
Index: branches/scool-ng/src/scl-syn/Expression.sdf
===================================================================
--- branches/scool-ng/src/scl-syn/Expression.sdf (revision 0)
+++ branches/scool-ng/src/scl-syn/Expression.sdf (revision 63)
@@ -0,0 +1,66 @@
+module Expression
+
+imports
+ Lexical Type
+
+exports
+ sorts Expression StaticExpression
+ context-free syntax
+
+ Id -> Expression {cons("Identifier")}
+ Id -> StaticExpression {cons("Identifier")}
+
+ Integer -> Expression {cons("Integer")}
+ String -> Expression {cons("String")}
+
+ %%"[" {StaticExpression ","}+ "]" -> StaticArguments
+ %%"(" {Expression ","}* ")" -> DynamicArguments
+
+ %%(StaticArguments)? DynamicArguments -> SimpleFunctionArguments
+
+ %%Identifier StaticArguments -> StaticExpression {cons("StaticFunctionCall")}
+ %%Identifier SimpleFunctionArugments -> Expression {cons("FunctionCall")}
+
+ Expression "+" Expression -> Expression {cons("Sum")}
+ Expression "-" Expression -> Expression {cons("Substraction")}
+ Expression "*" Expression -> Expression {cons("Multiplication")}
+ Expression "/" Expression -> Expression {cons("Division")}
+ Expression "=" Expression -> Expression {cons("Equal")}
+ Expression "!=" Expression -> Expression {cons("Different")}
+ Expression "<" Expression -> Expression {cons("StrictInferior")}
+ Expression ">" Expression -> Expression {cons("StrictSuperior")}
+ Expression ">=" Expression -> Expression {cons("Superior")}
+ Expression "<=" Expression -> Expression {cons("Inferior")}
+ Expression "or" Expression -> Expression {cons("Or")}
+ Expression "and" Expression -> Expression {cons("And")}
+
+ %%Identifier ":=" Expression -> Expression {cons("Affect")}
+
+ %%Expression "." Identifier -> Expression {cons("Field")}
+
+ %%Identifier "." Identifier SimpleFunctionArguments -> Expression {cons("MethodCall")}
+
+ %%"(" Expression ")" -> Expression {cons("Parenthesis")}
+
+ context-free priorities
+
+ {left:
+ Expression "/" Expression -> Expression
+ Expression "*" Expression -> Expression
+ }
+> {left:
+ Expression "+" Expression -> Expression
+ Expression "-" Expression -> Expression
+ }
+> {left:
+ Expression "=" Expression -> Expression
+ }
+> {left:
+ Expression "and" Expression -> Expression
+ }
+> {left:
+ Expression "or" Expression -> Expression
+ }
+%%> {right:
+%% Identifier ":=" Expression -> Expression
+%% }
Index: branches/scool-ng/src/scl-syn/Scool.sdf
===================================================================
--- branches/scool-ng/src/scl-syn/Scool.sdf (revision 0)
+++ branches/scool-ng/src/scl-syn/Scool.sdf (revision 63)
@@ -0,0 +1,11 @@
+module Scool
+
+imports
+ Statement
+
+exports
+ sorts Program
+ context-free start-symbols Program
+ context-free syntax
+
+ Statement* -> Program {cons("Program")}
Index: branches/scool-ng/src/scl-syn/b.sh
===================================================================
--- branches/scool-ng/src/scl-syn/b.sh (revision 0)
+++ branches/scool-ng/src/scl-syn/b.sh (revision 63)
@@ -0,0 +1,2 @@
+pack-sdf -i Concrete.sdf -o Concrete.def
+sdf2table -i Concrete.def -o Concrete.tbl -m Concrete
Property changes on: branches/scool-ng/src/scl-syn/b.sh
___________________________________________________________________
Name: svn:executable
+ *
Index: branches/scool-ng/src/scl-syn/Lexical.sdf
===================================================================
--- branches/scool-ng/src/scl-syn/Lexical.sdf (revision 0)
+++ branches/scool-ng/src/scl-syn/Lexical.sdf (revision 63)
@@ -0,0 +1,61 @@
+module Lexical
+
+exports
+ sorts Id Identifier Integer String Asterisk Slash BlockComment CommentPart Cxx RawCxx SimpleQualifier FunctionQualifier ClassQualifier TypeQualifier MethodQualifier
+
+ context-free syntax
+
+ "|[" RawCxx "]|" -> Cxx {cons("Cxx")}
+
+ lexical syntax
+
+ [A-Za-z][A-Za-z0-9\_]* -> Id
+ [0-9]+ -> Integer {cons("Integer")}
+ "\"" [A-Za-z0-9]* "\"" -> String {cons("String")}
+ ~[\ ]~[\]\|]*~[\ ] -> RawCxx
+
+ "class" -> Id {reject}
+ "concept" -> Id {reject}
+ "var" -> Id {reject}
+ "final" -> Id {reject}
+ "models" -> Id {reject}
+ "type" -> Id {reject}
+ "ref" -> Id {reject}
+
+ "char" -> Identifier {reject}
+ "int" -> Identifier {reject}
+ "float" -> Identifier {reject}
+ "string" -> Identifier {reject}
+ "void" -> Identifier {reject}
+
+ "//" ~[\n]* [\n] -> LAYOUT
+ [\ \t\n] -> LAYOUT
+ BlockComment -> LAYOUT
+
+ "/*" CommentPart* "*/" -> BlockComment
+ ~[\/\*] -> CommentPart
+ Asterisk -> CommentPart
+ Slash -> CommentPart
+ BlockComment -> CommentPart
+ [\/] -> Slash
+ [\*] -> Asterisk
+
+ "var" -> SimpleQualifier
+ "final" -> ClassQualifier
+ "models" -> TypeQualifier
+
+ "decl" -> FunctionQualifier
+ "abtract" -> MethodQualifier
+
+ context-free syntax
+
+ Id -> Identifier {cons("Identifier")}
+
+ lexical restrictions
+ Identifier -/- [A-Za-z0-9\_]
+ Asterisk -/- [\/]
+ Slash -/- [\*]
+
+ context-free restrictions
+ LAYOUT? -/- [\ \t\n]
+ LAYOUT? -/- [\/].[\/]
Index: branches/scool-ng/src/scl-syn/Type.sdf
===================================================================
--- branches/scool-ng/src/scl-syn/Type.sdf (revision 0)
+++ branches/scool-ng/src/scl-syn/Type.sdf (revision 63)
@@ -0,0 +1,25 @@
+module Type
+
+imports
+ Lexical
+
+exports
+
+ sorts Type SimpleType FunctionType StaticFunctionType
+
+ context-free syntax
+
+ Id -> SimpleType {cons("SimpleType")}
+ SimpleType -> Type
+
+
+ Identifier ":" SimpleType -> SimplyTypedId {cons("SimplyTypedId")}
+
+ "ref" SimpleType -> SimpleType {non-assoc,cons("ReferenceType")}
+
+
+ "[" {Type ","}* "]" "->" Type -> StaticFunctionType {cons("StaticFunctionType")}
+
+ ("[" {Type ","}* "]")?
+ "(" {SimplyTypedId ","}* ")" "->" Type -> FunctionType {cons("FunctionType")}
+
Index: branches/scool-ng/src/Makefile.am
===================================================================
--- branches/scool-ng/src/Makefile.am (revision 0)
+++ branches/scool-ng/src/Makefile.am (revision 63)
@@ -0,0 +1,7 @@
+# Makefile.am -*-Makefile-*-
+
+include $(top_srcdir)/config/Makefile.xt
+
+SUBDIRS = cxx-syn scl-syn pp-cxx scoolt
+
+BOOTCLEAN_SUBDIRS = $(SUBDIRS)
Index: branches/scool-ng/src/cxx-syn/CxxType.sdf
===================================================================
--- branches/scool-ng/src/cxx-syn/CxxType.sdf (revision 0)
+++ branches/scool-ng/src/cxx-syn/CxxType.sdf (revision 63)
@@ -0,0 +1,14 @@
+module CxxType
+
+imports
+ Lexical
+
+exports
+ sorts CxxType
+ context-free syntax
+
+ CxxId -> CxxType {cons("CxxType")}
+ CxxId "<" {CxxType ","}* ">" -> CxxType {cons("CxxType")}
+ "const" CxxType -> CxxType {cons("CxxConstType")}
+ CxxType "&" -> CxxType {cons("CxxRefType")}
+
Index: branches/scool-ng/src/cxx-syn/CxxStm.sdf
===================================================================
--- branches/scool-ng/src/cxx-syn/CxxStm.sdf (revision 0)
+++ branches/scool-ng/src/cxx-syn/CxxStm.sdf (revision 63)
@@ -0,0 +1,11 @@
+module CxxStm
+
+imports
+ CxxType CxxExp CxxDecl
+
+exports
+ sorts CxxStm
+ context-free syntax
+
+ CxxDecl -> CxxStm
+ CxxExp -> CxxStm {cons("CxxExpStm")}
Index: branches/scool-ng/src/cxx-syn/CxxDecl.sdf
===================================================================
--- branches/scool-ng/src/cxx-syn/CxxDecl.sdf (revision 0)
+++ branches/scool-ng/src/cxx-syn/CxxDecl.sdf (revision 63)
@@ -0,0 +1,37 @@
+module CxxDecl
+
+imports
+ CxxType CxxExp Lexical
+
+exports
+ sorts CxxDecl CxxTopLevel
+ context-free syntax
+
+ CxxType CxxId ";" -> CxxDecl {cons("CxxDecl")}
+ CxxType CxxId ("[" CxxExp "]")? ";" -> CxxDecl {cons("CxxArrayDecl")}
+
+ CxxType CxxId "=" CxxExp ";" -> CxxDecl {cons("CxxDecl")}
+ CxxDecl "=" CxxExp ";" -> CxxExp {cons("CxxAffect")}
+
+ CxxType "(" CxxType "::*" CxxType ")" ("(" {(CxxType CxxId) ","}* ")")?
+ -> CxxDecl {cons("CxxDecl")}
+
+ "typedef" CxxType CxxId ";" -> CxxDecl {cons("CxxTypedef")}
+
+ "template" "<" {(CxxType CxxId) ","}* ">"
+ "class" CxxId ":" {(CxxAccessModifier CxxId) ","}* ";"
+ -> CxxDecl {cons("CxxClassDecl")}
+
+ "template" "<" {(CxxType CxxId) ","}* ">"
+ "class" CxxId ":" {(CxxAccessModifier CxxId) ","}*
+ "{"
+ CxxDecl*
+ "}" ";"
+ -> CxxDecl {cons("CxxClassDecl")}
+
+ "typename" -> CxxType {cons("Typename")}
+ "typename" CxxType -> CxxType {cons("CxxTypename")}
+ "//" CxxText -> CxxTopLevel {cons("CxxComment")}
+ "public" ":" CxxTopLevel* -> CxxTopLevel {cons("CxxPublic")}
+ "protected" ":" CxxTopLevel* -> CxxTopLevel {cons("CxxProtected")}
+ "private" ":" CxxTopLevel* -> CxxTopLevel {cons("CxxPrivate")}
Index: branches/scool-ng/src/cxx-syn/CxxFun.sdf
===================================================================
--- branches/scool-ng/src/cxx-syn/CxxFun.sdf (revision 0)
+++ branches/scool-ng/src/cxx-syn/CxxFun.sdf (revision 63)
@@ -0,0 +1,24 @@
+module CxxFun
+
+imports
+ CxxType CxxExp Lexical CxxStm
+
+exports
+ sorts CxxTopLevel
+ context-free syntax
+
+ "template" "<" {(CxxType CxxId) ","}* ">"
+ CxxType CxxId "(" {(CxxType CxxId) ","}* ")"
+ "{"
+ CxxStm*
+ "}"
+ -> CxxTopLevel {cons("CxxFun")}
+
+ "template" "<" {(CxxType CxxId) ","}* ">"
+ CxxType CxxId "(" {(CxxType CxxId) ","}* ")" ";" -> CxxTopLevel {cons("CxxFun")}
+
+ CxxId ("<" {CxxType ","}* ">")? "(" {(CxxType CxxId) ","}* ")" ";" -> CxxTopLevel {cons("CxxFunCall")}
+
+ CxxDecl -> CxxTopLevel
+
+ CxxTopLevel* -> CxxTopLevel
Index: branches/scool-ng/src/cxx-syn/CxxScope.sdf
===================================================================
Index: branches/scool-ng/src/cxx-syn/Cxx.str
===================================================================
--- branches/scool-ng/src/cxx-syn/Cxx.str (revision 0)
+++ branches/scool-ng/src/cxx-syn/Cxx.str (revision 63)
@@ -0,0 +1,59 @@
+module Cxx
+
+signature
+ constructors
+ : List(CxxType) -> ListStarOfCxxType0
+ : CxxAccessModifier * CxxId -> CxxAccessModifier_CxxId0
+ : CxxType * CxxId -> CxxType_CxxId0
+ : List(CxxType_CxxId0) -> ListStarOfCxxType_CxxId1
+ : CxxExp -> CxxExp0
+ CxxProgram : CxxTopLevel -> CxxProgram
+ CxxExpStm : CxxExp -> CxxStm
+ : CxxDecl -> CxxStm
+ : List(CxxTopLevel) -> CxxTopLevel
+ : CxxDecl -> CxxTopLevel
+ CxxFunCall : CxxId * Option(ListStarOfCxxType0) * List(CxxType_CxxId0) -> CxxTopLevel
+ CxxFun : List(CxxType_CxxId0) * CxxType * CxxId * List(CxxType_CxxId0) -> CxxTopLevel
+ CxxFun : List(CxxType_CxxId0) * CxxType * CxxId * List(CxxType_CxxId0) * List(CxxStm) -> CxxTopLevel
+ CxxPrivate : List(CxxTopLevel) -> CxxTopLevel
+ CxxProtected : List(CxxTopLevel) -> CxxTopLevel
+ CxxPublic : List(CxxTopLevel) -> CxxTopLevel
+ CxxComment : CxxText -> CxxTopLevel
+ CxxClassDecl : List(CxxType_CxxId0) * CxxId * List(CxxAccessModifier_CxxId0) * List(CxxDecl) -> CxxDecl
+ CxxClassDecl : List(CxxType_CxxId0) * CxxId * List(CxxAccessModifier_CxxId0) -> CxxDecl
+ CxxTypedef : CxxType * CxxId -> CxxDecl
+ CxxDecl : CxxType * CxxType * CxxType * Option(ListStarOfCxxType_CxxId1) -> CxxDecl
+ CxxDecl : CxxType * CxxId * CxxExp -> CxxDecl
+ CxxArrayDecl : CxxType * CxxId * Option(CxxExp0) -> CxxDecl
+ CxxDecl : CxxType * CxxId -> CxxDecl
+ CxxAffect : CxxDecl * CxxExp -> CxxExp
+ CxxAdressOf : CxxExp -> CxxExp
+ CxxSum : CxxExp * CxxExp -> CxxExp
+ CxxAffect : CxxId * CxxExp -> CxxExp
+ CxxKeyword : CxxId * CxxExp -> CxxExp
+ CxxFunCall : CxxId * List(CxxExp) -> CxxExp
+ CxxInt : CxxInt -> CxxExp
+ CxxTypename : CxxType -> CxxType
+ Typename : CxxType
+ CxxRefType : CxxType -> CxxType
+ CxxConstType : CxxType -> CxxType
+ CxxType : CxxId * List(CxxType) -> CxxType
+ CxxType : CxxId -> CxxType
+ : String -> CxxAccessModifier
+ : String -> CxxInt
+ CxxScope : CxxType * CxxId -> CxxId
+ : String -> CxxId
+ : String -> CxxText
+
+
+signature
+ constructors
+ Some : a -> Option(a)
+ None : Option(a)
+
+
+signature
+ constructors
+ Cons : a * List(a) -> List(a)
+ Nil : List(a)
+ Conc : List(a) * List(a) -> List(a)
Index: branches/scool-ng/src/cxx-syn/Makefile.am
===================================================================
--- branches/scool-ng/src/cxx-syn/Makefile.am (revision 0)
+++ branches/scool-ng/src/cxx-syn/Makefile.am (revision 63)
@@ -0,0 +1,19 @@
+# Makefile.am -*-Makefile-*-
+
+MODULES = Cxx
+SDFS = Cxx CxxDecl CxxExp CxxFun CxxScope CxxStm CxxType Lexical
+
+include $(top_srcdir)/config/Makefile.xt
+-include $(MODULES:=.dep)
+
+PGEN_FLAGS = -m $*
+SDF2RTG_FLAGS = -m $*
+SCFLAGS = -m $* --verbose 0
+
+pkgdata_DATA = $(MODULES:=.def) \
+ $(MODULES:=.tbl) \
+ $(MODULES:=.str) \
+ $(MODULES:=.rtree)
+
+EXTRA_DIST = $(SDFS:=.sdf) $(MODULES:=.sdf)
+CLEANFILES = $(pkgdata_DATA) $(MODULES:=.dep)
Index: branches/scool-ng/src/cxx-syn/CxxExp.sdf
===================================================================
--- branches/scool-ng/src/cxx-syn/CxxExp.sdf (revision 0)
+++ branches/scool-ng/src/cxx-syn/CxxExp.sdf (revision 63)
@@ -0,0 +1,15 @@
+module CxxExp
+
+imports
+ Lexical
+
+exports
+ sorts CxxExp
+ context-free syntax
+
+ CxxInt -> CxxExp {cons("CxxInt")}
+ CxxId "(" {CxxExp ","}* ")" -> CxxExp {cons("CxxFunCall")}
+ CxxId CxxExp ";" -> CxxExp {cons("CxxKeyword")}
+ CxxId "=" CxxExp ";" -> CxxExp {cons("CxxAffect")}
+ CxxExp "+" CxxExp -> CxxExp {cons("CxxSum")}
+ "&" CxxExp -> CxxExp {cons("CxxAdressOf")}
Index: branches/scool-ng/src/cxx-syn/Lexical.sdf
===================================================================
--- branches/scool-ng/src/cxx-syn/Lexical.sdf (revision 0)
+++ branches/scool-ng/src/cxx-syn/Lexical.sdf (revision 63)
@@ -0,0 +1,15 @@
+module Lexical
+
+exports
+ sorts CxxId CxxInt CxxAccessModifier CxxText
+ lexical syntax
+
+ ~[]* -> CxxText
+ [a-zA-Z0-9]+ -> CxxId
+ [0-9]+ -> CxxInt
+ "private" -> CxxAccessModifier
+ "public" -> CxxAccessModifier
+ "protected" -> CxxAccessModifier
+
+ context-free syntax
+ CxxType "::" CxxId -> CxxId {cons("CxxScope")}
Index: branches/scool-ng/src/cxx-syn/Cxx.sdf
===================================================================
--- branches/scool-ng/src/cxx-syn/Cxx.sdf (revision 0)
+++ branches/scool-ng/src/cxx-syn/Cxx.sdf (revision 63)
@@ -0,0 +1,12 @@
+module Cxx
+
+imports
+ CxxDecl CxxFun
+
+exports
+ sorts CxxProgram CxxTopLevel
+ context-free start-symbols CxxProgram
+ context-free syntax
+
+ CxxTopLevel -> CxxProgram {cons("CxxProgram")}
+
Index: branches/scool-ng/COPYING
===================================================================
--- branches/scool-ng/COPYING (revision 0)
+++ branches/scool-ng/COPYING (revision 63)
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991, 2006 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
Index: branches/scool-ng/bin/pp-cxx
===================================================================
--- branches/scool-ng/bin/pp-cxx (revision 0)
+++ branches/scool-ng/bin/pp-cxx (revision 63)
@@ -0,0 +1 @@
+link ../src/pp-cxx
\ No newline at end of file
Property changes on: branches/scool-ng/bin/pp-cxx
___________________________________________________________________
Name: svn:special
+ *
Index: branches/scool-ng/Makefile.am
===================================================================
--- branches/scool-ng/Makefile.am (revision 0)
+++ branches/scool-ng/Makefile.am (revision 63)
@@ -0,0 +1,10 @@
+# Makefile.am -*-Makefile-*-
+
+include $(top_srcdir)/config/Makefile.xt
+
+XTC_IMPORT = $(STRATEGOXT)/share/strategoxt/XTC \
+ $(GENERIC_TOOLS_XTC)
+CLEANFILES = XTC
+BOOTCLEAN_SUBDIRS = $(SUBDIRS)
+ACLOCAL_AMFLAGS = -I config
+SUBDIRS = . config src
Index: branches/scool-ng/vcs/scool.rb
===================================================================
--- branches/scool-ng/vcs/scool.rb (revision 0)
+++ branches/scool-ng/vcs/scool.rb (revision 63)
@@ -0,0 +1,18 @@
+class Vcs
+
+ # See http://rubyforge.org/projects/vcs
+ # and http://vcs.rubyforge.org
+
+ protocol_version '0.1'
+
+ def scool_commit! ( *args )
+ common_commit!("scool <%= rev %>: <%= title %>", *args) do |subject|
+ mail!(:to => %w[transformers-patches(a)lrde.epita.fr
+ olena-patches(a)lrde.epita.fr]
+ :subject => subject)
+ end
+ end
+ alias_command :sclci, :scool_commit
+ default_commit :scool_commit
+
+end # class Vcs
Index: branches/scool-ng/NEWS
===================================================================
Index: branches/scool-ng/Makefile
===================================================================
--- branches/scool-ng/Makefile (revision 0)
+++ branches/scool-ng/Makefile (revision 63)
@@ -0,0 +1,918 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile. Generated from Makefile.in by configure.
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+# Makefile.am -*-Makefile-*-
+
+###########################################################
+# File: Makefile.xt
+#
+# autoxt
+#
+# Description
+#
+# This Makefile provides support for compiling Stratego
+# programs and use of some other XT tools.
+#
+###########################################################
+#
+# Variables
+#
+
+pkgdatadir = $(datadir)/scool
+pkglibdir = $(libdir)/scool
+pkgincludedir = $(includedir)/scool
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = i686-pc-linux-gnu
+host_triplet = i686-pc-linux-gnu
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(top_srcdir)/config/Makefile.xt \
+ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS
+am__append_1 = -DDEFAULT_XTC_REPOSITORY="\"$(REPOSITORY)\""
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/autoxt.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = ${SHELL} /lrde/beyrouth/lrde-2009/van-noppen/work/scool/branches/scool-ng/config/missing --run aclocal-1.10
+AMTAR = ${SHELL} /lrde/beyrouth/lrde-2009/van-noppen/work/scool/branches/scool-ng/config/missing --run tar
+AR = ar
+ASFIX_TOOLS = $(STRATEGOXT)
+ASF_LIBRARY = $(SDF)
+ATERM = /nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238
+ATERM_CFLAGS = -I/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/include
+ATERM_FRONT = $(STRATEGOXT)
+ATERM_LIBS = -L/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/lib -lATerm
+ATERM_STRCFLAGS =
+ATERM_XTC =
+AUTOCONF = ${SHELL} /lrde/beyrouth/lrde-2009/van-noppen/work/scool/branches/scool-ng/config/missing --run autoconf
+AUTOHEADER = ${SHELL} /lrde/beyrouth/lrde-2009/van-noppen/work/scool/branches/scool-ng/config/missing --run autoheader
+AUTOMAKE = ${SHELL} /lrde/beyrouth/lrde-2009/van-noppen/work/scool/branches/scool-ng/config/missing --run automake-1.10
+AWK = gawk
+BUILD_REPOSITORY = /lrde/beyrouth/lrde-2009/van-noppen/work/scool/branches/scool-ng/BUILDTIME_XTC
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -g -O2
+CONCRETE_SYNTAX = $(STRATEGOXT)
+CPP = gcc -E
+CPPFLAGS =
+CXX = g++
+CXXCPP = g++ -E
+CXXDEPMODE = depmode=gcc3
+CXXFLAGS = -g -O2
+CYGPATH_W = echo
+C_TOOLS = /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707
+C_TOOLS_CFLAGS = -I/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/include -I/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/include
+C_TOOLS_LIBS = -L/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib -L/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/lib -lstratego-lib -lstratego-lib-native -lstratego-runtime -lm -lATerm
+C_TOOLS_STRCFLAGS = -I /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/share/c-tools -I /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/share/sdf/c-tools
+C_TOOLS_XTC =
+DEFS = -DPACKAGE_NAME=\"scool\" -DPACKAGE_TARNAME=\"scool\" -DPACKAGE_VERSION=\"0.1\" -DPACKAGE_STRING=\"scool\ 0.1\" -DPACKAGE_BUGREPORT=\"yabo(a)lrde.epita.fr\" -DPACKAGE=\"scool\" -DVERSION=\"0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=4 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 -DSIZEOF_DOUBLE=8 -DHAVE_DLFCN_H=1
+DEPDIR = .deps
+DSYMUTIL =
+ECHO = echo
+ECHO_C =
+ECHO_N = -n
+ECHO_T =
+EGREP = /bin/grep -E
+EXEEXT =
+F77 = g77
+FFLAGS = -g -O2
+GPP = $(STRATEGOXT)
+GREP = /bin/grep
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LDFLAGS =
+LIBOBJS =
+LIBS =
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LN_S = ln -s
+LTLIBOBJS =
+MAKEINFO = ${SHELL} /lrde/beyrouth/lrde-2009/van-noppen/work/scool/branches/scool-ng/config/missing --run makeinfo
+MKDIR_P = /bin/mkdir -p
+NMEDIT =
+OBJEXT = o
+PACKAGE = scool
+PACKAGE_BUGREPORT = yabo(a)lrde.epita.fr
+PACKAGE_NAME = scool
+PACKAGE_STRING = scool 0.1
+PACKAGE_TARNAME = scool
+PACKAGE_VERSION = 0.1
+PATH_SEPARATOR = :
+PGEN = $(SDF)
+PKG_CONFIG = /usr/bin/pkg-config
+PT_SUPPORT = $(SDF)
+RANLIB = ranlib
+REPOSITORY = ${datarootdir}/scool/XTC
+SCOMPILE = $(STRC)/bin/strc
+SDF = /nix/store/9irdd9ajrx7g4bp7cshy12haj6ax12jj-sdf2-bundle-2.4pre212034
+SDF_CFLAGS = -I/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/include
+SDF_FRONT = $(STRATEGOXT)
+SDF_LIBRARY = $(SDF)
+SDF_LIBS = -L/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/lib -lATerm
+SDF_STRCFLAGS =
+SDF_TOOLS = $(STRATEGOXT)
+SDF_XTC =
+SED = /bin/sed
+SET_MAKE =
+SGLR = $(SDF)
+SHELL = /bin/sh
+SRTS = $(STRATEGO_RUNTIME)
+STRATEGOXT = /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707
+STRATEGOXT_CFLAGS =
+STRATEGOXT_LIBS =
+STRATEGOXT_STRCFLAGS =
+STRATEGOXT_XTC = /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/share/strategoxt/XTC
+STRATEGO_ATERM = /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707
+STRATEGO_ATERM_CFLAGS = -I/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/include -I/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/include
+STRATEGO_ATERM_LIBS = -L/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib -L/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/lib -lstratego-aterm -lstratego-gpp -lstratego-sglr -lstratego-lib -lstratego-lib-native -lstratego-runtime -lm -lATerm
+STRATEGO_ATERM_STRCFLAGS = -I /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/share -la /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib/libstratego-aterm.la
+STRATEGO_ATERM_XTC =
+STRATEGO_FRONT = $(STRATEGOXT)
+STRATEGO_GPP = /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707
+STRATEGO_GPP_CFLAGS = -I/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/include -I/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/include
+STRATEGO_GPP_LIBS = -L/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib -L/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/lib -lstratego-gpp -lstratego-sglr -lstratego-lib -lstratego-lib-native -lstratego-runtime -lm -lATerm
+STRATEGO_GPP_STRCFLAGS = -I /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/share -I /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/share/sdf/gpp -la /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib/libstratego-gpp.la
+STRATEGO_GPP_XTC =
+STRATEGO_LIB = /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707
+STRATEGO_LIBRARIES =
+STRATEGO_LIB_CFLAGS = -I/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/include -I/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/include
+STRATEGO_LIB_LIBS = -L/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib -L/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/lib -lstratego-lib -lstratego-lib-native -lstratego-runtime -lm -lATerm
+STRATEGO_LIB_STRCFLAGS = -I /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/share -la /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib/libstratego-lib.la
+STRATEGO_LIB_XTC =
+STRATEGO_REGULAR = $(STRATEGOXT)
+STRATEGO_RTG = /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707
+STRATEGO_RTG_CFLAGS = -I/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/include -I/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/include
+STRATEGO_RTG_LIBS = -L/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib -L/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/lib -lstratego-rtg -lstratego-sglr -lstratego-lib -lstratego-lib-native -lstratego-runtime -lm -lATerm
+STRATEGO_RTG_STRCFLAGS = -I /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/share -la /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib/libstratego-rtg.la
+STRATEGO_RTG_XTC =
+STRATEGO_RUNTIME = /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707
+STRATEGO_RUNTIME_CFLAGS = -I/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/include -I/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/include
+STRATEGO_RUNTIME_LIBS = -L/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib -L/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/lib -lstratego-runtime -lm -lATerm
+STRATEGO_RUNTIME_STRCFLAGS =
+STRATEGO_RUNTIME_XTC =
+STRATEGO_SDF = /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707
+STRATEGO_SDF_CFLAGS = -I/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/include -I/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/include
+STRATEGO_SDF_LIBS = -L/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib -L/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/lib -lstratego-sdf -lstratego-aterm -lstratego-gpp -lstratego-sglr -lstratego-lib -lstratego-lib-native -lstratego-runtime -lm -lATerm
+STRATEGO_SDF_STRCFLAGS = -I /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/share -la /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib/libstratego-sdf.la
+STRATEGO_SDF_XTC =
+STRATEGO_SGLR = /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707
+STRATEGO_SGLR_CFLAGS = -I/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/include -I/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/include
+STRATEGO_SGLR_LIBS = -L/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib -L/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/lib -lstratego-sglr -lstratego-lib -lstratego-lib-native -lstratego-runtime -lm -lATerm
+STRATEGO_SGLR_STRCFLAGS = -I /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/share -la /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib/libstratego-sglr.la
+STRATEGO_SGLR_XTC =
+STRATEGO_TOOL_DOC = /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707
+STRATEGO_TOOL_DOC_CFLAGS = -I/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/include -I/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/include
+STRATEGO_TOOL_DOC_LIBS = -L/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib -L/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/lib -lstratego-tool-doc -lstratego-gpp -lstratego-sglr -lstratego-lib -lstratego-lib-native -lstratego-runtime -lm -lATerm
+STRATEGO_TOOL_DOC_STRCFLAGS = -I /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/share -la /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib/libstratego-tool-doc.la
+STRATEGO_TOOL_DOC_XTC =
+STRATEGO_XTC = /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707
+STRATEGO_XTC_CFLAGS = -I/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/include -I/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/include
+STRATEGO_XTC_LIBS = -L/nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib -L/nix/store/y0mmwp9r3l0vk1vifhha67sv0y2p5gl0-aterm-2.5pre21238/lib -lstratego-xtc -lstratego-lib -lstratego-lib-native -lstratego-runtime -lm -lATerm
+STRATEGO_XTC_STRCFLAGS = -I /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/share -la /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/lib/libstratego-xtc.la
+STRATEGO_XTC_XTC =
+STRC = $(STRATEGOXT)
+STRIP = strip
+STR_CFLAGS = -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -Wno-unused-parameter
+STR_LDFLAGS =
+VERSION = 0.1
+XML_FRONT = $(STRATEGOXT)
+XTC = /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707
+XTC_CFLAGS =
+XTC_LIBS = $(STRATEGO_XTC_LIBS)
+XTC_PROG = /nix/store/k0b6445kc49a72cy8fyg2r36cgldcycg-strategoxt-0.17M3pre17707/bin/xtc
+XTC_STRCFLAGS = $(STRATEGO_XTC_STRCFLAGS)
+XTC_XTC =
+abs_builddir = /lrde/beyrouth/lrde-2009/van-noppen/work/scool/branches/scool-ng
+abs_srcdir = /lrde/beyrouth/lrde-2009/van-noppen/work/scool/branches/scool-ng
+abs_top_builddir = /lrde/beyrouth/lrde-2009/van-noppen/work/scool/branches/scool-ng
+abs_top_srcdir = /lrde/beyrouth/lrde-2009/van-noppen/work/scool/branches/scool-ng
+ac_ct_CC = gcc
+ac_ct_CXX = g++
+ac_ct_F77 = g77
+am__include = include
+am__leading_dot = .
+am__quote =
+am__tar = ${AMTAR} chof - "$$tardir"
+am__untar = ${AMTAR} xf -
+bindir = ${exec_prefix}/bin
+build = i686-pc-linux-gnu
+build_alias =
+build_cpu = i686
+build_os = linux-gnu
+build_vendor = pc
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host = i686-pc-linux-gnu
+host_alias =
+host_cpu = i686
+host_os = linux-gnu
+host_vendor = pc
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = $(SHELL) /lrde/beyrouth/lrde-2009/van-noppen/work/scool/branches/scool-ng/config/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = /bin/mkdir -p
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr/local
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target_alias =
+top_builddir = .
+top_srcdir = .
+AM_CFLAGS = $(STR_CFLAGS) $(am__append_1)
+AM_LDFLAGS = $(STR_LDFLAGS)
+AM_CPPFLAGS = $(STRATEGO_LIB_CFLAGS) $(STRATEGO_RUNTIME_CFLAGS) $(ATERM_CFLAGS)
+LDADD = $(STRATEGO_LIB_LIBS) $(STRATEGO_RUNTIME_LIBS) $(ATERM_LIBS)
+
+# backwards compatibilty: prefer STRATEGO_LIB_LIBS and STRATEGO_RUNTIME_LIBS in new code.
+SSL_LIBS = $(ATERM_LIBS) $(STRATEGO_XTC_LIBS) $(STRATEGO_LIB_LIBS) $(STRATEGO_RUNTIME_LIBS) $(ATERM_LIBS)
+STRATEGORUNLIBS = $(STRATEGO_RUNTIME_LIBS)
+SUFFIXES = .str .cr .r .rtree .def .tbl .pp .sdf .rtg .rtg-nf .dfta
+PARSESTRATEGO = $(STRATEGO_FRONT)/bin/parse-stratego
+pkgconfigdir = $(libdir)/pkgconfig
+sdfdatadir = $(datadir)/sdf/$(PACKAGE)
+docdatadir = $(datadir)/doc/$(PACKAGE)
+
+###########################################################
+#
+# Makerules for XTC
+#
+XTCFLAGS = -I $(XTC)/share/xtc
+DREPOSITORY = $(DESTDIR)$(REPOSITORY)
+XTC_IMPORT = $(STRATEGOXT)/share/strategoxt/XTC \
+ $(GENERIC_TOOLS_XTC)
+
+CLEANFILES = XTC
+BOOTCLEAN_SUBDIRS = $(SUBDIRS)
+ACLOCAL_AMFLAGS = -I config
+SUBDIRS = . config src
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .str .cr .r .rtree .def .tbl .pp .sdf .rtg .rtg-nf .dfta .c
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/Makefile.xt $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
+ cd $(srcdir) && $(AUTOMAKE) --gnu \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d $(distdir) || mkdir $(distdir)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+#all-local:
+all-am: Makefile all-local
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+#install-data-local:
+#install-exec-local:
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-data-local
+
+install-dvi: install-dvi-recursive
+
+install-exec-am: install-exec-local
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am all-local am--refresh check check-am clean \
+ clean-generic clean-libtool ctags ctags-recursive dist \
+ dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \
+ dist-zip distcheck distclean distclean-generic \
+ distclean-libtool distclean-tags distcleancheck distdir \
+ distuninstallcheck dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am \
+ install-data-local install-dvi install-dvi-am install-exec \
+ install-exec-am install-exec-local install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+###########################################################
+#
+# Make rules for Stratego programs
+#
+
+.str.c :
+ $(SCOMPILE) $(STRINCLUDES) $(STRCFLAGS) $(SCFLAGS) -i $< -o $@ -c
+
+.str.rtree :
+ $(PARSESTRATEGO) $(STRINCLUDES) -i $< -o $@
+
+.rtree.c :
+ $(SCOMPILE) $(STRINCLUDES) $(STRCFLAGS) $(SCFLAGS) -i $< -o $@ -c
+
+bootclean-am: clean-am
+ -test -z "$(BOOTCLEANFILES)" || rm -f $(BOOTCLEANFILES)
+
+bootclean : bootclean-recursive
+
+bootclean-recursive :
+ @dot_seen=no; \
+ target=bootclean; \
+ list='$(BOOTCLEAN_SUBDIRS) .'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+###########################################################
+#
+# Makerules for SDF definitions
+#
+
+.sdf.def :
+ $(SDF_FRONT)/bin/pack-sdf $(SDFINCLUDES) -i $< -o $@ --dep $*.dep
+
+.def.tbl :
+ $(PGEN)/bin/sdf2table $(PGEN_FLAGS) -i $< -o $@
+
+###########################################################
+#
+# Makerules for GPP
+#
+
+%.pp.af : %.pp
+ $(GPP)/bin/parse-pp-table -i $< -o $@
+
+.def.pp :
+ @if [ ! -f ${srcdir}/$@ ]; then \
+ $(GPP)/bin/ppgen -i $< -o $@ ;\
+ else \
+ $(GPP)/bin/parse-pp-table -i ${srcdir}/$@ -o $@.af ;\
+ $(GPP)/bin/ppgen -t -i $< \
+ | $(GPP)/bin/pptable-diff --old $@.af 2>&1 || \
+ eval "echo '## pptable-diff error: $@ is not consistent with syntax definition' >&2; exit 1";\
+ touch $@ ;\
+ $(RM) $@.af ;\
+ fi
+
+###########################################################
+#
+# Makerules for Stratego Regular
+#
+
+.def.rtg :
+ $(STRATEGO_REGULAR)/bin/sdf2rtg $(SDF2RTG_FLAGS) -i $< -o $@
+
+.rtg.str :
+ $(STRATEGO_REGULAR)/bin/rtg2sig --module `basename "$*"` -i $< -o $@
+
+.rtg.rtg-nf :
+ $(STRATEGO_REGULAR)/bin/parse-rtg -i $< | \
+ $(STRATEGO_REGULAR)/libexec/rtg-reduce | \
+ $(STRATEGO_REGULAR)/libexec/rtg-group -o $@
+
+.rtg.dfta :
+ $(STRATEGO_REGULAR)/bin/rtg2dfta -i $< -o $@
+
+relname:
+ echo -n $(distdir) > relname
+
+install-data-local::
+ $(mkinstalldirs) `dirname $(DREPOSITORY)`
+ @for file in fordummy $(XTC_IMPORT) ; do \
+ if [ "$$file" = "fordummy" ]; then continue; fi; \
+ $(XTC_PROG) -r $(DREPOSITORY) import $$file ; \
+ echo $(XTC_PROG) -r $(DREPOSITORY) import $$file ; \
+ done
+ @for file in fordummy $(pkgdata_DATA) ; do \
+ if [ "$$file" = "fordummy" ]; then continue; fi; \
+ $(XTC_PROG) -r $(DREPOSITORY) register -l $(pkgdatadir) -V $(VERSION) -t `basename $$file` ; \
+ done
+ @for file in fordummy $(nobase_pkgdata_DATA) ; do \
+ if [ "$$file" = "fordummy" ]; then continue; fi; \
+ $(XTC_PROG) -r $(DREPOSITORY) register -l $(pkgdatadir) -V $(VERSION) -t $$file ; \
+ done
+ @for file in fordummy $(sdfdata_DATA) ; do \
+ if [ "$$file" = "fordummy" ]; then continue; fi; \
+ $(XTC_PROG) -r $(DREPOSITORY) register -l $(sdfdatadir) -V $(VERSION) -t `basename $$file` ; \
+ done
+ @for file in fordummy $(nobase_sdfdata_DATA) ; do \
+ if [ "$$file" = "fordummy" ]; then continue; fi; \
+ $(XTC_PROG) -r $(DREPOSITORY) register -l $(sdfdatadir) -V $(VERSION) -t $$file ; \
+ done
+ @for file in fordummy $(data_DATA) ; do \
+ if [ "$$file" = "fordummy" ]; then continue; fi; \
+ $(XTC_PROG) -r $(DREPOSITORY) register -l $(datadir) -V $(VERSION) -t `basename $$file` ; \
+ done
+ @for file in fordummy $(nobase_data_DATA) ; do \
+ if [ "$$file" = "fordummy" ]; then continue; fi; \
+ $(XTC_PROG) -r $(DREPOSITORY) register -l $(datadir) -V $(VERSION) -t $$file ; \
+ done
+ @echo "Data registered in repository $(DREPOSITORY): $(data_DATA) $(nobase_data_DATA) $(pkgdata_DATA) $(nobase_pkgdata_DATA) $(sdfdata_DATA) $(nobase_sdfdata_DATA)"
+
+install-exec-local::
+ $(mkinstalldirs) `dirname $(DREPOSITORY)`
+ @for file in fordummy $(bin_PROGRAMS) $(bin_SCRIPTS) ; do \
+ if [ "$$file" = "fordummy" ]; then continue; fi; \
+ $(XTC_PROG) -r $(DREPOSITORY) register -l $(bindir) -V $(VERSION) -t `basename $$file $(EXEEXT)` ; \
+ done
+ @for file in fordummy $(libexec_PROGRAMS) $(libexec_SCRIPTS) ; do \
+ if [ "$$file" = "fordummy" ]; then continue; fi; \
+ $(XTC_PROG) -r $(DREPOSITORY) register -l $(libexecdir) -V $(VERSION) -t `basename $$file $(EXEEXT)` ; \
+ done
+ @echo "Tools registered in repository $(DREPOSITORY): $(bin_PROGRAMS) $(bin_SCRIPTS) $(libexec_PROGRAMS) $(libexec_SCRIPTS)"
+
+all-local::
+ @for file in fordummy $(XTC_IMPORT) ; do \
+ if [ "$$file" = "fordummy" ]; then continue; fi; \
+ $(XTC_PROG) -r $(BUILD_REPOSITORY) import $$file ; \
+ echo $(XTC_PROG) -r $(BUILD_REPOSITORY) import $$file ; \
+ done
+ @for file in fordummy $(data_DATA) $(pkgdata_DATA) $(sdfdata_DATA) $(bin_SCRIPTS) $(libexec_SCRIPTS); do \
+ if [ "$$file" = "fordummy" ]; then continue; fi; \
+ if test -f "$$file"; then d="`pwd`"; else d="/lrde/beyrouth/lrde-2009/van-noppen/work/scool/branches/scool-ng"; fi; \
+ $(XTC_PROG) -r $(BUILD_REPOSITORY) register -l "$$d" -V $(VERSION) -t `basename $$file` ; \
+ done
+ @for file in fordummy $(nobase_data_DATA) $(nobase_pkgdata_DATA) $(nobase_sdfdata_DATA) ; do \
+ if [ "$$file" = "fordummy" ]; then continue; fi; \
+ if test -f "$$file"; then d="`pwd`"; else d="/lrde/beyrouth/lrde-2009/van-noppen/work/scool/branches/scool-ng"; fi; \
+ $(XTC_PROG) -r $(BUILD_REPOSITORY) register -l "$$d" -V $(VERSION) -t $$file ; \
+ done
+ @for file in fordummy $(bin_PROGRAMS) $(libexec_PROGRAMS) ; do \
+ if [ "$$file" = "fordummy" ]; then continue; fi; \
+ if test -f "$$file"; then d="`pwd`"; else d="/lrde/beyrouth/lrde-2009/van-noppen/work/scool/branches/scool-ng"; fi; \
+ $(XTC_PROG) -r $(BUILD_REPOSITORY) register -l "$$d" -V $(VERSION) -t `basename $$file $(EXEEXT)` ; \
+ done
+ @echo "Tools registered in repository $(BUILD_REPOSITORY): $(bin_PROGRAMS) $(bin_SCRIPTS) $(libexec_PROGRAMS) $(libexec_SCRIPTS)"
+ @echo "Data registered in repository $(BUILD_REPOSITORY): $(data_DATA) $(nobase_data_DATA) $(pkgdata_DATA) $(nobase_pkgdata_DATA) $(sdfdata_DATA) $(nobase_sdfdata_DATA)"
+
+###########################################################
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: branches/scool-ng/README
===================================================================
Index: branches/scool-ng/bootstrap
===================================================================
--- branches/scool-ng/bootstrap (revision 0)
+++ branches/scool-ng/bootstrap (revision 63)
@@ -0,0 +1,7 @@
+#!/bin/sh -e
+
+here=`pwd`
+cd config
+ autoxt
+cd $here
+autoreconf -f -i --verbose
Property changes on: branches/scool-ng/bootstrap
___________________________________________________________________
Name: svn:executable
+ *
Property changes on: branches/scool-ng
___________________________________________________________________
Name: mailto
+ yabo(a)lrde.epita.fr
--
\__/ \__/
(00) Maxime `yabo` van Noppen (00)
___) \ Epita 2009 / (___
(_____/ \_____)
1
0
26 Jun '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Allow delayed construction of function expressions.
* mln/trait/ch_value.hh (mln_ch_value_): New.
* mln/pw/cst.hh (cst_): New ctor without arg.
* mln/fun/ops.hh (mln_decl_binary_expr_): New ctor wihtout arg
so that the definition of expr template functions involved in
image types can be delayed.
(mln_decl_unary_expr_): Likewise.
fun/ops.hh | 16 ++++++++++++----
pw/cst.hh | 10 +++++++++-
trait/ch_value.hh | 1 +
3 files changed, 22 insertions(+), 5 deletions(-)
Index: mln/trait/ch_value.hh
--- mln/trait/ch_value.hh (revision 2075)
+++ mln/trait/ch_value.hh (working copy)
@@ -38,6 +38,7 @@
# define mln_ch_value(I, V) typename mln::trait::ch_value< I, V >::ret
+# define mln_ch_value_(I, V) mln::trait::ch_value< I, V >::ret
Index: mln/pw/cst.hh
--- mln/pw/cst.hh (revision 2075)
+++ mln/pw/cst.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -50,6 +50,8 @@
{
typedef T result;
+ cst_();
+
cst_(const T& t);
template <typename P>
@@ -72,6 +74,12 @@
template <typename T>
inline
+ cst_<T>::cst_()
+ {
+ }
+
+ template <typename T>
+ inline
cst_<T>::cst_(const T& t)
: t_(t)
{
Index: mln/fun/ops.hh
--- mln/fun/ops.hh (revision 2075)
+++ mln/fun/ops.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -51,6 +51,10 @@
typedef typename mln::trait::op:: Name < mln_result(L), \
mln_result(R) >::ret result; \
\
+ Name##_##Out##_expr_() \
+ { \
+ } \
+ \
Name##_##Out##_expr_(const L& l, const R& r) \
: l_(l), r_(r) \
{ \
@@ -63,8 +67,8 @@
} \
\
protected: \
- const L l_; \
- const R r_; \
+ L l_; \
+ R r_; \
}; \
\
} \
@@ -103,6 +107,10 @@
{ \
typedef typename mln::trait::op:: Name < mln_result(F) >::ret result; \
\
+ Name##_##Out##_expr_() \
+ { \
+ } \
+ \
Name##_##Out##_expr_(const F& f) \
: f_(f) \
{ \
@@ -115,7 +123,7 @@
} \
\
protected: \
- const F f_; \
+ F f_; \
}; \
\
} \
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Géraud <thierry.geraud(a)lrde.epita.fr>
Allow delayed construction of function expressions.
* mln/trait/ch_value.hh (mln_ch_value_): New.
* mln/pw/cst.hh (cst_): New ctor without arg.
* mln/fun/ops.hh (mln_decl_binary_expr_): New ctor wihtout arg
so that the definition of expr template functions involved in
image types can be delayed.
(mln_decl_unary_expr_): Likewise.
* sandbox/folio/test/dt_maze.cc: Use...
* sandbox/folio/test/tmp.ppm: ...this new file.
* sandbox/folio/dt/canvas_dt.hh (f): Change to reference.
mln/fun/ops.hh | 16 ++++++++++++----
mln/pw/cst.hh | 7 +++++++
mln/trait/ch_value.hh | 1 +
sandbox/folio/dt/canvas_dt.hh | 2 +-
sandbox/folio/test/dt_maze.cc | 7 ++++---
5 files changed, 25 insertions(+), 8 deletions(-)
Index: mln/trait/ch_value.hh
--- mln/trait/ch_value.hh (revision 2074)
+++ mln/trait/ch_value.hh (working copy)
@@ -38,6 +38,7 @@
# define mln_ch_value(I, V) typename mln::trait::ch_value< I, V >::ret
+# define mln_ch_value_(I, V) mln::trait::ch_value< I, V >::ret
Index: mln/pw/cst.hh
--- mln/pw/cst.hh (revision 2074)
+++ mln/pw/cst.hh (working copy)
@@ -50,6 +50,7 @@
{
typedef T result;
+ cst_();
cst_(const T& t);
template <typename P>
@@ -78,6 +79,12 @@
}
template <typename T>
+ inline
+ cst_<T>::cst_()
+ {
+ }
+
+ template <typename T>
template <typename P>
inline
T
Index: mln/fun/ops.hh
--- mln/fun/ops.hh (revision 2074)
+++ mln/fun/ops.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -56,6 +56,10 @@
{ \
} \
\
+ Name##_##Out##_expr_() \
+ { \
+ } \
+ \
template <typename P> \
result operator()(const P& p) const \
{ \
@@ -63,8 +67,8 @@
} \
\
protected: \
- const L l_; \
- const R r_; \
+ L l_; \
+ R r_; \
}; \
\
} \
@@ -108,6 +112,10 @@
{ \
} \
\
+ Name##_##Out##_expr_() \
+ { \
+ } \
+ \
template <typename P> \
result operator()(const P& p) const \
{ \
@@ -115,7 +123,7 @@
} \
\
protected: \
- const F f_; \
+ F f_; \
}; \
\
} \
Index: sandbox/folio/test/dt_maze.cc
--- sandbox/folio/test/dt_maze.cc (revision 2074)
+++ sandbox/folio/test/dt_maze.cc (working copy)
@@ -20,7 +20,7 @@
#include <mln/core/sub_image.hh>
#include <mln/core/image_if.hh>
-#include <mln/pw/value.hh>
+#include <mln/pw/all.hh>
#include "../dt/path.hh"
// #include "../dt/raw_path_fast.hh"
@@ -35,7 +35,7 @@
point start;
point end;
- I ima = io::ppm::load<value::rgb8>("../img/monkeys_april.ppm");
+ I ima = io::ppm::load<value::rgb8>("tmp.ppm"); // "../img/monkeys_april.ppm");
mln_fwd_piter_(I) p(ima.domain());
mln_bkd_piter_(I) pp(ima.domain());
@@ -92,7 +92,8 @@
std::cout << " => done !" << std::endl << std::endl;
std::cout << "call path algorithm..." << std::endl;
- out = dt::path(input | pw::value(mask), make::w_window2d(ws), mln_max(unsigned));
+ out = dt::path(input | (pw::value(mask) == pw::cst(true)),
+ make::w_window2d(ws), mln_max(unsigned));
std::cout << " => done !" << std::endl << std::endl;
// Create output
Index: sandbox/folio/test/tmp.ppm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: sandbox/folio/test/tmp.ppm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: sandbox/folio/dt/canvas_dt.hh
--- sandbox/folio/dt/canvas_dt.hh (revision 2074)
+++ sandbox/folio/dt/canvas_dt.hh (working copy)
@@ -55,7 +55,7 @@
private:
// Functor.
- F f;
+ F& f;
void init();
void run();
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Have beguin/irm compile again.
* beguin/irm.cc: Catch up with the interface of
mln::util::vertex_id.
(my_mln::merge_fg): Remove a useless `typename'.
irm.cc | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: beguin/irm.cc
--- beguin/irm.cc (revision 2073)
+++ beguin/irm.cc (working copy)
@@ -314,7 +314,7 @@
fusion_graph fg;
// Vertices.
- for (util::vertex_id i = 0; i < rag.nvertices(); ++i)
+ for (util::vertex_id i = 0; i < rag.nvertices(); ++i.to_equiv())
{
// The singleton subregion: { I }.
std::set<util::vertex_id> sr;
@@ -350,7 +350,7 @@
// A disjoint set of vertices represented as a forest of rooted
// trees (disjoint set forest).
std::vector<util::vertex_id> parent(input.nvertices());
- for (util::vertex_id i = 0; i < parent.size(); ++i)
+ for (util::vertex_id i = 0; i < parent.size(); ++i.to_equiv())
// � make_set �.
parent[i] = i;
@@ -370,7 +370,7 @@
// Children.
typedef std::multimap<util::vertex_id, util::vertex_id> children_t;
children_t children;
- for (typename util::vertex_id i = 0; i < parent.size(); ++i)
+ for (util::vertex_id i = 0; i < parent.size(); ++i.to_equiv())
{
// � find �.
util::vertex_id r = i;
@@ -507,7 +507,7 @@
// Compute the values (means) for the output image.
std::map<util::vertex_id, int_u8> region_value;
- for (util::vertex_id v = 0; v < fg.nvertices(); ++v)
+ for (util::vertex_id v = 0; v < fg.nvertices(); ++v.to_equiv())
{
// FIXME: Implicit cast. We should rather change the type of
// the accumulator instead.
1
0
cleanup-2008 2072: Add some technical documentation to iterator base classes.
by Thierry Géraud 24 Jun '08
by Thierry Géraud 24 Jun '08
24 Jun '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Géraud <thierry.geraud(a)lrde.epita.fr>
Add some technical documentation to iterator base classes.
* mln/core/internal/site_relative_iterator_base.hh: Add some
documentation.
* mln/core/internal/site_iterator_base.hh: Likewise.
site_iterator_base.hh | 7 ++++---
site_relative_iterator_base.hh | 26 +++++++++++++++++---------
2 files changed, 21 insertions(+), 12 deletions(-)
Index: mln/core/internal/site_relative_iterator_base.hh
--- mln/core/internal/site_relative_iterator_base.hh (revision 2071)
+++ mln/core/internal/site_relative_iterator_base.hh (working copy)
@@ -50,8 +50,11 @@
/*! \brief A generic forward iterator on points of windows and of
* neighborhoods.
*
- * The parameter \c S is the type of std::vector enclosing
- * structure.
+ * Parameter \c S is the targeted "site set definition" type. It
+ * can be either a Window, or a Neighborhood.
+ *
+ * IMPORTANT: Sub-classes have to define do_start_, do_next_, and
+ * compute_p_. They shall define NEITHER start_ NOR next_.
*/
template <typename S, typename E>
class site_relative_iterator_base : public site_iterator_base< S, E >
@@ -79,11 +82,11 @@
/// The psite around which this iterator moves.
const mln_psite(S)& center() const;
- /// Overriding that adds a test to prevent getting an invalid
- /// iterator when its center has moved. Some sub-classes
- /// provide an update() method for the client to say that she
- /// really want to read the iterator just after the center has
- /// changed.
+ /// This overriding is very useful: it adds a test to prevent
+ /// getting an invalid iterator when its center has moved. Some
+ /// sub-classes provide an update() method for the client to say
+ /// that she really want to read the iterator just after the
+ /// center has changed.
const mln_psite(S)& unproxy() const;
/// Hook to the current location.
@@ -92,12 +95,17 @@
/// Change the site set targeted by this iterator.
void change_target(const S& s);
- /// FIXME: import doc from home.
+ /// Warning: this method is an advanced tool provided for very
+ /// special occasions; if you are a regular user, you should
+ /// never use it! Calling this method forces this relative
+ /// iterator to synchronize with its center when it has just
+ /// moved and when the relative iterator still makes sense.
E& update();
protected:
- /// A pointer to the center psite.
+ /// A pointer to the center psite around which this iterator
+ /// moves.
const mln_psite(S)* c_;
private:
Index: mln/core/internal/site_iterator_base.hh
--- mln/core/internal/site_iterator_base.hh (revision 2071)
+++ mln/core/internal/site_iterator_base.hh (working copy)
@@ -53,10 +53,11 @@
*
* NEVER DIRECTLY DERIVE FROM THIS CLASS.
*
- * Instead derive from EITHER site_set_iterator_base OR
- * site_relative_iterator_base.
+ * Instead derive EITHER from site_set_iterator_base OR from
+ * site_relative_iterator_base OR from piter_adaptor_.
*
- * Parameter \c S is the targeted site set type.
+ * Parameter \c S is the targeted "site set definition" type. It
+ * can be either a Site_Set, a Window, or a Neighborhood.
*/
template <typename S, typename E>
struct site_iterator_base : Site_Iterator<E>,
1
0
***SPAM*** L3 cleanup-2008 2070: Prefer delegation to impl inheritance for neighborhood.
by Thierry Geraud 24 Jun '08
by Thierry Geraud 24 Jun '08
24 Jun '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Prefer delegation to impl inheritance for neighborhood.
* doc/tutorial/examples/window.cc: Test make.
* mln/core/internal/basic_window_impl.hh: Remove; its contents
is now directly handled by...
* mln/core/window.hh: ...this class.
* mln/core/internal/neighborhood_impl_mixin.hh: Remove.
* mln/core/internal/neighborhood_base.hh
(is_centered, is_symmetric, sym): Remove; meaningless.
* mln/core/pset_if_piter.hh: Use using and update.
* mln/core/neighb2d.hh (neighb2d): Rely on neighborhood.
Clean code.
* mln/core/neighborhood.hh: New; use delegation to window.
* mln/metal/math/sqrt.hh (mlc_sqrt_int): New.
(sqrt_int_): Help compiler.
(sqrt): Fix params.
* mln/make/neighb2d.hh: New.
* mln/make/window2d.hh: New overload.
* mln/morpho/dilation_elementary.hh (todo): New.
doc/tutorial/examples/window.cc | 11 +
mln/core/internal/neighborhood_base.hh | 44 -----
mln/core/neighb2d.hh | 31 ++-
mln/core/neighborhood.hh | 274 +++++++++++++++++++++++++++++++++
mln/core/pset_if_piter.hh | 18 +-
mln/core/window.hh | 202 ++++++++++++++++++++++--
mln/make/neighb2d.hh | 67 +++++---
mln/make/window2d.hh | 42 +++--
mln/metal/math/sqrt.hh | 18 +-
mln/morpho/dilation_elementary.hh | 2
10 files changed, 592 insertions(+), 117 deletions(-)
Index: doc/tutorial/examples/window.cc
--- doc/tutorial/examples/window.cc (revision 2069)
+++ doc/tutorial/examples/window.cc (working copy)
@@ -53,6 +53,17 @@
std::cout << win << std::endl;
{
+ bool b[9] = { 1, 1, 0,
+ 1, 0, 0,
+ 0, 0, 0 };
+ bool b2[3][3] = { { 1, 1, 0 },
+ { 1, 0, 0 },
+ { 0, 0, 0 } };
+ mln_assertion(make::window2d(b) == make::window2d(b2));
+ mln_assertion(make::window2d(b) == win);
+ }
+
+ {
mln_fwd_piter_(I) p(ima.domain());
for_all(p)
picture(ima, win, p);
Index: mln/core/window.hh
--- mln/core/window.hh (revision 2069)
+++ mln/core/window.hh (working copy)
@@ -36,25 +36,33 @@
* point_, neighb_, etc.
*
* \todo Code other comparisons (< and <=).
+ *
+ * \todo Add static checks in insert methods.
*/
# include <mln/core/internal/window_base.hh>
-# include <mln/core/internal/basic_window_impl.hh>
# include <mln/metal/is_a.hh>
+# include <mln/util/set.hh>
+# include <mln/fun/i2v/all_to.hh>
+# include <mln/norm/linfty.hh>
namespace mln
{
+ // Fwd decls.
+ template <typename V> class dpsites_fwd_piter;
+ template <typename V> class dpsites_bkd_piter;
+
+
/*! \brief Generic window class.
*
* This type of window is just like a set of delta-points. The
* parameter is \c D, type of delta-point.
*/
template <typename D>
- class window : public internal::window_base< D, window<D> >,
- public internal::basic_window_impl< D, window<D> >
+ class window : public internal::window_base< D, window<D> >
{
public:
@@ -64,11 +72,6 @@
*/
window();
- window(const util::set<D>& s)
- {
- this->dps_ = s;
- }
-
/*! \brief Test if the window is centered.
*
* \return True if the delta-point 0 belongs to the window.
@@ -82,6 +85,65 @@
/*! Apply a central symmetry to the target window.
*/
void sym();
+
+
+ /*! \brief Site_Iterator type to browse the points of a basic window
+ * w.r.t. the ordering of delta-points.
+ */
+ typedef dpsites_fwd_piter< window<D> > fwd_qiter;
+
+ /*! \brief Site_Iterator type to browse the points of a basic window
+ * w.r.t. the reverse ordering of delta-points.
+ */
+ typedef dpsites_bkd_piter< window<D> > bkd_qiter;
+
+ /*! \brief Site_Iterator type to browse the points of a basic window
+ * whatever the ordering of delta-points.
+ */
+ typedef fwd_qiter qiter;
+
+
+ /// Give the window size, i.e., the number of delta-sites.
+ unsigned size() const;
+
+ /*! \brief Test if the window is empty (null size; no delta-point).
+ */
+ bool is_empty() const;
+
+ /*! \brief Give the maximum coordinate gap between the window
+ center and a window point.
+ */
+ unsigned delta() const;
+
+ // Give the \p i-th delta-point.
+ const D& dp(unsigned i) const;
+
+
+
+ /// Insert a delta-point \p dp.
+ window<D>& insert(const D& dp);
+
+ /// \{ Insertion of a delta-point with different numbers of
+ /// arguments (coordinates) w.r.t. the dimension.
+ window<D>& insert(const mln_coord(D)& dind); // For 1D.
+
+ window<D>& insert(const mln_coord(D)& drow,
+ const mln_coord(D)& dcol); // For 2D.
+
+ window<D>& insert(const mln_coord(D)& dsli,
+ const mln_coord(D)& drow,
+ const mln_coord(D)& dcol); // For 3D.
+ /// \}
+
+ /// Give the vector of delta-points.
+ const std::vector<D>& std_vector() const;
+
+ /// Hook to the set of D.
+ const util::set<D>& dps_hook_() const;
+
+ private:
+
+ util::set<D> dps_;
};
@@ -114,7 +176,8 @@
template <typename D>
inline
- bool window<D>::is_symmetric() const
+ bool
+ window<D>::is_symmetric() const
{
window<D> cpy = *this;
return cpy.sym() == *this;
@@ -122,7 +185,8 @@
template <typename D>
inline
- bool window<D>::is_centered() const
+ bool
+ window<D>::is_centered() const
{
static const D origin = all_to(0);
return this->dps_.has(origin); // FIXME: Use literal::origin.
@@ -134,22 +198,127 @@
window<D>::sym()
{
window<D> tmp;
- const unsigned n = this->ndpoints();
+ const unsigned n = size();
for (unsigned i = 0; i < n; ++i)
tmp.insert(- this->dp(i));
*this = tmp;
}
+
+ template <typename D>
+ inline
+ bool
+ window<D>::is_empty() const
+ {
+ return dps_.is_empty();
+ }
+
template <typename D>
- std::ostream& operator<<(std::ostream& ostr, const window<D>& win)
+ inline
+ unsigned
+ window<D>::delta() const
+ {
+ // FIXME: Is-it correct?
+ unsigned d = 0;
+ const unsigned n = size();
+ for (unsigned i = 0; i < n; ++i)
{
- return ostr << win.dps_hook();
+ unsigned dd = norm::linfty(dp(i).to_vec());
+ if (dd > d)
+ d = dd;
+ }
+ return d;
}
template <typename D>
- bool operator==(const window<D>& lhs, const window<D>& rhs)
+ inline
+ unsigned
+ window<D>::size() const
{
- return lhs.dps_hook() == rhs.dps_hook();
+ return dps_.nelements();
+ }
+
+ template <typename D>
+ inline
+ const D&
+ window<D>::dp(unsigned i) const
+ {
+ mln_precondition(i < size());
+ return dps_[i];
+ }
+
+ template <typename D>
+ inline
+ const std::vector<D>&
+ window<D>::std_vector() const
+ {
+ return dps_.vect();
+ }
+
+ template <typename D>
+ inline
+ window<D>&
+ window<D>::insert(const D& dp)
+ {
+ dps_.insert(dp);
+ return *this;
+ }
+
+ template <typename D>
+ inline
+ window<D>&
+ window<D>::insert(const mln_coord(D)& dind)
+ {
+ mlc_bool(D::dim == 1)::check();
+ D dp(dind);
+ return insert(dp);
+ }
+
+ template <typename D>
+ inline
+ window<D>&
+ window<D>::insert(const mln_coord(D)& drow,
+ const mln_coord(D)& dcol)
+ {
+ mlc_bool(D::dim == 2)::check();
+ D dp(drow, dcol);
+ return insert(dp);
+ }
+
+ template <typename D>
+ inline
+ window<D>&
+ window<D>::insert(const mln_coord(D)& dsli,
+ const mln_coord(D)& drow,
+ const mln_coord(D)& dcol)
+ {
+ mlc_bool(D::dim == 3)::check();
+ D dp(dsli, drow, dcol);
+ return insert(dp);
+ }
+
+ template <typename D>
+ inline
+ const util::set<D>&
+ window<D>::dps_hook_() const
+ {
+ return dps_;
+ }
+
+ // Operators.
+
+ template <typename D>
+ std::ostream&
+ operator<<(std::ostream& ostr, const window<D>& win)
+ {
+ return ostr << win.dps_hook_();
+ }
+
+ template <typename D>
+ bool
+ operator==(const window<D>& lhs, const window<D>& rhs)
+ {
+ return lhs.dps_hook_() == rhs.dps_hook_();
}
# endif // ! MLN_INCLUDE_ONLY
@@ -157,4 +326,7 @@
} // end of namespace mln
+# include <mln/core/dpsites_piter.hh>
+
+
#endif // ! MLN_CORE_WINDOW_HH
Index: mln/core/internal/neighborhood_base.hh
--- mln/core/internal/neighborhood_base.hh (revision 2069)
+++ mln/core/internal/neighborhood_base.hh (working copy)
@@ -60,26 +60,6 @@
/// Site associated type.
typedef mln_site(D) site;
-
- /*! \brief Test (as a window) if it is centered so (as a
- * neighborhood) return false.
- *
- * \return Always false.
- */
- bool is_centered() const;
-
- /*! \brief Test (as a window) if it is symmetric so (as a
- * neighborhood) return true.
- *
- * \return Always true.
- */
- bool is_symmetric() const;
-
- /*! Apply (as a window) a central symmetry so (as a
- neighborhood) it is a no-op.
- */
- void sym();
-
protected:
neighborhood_base();
};
@@ -93,30 +73,6 @@
{
}
- template <typename D, typename E>
- inline
- bool
- neighborhood_base<D,E>::is_centered() const
- {
- return false;
- }
-
- template <typename D, typename E>
- inline
- bool
- neighborhood_base<D,E>::is_symmetric() const
- {
- return true;
- }
-
- template <typename D, typename E>
- inline
- void
- neighborhood_base<D,E>::sym()
- {
- // No-op.
- }
-
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::internal
Index: mln/core/pset_if_piter.hh
--- mln/core/pset_if_piter.hh (revision 2069)
+++ mln/core/pset_if_piter.hh (working copy)
@@ -68,6 +68,14 @@
/// The set site targeted by pi_.
const S& pi_set_from_(const pset_if<S,F>& s) const;
+
+ private:
+ typedef pset_if_piter_<Pi,S,F> self_;
+ typedef internal::piter_adaptor_<Pi, pset_if<S,F>, self_> super_;
+
+ protected:
+ using super_::s_;
+ using super_::pi_;
};
@@ -92,9 +100,9 @@
void
pset_if_piter_<Pi,S,F>::start_()
{
- this->pi_.start();
- while (this->pi_.is_valid() && ! this->s_->pred(this->pi_))
- this->pi_.next();
+ pi_.start();
+ while (pi_.is_valid() && ! s_->pred(pi_))
+ pi_.next();
}
template <typename Pi, typename S, typename F>
@@ -103,8 +111,8 @@
pset_if_piter_<Pi,S,F>::next_()
{
do
- this->pi_.next();
- while (this->pi_.is_valid() && ! this->s_->pred(this->pi_));
+ pi_.next();
+ while (pi_.is_valid() && ! s_->pred(pi_));
}
template <typename Pi, typename S, typename F>
Index: mln/core/neighb2d.hh
--- mln/core/neighb2d.hh (revision 2069)
+++ mln/core/neighb2d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -35,7 +35,7 @@
*/
# include <cmath>
-# include <mln/core/neighb.hh>
+# include <mln/core/neighborhood.hh>
# include <mln/core/dpoint2d.hh>
@@ -45,9 +45,17 @@
/*! \brief Type alias for a neighborhood defined on the 2D square
* grid with integer coordinates.
*/
- typedef neighb<dpoint2d> neighb2d;
+ typedef neighborhood<dpoint2d> neighb2d;
+
+}
+
+
+# include <mln/make/neighb2d.hh>
+namespace mln
+{
+
/*! \brief 4-connectivity neighborhood on the 2D grid.
*
* - o -
@@ -104,8 +112,8 @@
static neighb2d it;
if (flower)
{
- it.insert(make::dpoint2d(0, 1));
- it.insert(make::dpoint2d(1, 0));
+ it.insert(0, 1)
+ .insert(1, 0);
flower = false;
}
return it;
@@ -118,10 +126,10 @@
static neighb2d it;
if (flower)
{
- it.insert(make::dpoint2d(0, 1));
- it.insert(make::dpoint2d(1,-1));
- it.insert(make::dpoint2d(1, 0));
- it.insert(make::dpoint2d(1, 1));
+ it.insert(0, 1)
+ .insert(1,-1)
+ .insert(1, 0)
+ .insert(1, 1);
flower = false;
}
return it;
@@ -134,7 +142,7 @@
static neighb2d it;
if (flower)
{
- it.insert(make::dpoint2d(0, 1));
+ it.insert(0, 1);
flower = false;
}
return it;
@@ -147,7 +155,7 @@
static neighb2d it;
if (flower)
{
- it.insert(make::dpoint2d(1, 0));
+ it.insert(1, 0);
flower = false;
}
return it;
@@ -158,4 +166,5 @@
} // end of namespace mln
+
#endif // ! MLN_CORE_NEIGHB2D_HH
Index: mln/core/neighborhood.hh
--- mln/core/neighborhood.hh (revision 0)
+++ mln/core/neighborhood.hh (revision 0)
@@ -0,0 +1,274 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_CORE_NEIGHBORHOOD_HH
+# define MLN_CORE_NEIGHBORHOOD_HH
+
+/*! \file mln/core/neighborhood.hh
+ *
+ * \brief Definition of the generic neighborhood class mln::neighborhood.
+ *
+ * \todo Make naming coherent: we have neighborhood (without '_') but
+ * point_, neighb_, etc.
+ *
+ * \todo Code other comparisons (< and <=).
+ *
+ * \todo Add static checks in insert methods.
+ */
+
+# include <mln/core/internal/neighborhood_base.hh>
+# include <mln/core/window.hh>
+# include <mln/literal/zero.hh>
+
+
+namespace mln
+{
+
+ // Fwd decls.
+ template <typename V> class dpsites_fwd_piter;
+ template <typename V> class dpsites_bkd_piter;
+
+
+ /*! \brief Generic neighborhood class.
+ *
+ * This type of neighborhood is just like a set of delta-points. The
+ * parameter is \c D, type of delta-point.
+ */
+ template <typename D>
+ class neighborhood : public internal::neighborhood_base< D, neighborhood<D> >
+ {
+ public:
+
+ /*! \brief Constructor without argument.
+ *
+ * The constructed neighborhood is empty.
+ */
+ neighborhood();
+
+ /*! \brief Constructor from a window.
+ *
+ * \pre The window has to be symmetrical and not centered.
+ */
+ neighborhood(const mln::window<D>& win);
+
+ /*! \brief Site_Iterator type to browse the points of a basic neighborhood
+ * w.r.t. the ordering of delta-points.
+ */
+ typedef dpsites_fwd_piter< neighborhood<D> > fwd_niter;
+
+ /*! \brief Site_Iterator type to browse the points of a basic neighborhood
+ * w.r.t. the reverse ordering of delta-points.
+ */
+ typedef dpsites_bkd_piter< neighborhood<D> > bkd_niter;
+
+ /*! \brief Site_Iterator type to browse the points of a basic neighborhood
+ * whatever the ordering of delta-points.
+ */
+ typedef fwd_niter niter;
+
+
+ /// Give the neighborhood size, i.e., the number of delta-sites.
+ unsigned size() const;
+
+ /*! \brief Give the maximum coordinate gap between the neighborhood
+ center and a neighborhood point.
+ */
+ unsigned delta() const;
+
+
+ /// Insert a delta-point \p dp.
+ neighborhood<D>& insert(const D& dp);
+
+ /// \{ Insertion of a delta-point with different numbers of
+ /// arguments (coordinates) w.r.t. the dimension.
+ neighborhood<D>& insert(const mln_coord(D)& dind); // For 1D.
+
+ neighborhood<D>& insert(const mln_coord(D)& drow,
+ const mln_coord(D)& dcol); // For 2D.
+
+ neighborhood<D>& insert(const mln_coord(D)& dsli,
+ const mln_coord(D)& drow,
+ const mln_coord(D)& dcol); // For 3D.
+ /// \}
+
+
+
+ typedef window<D> window;
+
+ mln::window<D> to_window() const
+ {
+ mln::window<D> tmp = win_;
+ D zero = literal::zero;
+ tmp.insert(zero);
+ return tmp;
+ }
+
+ /// Give the vector of delta-points.
+ const std::vector<D>& std_vector() const;
+
+ /// Hook to the set of D.
+ const util::set<D>& dps_hook_() const;
+
+ private:
+
+ mln::window<D> win_;
+ };
+
+
+ // FIXME: Doc!
+ template <typename D>
+ std::ostream& operator<<(std::ostream& ostr, const neighborhood<D>& nbh);
+
+
+
+ /*! \brief Equality comparison between neighborhoods \p lhs and \p rhs.
+ *
+ * \relates mln::neighborhood<D>
+ */
+ template <typename D>
+ bool operator==(const neighborhood<D>& lhs, const neighborhood<D>& rhs);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ // neighborhood<D>
+
+ template <typename D>
+ inline
+ neighborhood<D>::neighborhood()
+ {
+ // FIXME HERE: Was: mln::metal::is_a<D, Dpoint>::check();
+ // mln::metal::is_a<D, Delta_Point_Site>::check();
+ }
+
+ template <typename D>
+ inline
+ neighborhood<D>::neighborhood(const mln::window<D>& win)
+ {
+ mln_precondition(win.is_symmetric() == true);
+ mln_precondition(win.is_centered() == false);
+ win_ = win;
+ }
+
+ template <typename D>
+ inline
+ unsigned
+ neighborhood<D>::delta() const
+ {
+ mln_precondition(size() != 0);
+ return win_.delta();
+ }
+
+ template <typename D>
+ inline
+ unsigned
+ neighborhood<D>::size() const
+ {
+ return win_.size();
+ }
+
+ template <typename D>
+ inline
+ const std::vector<D>&
+ neighborhood<D>::std_vector() const
+ {
+ return win_.std_vector();
+ }
+
+ template <typename D>
+ inline
+ neighborhood<D>&
+ neighborhood<D>::insert(const D& dp)
+ {
+ win_.insert( dp);
+ win_.insert(-dp);
+ return *this;
+ }
+
+ template <typename D>
+ inline
+ neighborhood<D>&
+ neighborhood<D>::insert(const mln_coord(D)& dind)
+ {
+ mlc_bool(D::dim == 1)::check();
+ D dp(dind);
+ return insert(dp);
+ }
+
+ template <typename D>
+ inline
+ neighborhood<D>&
+ neighborhood<D>::insert(const mln_coord(D)& drow,
+ const mln_coord(D)& dcol)
+ {
+ mlc_bool(D::dim == 2)::check();
+ D dp(drow, dcol);
+ return insert(dp);
+ }
+
+ template <typename D>
+ inline
+ neighborhood<D>&
+ neighborhood<D>::insert(const mln_coord(D)& dsli,
+ const mln_coord(D)& drow,
+ const mln_coord(D)& dcol)
+ {
+ mlc_bool(D::dim == 3)::check();
+ D dp(dsli, drow, dcol);
+ return insert(dp);
+ }
+
+ template <typename D>
+ inline
+ const util::set<D>&
+ neighborhood<D>::dps_hook_() const
+ {
+ return win_.dps_hook_();
+ }
+
+ // Operators.
+
+ template <typename D>
+ std::ostream& operator<<(std::ostream& ostr, const neighborhood<D>& nbh)
+ {
+ return ostr << nbh.dps_hook_();
+ }
+
+ template <typename D>
+ bool operator==(const neighborhood<D>& lhs, const neighborhood<D>& rhs)
+ {
+ return lhs.dps_hook_() == rhs.dps_hook_();
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+} // end of namespace mln
+
+
+
+#endif // ! MLN_CORE_NEIGHBORHOOD_HH
Index: mln/metal/math/sqrt.hh
--- mln/metal/math/sqrt.hh (revision 2069)
+++ mln/metal/math/sqrt.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -37,6 +37,9 @@
# include <mln/metal/int.hh>
+# define mlc_sqrt_int(N) mln::metal::math::sqrt_int<( N )>::value
+
+
namespace mln
{
@@ -54,11 +57,12 @@
template <int n, int lo = 1, int hi = n>
struct sqrt_int_
{
- enum { mid = (lo + hi + 1) / 2 };
-
- enum { value = n < mid * mid
- ? sqrt_int_<n, lo, mid-1>::value
- : sqrt_int_<n, mid, hi>::result };
+ enum {
+ mid = (lo + hi + 1) / 2,
+ val_lo = sqrt_int_<n, lo, mid-1>::value,
+ val_hi = sqrt_int_<n, mid, hi>::value
+ };
+ enum { value = n < mid * mid ? val_lo : val_hi };
};
template<int n, int m>
@@ -92,7 +96,7 @@
// sqrt<N>
- template <typename X, typename N>
+ template <typename N>
struct sqrt;
template <int n>
Index: mln/make/neighb2d.hh
--- mln/make/neighb2d.hh (revision 2069)
+++ mln/make/neighb2d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,17 +25,15 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_MAKE_WINDOW2D_HH
-# define MLN_MAKE_WINDOW2D_HH
+#ifndef MLN_MAKE_NEIGHB2D_HH
+# define MLN_MAKE_NEIGHB2D_HH
-/*! \file mln/make/window2d.hh
+/*! \file mln/make/neighb2d.hh
*
- * \brief Routine to create an mln::window2d.
+ * \brief Routine to create an mln::neighb2d.
*/
-# include <cmath>
-# include <mln/core/window2d.hh>
-# include <mln/make/dpoint2d.hh>
+# include <mln/make/window2d.hh>
namespace mln
@@ -44,32 +42,53 @@
namespace make
{
- /*! \brief Create an mln::window2d.
+ /*! \brief Create a mln::neighb2d.
*
* \param[in] values Array of Booleans.
*
- * \pre The array size, \c M, has to be a square of an odd integer.
+ * \pre The array size, \c S, has to be a square of an odd integer.
*
- * \return A 2D window.
+ * \return A 2D neighborhood.
*/
- template <unsigned M>
- mln::window2d window2d(bool (&values)[M]);
+ template <unsigned S>
+ mln::neighb2d neighb2d(bool (&values)[S]);
+
+
+ /*! \brief Create a mln::neighb2d.
+ *
+ * \param[in] values Double-array of Booleans.
+ *
+ * \pre \c R and \c C, defining the array size, have to be odd.
+ *
+ * \return A 2D neighborhood.
+ */
+ template <unsigned R, unsigned C>
+ mln::neighb2d neighb2d(bool (&values)[R][C]);
# ifndef MLN_INCLUDE_ONLY
- template <unsigned M>
+ template <unsigned S>
+ inline
+ mln::neighb2d
+ neighb2d(bool (&values)[S])
+ {
+ enum { h = mlc_sqrt_int(S) / 2 };
+ mlc_bool((2 * h + 1) * (2 * h + 1) == S)::check();
+ mln::window2d win = make::window2d(values);
+ neighb2d tmp(win);
+ return tmp;
+ }
+
+ template <unsigned R, unsigned C>
inline
- mln::window2d window2d(bool (&values)[M])
+ mln::neighb2d
+ neighb2d(bool (&values)[R][C])
{
- int h = unsigned(std::sqrt(float(M))) / 2;
- assert((2 * h + 1) * (2 * h + 1) == M);
- mln::window2d tmp;
- unsigned i = 0;
- for (int row = - h; row <= h; ++row)
- for (int col = - h; col <= h; ++col)
- if (values[i++])
- tmp.insert(make::dpoint2d(row, col));
+ mlc_bool(R % 2 == 1)::check();
+ mlc_bool(C % 2 == 1)::check();
+ mln::window2d win = make::window2d(values);
+ neighb2d tmp(win);
return tmp;
}
@@ -80,4 +99,4 @@
} // end of namespace mln
-#endif // ! MLN_MAKE_WINDOW2D_HH
+#endif // ! MLN_MAKE_NEIGHB2D_HH
Index: mln/make/window2d.hh
--- mln/make/window2d.hh (revision 2069)
+++ mln/make/window2d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -33,9 +33,8 @@
* \brief Routine to create an mln::window2d.
*/
-# include <cmath>
# include <mln/core/window2d.hh>
-# include <mln/make/dpoint2d.hh>
+# include <mln/metal/math/sqrt.hh>
namespace mln
@@ -48,28 +47,49 @@
*
* \param[in] values Array of Booleans.
*
- * \pre The array size, \c M, has to be a square of an odd integer.
+ * \pre The array size, \c S, has to be a square of an odd integer.
*
* \return A 2D window.
*/
- template <unsigned M>
- mln::window2d window2d(bool (&values)[M]);
+ template <unsigned S>
+ mln::window2d window2d(bool (&values)[S]);
+
+
+ template <unsigned R, unsigned C>
+ mln::window2d window2d(bool (&values)[R][C]);
# ifndef MLN_INCLUDE_ONLY
- template <unsigned M>
+ template <unsigned S>
inline
- mln::window2d window2d(bool (&values)[M])
+ mln::window2d
+ window2d(bool (&values)[S])
{
- int h = unsigned(std::sqrt(float(M))) / 2;
- assert((2 * h + 1) * (2 * h + 1) == M);
+ enum { h = mlc_sqrt_int(S) / 2 };
+ mlc_bool((2 * h + 1) * (2 * h + 1) == S)::check();
mln::window2d tmp;
unsigned i = 0;
for (int row = - h; row <= h; ++row)
for (int col = - h; col <= h; ++col)
if (values[i++])
- tmp.insert(make::dpoint2d(row, col));
+ tmp.insert(row, col);
+ return tmp;
+ }
+
+ template <unsigned R, unsigned C>
+ inline
+ mln::window2d
+ window2d(bool (&values)[R][C])
+ {
+ mlc_bool(R % 2 == 1)::check();
+ mlc_bool(C % 2 == 1)::check();
+ const int drow = int(R) / 2, dcol = int(C) / 2;
+ mln::window2d tmp;
+ for (int row = - drow; row <= drow; ++row)
+ for (int col = - dcol; col <= dcol; ++col)
+ if (values[row + drow][col + dcol])
+ tmp.insert(row, col);
return tmp;
}
Index: mln/morpho/dilation_elementary.hh
--- mln/morpho/dilation_elementary.hh (revision 2069)
+++ mln/morpho/dilation_elementary.hh (working copy)
@@ -30,6 +30,8 @@
/// \file mln/morpho/dilation_elementary.hh
/// \brief Morphological elementary dilation.
+///
+/// \todo Write specific code.
# include <mln/morpho/dilation.hh>
1
0
***SPAM*** L3 cleanup-2008 2069: Factor code for pset_if piters and add bkd iterations.
by Thierry Geraud 24 Jun '08
by Thierry Geraud 24 Jun '08
24 Jun '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Factor code for pset_if piters and add bkd iterations.
* mln/core/internal/piter_adaptor.hh (comment): Remove.
* mln/core/pset_if_piter.hh (todo): Remove.
(pset_if_fwd_piter_): Rename as...
(pset_if_piter_): ...this.
(Pi): New parameter.
Update.
(pset_if_bkd_piter_): Remove; obsolete.
* mln/core/pset_if.hh (fwd_piter, bkd_piter): Update.
internal/piter_adaptor.hh | 2 -
pset_if.hh | 8 +++---
pset_if_piter.hh | 54 +++++++++++++++-------------------------------
3 files changed, 23 insertions(+), 41 deletions(-)
Index: mln/core/internal/piter_adaptor.hh
--- mln/core/internal/piter_adaptor.hh (revision 2068)
+++ mln/core/internal/piter_adaptor.hh (working copy)
@@ -84,7 +84,7 @@
protected:
/// The adaptee site iterator.
- Pi pi_; // own copy
+ Pi pi_;
};
Index: mln/core/pset_if_piter.hh
--- mln/core/pset_if_piter.hh (revision 2068)
+++ mln/core/pset_if_piter.hh (working copy)
@@ -31,8 +31,6 @@
/*! \file mln/core/pset_if_piter.hh
*
* \brief Definition of iterators on pset_if<S,F>.
- *
- * \todo pset_if_bkd_piter_.
*/
# include <mln/core/internal/piter_adaptor.hh>
@@ -43,26 +41,24 @@
{
- /*! \brief A generic forward iterator on points of subsets.
+ /*! \brief Iterator on site sets conditionned by a function.
*
- * Parameter \c S is a point set type; parameter F is a function
+ * Parameter \c S is a site set type; parameter F is a function
* from point to Boolean.
*
* \see mln::pset_if
*/
- template <typename S, typename F>
- class pset_if_fwd_piter_
- : public internal::piter_adaptor_< mln_fwd_piter(S), // Adaptee.
+ template <typename Pi, typename S, typename F>
+ struct pset_if_piter_
+ : public internal::piter_adaptor_< Pi, // Adaptee.
pset_if<S,F>, // Site_Set.
- pset_if_fwd_piter_<S,F> > // Exact.
+ pset_if_piter_<Pi,S,F> > // Exact.
{
- public:
-
/// Constructor without argument.
- pset_if_fwd_piter_();
+ pset_if_piter_();
/// Constructor from a site set.
- pset_if_fwd_piter_(const pset_if<S,F>& s);
+ pset_if_piter_(const pset_if<S,F>& s);
/// Start an iteration.
void start_();
@@ -75,64 +71,50 @@
};
- // FIXME:
- template <typename S, typename F>
- class pset_if_bkd_piter_
- :
- public mln::internal::fixme
- {};
-
-
# ifndef MLN_INCLUDE_ONLY
-
- // pset_if_fwd_piter_<S,F>
-
- template <typename S, typename F>
+ template <typename Pi, typename S, typename F>
inline
- pset_if_fwd_piter_<S,F>::pset_if_fwd_piter_()
+ pset_if_piter_<Pi,S,F>::pset_if_piter_()
{
}
- template <typename S, typename F>
+ template <typename Pi, typename S, typename F>
inline
- pset_if_fwd_piter_<S,F>::pset_if_fwd_piter_(const pset_if<S,F>& s)
+ pset_if_piter_<Pi,S,F>::pset_if_piter_(const pset_if<S,F>& s)
{
this->change_target(s);
}
- template <typename S, typename F>
+ template <typename Pi, typename S, typename F>
inline
void
- pset_if_fwd_piter_<S,F>::start_()
+ pset_if_piter_<Pi,S,F>::start_()
{
this->pi_.start();
while (this->pi_.is_valid() && ! this->s_->pred(this->pi_))
this->pi_.next();
}
- template <typename S, typename F>
+ template <typename Pi, typename S, typename F>
inline
void
- pset_if_fwd_piter_<S,F>::next_()
+ pset_if_piter_<Pi,S,F>::next_()
{
do
this->pi_.next();
while (this->pi_.is_valid() && ! this->s_->pred(this->pi_));
}
- template <typename S, typename F>
+ template <typename Pi, typename S, typename F>
inline
const S&
- pset_if_fwd_piter_<S,F>::pi_set_from_(const pset_if<S,F>& s) const
+ pset_if_piter_<Pi,S,F>::pi_set_from_(const pset_if<S,F>& s) const
{
return s.overset();
}
- // FIXME: pset_if_bkd_piter_<S,F>
-
-
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
Index: mln/core/pset_if.hh
--- mln/core/pset_if.hh (revision 2068)
+++ mln/core/pset_if.hh (working copy)
@@ -42,8 +42,8 @@
// Fwd decls.
template <typename S, typename F> struct pset_if;
- template <typename S, typename F> struct pset_if_fwd_piter_;
- template <typename S, typename F> struct pset_if_bkd_piter_;
+ template <typename Pi, typename S, typename F> struct pset_if_piter_;
+
namespace trait
{
@@ -88,13 +88,13 @@
/// Forward Site_Iterator associated type.
- typedef pset_if_fwd_piter_<S,F> fwd_piter;
+ typedef pset_if_piter_<mln_fwd_piter(S), S, F> fwd_piter;
/// Site_Iterator associated type.
typedef fwd_piter piter;
/// Backward Site_Iterator associated type.
- typedef mln::internal::fixme bkd_piter;
+ typedef pset_if_piter_<mln_bkd_piter(S), S, F> bkd_piter;
/// Constructor with a point set \p pset and a predicate \p f.
1
0
***SPAM*** L3 cleanup-2008 2068: Update iterator base classes and make image_if fully work.
by Thierry Geraud 24 Jun '08
by Thierry Geraud 24 Jun '08
24 Jun '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Update iterator base classes and make image_if fully work.
* doc/tutorial/examples/image_if.cc (change_target): Test it.
* doc/tutorial/examples/window.cc: New.
* mln/core/window.hh (window): New ctor from util::set.
* mln/core/internal/basic_window_impl.hh (dps_): Move from
private to protected.
(basic_window_impl): New ctor from util::set.
* mln/core/dpsites_piter.hh (update): Move...
* mln/core/internal/site_relative_iterator_base.hh: ...here so
it is factored.
(p_, p_hook_, change_target): New.
* mln/core/internal/site_iterator_base.hh (todo): Update.
(p): Remove.
(current_p_, p_): Remove as is; those entities are now defined
in sub-classes as respectively p_hook_ and p_ (if needed).
* mln/core/internal/site_set_iterator_base.hh
(site_set_iterator_base): Change from struct to class.
(p_, p_hook_, change_target): New.
* mln/core/internal/piter_adaptor.hh (todo): Update.
(piter_adaptor_): Fix inheritance.
(S): New parameter.
(p_hook_, change_target): New.
(piter_): Rename as...
(pi_): ...this.
* mln/core/concept/neighborhood.hh (window, to_window): New.
* mln/core/neighb.hh: Likewise.
* mln/core/box_piter.hh (super_): Fix type definition.
* mln/core/pset_if_piter.hh (pset_if_piter_): Inherit from
piter_adaptor_.
(is_valid_, invalidate_): Remove; now factored in super class.
(pi_set_from_): New method required for adapters.
(start_, next_): Update.
* mln/core/p_array_piter.hh: Layout.
* mln/morpho/dilation_elementary.hh: New.
doc/tutorial/examples/image_if.cc | 11 +++
doc/tutorial/examples/window.cc | 80 +++++++++++++++++++++
mln/core/box_piter.hh | 40 +++++-----
mln/core/concept/neighborhood.hh | 11 ++-
mln/core/dpsites_piter.hh | 26 -------
mln/core/internal/basic_window_impl.hh | 23 +++++-
mln/core/internal/piter_adaptor.hh | 84 ++++++++++++++++-------
mln/core/internal/site_iterator_base.hh | 41 +----------
mln/core/internal/site_relative_iterator_base.hh | 55 +++++++++++++--
mln/core/internal/site_set_iterator_base.hh | 35 +++++++++
mln/core/neighb.hh | 13 +++
mln/core/p_array_piter.hh | 2
mln/core/pset_if_piter.hh | 62 +++++-----------
mln/core/window.hh | 4 +
mln/morpho/dilation_elementary.hh | 80 +++++++++++++++++++++
15 files changed, 407 insertions(+), 160 deletions(-)
Index: doc/tutorial/examples/image_if.cc
--- doc/tutorial/examples/image_if.cc (revision 2067)
+++ doc/tutorial/examples/image_if.cc (working copy)
@@ -7,6 +7,12 @@
# include <mln/fun/p2b/chess.hh>
+template <typename It, typename S>
+void ch_target(It it, const S& s)
+{
+ it.change_target(s);
+}
+
int main()
{
@@ -20,4 +26,9 @@
debug::println(ima | fun::p2b::chess);
trait::image::print(ima | fun::p2b::chess);
+
+ typedef pset_if<box2d, fun::p2b::chess_t> S;
+
+ ch_target(mln_fwd_piter_(S)(),
+ (ima | fun::p2b::chess).domain());
}
Index: doc/tutorial/examples/window.cc
--- doc/tutorial/examples/window.cc (revision 0)
+++ doc/tutorial/examples/window.cc (revision 0)
@@ -0,0 +1,80 @@
+# include <mln/core/image2d.hh>
+# include <mln/core/window2d.hh>
+# include <mln/core/p_array.hh>
+
+# include <mln/debug/iota.hh>
+# include <mln/debug/println.hh>
+
+# include <mln/core/neighb2d.hh>
+
+
+template <typename I, typename W, typename P>
+void picture(const I& ima, const W& win, const P& p)
+{
+ std::cout << ima(p) << ": ";
+ mln_qiter(W) q(win, p);
+ for_all(q)
+ if (ima.has(q))
+ std::cout << ima(q) << ' ';
+ else
+ std::cout << "- ";
+ std::cout << std::endl;
+}
+
+
+template <typename I, typename W>
+void fill_null(I& ima, const W& win)
+{
+ mln_piter(I) p(ima.domain());
+ mln_qiter(W) q(win, p);
+ for_all(p)
+ for_all(q)
+ if (ima.has(q))
+ ima(q) = 0;
+}
+
+
+
+int main()
+{
+ using namespace mln;
+
+ typedef image2d<unsigned> I;
+ I ima(2, 3, 0); // no border
+ debug::iota(ima);
+ debug::println(ima);
+ mln_invariant(ima.nsites() == 6);
+
+ window2d win;
+ win
+ .insert(-1, 0)
+ .insert(0, -1)
+ .insert(-1,-1);
+ std::cout << win << std::endl;
+
+ {
+ mln_fwd_piter_(I) p(ima.domain());
+ for_all(p)
+ picture(ima, win, p);
+ }
+
+ {
+ typedef p_array<point2d> A;
+ A arr;
+ arr.insert_all(ima.domain());
+ mln_fwd_piter_(A) p(arr);
+ for_all(p)
+ picture(ima, win, p);
+
+ // FIXME: Move this new test in a separate file.
+ mln_psite_(A) c(arr, 0);
+ window2d it; it.insert(0,0);
+ mln_qiter_(window2d) q(it, c);
+ q.start();
+ q.to_site() == c.to_site();
+ c.inc_index();
+ mln_assertion(q.update().to_site() == c.to_site());
+ }
+
+ fill_null(ima, win);
+}
Index: mln/core/window.hh
--- mln/core/window.hh (revision 2067)
+++ mln/core/window.hh (working copy)
@@ -64,6 +64,10 @@
*/
window();
+ window(const util::set<D>& s)
+ {
+ this->dps_ = s;
+ }
/*! \brief Test if the window is centered.
*
Index: mln/core/internal/basic_window_impl.hh
--- mln/core/internal/basic_window_impl.hh (revision 2067)
+++ mln/core/internal/basic_window_impl.hh (working copy)
@@ -55,8 +55,6 @@
template <typename D, typename E>
class basic_window_impl
{
- util::set<D> dps_;
-
public:
@@ -119,8 +117,14 @@
protected:
+ util::set<D> dps_;
+
+ /// Constructor without argument.
basic_window_impl();
+ /// Constructor from an util::set.
+ basic_window_impl(const util::set<D>& s);
+
void insert_(const D& dp); // The only routine to effectively insert a dp.
// This is a default implementation. This routine can be
// overidden in sub-classes.
@@ -137,6 +141,21 @@
template <typename D, typename E>
inline
+ basic_window_impl<D,E>::basic_window_impl(const util::set<D>& s)
+ {
+ bool is_sym = true;
+ for (unsigned i = 0; s.nelements(); ++i)
+ if (! s.has(-s[i]))
+ {
+ is_sym = false;
+ break;
+ }
+ mln_precondition(is_sym);
+ dps_ = s;
+ }
+
+ template <typename D, typename E>
+ inline
bool basic_window_impl<D,E>::is_empty() const
{
return dps_.is_empty();
Index: mln/core/internal/site_relative_iterator_base.hh
--- mln/core/internal/site_relative_iterator_base.hh (revision 2067)
+++ mln/core/internal/site_relative_iterator_base.hh (working copy)
@@ -86,9 +86,24 @@
/// changed.
const mln_psite(S)& unproxy() const;
+ /// Hook to the current location.
+ const mln_psite(S)& p_hook_() const;
+
+ /// Change the site set targeted by this iterator.
+ void change_target(const S& s);
+
+ /// FIXME: import doc from home.
+ E& update();
+
protected:
+ /// A pointer to the center psite.
const mln_psite(S)* c_;
+
+ private:
+
+ /// The psite designated by this iterator.
+ mln_psite(S) p_;
};
@@ -125,7 +140,7 @@
{
exact(this)->do_start_();
if (this->is_valid())
- this->p_ = exact(this)->compute_p_();
+ p_ = exact(this)->compute_p_();
}
template <typename S, typename E>
@@ -135,7 +150,7 @@
{
exact(this)->do_next_();
if (this->is_valid())
- this->p_ = exact(this)->compute_p_();
+ p_ = exact(this)->compute_p_();
}
template <typename S, typename E>
@@ -153,8 +168,40 @@
site_relative_iterator_base<S,E>::unproxy() const
{
mln_psite(S) p_now = exact(this)->compute_p_();
- mln_assertion(p_now == this->p_);
- return this->p_;
+ mln_assertion(p_now == p_);
+ return p_;
+ }
+
+ template <typename S, typename E>
+ inline
+ const mln_psite(S)&
+ site_relative_iterator_base<S,E>::p_hook_() const
+ {
+ return p_;
+ }
+
+ template <typename S, typename E>
+ inline
+ void
+ site_relative_iterator_base<S,E>::change_target(const S& s)
+ {
+ this->s_ = & s;
+ // p might be also updated since it can hold a pointer towards
+ // the set it designates, so:
+ if_possible::change_target(p_, s);
+ // Last:
+ this->invalidate();
+ }
+
+ template <typename S, typename E>
+ inline
+ E&
+ site_relative_iterator_base<S,E>::update()
+ {
+ mln_precondition(this->s_ && c_);
+ p_ = exact(this)->compute_p_();
+ mln_postcondition(this->is_valid());
+ return exact(*this);
}
# endif // ! MLN_INCLUDE_ONLY
Index: mln/core/internal/site_iterator_base.hh
--- mln/core/internal/site_iterator_base.hh (revision 2067)
+++ mln/core/internal/site_iterator_base.hh (working copy)
@@ -32,20 +32,14 @@
*
* \brief Base class to factor code for site iterator classes.
*
- * \todo Make p_ private and add a p() method that can be overridden
- * so that a subclass can use some other info than this attribute.
- * See for instance start_ and next_ in pset_if_piter.hh: we have
- * both pi_ and p_ to designate the current site.
+ * \todo Import tech doc from home.
*/
# include <mln/core/concept/site_iterator.hh>
# include <mln/core/concept/pseudo_site.hh> // Use of if_possible::change_target.
-// site_iterator_base<S> where S is a Site_Set
-// {
-// s_ : const S*
-// }
+// FIXME: See todo.
@@ -100,26 +94,12 @@
/// Give the target address. It might be 0.
const S*& target_();
- /// Change the iterator target.
- void change_target(const S& s);
-
- mln_psite(S)& p() { return exact(this)->current_p_(); }
- const mln_psite(S)& p() const { return exact(this)->current_p_(); }
-
- mln_psite(S)& current_p_() { return p_; }
- const mln_psite(S)& current_p_() const { return p_; }
-
protected:
site_iterator_base();
/// The target.
const S* s_;
-
- private:
-
- /// The psite designated by this iterator.
- mln_psite(S) p_;
};
@@ -146,7 +126,7 @@
site_iterator_base<S, E>::to_site() const
{
mln_precondition(exact(*this).is_valid()); // FIXME: OK?
- return internal::to_site( p() );
+ return internal::to_site( exact(this)->p_hook_() );
}
template <typename S, typename E>
@@ -154,7 +134,7 @@
const mln_psite(S)&
site_iterator_base<S, E>::unproxy() const
{
- return p();
+ return exact(this)->p_hook_();
}
template <typename S, typename E>
@@ -165,19 +145,6 @@
return s_;
}
- template <typename S, typename E>
- inline
- void
- site_iterator_base<S, E>::change_target(const S& s)
- {
- s_ = & s;
- // p might be also updated since it can hold a pointer towards
- // the set it designates, so:
- if_possible::change_target(p(), s);
- // Last:
- this->invalidate();
- }
-
#endif // ! MLN_INCLUDE_ONLY
} // end of namespace internal
Index: mln/core/internal/site_set_iterator_base.hh
--- mln/core/internal/site_set_iterator_base.hh (revision 2067)
+++ mln/core/internal/site_set_iterator_base.hh (working copy)
@@ -48,13 +48,25 @@
* Parameter \c S is the targeted site set type.
*/
template <typename S, typename E>
- struct site_set_iterator_base : site_iterator_base<S, E>
+ class site_set_iterator_base : public site_iterator_base<S, E>
{
+ public:
+
/// Give the site set that this iterator browses.
const S& site_set() const;
+ /// Hook to the current location.
+ const mln_psite(S)& p_hook_() const;
+
+ /// Change the site set targeted by this iterator.
+ void change_target(const S& s);
+
protected:
+ /// The psite designated by this iterator.
+ mln_psite(S) p_;
+
+ /// Constructor without argument.
site_set_iterator_base();
};
@@ -76,6 +88,27 @@
return *this->s_;
}
+ template <typename S, typename E>
+ inline
+ void
+ site_set_iterator_base<S, E>::change_target(const S& s)
+ {
+ this->s_ = & s;
+ // p might be also updated since it can hold a pointer towards
+ // the set it designates, so:
+ if_possible::change_target(p_, s);
+ // Last:
+ this->invalidate();
+ }
+
+ template <typename S, typename E>
+ inline
+ const mln_psite(S)&
+ site_set_iterator_base<S, E>::p_hook_() const
+ {
+ return p_;
+ }
+
#endif // ! MLN_INCLUDE_ONLY
} // end of namespace internal
Index: mln/core/internal/piter_adaptor.hh
--- mln/core/internal/piter_adaptor.hh (revision 2067)
+++ mln/core/internal/piter_adaptor.hh (working copy)
@@ -31,10 +31,14 @@
/*! \file mln/core/internal/piter_adaptor.hh
*
* \brief Definition of iterators on points of boxes.
+ *
+ * \todo Rename as site_iterator_adaptor_base.
+ *
+ * \todo Distinguish between adaptors of site_set_iterator,
+ * site_relative_iterator, etc. (?)
*/
-# include <mln/core/internal/site_set_iterator_base.hh>
-# include <mln/core/concept/box.hh>
+# include <mln/core/internal/site_iterator_base.hh>
namespace mln
@@ -44,14 +48,18 @@
{
/*! \internal A base class for point iterator adaptors.
+ *
* Parameter \c Pi is the type of the point iterator adaptee;
* parameter E is the exact type.
*/
- template <typename Pi, typename E>
- class piter_adaptor_ : public internal::site_set_iterator_base< mln_pset(Pi), E >
+ template <typename Pi, typename S, typename E>
+ class piter_adaptor_ : public internal::site_iterator_base< S, E >
{
public:
+ /// Constructor without argument.
+ piter_adaptor_();
+
/// Constructor from a point iterator \p piter.
piter_adaptor_(const Pi& piter);
@@ -67,54 +75,86 @@
/// Go to the next point.
void next_();
- protected:
+ /// Hook to the current location.
+ const mln_psite(S)& p_hook_() const;
- Pi piter_; // own copy
- };
+ /// Change the site set targeted by this iterator.
+ void change_target(const S& s);
+ protected:
+ /// The adaptee site iterator.
+ Pi pi_; // own copy
+ };
# ifndef MLN_INCLUDE_ONLY
- template <typename Pi, typename E>
+ template <typename Pi, typename S, typename E>
inline
- piter_adaptor_<Pi,E>::piter_adaptor_(const Pi& piter)
- : piter_(piter)
+ piter_adaptor_<Pi,S,E>::piter_adaptor_()
+ {
+ }
+
+ template <typename Pi, typename S, typename E>
+ inline
+ piter_adaptor_<Pi,S,E>::piter_adaptor_(const Pi& pi)
+ : pi_(pi)
{
invalidate_();
}
- template <typename Pi, typename E>
+ template <typename Pi, typename S, typename E>
inline
bool
- piter_adaptor_<Pi,E>::is_valid_() const
+ piter_adaptor_<Pi,S,E>::is_valid_() const
+ {
+ return pi_.is_valid();
+ }
+
+ template <typename Pi, typename S, typename E>
+ inline
+ void
+ piter_adaptor_<Pi,S,E>::invalidate_()
{
- return piter_.is_valid();
+ pi_.invalidate();
}
- template <typename Pi, typename E>
+ template <typename Pi, typename S, typename E>
inline
void
- piter_adaptor_<Pi,E>::invalidate_()
+ piter_adaptor_<Pi,S,E>::start_()
{
- piter_.invalidate();
+ pi_.start();
}
- template <typename Pi, typename E>
+ template <typename Pi, typename S, typename E>
inline
void
- piter_adaptor_<Pi,E>::start_()
+ piter_adaptor_<Pi,S,E>::next_()
+ {
+ pi_.next();
+ }
+
+ template <typename Pi, typename S, typename E>
+ inline
+ const mln_psite(S)&
+ piter_adaptor_<Pi,S,E>::p_hook_() const
{
- piter_.start();
+ return pi_.p_hook_();
}
- template <typename Pi, typename E>
+ template <typename Pi, typename S, typename E>
inline
void
- piter_adaptor_<Pi,E>::next_()
+ piter_adaptor_<Pi,S,E>::change_target(const S& s)
{
- piter_.next();
+ this->s_ = & s;
+ // p might be also updated since it can hold a pointer towards
+ // the set it designates, so:
+ pi_.change_target( exact(this)->pi_set_from_(s) );
+ // Last:
+ this->invalidate();
}
# endif // ! MLN_INCLUDE_ONLY
Index: mln/core/neighb.hh
--- mln/core/neighb.hh (revision 2067)
+++ mln/core/neighb.hh (working copy)
@@ -37,6 +37,9 @@
# include <mln/core/internal/basic_window_impl.hh>
# include <mln/core/internal/neighborhood_impl_mixin.hh>
+# include <mln/core/window.hh>
+# include <mln/literal/zero.hh>
+
namespace mln
{
@@ -62,6 +65,16 @@
// Overridden from internal::basic_window_impl so that it also
// inserts \a -dp.
neighb<D>& insert_(const D& dp);
+
+ typedef mln::window<D> window;
+
+ window to_window() const
+ {
+ window tmp(this->dps_);
+ D zero = literal::zero;
+ tmp.insert(zero);
+ return tmp;
+ }
};
Index: mln/core/box_piter.hh
--- mln/core/box_piter.hh (revision 2067)
+++ mln/core/box_piter.hh (working copy)
@@ -51,7 +51,7 @@
box_fwd_piter_<P> >
{
typedef box_fwd_piter_<P> self_;
- typedef internal::site_iterator_base< box<P>, self_ > super_;
+ typedef internal::site_set_iterator_base< box<P>, self_ > super_;
public:
@@ -79,9 +79,8 @@
/// Go to the next point.
void next_();
- using super_::p;
-
protected:
+ using super_::p_;
using super_::s_;
};
@@ -94,11 +93,11 @@
* \see mln::box_
*/
template <typename P>
- class box_bkd_piter_ : public internal::site_iterator_base< box<P>,
+ class box_bkd_piter_ : public internal::site_set_iterator_base< box<P>,
box_bkd_piter_<P> >
{
typedef box_bkd_piter_<P> self_;
- typedef internal::site_iterator_base< box<P>, self_ > super_;
+ typedef internal::site_set_iterator_base< box<P>, self_ > super_;
public:
@@ -126,9 +125,8 @@
/// Go to the next point.
void next_();
- using super_::p;
-
protected:
+ using super_::p_;
using super_::s_;
};
@@ -158,7 +156,7 @@
bool
box_fwd_piter_<P>::is_valid_() const
{
- return p()[0] != s_->pmax()[0] + 1;
+ return p_[0] != s_->pmax()[0] + 1;
}
template <typename P>
@@ -166,7 +164,7 @@
void
box_fwd_piter_<P>::invalidate_()
{
- p()[0] = s_->pmax()[0] + 1;
+ p_[0] = s_->pmax()[0] + 1;
}
template <typename P>
@@ -174,7 +172,7 @@
void
box_fwd_piter_<P>::start_()
{
- p() = s_->pmin();
+ p_ = s_->pmin();
}
template <typename P>
@@ -183,14 +181,14 @@
box_fwd_piter_<P>::next_()
{
for (int i = dim - 1; i >= 0; --i)
- if (p()[i] == s_->pmax()[i])
- p()[i] = s_->pmin()[i];
+ if (p_[i] == s_->pmax()[i])
+ p_[i] = s_->pmin()[i];
else
{
- ++p()[i];
+ ++p_[i];
break;
}
- if (p() == s_->pmin())
+ if (p_ == s_->pmin())
invalidate_();
}
@@ -215,7 +213,7 @@
bool
box_bkd_piter_<P>::is_valid_() const
{
- return p()[0] != s_->pmin()[0] - 1;
+ return p_[0] != s_->pmin()[0] - 1;
}
template <typename P>
@@ -223,7 +221,7 @@
void
box_bkd_piter_<P>::invalidate_()
{
- p()[0] = s_->pmin()[0] - 1;
+ p_[0] = s_->pmin()[0] - 1;
}
template <typename P>
@@ -231,7 +229,7 @@
void
box_bkd_piter_<P>::start_()
{
- p() = s_->pmax();
+ p_ = s_->pmax();
}
template <typename P>
@@ -240,14 +238,14 @@
box_bkd_piter_<P>::next_()
{
for (int i = dim - 1; i >= 0; --i)
- if (p()[i] == s_->pmin()[i])
- p()[i] = s_->pmax()[i];
+ if (p_[i] == s_->pmin()[i])
+ p_[i] = s_->pmax()[i];
else
{
- --p()[i];
+ --p_[i];
break;
}
- if (p() == s_->pmax())
+ if (p_ == s_->pmax())
invalidate_();
}
Index: mln/core/pset_if_piter.hh
--- mln/core/pset_if_piter.hh (revision 2067)
+++ mln/core/pset_if_piter.hh (working copy)
@@ -32,16 +32,17 @@
*
* \brief Definition of iterators on pset_if<S,F>.
*
- * \todo See todo in site_iterator_base.hh
+ * \todo pset_if_bkd_piter_.
*/
-# include <mln/core/internal/site_set_iterator_base.hh>
+# include <mln/core/internal/piter_adaptor.hh>
# include <mln/core/pset_if.hh>
namespace mln
{
+
/*! \brief A generic forward iterator on points of subsets.
*
* Parameter \c S is a point set type; parameter F is a function
@@ -51,8 +52,9 @@
*/
template <typename S, typename F>
class pset_if_fwd_piter_
- : public internal::site_set_iterator_base< pset_if<S,F>,
- pset_if_fwd_piter_<S,F> >
+ : public internal::piter_adaptor_< mln_fwd_piter(S), // Adaptee.
+ pset_if<S,F>, // Site_Set.
+ pset_if_fwd_piter_<S,F> > // Exact.
{
public:
@@ -62,26 +64,14 @@
/// Constructor from a site set.
pset_if_fwd_piter_(const pset_if<S,F>& s);
- /// Test if the iterator is valid.
- bool is_valid_() const;
-
- /// Invalidate the iterator.
- void invalidate_();
-
/// Start an iteration.
void start_();
/// Go to the next point.
void next_();
- mln_fwd_piter(S)& hook_pi_() { return pi_; }
-
- mln_psite(S)& current_p_() { return pi_.p(); }
- const mln_psite(S)& current_p_() const { return pi_.p(); }
-
- private:
-
- mln_fwd_piter(S) pi_;
+ /// The set site targeted by pi_.
+ const S& pi_set_from_(const pset_if<S,F>& s) const;
};
@@ -109,51 +99,37 @@
inline
pset_if_fwd_piter_<S,F>::pset_if_fwd_piter_(const pset_if<S,F>& s)
{
- pi_.change_target(s.overset());
this->change_target(s);
}
template <typename S, typename F>
inline
- bool
- pset_if_fwd_piter_<S,F>::is_valid_() const
- {
- return pi_.is_valid();
- }
-
- template <typename S, typename F>
- inline
void
- pset_if_fwd_piter_<S,F>::invalidate_()
+ pset_if_fwd_piter_<S,F>::start_()
{
- pi_.invalidate();
+ this->pi_.start();
+ while (this->pi_.is_valid() && ! this->s_->pred(this->pi_))
+ this->pi_.next();
}
template <typename S, typename F>
inline
void
- pset_if_fwd_piter_<S,F>::start_()
+ pset_if_fwd_piter_<S,F>::next_()
{
- pi_.start();
- while (pi_.is_valid() && ! this->s_->pred(pi_))
- pi_.next();
-// if (is_valid_())
-// this->p_ = pi_;
+ do
+ this->pi_.next();
+ while (this->pi_.is_valid() && ! this->s_->pred(this->pi_));
}
template <typename S, typename F>
inline
- void
- pset_if_fwd_piter_<S,F>::next_()
+ const S&
+ pset_if_fwd_piter_<S,F>::pi_set_from_(const pset_if<S,F>& s) const
{
- do
- pi_.next();
- while (pi_.is_valid() && ! this->s_->pred(pi_));
-// if (is_valid_())
-// this->p_ = pi_;
+ return s.overset();
}
-
// FIXME: pset_if_bkd_piter_<S,F>
Index: mln/core/p_array_piter.hh
--- mln/core/p_array_piter.hh (revision 2067)
+++ mln/core/p_array_piter.hh (working copy)
@@ -72,7 +72,6 @@
int index() const;
protected:
-
using super::p_;
using super::s_;
};
@@ -117,7 +116,6 @@
int index() const;
protected:
-
using super::p_;
using super::s_;
};
Index: mln/core/dpsites_piter.hh
--- mln/core/dpsites_piter.hh (revision 2067)
+++ mln/core/dpsites_piter.hh (working copy)
@@ -76,8 +76,6 @@
/// Compute the current psite.
mln_psite(V) compute_p_() const;
- dpsites_fwd_piter<V>& update();
-
protected:
unsigned i_;
@@ -119,8 +117,6 @@
/// Compute the current psite.
mln_psite(V) compute_p_() const;
- dpsites_fwd_piter<V>& update();
-
protected:
int i_;
@@ -183,17 +179,6 @@
return *this->c_ + this->s_->std_vector()[i_];
}
- template <typename V>
- inline
- dpsites_fwd_piter<V>&
- dpsites_fwd_piter<V>::update()
- {
- mln_precondition(this->s_ && this->c_);
- this->p_ = compute_p_();
- mln_postcondition(this->is_valid());
- return *this;
- }
-
// Backward.
@@ -247,17 +232,6 @@
return *this->c_ + this->s_->std_vector()[i_];
}
- template <typename V>
- inline
- dpsites_fwd_piter<V>&
- dpsites_bkd_piter<V>::update()
- {
- mln_precondition(this->s_ && this->c_);
- this->p_ = compute_p_();
- mln_postcondition(this->is_valid());
- return *this;
- }
-
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
Index: mln/core/concept/neighborhood.hh
--- mln/core/concept/neighborhood.hh (revision 2067)
+++ mln/core/concept/neighborhood.hh (working copy)
@@ -32,7 +32,7 @@
* \brief Definition of the concept of mln::Neighborhood.
*/
-# include <mln/core/concept/window.hh>
+# include <mln/core/concept/object.hh>
namespace mln
@@ -55,7 +55,7 @@
* class contents.
*/
template <typename E>
- struct Neighborhood : public Window<E>
+ struct Neighborhood : public Object<E>
{
typedef Neighborhood<void> category;
@@ -63,6 +63,9 @@
typedef niter;
typedef fwd_niter;
typedef bkd_niter;
+
+ typedef window;
+ window to_window() const;
*/
protected:
@@ -79,6 +82,10 @@
typedef mln_niter(E) niter;
typedef mln_fwd_niter(E) fwd_niter;
typedef mln_bkd_niter(E) bkd_niter;
+
+ typedef mln_window(E) window;
+ window (E::*m)() const = & E::to_window;
+ m = 0;
}
# endif // ! MLN_INCLUDE_ONLY
Index: mln/morpho/dilation_elementary.hh
--- mln/morpho/dilation_elementary.hh (revision 0)
+++ mln/morpho/dilation_elementary.hh (revision 0)
@@ -0,0 +1,80 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_MORPHO_DILATION_ELEMENTARY_HH
+# define MLN_MORPHO_DILATION_ELEMENTARY_HH
+
+/// \file mln/morpho/dilation_elementary.hh
+/// \brief Morphological elementary dilation.
+
+# include <mln/morpho/dilation.hh>
+
+
+namespace mln
+{
+
+ namespace morpho
+ {
+
+ /// Morphological elementary dilation.
+ ///
+ /// \param[in] input The image to be dilated.
+ /// \param[in] nbh The neighborhood to consider.
+ ///
+ /// The structuring element is the neighborhood + the center site.
+ ///
+ /// \{
+ template <typename I, typename N>
+ mln_concrete(I)
+ dilation_elementary(const Image<I>& input, const Neighborhood<N>& nbh);
+ /// \}
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename I, typename N>
+ mln_concrete(I)
+ dilation_elementary(const Image<I>& input, const Neighborhood<N>& nbh)
+ {
+ trace::entering("morpho::dilation_elementary");
+ mln_precondition(exact(input).has_data());
+ // FIXME: mln_precondition(! exact(nbh).is_empty());
+
+ mln_concrete(I) output = dilation(input, nbh.to_window());
+
+ trace::exiting("morpho::dilation_elementary");
+ return output;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::morpho
+
+} // end of namespace mln
+
+
+#endif // ! MLN_MORPHO_DILATION_ELEMENTARY_HH
1
0
23 Jun '08
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix the linkage of tools from apps/statues/ on GNU/Linux.
* apps/statues/Makefile.am (AM_LDFLAGS): Rename as...
(LDADD): ...this.
Makefile.am | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: apps/statues/Makefile.am
--- apps/statues/Makefile.am (revision 2065)
+++ apps/statues/Makefile.am (working copy)
@@ -4,8 +4,8 @@
AM_CPPFLAGS = -I$(top_srcdir)/milena -I$(top_srcdir)/external/trimesh/include
# Produce fast code.
AM_CXXFLAGS = -O3 -DNDEBUG -ggdb
-# Find trimesh archive.
-AM_LDFLAGS = -L$(top_builddir)/external/trimesh/libsrc -ltrimesh
+# Find the trimesh archive.
+LDADD = -L$(top_builddir)/external/trimesh/libsrc -ltrimesh
bin_PROGRAMS = mesh-segm mesh-skel
mesh_segm_SOURCES = mesh-segm.cc io.hh
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/external/trimesh
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix the linkage of trimesh utilities on GNU/Linux.
* utilsrc/Makefile.am (AM_LDFLAGS): Rename as..
(LDADD): ...this.
Put `-lm' after `-ltrimesh'.
(GLFLAGS): New.
(GLLIBS) [DARWIN]: Move `-framework GLUT -framework OpenGL'...
(GLFLAGS) [DARWIN]: ...here.
(mesh_view_LDFLAGS): s/GLLIBS/GLFLAGS/.
(mesh_view_LDADD): New.
Set to $(LDADD) $(GLLIBS).
Makefile.am | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Index: utilsrc/Makefile.am
--- utilsrc/Makefile.am (revision 2064)
+++ utilsrc/Makefile.am (working copy)
@@ -1,13 +1,14 @@
## Process this file through Automake to produce Makefile.in -*- Makefile -*-
AM_CPPFLAGS = -I$(top_srcdir)/include
-AM_LDFLAGS = -L$(top_builddir)/libsrc -L$(top_builddir)/gluit -lm -ltrimesh
+LDADD = -L$(top_builddir)/libsrc -L$(top_builddir)/gluit -ltrimesh -lm
# FIXME: Handle other OSes as well (Win32, SunOS, etc.)
if DARWIN
-# LIBS += -lobjc
- GLLIBS = -framework GLUT -framework OpenGL -lgluit
+ GLFLAGS = -framework GLUT -framework OpenGL
+ GLLIBS = -lgluit
else !DARWIN
+ GLFLAGS =
GLLIBS = -lgluit -lGL -lGLU -lX11 -lXmu -lXi
endif !DARWIN
@@ -28,4 +29,5 @@
mesh_shade_SOURCES = mesh_shade.cc
mesh_view_SOURCES = mesh_view.cc
-mesh_view_LDFLAGS = $(AM_LDFLAGS) $(GLLIBS)
+mesh_view_LDFLAGS = $(AM_LDFLAGS) $(GLFLAGS)
+mesh_view_LDADD = $(LDADD) $(GLLIBS)
1
0