[PATCH 01/32] Import dynamic-use-of-static-c++.

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * dynamic-use-of-static-c++/: New directory. Fetched from https://svn.lrde.epita.fr/svn/oln/prototypes/dynamic-use-of-static-c++/trunk at revision 377. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4640 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- ChangeLog | 9 + dynamic-use-of-static-c++/.vcs | 23 + dynamic-use-of-static-c++/ChangeLog | 884 ++++++ dynamic-use-of-static-c++/Makefile.am | 5 + dynamic-use-of-static-c++/README | 23 + dynamic-use-of-static-c++/bin/Makefile.am | 4 + dynamic-use-of-static-c++/bin/dyn-config.in | 70 + dynamic-use-of-static-c++/bin/mk_swig_input | 38 + dynamic-use-of-static-c++/bin/swig_tree_to_yaml | 8 + dynamic-use-of-static-c++/bin/yaml_to_dyn_decls | 197 ++ dynamic-use-of-static-c++/bootstrap | 18 + dynamic-use-of-static-c++/config.site | 24 + dynamic-use-of-static-c++/config/Makefile.am | 1 + dynamic-use-of-static-c++/config/erbx | 111 + .../config/mk_local_config_rb_in.rb | 22 + dynamic-use-of-static-c++/config/rbconfig_gen.rb | 19 + dynamic-use-of-static-c++/config/ruby.m4 | 45 + dynamic-use-of-static-c++/config/warning.m4 | 105 + dynamic-use-of-static-c++/configure.ac | 154 + dynamic-use-of-static-c++/data/Makefile.am | 33 + dynamic-use-of-static-c++/data/function.cc | 5 + .../lib/.libs/libiberty-i486-linux.a | Bin 0 -> 486694 bytes .../lib/.libs/libiberty-powerpc-darwin.a | Bin 0 -> 472928 bytes .../lib/libiberty-i486-linux.la | 35 + .../lib/libiberty-powerpc-darwin.la | 35 + .../lib/libiberty-powerpc-darwin8.3.0.la | 35 + dynamic-use-of-static-c++/src/Makefile.am | 79 + dynamic-use-of-static-c++/src/all_methods.erb.cc | 37 + dynamic-use-of-static-c++/src/all_methods.erb.hh | 37 + dynamic-use-of-static-c++/src/ansidecl.h | 326 +++ dynamic-use-of-static-c++/src/config.hh.in | 3 + dynamic-use-of-static-c++/src/cxx_symbols.rb | 115 + dynamic-use-of-static-c++/src/data.cc | 128 + dynamic-use-of-static-c++/src/data.erb.hh | 418 +++ dynamic-use-of-static-c++/src/data.hxx | 61 + dynamic-use-of-static-c++/src/demangle.h | 163 ++ dynamic-use-of-static-c++/src/dyn.hh | 62 + dynamic-use-of-static-c++/src/function.erb.cc | 47 + dynamic-use-of-static-c++/src/function.erb.hh | 63 + dynamic-use-of-static-c++/src/function_loader.cc | 359 +++ dynamic-use-of-static-c++/src/function_loader.hh | 29 + dynamic-use-of-static-c++/src/function_loader.rb | 39 + dynamic-use-of-static-c++/src/name_of.cc | 25 + dynamic-use-of-static-c++/src/name_of.hh | 183 ++ dynamic-use-of-static-c++/src/policy.cc | 18 + dynamic-use-of-static-c++/src/policy.hh | 107 + dynamic-use-of-static-c++/src/ruby_stream.cc | 11 + dynamic-use-of-static-c++/src/ruby_stream.hh | 100 + dynamic-use-of-static-c++/test/Makefile.am | 60 + .../test/fixtures/my_lib/damien.hh | 60 + .../test/fixtures/my_lib/damien.hxx | 57 + .../test/fixtures/my_lib/lib.hh | 105 + .../test/fixtures/some_identifiers.yml.cc | 8 + .../test/fixtures/tree/tree.swig | 2824 +++++++++++++++++++ .../test/fixtures/tree/tree.yml | 2943 ++++++++++++++++++++ .../fixtures/vaucanson/dyn_vaucanson_dyn_mirror.hh | 887 ++++++ .../vaucanson/dyn_vaucanson_mlc_name_of.hh | 126 + dynamic-use-of-static-c++/test/test_containers.cc | 89 + dynamic-use-of-static-c++/test/test_damien.cc | 96 + .../test/test_function_loader.cc | 75 + .../test/test_function_loader.rb | 23 + .../test/test_function_loader_cxx.rb | 26 + dynamic-use-of-static-c++/test/test_methods.cc | 26 + dynamic-use-of-static-c++/test/test_olena.cc | 21 + dynamic-use-of-static-c++/test/test_var_and_val.cc | 95 + .../test/vaucanson/Makefile.am | 18 + .../test/vaucanson/dyn_algorithms.cc | 464 +++ .../test/vaucanson/dyn_vaucanson_dyn_mirror.hh | 1277 +++++++++ .../test/vaucanson/test-loader.cc | 39 + .../vcs/dynamic_static_bridge_vcs.rb | 19 + 70 files changed, 13651 insertions(+), 0 deletions(-) create mode 100644 dynamic-use-of-static-c++/.vcs create mode 100644 dynamic-use-of-static-c++/ChangeLog create mode 100644 dynamic-use-of-static-c++/Makefile.am create mode 100644 dynamic-use-of-static-c++/README create mode 100644 dynamic-use-of-static-c++/bin/Makefile.am create mode 100755 dynamic-use-of-static-c++/bin/dyn-config.in create mode 100755 dynamic-use-of-static-c++/bin/mk_swig_input create mode 100755 dynamic-use-of-static-c++/bin/swig_tree_to_yaml create mode 100755 dynamic-use-of-static-c++/bin/yaml_to_dyn_decls create mode 100755 dynamic-use-of-static-c++/bootstrap create mode 100644 dynamic-use-of-static-c++/config.site create mode 100644 dynamic-use-of-static-c++/config/Makefile.am create mode 100755 dynamic-use-of-static-c++/config/erbx create mode 100644 dynamic-use-of-static-c++/config/mk_local_config_rb_in.rb create mode 100644 dynamic-use-of-static-c++/config/rbconfig_gen.rb create mode 100644 dynamic-use-of-static-c++/config/ruby.m4 create mode 100644 dynamic-use-of-static-c++/config/warning.m4 create mode 100644 dynamic-use-of-static-c++/configure.ac create mode 100644 dynamic-use-of-static-c++/data/Makefile.am create mode 100644 dynamic-use-of-static-c++/data/function.cc create mode 100644 dynamic-use-of-static-c++/lib/.libs/libiberty-i486-linux.a create mode 100644 dynamic-use-of-static-c++/lib/.libs/libiberty-powerpc-darwin.a create mode 100644 dynamic-use-of-static-c++/lib/libiberty-i486-linux.la create mode 100644 dynamic-use-of-static-c++/lib/libiberty-powerpc-darwin.la create mode 100644 dynamic-use-of-static-c++/lib/libiberty-powerpc-darwin8.3.0.la create mode 100644 dynamic-use-of-static-c++/src/Makefile.am create mode 100644 dynamic-use-of-static-c++/src/all_methods.erb.cc create mode 100644 dynamic-use-of-static-c++/src/all_methods.erb.hh create mode 100644 dynamic-use-of-static-c++/src/ansidecl.h create mode 100644 dynamic-use-of-static-c++/src/config.hh.in create mode 100644 dynamic-use-of-static-c++/src/cxx_symbols.rb create mode 100644 dynamic-use-of-static-c++/src/data.cc create mode 100644 dynamic-use-of-static-c++/src/data.erb.hh create mode 100644 dynamic-use-of-static-c++/src/data.hxx create mode 100644 dynamic-use-of-static-c++/src/demangle.h create mode 100644 dynamic-use-of-static-c++/src/dyn.hh create mode 100644 dynamic-use-of-static-c++/src/function.erb.cc create mode 100644 dynamic-use-of-static-c++/src/function.erb.hh create mode 100644 dynamic-use-of-static-c++/src/function_loader.cc create mode 100644 dynamic-use-of-static-c++/src/function_loader.hh create mode 100644 dynamic-use-of-static-c++/src/function_loader.rb create mode 100644 dynamic-use-of-static-c++/src/name_of.cc create mode 100644 dynamic-use-of-static-c++/src/name_of.hh create mode 100644 dynamic-use-of-static-c++/src/policy.cc create mode 100644 dynamic-use-of-static-c++/src/policy.hh create mode 100644 dynamic-use-of-static-c++/src/ruby_stream.cc create mode 100644 dynamic-use-of-static-c++/src/ruby_stream.hh create mode 100644 dynamic-use-of-static-c++/test/Makefile.am create mode 100644 dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hh create mode 100644 dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hxx create mode 100644 dynamic-use-of-static-c++/test/fixtures/my_lib/lib.hh create mode 100644 dynamic-use-of-static-c++/test/fixtures/some_identifiers.yml.cc create mode 100644 dynamic-use-of-static-c++/test/fixtures/tree/tree.swig create mode 100644 dynamic-use-of-static-c++/test/fixtures/tree/tree.yml create mode 100644 dynamic-use-of-static-c++/test/fixtures/vaucanson/dyn_vaucanson_dyn_mirror.hh create mode 100644 dynamic-use-of-static-c++/test/fixtures/vaucanson/dyn_vaucanson_mlc_name_of.hh create mode 100644 dynamic-use-of-static-c++/test/test_containers.cc create mode 100644 dynamic-use-of-static-c++/test/test_damien.cc create mode 100644 dynamic-use-of-static-c++/test/test_function_loader.cc create mode 100644 dynamic-use-of-static-c++/test/test_function_loader.rb create mode 100644 dynamic-use-of-static-c++/test/test_function_loader_cxx.rb create mode 100644 dynamic-use-of-static-c++/test/test_methods.cc create mode 100644 dynamic-use-of-static-c++/test/test_olena.cc create mode 100644 dynamic-use-of-static-c++/test/test_var_and_val.cc create mode 100644 dynamic-use-of-static-c++/test/vaucanson/Makefile.am create mode 100644 dynamic-use-of-static-c++/test/vaucanson/dyn_algorithms.cc create mode 100644 dynamic-use-of-static-c++/test/vaucanson/dyn_vaucanson_dyn_mirror.hh create mode 100644 dynamic-use-of-static-c++/test/vaucanson/test-loader.cc create mode 100644 dynamic-use-of-static-c++/vcs/dynamic_static_bridge_vcs.rb diff --git a/ChangeLog b/ChangeLog index ba281c8..bc82322 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-06-08 Roland Levillain <roland@lrde.epita.fr> + + Import dynamic-use-of-static-c++. + + * dynamic-use-of-static-c++/: New directory. + Fetched from + https://svn.lrde.epita.fr/svn/oln/prototypes/dynamic-use-of-static-c++/trunk + at revision 377. + 2009-10-16 Edwin Carlinet <carlinet@lrde.epita.fr> Update configure.ac with AVS IO tests Makefile. diff --git a/dynamic-use-of-static-c++/.vcs b/dynamic-use-of-static-c++/.vcs new file mode 100644 index 0000000..ef8e8b2 --- /dev/null +++ b/dynamic-use-of-static-c++/.vcs @@ -0,0 +1,23 @@ +--- +precious: + - repository + +unmask: + - test/olena/proto-stl-style + - test/dyn.log + - libltdl + +exclude: + - Makefile.in + - _build + - _config + - _install + + # autotools stuffs + - configure + - autom4te.cache + - aclocal.m4 + +junk: + - \.gdb_history + - a.out diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog new file mode 100644 index 0000000..5a65dfe --- /dev/null +++ b/dynamic-use-of-static-c++/ChangeLog @@ -0,0 +1,884 @@ +2006-01-15 Nicolas Pouillard <ertai@lrde.epita.fr> + + Add another version of libiberty. + + * lib/libiberty-powerpc-darwin8.3.0.la: A copy of + libiberty-powerpc-darwin.la + +2005-12-06 Nicolas Pouillard <ertai@lrde.epita.fr> + + Remove to ruby evals. + + * src/function_loader.cc: Update. + +2005-12-06 Nicolas Pouillard <ertai@lrde.epita.fr> + + Remove options, add method. + + * src/function.erb.cc, + * src/function.erb.hh, + * src/function_loader.cc, + * src/function_loader.hh, + * src/all_methods.erb.cc, + * src/data.erb.hh, + * src/data.cc: Update. + * src/dyn.hh: Add typdefs. + * test/test_function_loader.cc, + * test/test_damien.cc, + * test/test_methods.cc, + * test/test_containers.cc: Update tests. + +2005-12-06 Nicolas Pouillard <ertai@lrde.epita.fr> + + Disable the ruby segv handler. + + * src/function_loader.cc: Ignore segv cause the system handle it + normally. + +2005-12-06 Nicolas Pouillard <ertai@lrde.epita.fr> + + Flags and include_dirs go to the (dark) C++ side. + + * src/function_loader.rb: Simplify since it's just a function now. + * src/function_loader.cc: Update accordingly. + * test/Makefile.am: Add a rule to build tests. + +2005-12-06 Nicolas Pouillard <ertai@lrde.epita.fr> + + Generate the C++ code from C++. + + * src/function_loader.cc, + * src/function_loader.hh, + * src/function_loader.rb: More C++, less ruby. + + * src/function.erb.cc: Reverse load_function argument order. + * src/function.erb.hh: Reorder arguments. + * src/ruby_stream.hh: Add a debug mode. + * src/data.erb.hh: Remove a useless comma. + * src/data.cc: Add * to paths in method(). + * config/erbx: Add * to fake_method. + * test/test_function_loader.cc: The path is the third argument. + * configure.ac: Add -Werror. + +2005-12-04 Nicolas Pouillard <ertai@lrde.epita.fr> + + Make the config.site compliant with sub-confgiures on linux. + + * config.site: Do not exit if the package name is wrong. + +2005-12-04 Nicolas Pouillard <ertai@lrde.epita.fr> + + Use libltdl. + + * bootstrap, + * Makefile.am, + * configure.ac: Add the libltld. + + * src/Makefile.am, + * src/function.erb.cc, + * src/ruby_stream.hh, + * src/function.erb.hh, + * src/function_loader.cc, + * src/function_loader.hh, + * src/function_loader.rb: More C++ less ruby. + + * bin/dyn-config.in: . + * data/Makefile.am: Produce two makefiles for the repository. + * data/function.cc: Update the include. + + * test/Makefile.am: Update flags. + * test/fixtures/my_lib/damien.hxx: Remove the name_of include. + * test/test_function_loader.cc: Add another dfoo1 call. + +2005-12-04 Nicolas Pouillard <ertai@lrde.epita.fr> + + Remove all svn:ignore properties. + + * ., test, src: Update. + +2005-12-01 Nicolas Pouillard <ertai@lrde.epita.fr> + + Use a more portable pattern. + + * src/Makefile.am: No # since it begins a comment. + +2005-12-01 Nicolas Pouillard <ertai@lrde.epita.fr> + + Now works installed. + + * src/Makefile.am: Adapt to the new design. + * src/function_loader.rb: Use dyn-light.hh. + * src/data.erb.hh: Leave a FIXME. + * bin/dyn-config.in: More calls to expand. + * bin/Makefile.am: Install just dyn-config. + + * test/test_var_and_val.cc, + * test/test_damien.cc, + * test/test_olena.cc, + * test/test_methods.cc, + * test/test_containers.cc, + * test/test_function_loader.cc: Include dyn-all.hh. + +2005-12-01 Nicolas Pouillard <ertai@lrde.epita.fr> + + Update the liberty lib for i486-linux. + + * lib/libiberty-linux.a: Remove. + * lib/libiberty-i486-linux.la: New. + * lib/.libs/libiberty-i486-linux.a: New. + +2005-12-01 Nicolas Pouillard <ertai@lrde.epita.fr> + + Clean svn:ignore properties. + + * ., + * src, + * test, + * test/vaucanson, + * test/olena: Remove svn:ignore since the .vcs handle them. + +2005-12-01 Nicolas Pouillard <ertai@lrde.epita.fr> + + Commit a common .vcs. + + * .vcs: New. + +2005-12-01 Nicolas Pouillard <ertai@lrde.epita.fr> + + 2 little fixes. + + * configure.ac: Remove useless echo ans comments. + * README: Talk about the PATH extension. + +2005-12-01 Nicolas Pouillard <ertai@lrde.epita.fr> + + Dyn now use the autotools! + + * README: Deal with the new the schema. + * bin/dyn-config.in: New. A nice tool to use the project. + + Removing part: + * configure: Remove. + * Makefile.in: Remove. + * test/Makefile.in: Remove. + * test/vaucanson/Makefile.in: Remove. + + New autotools part: + * bootstrap: New. + * configure.ac: New. + * config: New. + * config/erbx: New. + * config/ruby.m4: New. + * config/mk_local_config_rb_in.rb: New. + * config/rbconfig_gen.rb: New. + * config/warning.m4: New. + * config/Makefile.am: New. + * config.site: New. + * Makefile.am: New. + * data/Makefile.am: New. + * data/function.cc: New. Dummy function to make a base makefile. + * bin/Makefile.am: New. + * src/Makefile.am: New. + * test/Makefile.am: New. + * test/vaucanson/Makefile.am: New. + + Test part: + * test/test_var_and_val.cc, + * test/test_damien.cc, + * test/test_olena.cc, + * test/test_methods.cc, + * test/test_containers.cc, + * test/test_function_loader.cc: Update include dirs. + + * src/all_methods.erb.hh, + * src/all_methods.erb.cc, + * src/function.erb.hh, + * src/function.erb.cc, + * src/ruby_stream.hh: Update includes and erb variables. + + * src/function_loader.rb: Use md5 for filenames. + * src/config.hh.in: Add DYN_FIXTURES. + * src/data.cc: Properly setup de logger. + +2005-11-27 Nicolas Pouillard <ertai@lrde.epita.fr> + + Improve background compilation. + + * configure: Add silent_link (libtool --silent). + * src/function_loader.rb: Make objects without libtool (to avoid the + double compilation), and use the silent linking. + +2005-11-27 Nicolas Pouillard <ertai@lrde.epita.fr> + + Vaucanson test... + + +2005-11-27 Nicolas Pouillard <ertai@lrde.epita.fr> + + Handle multiple paths for a same function (sep by `:'). + + * test/test_methods.cc: New. + * bin/mk_swig_input, + * bin/yaml_to_dyn_decls, + * src/cxx_symbols.rb, + * src/function_loader.rb, + * configure, + * test/Makefile.in, + * test/fixtures/my_lib/lib.hh: Update. + +2005-11-26 Nicolas Pouillard <ertai@lrde.epita.fr> + + Code re-organisation. Produce a library using libtool. + + * src/dyn.hh: Update. + * src/data.erb.hh: Inherit from all_methods. + * src/data.erb.hxx: Remove. No more an erb template. + * src/data.hxx: New. From data.erb.hxx. + * src/data.cc: New. + * src/ruby_stream.hh: Export ruby::eval, add the environment struct. + * src/ruby_stream.cc: New. + * src/function.erb.cc: New. + * src/policy.hh: Export the implementation. + * src/policy.cc: New. + * src/name_of.hh: Export the implementation. + * src/name_of.cc: New. + * src/function_loader.hh: Export the implementation. + * src/function_loader.cc: New. + * src/function_loader.rb: Update to libtool. + * src/all_methods.erb.hh: New. + * src/all_methods.erb.cc: New. + * src/function.erb.hxx: Remove. + + Remove the old static library, add a libtool one. + * lib/libiberty-macos.a: Remove. + * lib/.libs: New. + * lib/libiberty-powerpc-darwin.la: New. + * lib/.libs/libiberty-powerpc-darwin.a: New. + + * configure: Improve and simplify. + * Makefile.in: New. + + * test/Makefile.in: Update to libtool. + * test/fixtures/my_lib/lib.hh, + * test/fixtures/my_lib/damien.hh: Remove the name_of.hh include. + +2005-11-25 Nicolas Pouillard <ertai@lrde.epita.fr> + + Use a data_proxy_by_ptr values returned by a ctor. + + * src/function_loader.rb: Change the generated code for ctors. + * src/data.erb.hh: Some fixes in data_proxy_by_ptr<T>. + +2005-11-25 Nicolas Pouillard <ertai@lrde.epita.fr> + + Change the data methods extension system. + + * src/data.erb.hh: Declare them. + * src/data.erb.hxx: Implement them. + * configure: Give it as argument the file containing your methods. + * src/dyn.hh: Define DYN_FULL_IMPLEMENTATION. + * bin/yaml_to_dyn_decls: Generate methods with the new format. + * test/vaucanson/Makefile.in: Update. + +2005-11-25 Nicolas Pouillard <ertai@lrde.epita.fr> + + Higly simplify the arguments handling. + + * src/function_loader.rb: No more stringify then parse arguments. + +2005-11-25 Nicolas Pouillard <ertai@lrde.epita.fr> + + Revert the previous patch. + + * src/data.erb.hxx, src/data.erb.hh: Restore this useful piece + of code. + +2005-11-25 Nicolas Pouillard <ertai@lrde.epita.fr> + + Remove a FIXME and some useless code. + + * src/data.erb.hh, src/data.erb.hxx: Remove data::get_const_ref and the + const version of operator*. + +2005-11-25 Nicolas Pouillard <ertai@lrde.epita.fr> + + Make works the var -> val conversion. + + * src/dyn.hh: Use const_assign. + * src/data.erb.hh: Implement it. + * test/test_var_and_val.cc: Remove the FIXME about that. + +2005-11-25 Nicolas Pouillard <ertai@lrde.epita.fr> + + Factor cpy ctors. + + * src/data.erb.hh, src/data.erb.hxx: + Clean, unify and factor the cpy ctors, and assignments operators. + +2005-11-25 Nicolas Pouillard <ertai@lrde.epita.fr> + + Little fix with the constness. + + * test/test_containers.cc: Restore the "for" loop over a std::vector. + * src/function_loader.rb: Make const optional in the first_type_is_ptr + regexp. + * src/policy.hh: Do not write in cout but in logger. Do not propagate + the const here. + * src/data.erb.hh: But here. + +2005-11-25 Nicolas Pouillard <ertai@lrde.epita.fr> + + Automatic void detection, and automatic referencing for ret values. + + * src/policy.hh: New. Use few C++ tricks to get rid of void functions, + and detect functions returning references and const references. + * src/data.erb.hh, + * src/data.erb.hxx, + * src/function_loader.rb: Update to the new policy system. + * src/function.erb.hh: Remove proc and ctor2. + * src/cxx_symbols.rb: Better const handling. + * src/dyn.hh: Update. + * bin/yaml_to_dyn_decls: No more generate proc decls. + + * lib/libiberty-macos.a: Use a new and patched version (no use of environ). + + * test/test_damien.cc, + * test/test_olena.cc, + * test/test_function_loader.cc: Replace proc by fun. + +2005-11-24 Nicolas Pouillard <ertai@lrde.epita.fr> + + Merge the demangling branch into the trunk. + + +2005-11-23 Nicolas Pouillard <ertai@lrde.epita.fr> + + Use the compiler typeof + binutils demangling. + +2005-11-22 Nicolas Pouillard <ertai@lrde.epita.fr> + + Merge trunk -> branch. + + Merge from 342 to 344. + +2005-11-22 Nicolas Pouillard <ertai@lrde.epita.fr> + + No more share the same nil object. + + * src/data.erb.hh: Update clone and the cpy ctor of data. + +2005-11-22 Nicolas Pouillard <ertai@lrde.epita.fr> + + Work in progess. + + +2005-11-22 Nicolas Pouillard <ertai@lrde.epita.fr> + + Merge trunk -> branch. + + Merge from 335 to 341. + Replace misc_compile_line to cflags and ldflags + +2005-11-21 Nicolas Pouillard <ertai@lrde.epita.fr> + + More ctors, more tests. + + * test/test_var_and_val.cc: More tests. + * src/name_of.hh: Add T[], and T[N]. + * src/data.erb.hxx: Add 2 ctors defs. + * src/dyn.hh: Add 3 ctors defs. + * src/cxx_symbols.rb: Handle []. + * src/data.erb.hh: Add is_const() and 2 ctors decls. + +2005-11-21 Nicolas Pouillard <ertai@lrde.epita.fr> + + Make nil_proxy a pointer and no more take its address. + + * src/data.erb.hxx, src/data.erb.hh: Update. + +2005-11-21 Nicolas Pouillard <ertai@lrde.epita.fr> + + Add val, improve var. + + * test/test_var_and_val.cc: New. Does not works completly. + * src/dyn.hh: Add the var and the val classes. + * src/data.erb.hh: Add new ctors decls. + * src/data.erb.hxx: Add the new ctors defs. + + * test/Makefile.in:Make it an erb template. + * src/config.hh.in, + * configure, + * test/test_damien.cc, + * test/test_olena.cc, + * test/test_containers.cc, + * test/test_function_loader.cc: Update. + * test/olena: New. + +2005-11-20 Nicolas Pouillard <ertai@lrde.epita.fr> + + Constness, reference/copy returned values... + + * src/data.erb.hh, src/data.erb.hxx: + Really handle the constness (without const_cast), provide different + kinds of memory managment (by_ptr, by_ref, by_cpy, by_const_ref), to + honor readonly, lvalue, by_cpy properties. Add a traits to make a + good automatic default behaviour. + + * configure: Improve and make it loadable. + * src/dyn.hh, + * src/function_loader.hh, + * src/function_loader.rb, + * src/function.erb.hh: Update. + * src/cxx_symbols.rb: Better const handling. + + * test/test_containers.cc: New. Extract from test_function_loader.cc. + * test/test_function_loader.cc: Remove the container tests. + + * test/Makefile.in: Make it real, but do not handle deps :( + * test/test_olena.cc, + * src/config.hh.in, + * test/vaucanson/dyn_algorithms.cc, + * test/test_damien.cc: Replace SOURCE_DIR by DYNDIR. + +2005-11-20 Nicolas Pouillard <ertai@lrde.epita.fr> + + In fact, an iterator has a copy ctor :). + + * test/fixtures/my_lib/lib.hh: Remove this silly and buggy + specializtion. + +2005-11-19 Nicolas Pouillard <ertai@lrde.epita.fr> + + Restore the Damien patch into the new branch. + + Add demangle from libiberty. + + * test/test_damien.cc: a few changes. + * test/fixtures/my_lib/damien.hxx: Add sqr. + * test/fixtures/my_lib/damien.hh: Add sqr. + * lib/libiberty-linux.a: New. libiberty for linux. + * lib/libiberty-macos.a: New. libiberty for macos. + * src/demangle.h: New. Demangling header. + * src/ansidecl.h: New. Needed by demangle.h + * src/function_loader.hh: Add misc_compile_line for add compilation + line options. + * src/function_loader.rb: Likewise. + * src/data.erb.hh: Now use demangling from libiberty instead of + name_of. + +2005-11-19 Nicolas Pouillard <ertai@lrde.epita.fr> + + Add a better support for methods. + +2005-11-19 Nicolas Pouillard <ertai@lrde.epita.fr> + + Revert the previous patch before make a branch. + +2005-11-18 Nicolas Pouillard <ertai@lrde.epita.fr> + + Add type2() and simplify the function options. + +2005-11-18 Nicolas Pouillard <ertai@lrde.epita.fr> + + Add a little README file. + + * README: New. + * test/test_function_loader.cc: Add an exit message. + +2005-11-18 Nicolas Pouillard <ertai@lrde.epita.fr> + + Add some operators and handle returned references. + +2005-11-17 Nicolas Pouillard <ertai@lrde.epita.fr> + + Fix some tests. + + * test/fixtures/some_identifiers.yml.cc, + * test/test_function_loader.rb, + * test/test_function_loader_cxx.rb: Adapt these tests to the current + version. + * src/function_loader.rb: Improve the void detection. + +2005-11-16 Nicolas Pouillard <ertai@lrde.epita.fr> + + After the rush... + + * test/fixtures/vaucanson: New. + * test/fixtures/vaucanson/dyn_vaucanson_mlc_name_of.hh: New. + * test/fixtures/vaucanson/dyn_vaucanson_dyn_mirror.hh: New. + * test/vaucanson/dyn_algorithms.cc: New. + * test/test_damien.cc, + * test/fixtures/my_lib/lib.hh, + * test/vaucanson/Makefile.in, + * test/test_function_loader.cc, + * src/name_of.hh, + * src/data.erb.hxx, + * src/cxx_symbols.rb, + * src/function_loader.rb, + * src/data.erb.hh, + * bin/yaml_to_dyn_decls: Many changes. + +2005-11-15 Nicolas Pouillard <ertai@lrde.epita.fr> + + Some fixes. + + * test/test_function_loader.cc: Exit. + * src/function_loader.rb: Fix. + +2005-11-15 Nicolas Pouillard <ertai@lrde.epita.fr> + + Make works better. + + * test/fixtures/my_lib/lib.hh, + * test/test_function_loader.cc, + * configure, + * src/data.erb.hxx, + * src/function_loader.hh, + * src/function_loader.rb, + * src/data.erb.hh: Update. + +2005-11-15 Nicolas Pouillard <ertai@lrde.epita.fr> + + A printable is not a not_printable. + +2005-11-15 Nicolas Pouillard <ertai@lrde.epita.fr> + + Less badly used references. + +2005-11-15 Nicolas Pouillard <ertai@lrde.epita.fr> + + Fix basics tests. + + * test/fixtures/my_lib/damien.hxx, + * test/fixtures/my_lib/lib.hh, + * test/fixtures/my_lib/damien.hh: Use name_of not mlc. + * src/name_of.hh: Add std::ostream. + * src/function_loader.rb: Fix simple function file mangling. + +2005-11-15 Nicolas Pouillard <ertai@lrde.epita.fr> + + Add the vaucanson test. + + * src/name_of.hh: Error at compile time for default case of mlc_name<T>. + * src/function_loader.hh: Put the SOURCE_DIR in $:. + * src/data.erb.hh: Add some mlc_set_name(). + * bin/mk_swig_input: Take the dir as argument. + * bin/yaml_to_dyn_decls: Mangle conversion operators. + * src/cxx_symbols.rb: New. Extract from ... + * src/function_loader.rb: ... here. + + * test/Makefile.in: Add vaucanson. + * test/vaucanson: New. + * test/vaucanson/Makefile.in: New. + * configure: Update. + * test: Add some ignore rules. + +2005-11-14 Nicolas Pouillard <ertai@lrde.epita.fr> + + Add 2 big trees. + + * test/fixtures/tree: New. + * test/fixtures/tree/tree.yml: New. + * test/fixtures/tree/tree.swig: New. + +2005-11-14 Nicolas Pouillard <ertai@lrde.epita.fr> + + Add some swig tools. + + * bin: New. + * bin/mk_swig_input: New. + * bin/yaml_to_dyn_decls: New. + * bin/swig_tree_to_yaml: New. + +2005-11-14 Nicolas Pouillard <ertai@lrde.epita.fr> + + post_include and unset. + + * src: Ignore function.hxx. + * src/function_loader.hh: Handle post_include and unset macros to + avoid multiple defs. + * src/function_loader.rb: Implement post_include. + +2005-11-14 Nicolas Pouillard <ertai@lrde.epita.fr> + + Separation interface/implementation for function.erb.hh. + + +2005-11-14 Damien Thivolle <damien@lrde.epita.fr> + + Rename some includes and add olena test to Makefile.in. + + * test/test_olena.cc: Include dyn.hh. + * test/Makefile.in: Add olena test. + * test/fixtures/oln_name.hh: New. Contains name declarations for + olena. + * src/name_of.hh: New. Old mlc.hh + * src/data.erb.hxx: Update mlc.hh -> name_of.hh. + * src/mlc.hh: Remove. + * src/function_loader.hh: Update mlc.hh -> name_of.hh. + * src/data.erb.hh: Likewise. + +2005-11-14 Nicolas Pouillard <ertai@lrde.epita.fr> + + More warning flags. + + +2005-11-14 Damien Thivolle <damien@lrde.epita.fr> + + Add olena entry to Makefile.in. + + * test/Makefile.in: Refer to title. + +2005-11-14 Nicolas Pouillard <ertai@lrde.epita.fr> + + More examples. + + * test/test_damien.cc: Test deref, get_i, get_t, and clone. + * test/fixtures/my_lib/damien.hxx: New. To test that it works even if + the code is not available during the driver compilation. + Add deref, get_i, get_t, change, clone. + * test/fixtures/my_lib/damien.hh: It's now just the minimal interface. + +2005-11-14 Nicolas Pouillard <ertai@lrde.epita.fr> + + Yeah it works. + + * src/data.erb.hh: Setup conditional inheritance to handle printablity. + + * src/data.erb.hxx, src/function.erb.hh: Fix argument number + compatiblity. + + * test/test_damien.cc: Add test about printablity. + * test/fixtures/my_lib/damien.hh: Add proc change. + * test/test_function_loader.cc: Include dyn not function_loader. + +2005-11-14 Nicolas Pouillard <ertai@lrde.epita.fr> + + Minor changes. + + +2005-11-14 Nicolas Pouillard <ertai@lrde.epita.fr> + + Touch data_gen.hh in configure. + + +2005-11-14 Nicolas Pouillard <ertai@lrde.epita.fr> + + Work in progress. + + * test/test_function_loader.cc: Restore the include. + * src/dyn.hh: Manage includes in the proper order. + * src/mlc.hh: Add mlc_name2 for dynamic type deductions. + * src/function_loader.rb: Support for method_fun2 and method_proc2. + + * src/function_loader.erb.hh: Remove. + * src/data.erb.hxx: New. + * src/function_loader.hh: New. + * src/function.erb.hh: New. + * src/data.erb.hh: New. + * src/data.hh: Remove. + + * src/ruby_stream.hh, + * test/test_damien.cc, + * test/fixtures/my_lib/damien.hh, + * configure: Update. + +2005-11-13 Damien Thivolle <damien@lrde.epita.fr> + + Add const/non const proxy support and tests for olena. + + * test/test_olena.cc: New. Tests for olena. + * test/fixtures/my_lib/lib.hh: Remove templates from constructor + names. + * test/test_function_loader.cc: Remove an include. + * src/function_loader.erb.hh: Operator() now takes directly dyn::data + objects as arguments. + * src/data.hh: Comment print methods so that we can have proxy_data + of std::ostream.. + * src/mlc.hh: Add useful empty lines. + * src/function_loader.rb: Change pointers to references. + +2005-11-13 Nicolas Pouillard <ertai@lrde.epita.fr> + + Add constructors. + + +2005-11-13 Nicolas Pouillard <ertai@lrde.epita.fr> + + Remove \r in data.hh. + + +2005-11-13 Nicolas Pouillard <ertai@lrde.epita.fr> + + Fix the conversion (step1). + +2005-11-13 Nicolas Pouillard <ertai@lrde.epita.fr> + + Use a SortedSet for includes and include_dirs. + + +2005-11-13 Damien Thivolle <damien@lrde.epita.fr> + + Add methods. + + * .: . + * test/test_damien.cc: Test methods. + * test/fixtures/my_lib/damien.hh: Add a method that doesn't take a + std::ostream as argument :). + * src/function_loader.erb.hh: Add method_proc and method_fun. + * src/data.hh: Nothing worth being mentionned, mostly comments + that I've been too lazy to remove. + * src/function_loader.rb: Add method wrappers generation.. + +2005-11-12 Damien Thivolle <damien@lrde.epita.fr> + + Change dynamic_cast to reinterpret_case. + + * src/function_loader.rb: Change dynamic_cast to reinterpret_case. + For some reasons, dynamic_cast doesn't work in a function + called via the DL API. + +2005-11-10 Nicolas Pouillard <ertai@lrde.epita.fr> + + Remove data#assign. + + +2005-11-10 Nicolas Pouillard <ertai@lrde.epita.fr> + + mlc_name_of: const and ref. + + +2005-11-10 Nicolas Pouillard <ertai@lrde.epita.fr> + + Add a default include handling. + + +2005-11-10 Nicolas Pouillard <ertai@lrde.epita.fr> + + Simplify the function handling. + + * test/test_damien.cc, + * test/test_function_loader.cc, + * src/function_loader.erb.hh, + * src/data.hh, + * src/function_loader.rb: Update. + +2005-11-08 Nicolas Pouillard <ertai@lrde.epita.fr> + + More tests, more warnings, less errors. + + * src/data.hh, + * src/dyn.hh, + * src/function_loader.erb.hh, + * src/function_loader.rb, + * test/test_damien.cc, + * test/fixtures/my_lib/lib.hh, + * test/test_function_loader.cc, + * configure: Update. + * src/env.hh: Remove. + * src/call.hh: Remove. + +2005-11-08 Damien Thivolle <damien@lrde.epita.fr> + + Add procedures. + + * test/test_function_loader.cc: Use procedures and functions. + * src/function_loader.erb.hh: Add procedures. + +2005-11-08 Nicolas Pouillard <ertai@lrde.epita.fr> + + Make call_ret works. + + * test/test_function_loader.cc, + * src/function_loader.erb.hh, + * src/data.hh, + * src/dyn.hh, + * src/mlc.hh, + * src/function_loader.rb: Update. + +2005-11-08 Nicolas Pouillard <ertai@lrde.epita.fr> + + Improve the call convention. + + * test/test_damien.cc, + * test/Makefile.in, + * test/fixtures/my_lib/lib.hh, + * test/fixtures/my_lib/damien.hh, + * test/test_function_loader.cc, + * test/test_function_loader_cxx.rb, + * configure, + * src/env.hh, + * src/data.hh, + * src/dyn.hh, + * src/call.hh, + * src/mlc.hh, + * src/function_loader.rb: Improve the call convention. + * src/function_loader.hh: Rename to ... + * src/function_loader.erb.hh: ... this. + +2005-11-07 Damien Thivolle <damien@lrde.epita.fr> + + New loader c++-side interface. + + * test/test_damien.cc: New. A test. + * test/Makefile.in: Add test_damien.cc compilation. + * test/fixtures/my_lib/damien.hh: New. Functions needed by the test. + * src/mangle.hh: Remove. + * src/env.hh: remove this->name_ = name. + * src/data.hh: Comment mangle related methods. + * src/dyn.hh: Remove mangle.hh inclusion. + * src/function_loader.hh: Add call methods. + +2005-11-07 Nicolas Pouillard <ertai@lrde.epita.fr> + + Fix a test. + + * test/test_function_loader_cxx.rb: Remove a incorrect *. + +2005-11-07 Nicolas Pouillard <ertai@lrde.epita.fr> + + Add from_cxx_call. + + * src/function_loader.rb: Add from_cxx_call. + * test/fixtures/some_identifiers.yml.cc: Remove the useless type spec. + * test/test_function_loader_cxx.rb: New. + +2005-11-07 Damien Thivolle <damien@lrde.epita.fr> + + Changes in the loader. + + * src/function_loader.hh: Add call_ret(). + +2005-11-07 Damien Thivolle <damien@lrde.epita.fr> + + Add call() in the loader. + + * src/function_loader.hh: Add call() in the loader. + +2005-11-07 Nicolas Pouillard <ertai@lrde.epita.fr> + + Use YAML instead of PStore. + + * src/function_loader.rb: Because PStore segv sometimes :(. + +2005-11-07 Nicolas Pouillard <ertai@lrde.epita.fr> + + Some fixes. + + * src/data.hh, src/call.hh: include cassert. + * src/function_loader.rb: Use Pathname#read instead of File.read. + +2005-11-07 Nicolas Pouillard <ertai@lrde.epita.fr> + + Change the argument parser. + + * src/function_loader.rb: Use a little LL parser. + * test/fixtures/some_identifiers.yml.cc: All tests passes now. + +2005-11-07 Nicolas Pouillard <ertai@lrde.epita.fr> + + Add the Vcs extension. + + * vcs: New. + * vcs/dynamic_static_bridge_vcs.rb: New. + diff --git a/dynamic-use-of-static-c++/Makefile.am b/dynamic-use-of-static-c++/Makefile.am new file mode 100644 index 0000000..61eb925 --- /dev/null +++ b/dynamic-use-of-static-c++/Makefile.am @@ -0,0 +1,5 @@ +SUBDIRS = libltdl bin src config data test + +ACLOCAL_AMFLAGS = -I config -I libltdl + +EXTRA_DIST = bootstrap diff --git a/dynamic-use-of-static-c++/README b/dynamic-use-of-static-c++/README new file mode 100644 index 0000000..112dac3 --- /dev/null +++ b/dynamic-use-of-static-c++/README @@ -0,0 +1,23 @@ +HOW TO USE THIS PROJECT + +From the repository: + + # Initialize the build system + ./bootstrap + + # Make a build dir + mkdir _build && cd _build + + # Configure the build for your system + # The config.site try to use more efficient tools (g++-4.0 and ccache) + # it also enable the configure caching. + # With --prefix you can set the destination (here _install) + CONFIG_SITE=`pwd`/../config.site ../configure --prefix=`pwd`/../_install + + # For now need to add the bin directory to your path because dyn-config is + # by programs compiled with our system + export PATH=$PATH:`pwd`/bin + + make check # The test with a latest prototype of olena will fail if you + # don't checkout it: + # cd test/olena && svn co https://svn.lrde.epita.fr/svn/oln/prototypes/proto-stl-style diff --git a/dynamic-use-of-static-c++/bin/Makefile.am b/dynamic-use-of-static-c++/bin/Makefile.am new file mode 100644 index 0000000..41bad07 --- /dev/null +++ b/dynamic-use-of-static-c++/bin/Makefile.am @@ -0,0 +1,4 @@ +bin_SCRIPTS = dyn-config +# FIXME put dyn- before these binaries +noinst_SCRIPTS = mk_swig_input swig_tree_to_yaml yaml_to_dyn_decls +BUILT_SOURCES = dyn-config diff --git a/dynamic-use-of-static-c++/bin/dyn-config.in b/dynamic-use-of-static-c++/bin/dyn-config.in new file mode 100755 index 0000000..0271082 --- /dev/null +++ b/dynamic-use-of-static-c++/bin/dyn-config.in @@ -0,0 +1,70 @@ +#!/usr/bin/env ruby +require 'optparse' +require 'pathname' + +def expand ( var, binding ) + var.gsub(/\$\{(.*)\}/) { eval($1, binding) } +end + +name = 'libdyn' +version = '0.1' +prefix = Pathname.new('@prefix@') +includedir = expand('@includedir@', binding) +top_builddir = Pathname.new(__FILE__).dirname.parent +top_srcdir = expand('@top_srcdir@', binding) +exec_prefix = expand('@exec_prefix@', binding) +libdir = expand('@libdir@', binding) + +libtool_flags = '-export-dynamic' +libdir_libdyn_la = Pathname.new("#{libdir}/libdyn.la") +if libdir_libdyn_la.exist? # FIXME Perhaps is assertion is bad. + cflags = "-I#{includedir}" + libtool = 'libtool' # Hope that libtool is installed + libtool_libs = "#{libdir_libdyn_la} #{libtool_flags}" +else + cflags = "-I#{top_builddir}/src -I#{top_srcdir}/src" + libtool_libs = "#{top_builddir}/src/libdyn.la #{libtool_flags}" + libtool = "#{top_builddir}/libtool" +end + +o = OptionParser.new do |o| + o.banner { "Usage: #$0 [OPTION]" } + + o.on('--prefix DIR', + "change #{name} prefix [default #{prefix}])") { |prefix| } + + o.on('--exec-prefix DIR', + "change #{name} exec prefix [default #{exec_prefix}])") { |exec_prefix| } + + # o.on('--libs', 'print library linking information') do + # end + + o.on('--libtool-libs', 'print linking information for use with libtool') do + puts libtool_libs + end + + o.on('--cflags', 'print pre-processor and compiler flags') do + puts cflags + end + + o.on('--compile', 'compile line (add at least the input and the output)') do + puts "#{libtool} --mode=compile --tag=CXX ccache g++ -c #{cflags}" + end + + o.on('--link', 'link line (add at least the input and the output)') do + puts "#{libtool} --mode=link --tag=CXX ccache g++ #{libtool_libs}" + end + + o.on_tail('--help', 'display this help and exit') do + STDERR.puts o + exit + end + + o.on_tail('--version', 'output version information') do + puts "#$0 #{version}" + end +end + +puts o if ARGV.empty? + +o.parse!(ARGV) diff --git a/dynamic-use-of-static-c++/bin/mk_swig_input b/dynamic-use-of-static-c++/bin/mk_swig_input new file mode 100755 index 0000000..5efcc49 --- /dev/null +++ b/dynamic-use-of-static-c++/bin/mk_swig_input @@ -0,0 +1,38 @@ +#!/usr/bin/env ruby +require 'pathname' +load Pathname.new(__FILE__).dirname.parent + 'configure' +includes = [] + +# dir = ARGV.shift +if ARGV.empty? + # STDERR.puts "usage #$0 <dir> <path/to/some/c++/headers.hh>*" + STDERR.puts "usage #$0 <dir>*" + exit +end +# patt = /\.t?h(h|xx)$/ +patt = /\.t?hh$/ +flags = '' # '-DVCSN_USE_INTERFACE_ONLY' +File.open('all.hh', 'w') do |all| + ARGV.each do |root| + Pathname.new(root).find do |path| + next unless path.to_s =~ patt + all.puts "#include \"#{path}\"" + end + end +end +dirs = ARGV.map {|x| '-I' + x} +`g++ #{dirs.join ' '} -I. #{CFLAGS} -I#{DYNDIR} #{flags} -E all.hh | grep '^#.*vaucanson'`.to_a.reverse_each do |line| + line.chomp! + line.gsub!(/^.*include\/(vaucanson\/.*)".*$/, '\1') + next unless line =~ patt + + next if line =~ /\/(static|letter|freemonoid_product(_base)?)\.hh/ # XXX hard skipping + + includes << line unless includes.include? line +end +File.open('vcsn.i', 'w') do |vcsn_i| + includes.reverse_each do |include| + vcsn_i.puts "%include \"#{include}\"" + end + vcsn_i.puts "%module vcsn" +end diff --git a/dynamic-use-of-static-c++/bin/swig_tree_to_yaml b/dynamic-use-of-static-c++/bin/swig_tree_to_yaml new file mode 100755 index 0000000..eb63157 --- /dev/null +++ b/dynamic-use-of-static-c++/bin/swig_tree_to_yaml @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +str = STDIN.read +str.gsub!(/^(\s*) \+\+\+ (\w+) -+$/, '\1- \2:') +str.gsub!(/^(\s*)\+\+\+ (\w+) -+$/, '\1\2:') +str.gsub!(/^(\s*)\| (\S+)\s+- (.*)$/, '\1 \2: \3') +str.gsub!(/^$(\s*) -/, "\\1contents:\n\\1 -") +str.gsub!(/^\s*\|\s*$/, '') +puts str diff --git a/dynamic-use-of-static-c++/bin/yaml_to_dyn_decls b/dynamic-use-of-static-c++/bin/yaml_to_dyn_decls new file mode 100755 index 0000000..85ad16a --- /dev/null +++ b/dynamic-use-of-static-c++/bin/yaml_to_dyn_decls @@ -0,0 +1,197 @@ +#!/usr/bin/env ruby +require 'yaml' +require 'rubygems' +require_gem 'ruby_ex' +require 'ruby_ex' +require 'r_path' +require 'set' +require __FILE__.to_path.dirname.parent/'src/cxx_symbols' +tree = YAML.load STDIN.read +raise "Tree is Empty" if tree.nil? +class Hash + undef type + def name + # self['sym:name'] || super + super.gsub(/.*::/, '') + end + def method_missing ( meth ) + self[meth.to_s] + end +end +class Dumper + def initialize + @namespace = [] + @includes = [] + @states = [] + @all_methods = {} + @qualified_names = SortedSet[] + # @mlc_set_names = [] + @io = STDOUT + + @path_clean_re = /^.*\/include\/(.*)$/ + end + def with ( io, &block ) + oldio = @io + begin + @io = io + block[] + ensure + @io = oldio + end + end + def operator ( name ) + mangle(name) + end + def puts ( *args ) + @io.print ' ' * @namespace.size + @io.puts(*args) + end + def namespace ( name, &block ) + puts "namespace #{name} {" + @namespace << name + @states << 'namespace' + block[] + @namespace.pop + @states.pop + puts "} // end of namespace #{name}" + end + def struct ( name, qualified_name, &block ) + puts "// struct #{name} {" + @namespace << name + @states << 'struct' + block[] + unless @qualified_names.include? "ctor #{qualified_name}" + @qualified_names << "ctor #{qualified_name}" + puts "ctor #{name}(\"#{qualified_name}\");" + end + @namespace.pop + @states.pop + puts '// };' + end + def print_dyn ( key, tree ) + return if tree.nil? + case tree + when Array + tree.each do |node| + print_dyn(nil, node) + end + return + when Hash + if tree.size == 1 + print_dyn(*tree.to_a.first) + return + end + when String + return + end + key = tree.kind if key.nil? or (%w[template class].include? key) + + # No struct specializations + return if tree.specialization == '1' + return if tree.partialspecialization == '1' + + # No instance variables + return if key == 'cdecl' and not (tree.decl != '' and tree.access.nil?) + + # No typdefs + return if tree.storage == 'typedef' + + case key + when 'namespace' + namespace tree.name do + print_dyn nil, tree.contents + end + when 'struct', 'class' + name = (@namespace[1..-1] + [tree.name]).join('::') + unless @qualified_names.include? name + @qualified_names << name +=begin + case n = (parms = (tree.templateparms || '').split(/\s*,\s*/)).size + when 0 then @mlc_set_names << "mlc_set_name(#{name});" + else + b = -1 + builtin_type = /bool|char/ + parms.map! { |p| (p =~ builtin_type)? "#{p} B#{b += 1}" : p } + parm_names = parms.map { |p| p.split(/\s+/).last } + name_of = parms.map do |p| + var = p.split(/\s+/).last + case p + when /bool/ then "((#{var})? \"true\" : \"false\")" + when /char/ then "\"'\" + std::string(#{var}) + \"'\"" + else "mlc_name<#{var}>::of()" + end + end.join(" + \", \" + ") + @mlc_set_names << + "template <#{parms.join(', ')}> struct mlc_name " + + "< #{name}<#{parm_names.join(', ')}> > " + + "{ static std::string of() { return std::string(\"#{name}\") + " + + "\"< \" + #{name_of} + \" >\"; } };" + end +=end + end + struct tree.name, name do + print_dyn nil, tree.contents + end + when 'cdecl' + node_name = tree.name + if node_name =~ /operator/ + node_name = operator(node_name) + end + name = (@namespace + [node_name]).join('::') + return if @qualified_names.include? name + @qualified_names << name + if @states.last == 'struct' + @all_methods[node_name] ||= Set.new + @all_methods[node_name] << @includes.last + else + puts "fun #{node_name}(\"#{name}\", \"\", \"#{@includes.last}\");" + end + when 'include' + @includes << tree.name + print_dyn nil, tree.contents + @includes.pop + # when 'constructor' + # dump "dyn::ctor(#{convert_params(tree.parms)})" + end + end + def print_all_methods + @all_methods.each { |k, v| @all_methods[k] = v.map { |x| x.gsub(@path_clean_re, '\1') } } + puts @all_methods.to_yaml + end +=begin + def print_mlc_set_names + @mlc_set_names.each do |mlc_set_name| + next if mlc_set_name =~ /TiSlot|PartialExp/ # XXX constant ignoring + puts mlc_set_name + end + end +=end +end +dumper = Dumper.new +root = tree.rpath_find(:first, ARGV[0] || 'top/contents/include/*name/vcsn\.i') +# puts root.to_yaml +puts '// ------------------------------------------------ ' +puts '// dyn_vaucanson_dyn_mirror.hh' +File.open('dyn_vaucanson_dyn_mirror.hh', 'w') do |dyn_vaucanson_dyn_mirror_hh| + dumper.with(dyn_vaucanson_dyn_mirror_hh) do + dumper.namespace 'dyn' do + dumper.print_dyn nil, root['contents'] + end + end +end +puts '// ------------------------------------------------ ' +puts '// all_methods.yml' +File.open('dyn_vaucanson_methods.yml', 'w') do |all_methods_yml| + dumper.with(all_methods_yml) do + dumper.print_all_methods + end +end +=begin +puts '// ------------------------------------------------ ' +puts '// dyn_vaucanson_mlc_name.hh' +File.open('dyn_vaucanson_mlc_name.hh', 'w') do |dyn_vaucanson_mlc_name_hh| + dumper.with(dyn_vaucanson_mlc_name_hh) do + dumper.print_mlc_set_names + end +end +=end diff --git a/dynamic-use-of-static-c++/bootstrap b/dynamic-use-of-static-c++/bootstrap new file mode 100755 index 0000000..8bd6e9e --- /dev/null +++ b/dynamic-use-of-static-c++/bootstrap @@ -0,0 +1,18 @@ +#!/bin/sh + +# Failures do matter. +set -e +# Tell what's going on. +set -x + +mkdir -p _config +touch _config/local-config.rb.in + +# Make the libtool with ltdl +libtoolize --force --copy --automake --ltdl + +# Finally, install the GNU Build System. +autoreconf -f -v -i + +# FIXME: autoheader does not obey --force. +find . -name 'config.h*.in' -o -name 'local-config.*.in' | xargs touch diff --git a/dynamic-use-of-static-c++/config.site b/dynamic-use-of-static-c++/config.site new file mode 100644 index 0000000..760273e --- /dev/null +++ b/dynamic-use-of-static-c++/config.site @@ -0,0 +1,24 @@ +# -*- shell-script -*- + +if test $PACKAGE_TARNAME == dyn; then + +# Use the cache. +cache_file=config.cache + +# Use a pretty recent GCC. +for i in -snapshot -4.0 '' +do + gcc$i --help >/dev/null 2>&1 && + : ${CC=ccache gcc$i} + g++$i --help >/dev/null 2>&1 && + : ${CXX=ccache g++$i} +done +# Don't optimize, but do debug. +: ${CXXFLAGS=-ggdb} +echo CC:$CC +echo CXX:$CXX +echo CXXFLAGS:$CXXFLAGS + +else + echo "Loading config.site for the wrong package." >&2 +fi diff --git a/dynamic-use-of-static-c++/config/Makefile.am b/dynamic-use-of-static-c++/config/Makefile.am new file mode 100644 index 0000000..0b6a05c --- /dev/null +++ b/dynamic-use-of-static-c++/config/Makefile.am @@ -0,0 +1 @@ +ruby.m4: rbconfig_gen.rb config/mk_local_config_rb_in.rb diff --git a/dynamic-use-of-static-c++/config/erbx b/dynamic-use-of-static-c++/config/erbx new file mode 100755 index 0000000..bd49f97 --- /dev/null +++ b/dynamic-use-of-static-c++/config/erbx @@ -0,0 +1,111 @@ +#!/usr/bin/env ruby + +# For this project only +DYN_MAX_ARGUMENTS = 10 +ALL_METHODS = { 'fake_method' => ['*'] } +# end + +require 'erb' +require 'pathname' +require 'optparse' +require 'ostruct' + +opts = OpenStruct.new +opts.input_file = '-' +out = STDOUT + +OptionParser.new do |o| + o.on('-c', '--copy', 'Copy the input before the result') { |opts.copy| } + o.on('-C', '--smart-copy', 'Smart copy see the manual') { |opts.smart_copy| } + o.on('-e', '--one-line INPUT', 'One line of input') { |opts.input_line| } + o.on('-i', '--input FILE', 'Input file (stdin by default)') { |opts.input_file| } + o.on('-o', '--output FILE', 'Output file (stdout by default)') do |output_file| + out_path = Pathname.new(output_file) + out_path.chmod(0644) if out_path.exist? + out = out_path.open('w') + out_path.chmod(0444) if out_path.exist? + end + o.on('--chomp', 'Remove the trailing new-line at the end') { |opts.chomp| } + o.on_tail('-h', '--help', 'This help message') { STDERR.puts o ; exit } +end.parse!(ARGV) + +case opts.input_file +when '-' + input = opts.input_line || STDIN.read +else + input = File.read(opts.input_file) +end + + +print input if opts.copy + +comment = '#erb# ' + +=begin +mode -C +example: + + foo: do not touch me ... + + =begin + erb code <%= 6 * 7 %>... + =end + + bar: ... + +become: + + foo: do not touch me ... + + #erb# =begin # Read the documentation of erbx to see how to change this part + #erb# erb code <%= 6 * 7 %>... + #erb# =end + + #erb# =generated + erb code 42... + #erb# =end_generated + + bar: ... + +and this output can be an new input where the generated part +will be updated +=end + +documentation = ' # Read the documentation of erbx to see how to change this part' +comment_re = /^#{comment}/ +begin_re = /^(?:#{comment})?=begin[^\n]*$/ +end_re = /^(?:#{comment})?=end$/ +generated_re = /^#{comment}=generated$/ +end_generated_re = /^#{comment}=end_generated$/ +begin_t = "#{comment}=begin#{documentation}\n" +end_t = "#{comment}=end\n" +generated_t = "#{comment}=generated\n" +end_generated_t = "#{comment}=end_generated\n" + +code = input[/#{begin_re}\n(.*)#{end_re}/m, 1] +code = input if code.nil? or code.empty? +code.gsub!(comment_re, '') + +output = ERB.new(code, $SAFE, '<-%->', '$erbout_').result + +if input =~ generated_re + input.gsub!(/\n(#{generated_re}).*(#{end_generated_re})/mx, + "\\1\n#{output}\\2") +else + input.gsub!(/(#{end_re}\n)/, "\\1#{generated_t}#{output}#{end_generated_t}") +end + +if opts.smart_copy + code.gsub!(/^/, comment) + input.gsub!(/#{begin_re}.*#{end_re}/mx, + "#{begin_t}#{code}#{end_t}") + input.chomp! + out.print input +else + output.chomp! + out.print output +end + +out.puts unless opts.input_line + +out.close diff --git a/dynamic-use-of-static-c++/config/mk_local_config_rb_in.rb b/dynamic-use-of-static-c++/config/mk_local_config_rb_in.rb new file mode 100644 index 0000000..985b1c3 --- /dev/null +++ b/dynamic-use-of-static-c++/config/mk_local_config_rb_in.rb @@ -0,0 +1,22 @@ +require 'pathname' +# STDERR.puts "MK: #{ARGV.inspect}" +def usage + STDERR.puts "Usage: #$0 <dest-file>" + STDERR.puts "ac_subst_vars will be read from stdin" + exit +end +usage if ARGV.size != 1 +out_path = Pathname.new ARGV.shift +args = STDIN.read.split(/\s+/) +out_path.chmod(0644) if out_path.exist? +out_path.open('w') do |out| + out.puts "# Generated by mk_local_config_rb_in.rb" + out.puts "# dest-file: #{out_path}" + out.puts "# ac_subst_vars: #{args.join(' ')}" + out.puts "AC_CONFIG = {" + args.each do |arg| + out.puts " :#{arg} => '@#{arg}@'," + end + out.puts "}" +end +out_path.chmod(0444) diff --git a/dynamic-use-of-static-c++/config/rbconfig_gen.rb b/dynamic-use-of-static-c++/config/rbconfig_gen.rb new file mode 100644 index 0000000..837cf2b --- /dev/null +++ b/dynamic-use-of-static-c++/config/rbconfig_gen.rb @@ -0,0 +1,19 @@ +require 'rbconfig' + +def gen_m4 ( config ) + config.each_key do |k| + name = "RUBY_#{k}" + puts %Q{ + AC_SUBST([#{name}], + RUBY([ + val = Config::CONFIG[%q[#{k}]] + val = val.to_s.gsub(%q['], %q['"'"']) + %q['] + val + %q['] + ])) + AC_DEFINE([#{name}], $#{name}, + [Contains Config::CONFIG['#{k}'] (generated by rbconfig_gen.rb)]) + } + end +end + +gen_m4(Config::CONFIG) diff --git a/dynamic-use-of-static-c++/config/ruby.m4 b/dynamic-use-of-static-c++/config/ruby.m4 new file mode 100644 index 0000000..ac5cddd --- /dev/null +++ b/dynamic-use-of-static-c++/config/ruby.m4 @@ -0,0 +1,45 @@ + + +AC_DEFUN([RUBY], +[esyscmd([ruby <<\RUBY_EOF $2 $3 $4 $5 # and so on... +require "rbconfig" +block = proc do +$1 +end +result = block.call(*ARGV) +# STDERR.puts "RUBY: argv: #{ARGV.inspect}, result: #{result}" +print result +RUBY_EOF +])]) + + + +AC_DEFUN([RBCONFIG], [esyscmd([ruby config/rbconfig_gen.rb])]) + + + +AC_DEFUN([MK_LOCAL_CONFIG_RB_IN], [ +ruby $srcdir/config/mk_local_config_rb_in.rb $1 <<MK_LOCAL_CONFIG_RB_IN_EOF +$ac_subst_vars +MK_LOCAL_CONFIG_RB_IN_EOF +]) + + + +# Examples: +# * ERB([Hello, <%= "WORLD".downcase %>! (<%= 6 * 7 %>)]) +# => equivalent to: `Hello, world! (42)' +# +# * But in fact if you want that the code will be really substitute +# During m4 instantiation you must use esyscmd: +# +# esyscmd(ERB([AC_SUBST([<%= 'FOO' + '_' + 'BAR' %>])])) +# => equivalent to: `AC_SUBST([FOO_BAR])' +AC_DEFUN([ERB], [ruby <<\RUBY_EOF + require 'erb' + code = <<RUBY_CODE +$1 +RUBY_CODE + eval('ER' + 'B').new(code, $SAFE, '<-%->', '$erbout_').run +RUBY_EOF +]) diff --git a/dynamic-use-of-static-c++/config/warning.m4 b/dynamic-use-of-static-c++/config/warning.m4 new file mode 100644 index 0000000..2df4649 --- /dev/null +++ b/dynamic-use-of-static-c++/config/warning.m4 @@ -0,0 +1,105 @@ +# Finding valid warning flags for the C Compiler. -*-Autoconf-*- +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# +# 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., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA + +# serial 2 + +# AC_COMPILE_STDERR_IFELSE([PROGRAM], +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ------------------------------------------------------------------ +# Try to compile PROGRAM, and log the result of the compiler run. +m4_define([AC_COMPILE_STDERR_IFELSE], +[AC_LANG_COMPILER_REQUIRE()dnl +m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl +rm -f conftest.$ac_objext +AS_IF([_AC_EVAL_STDERR($ac_compile) && + AC_TRY_COMMAND([test -s conftest.$ac_objext])], + [$2], + [_AC_MSG_LOG_CONFTEST +m4_ifvaln([$3],[$3])dnl])dnl +rm -f conftest.$ac_objext m4_ifval([$1], [conftest.$ac_ext])[]dnl +])# AC_COMPILE_STDERR_IFELSE + + +# DYN_COMPILER_FLAGS_NAME +# ---------------------- +# Return the name of the FLAGS variable for the current language. +m4_define([DYN_COMPILER_FLAGS_NAME], +[AC_LANG_CASE([C], [CFLAGS], + [C++], [CXXFLAGS])[]dnl +])# DYN_COMPILER_FLAGS_NAME + + +# DYN_COMPILER_OPTION_IF(OPTION, [IF-SUPPORTED], [IF-NOT-SUPPORTED]) +# ----------------------------------------------------------------- +# icc doesn't choke on unknown options, it will just issue warnings +# (even with -Werror). So we grep stderr for any message that says an +# option was ignored. For instance on "-Wall" it says: +# +# icc: Command line warning: ignoring option '-W'; no argument required +# +# And GCC sometimes follows an irregular scheme (this is 3.3): +# g++: unrecognized option `-wd654' +# cc1plus: warning: "-Wbad-function-cast" is valid for C/ObjC but not for C++. +# cc1plus: warning: ignoring command line option '-Wbad-function-cast' +# +# Pay attention not to give grep a regexp starting with "-". +AC_DEFUN([DYN_COMPILER_OPTION_IF], +[AS_VAR_PUSHDEF([ac_Option], + [ac_cv_[]_AC_LANG_ABBREV[]_supports_$1])dnl +AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], + [ac_Option], +[ac_save_[]DYN_COMPILER_FLAGS_NAME=$DYN_COMPILER_FLAGS_NAME +DYN_COMPILER_FLAGS_NAME="$DYN_COMPILER_FLAGS_NAME $1" +ac_Option=no +AC_COMPILE_STDERR_IFELSE([AC_LANG_PROGRAM], + [if (grep -E 'm4_do([ignoring option], + [|ignoring command line option .$1.], + [|unrecognized option .*$1], + [|option.*$1.*not supported], + [|$1.* is valid for.*but not for])' conftest.err + ) >/dev/null 2>&1; then :; else + ac_Option=yes + fi]) +DYN_COMPILER_FLAGS_NAME=$ac_save_[]DYN_COMPILER_FLAGS_NAME +]) +AS_IF([test AS_VAR_GET(ac_Option) = yes], [$2], [$3])[]dnl +AS_VAR_PUSHDEF([ac_Option])dnl +])# DYN_COMPILER_OPTION_IF + + +# DYN_CXX_WARNINGS(OPTIONS) +# ------------------------ +# Check whether the C++ compiler support the OPTION, and if it +# does, append it to WARNING_CXXFLAGS. +# It is important to try the options all together, not just individually, +# as for instance for GCC 3.2 '-Wbad-function-cast' after '-W' gives: +# +# cc1plus: warning: ignoring command line option '-Wbad-function-cast' +# +# but not when used alone. This also demonstrates the importance of the +# order. +AC_DEFUN([DYN_CXX_WARNINGS], +[ac_save_compiler_flags=$DYN_COMPILER_FLAGS_NAME +m4_foreach([AC_Option], [$1], + [DYN_COMPILER_OPTION_IF(AC_Option, + [WARNING_CXXFLAGS="$WARNING_CXXFLAGS AC_Option" + DYN_COMPILER_FLAGS_NAME="$ac_save_compiler_flags $WARNING_FLAGS"])]) +DYN_COMPILER_FLAGS_NAME=$ac_save_compiler_flags +AC_SUBST([WARNING_CXXFLAGS]) +])# DYN_CXX_WARNINGS(OPTIONS) diff --git a/dynamic-use-of-static-c++/configure.ac b/dynamic-use-of-static-c++/configure.ac new file mode 100644 index 0000000..95952e7 --- /dev/null +++ b/dynamic-use-of-static-c++/configure.ac @@ -0,0 +1,154 @@ +AC_PREREQ([2.59]) + +# Catch some macros that are not expanded. +m4_pattern_forbid([^AC_LIBLTDL_]) +m4_pattern_forbid([^DYN_]) +m4_pattern_allow([^DYN_FIXTURES$]) +m4_pattern_forbid([^ERB$]) +m4_pattern_forbid([^RBCONFIG$]) + +## ---------------- ## +## Package set up. ## +## ---------------- ## + +AC_INIT([LRDE C++ Static-Dynamic bridge], [0.1], + [nicolas.pouillard@lrde.epita.fr, damien.thivolle@lrde.epita.fr], [dyn]) + +# Auxiliary files. +AC_CONFIG_AUX_DIR([_config]) + +# Automake. +AM_INIT_AUTOMAKE([1.9 foreign check-news dist-bzip2 -Wall nostdinc]) + + +## --------------------- ## +## C++ Compiler Set up. ## +## --------------------- ## + +# Look for a C++ compiler. +AC_LANG([C++]) +AC_PROG_CXX + +# Speed the compilation up. +if test "$GXX" = yes; then + CXXFLAGS="$CXXFLAGS -pipe" +fi + +# Use good warnings. +DYN_CXX_WARNINGS([[-Wall], + [-W], + [-Wcast-align], + [-Wcast-qual], + [-Wformat], + [-Wmissing-prototypes], + [-Wstrict-prototypes], + [-Wwrite-strings], + [-Wbad-function-cast], + [-Wmissing-declarations], + [-Wnested-externs], + [-Werror]]) + +## -------- ## +## Libtool. ## +## -------- ## + +# Configure libltdl +AC_CONFIG_SUBDIRS(libltdl) + +AC_DISABLE_STATIC +# Use the installable version of ltdl + +# AC_LIBLTDL_INSTALLABLE +# INSTALL_LTDL + +AC_LIBLTDL_CONVENIENCE + +# Check for dlopen support +AC_LIBTOOL_DLOPEN +# We don't need static libraries, speed the compilation up. +AC_DISABLE_STATIC +# Configure libtool +AC_PROG_LIBTOOL + +AC_SUBST(INCLTDL) +AC_SUBST(LIBLTDL) + +dnl ## ------ ## +dnl ## Swig. ## +dnl ## ------ ## + +dnl AC_ARG_WITH([swig], + dnl [AC_HELP_STRING([--with-swig], + dnl [require Swig modules (defaults to auto)])], + dnl [], + dnl [with_swig=auto]) + +dnl if test x$with_swig != xno; then + dnl has_swig=yes + + dnl # Check for python and swig + + dnl AC_PROG_SWIG([1.3.24]) + dnl if (eval "$SWIG -version") >/dev/null 2>&1; then :; else + dnl has_swig=no + dnl fi + + dnl case $with_swig:$has_swig in + dnl yes:no) + dnl AC_MSG_ERROR([SWIG 1.3.24 is required. + dnl Use `--without-swig' to disable SWIG modules.]);; + dnl esac +dnl fi + +dnl AC_MSG_RESULT([$has_swig]) + +my_abs_srcdir=`cd $srcdir && pwd` + +# FIXME: Remove me when function_loader will be pure C++ +AC_SUBST([DYNDIR], [$my_abs_srcdir/src]) + +AC_SUBST([DYN_FIXTURES], [$my_abs_srcdir/test/fixtures]) + +# Make the proper link to the olena-proto-stl-style in test +AC_SUBST([OLENA_PROTO_STL_STYLE], [$my_abs_srcdir/test/olena/proto-stl-style]) + +AC_SUBST([LIBERTYARG], + $my_abs_srcdir/$(ERB([lib/libiberty-<%= RUBY_PLATFORM %>.la]))) + + +## ------------------- ## +## Ruby Configuration. ## +## ------------------- ## + +# Make available Config::CONFIG +# AC_DEFINE and AC_SUBST everything in this hash +# All keys are prefixed by RUBY_. +RBCONFIG() + +# ... +echo $srcdir/config/local-config.rb.in +MK_LOCAL_CONFIG_RB_IN([$srcdir/_config/local-config.rb.in]) + +## --------------- ## +## Configuration. ## +## --------------- ## + +# Ask for config.h. +AM_CONFIG_HEADER([_config/config.h]) + +# Ask for the Makefile creations. +AC_CONFIG_FILES([ + Makefile + bin/Makefile + bin/dyn-config + src/Makefile + src/config.hh + data/Makefile + config/Makefile + _config/local-config.rb + test/Makefile + test/vaucanson/Makefile +], [chmod +x bin/dyn-config]) + +# Instantiate the output files. +AC_OUTPUT diff --git a/dynamic-use-of-static-c++/data/Makefile.am b/dynamic-use-of-static-c++/data/Makefile.am new file mode 100644 index 0000000..61882d7 --- /dev/null +++ b/dynamic-use-of-static-c++/data/Makefile.am @@ -0,0 +1,33 @@ +# Do not install me +lib_LTLIBRARIES = libdyn_function.la +libdyn_function_la_LDFLAGS = `dyn-config --libtool-libs` +libdyn_function_la_CXXFLAGS = `dyn-config --cflags` +libdyn_function_la_SOURCES = function.cc +BUILT_SOURCES = function.cc +CLEANFILES = function.cc +SUBDIRS = + +pkgdata_DATA = Makefile.template Makefile.repository + +Makefile.template: Makefile + cat $< | \ + sed -e 's|^srcdir = .*|srcdir = '`cd $(srcdir) && pwd`'|' \ + -e 's|^top_srcdir = .*|top_srcdir = '`cd $(top_srcdir) && pwd`'|' \ + -e 's|^top_builddir = .*|top_builddir = '`cd $(top_builddir) && pwd`'|' \ + -e 's|^pkgdata_DATA = .*|pkgdata_DATA = |' \ + -e 's|^CLEANFILES = .*|CLEANFILES = |' \ + -e 's|^Makefile: |Makefile.old: |' \ + -e 's|^VPATH = .*|VPATH = .|' > $@ + +Makefile.repository: Makefile + cat $< | \ + sed -e 's|^srcdir = .*|srcdir = '`cd $(srcdir) && pwd`'|' \ + -e 's|^top_srcdir = .*|top_srcdir = '`cd $(top_srcdir) && pwd`'|' \ + -e 's|^top_builddir = .*|top_builddir = '`cd $(top_builddir) && pwd`'|' \ + -e 's|^pkgdata_DATA = .*|pkgdata_DATA = |' \ + -e 's|^CLEANFILES = .*|CLEANFILES = make.out|' \ + -e 's|^lib_LTLIBRARIES = .*|lib_LTLIBRARIES = |' \ + -e 's|^BUILT_SOURCES = .*|BUILT_SOURCES = |' \ + -e 's/^SUBDIRS = .*/SUBDIRS = $$(shell ls | grep -v Makefile)/' \ + -e 's|^Makefile: |Makefile.old: |' \ + -e 's|^VPATH = .*|VPATH = .|' | grep -v '^include ' > $@ diff --git a/dynamic-use-of-static-c++/data/function.cc b/dynamic-use-of-static-c++/data/function.cc new file mode 100644 index 0000000..e42cbed --- /dev/null +++ b/dynamic-use-of-static-c++/data/function.cc @@ -0,0 +1,5 @@ +#include "dyn-light.hh" +int foo() +{ + return 42; +} diff --git a/dynamic-use-of-static-c++/lib/.libs/libiberty-i486-linux.a b/dynamic-use-of-static-c++/lib/.libs/libiberty-i486-linux.a new file mode 100644 index 0000000..1731b1e Binary files /dev/null and b/dynamic-use-of-static-c++/lib/.libs/libiberty-i486-linux.a differ diff --git a/dynamic-use-of-static-c++/lib/.libs/libiberty-powerpc-darwin.a b/dynamic-use-of-static-c++/lib/.libs/libiberty-powerpc-darwin.a new file mode 100644 index 0000000..432b22f Binary files /dev/null and b/dynamic-use-of-static-c++/lib/.libs/libiberty-powerpc-darwin.a differ diff --git a/dynamic-use-of-static-c++/lib/libiberty-i486-linux.la b/dynamic-use-of-static-c++/lib/libiberty-i486-linux.la new file mode 100644 index 0000000..6dfe41a --- /dev/null +++ b/dynamic-use-of-static-c++/lib/libiberty-i486-linux.la @@ -0,0 +1,35 @@ +# libiberty.la - a libtool library file +# Generated by ltmain.sh - GNU libtool 1.5.18 (1.1220.2.246 2005/05/16 10:00:18) +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='' + +# Names of this library. +library_names='' + +# The name of the static archive. +old_library='libiberty-i486-linux.a' + +# Libraries that this one depends upon. +dependency_libs='' + +# Version information for libiberty. +current= +age= +revision= + +# Is this an already installed library? +installed=no + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='' diff --git a/dynamic-use-of-static-c++/lib/libiberty-powerpc-darwin.la b/dynamic-use-of-static-c++/lib/libiberty-powerpc-darwin.la new file mode 100644 index 0000000..b9f9449 --- /dev/null +++ b/dynamic-use-of-static-c++/lib/libiberty-powerpc-darwin.la @@ -0,0 +1,35 @@ +# libiberty.la - a libtool library file +# Generated by ltmain.sh - GNU libtool 1.5.18 (1.1220.2.246 2005/05/16 10:00:18) +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='' + +# Names of this library. +library_names='' + +# The name of the static archive. +old_library='libiberty-powerpc-darwin.a' + +# Libraries that this one depends upon. +dependency_libs='' + +# Version information for libiberty. +current= +age= +revision= + +# Is this an already installed library? +installed=no + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='' diff --git a/dynamic-use-of-static-c++/lib/libiberty-powerpc-darwin8.3.0.la b/dynamic-use-of-static-c++/lib/libiberty-powerpc-darwin8.3.0.la new file mode 100644 index 0000000..b9f9449 --- /dev/null +++ b/dynamic-use-of-static-c++/lib/libiberty-powerpc-darwin8.3.0.la @@ -0,0 +1,35 @@ +# libiberty.la - a libtool library file +# Generated by ltmain.sh - GNU libtool 1.5.18 (1.1220.2.246 2005/05/16 10:00:18) +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='' + +# Names of this library. +library_names='' + +# The name of the static archive. +old_library='libiberty-powerpc-darwin.a' + +# Libraries that this one depends upon. +dependency_libs='' + +# Version information for libiberty. +current= +age= +revision= + +# Is this an already installed library? +installed=no + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='' diff --git a/dynamic-use-of-static-c++/src/Makefile.am b/dynamic-use-of-static-c++/src/Makefile.am new file mode 100644 index 0000000..d64c2ea --- /dev/null +++ b/dynamic-use-of-static-c++/src/Makefile.am @@ -0,0 +1,79 @@ +include_HEADERS = dyn-all.hh dyn-light.hh +lib_LTLIBRARIES = libdyn.la + +ERB = ruby $(top_srcdir)/config/erbx + +dyn_light_hh_DEPENDECIES = \ + $(srcdir)/name_of.hh \ + function.hh \ + all_methods.hh \ + data.hh \ + $(srcdir)/policy.hh + +dyn_all_hh_DEPENDECIES = \ + config.hh \ + $(srcdir)/name_of.hh \ + function.hh \ + all_methods.hh \ + data.hh \ + $(srcdir)/data.hxx \ + $(srcdir)/function_loader.hh \ + $(srcdir)/dyn.hh + +BUILT_SOURCES = \ + dyn-all.hh dyn-light.hh \ + all_methods.hh all_methods.cc \ + function.hh function.cc \ + data.hh config.hh + +libdyn_la_SOURCES = \ + dyn.hh \ + data.hh data.hxx data.cc \ + all_methods.hh all_methods.cc \ + function.hh function.cc \ + function_loader.hh function_loader.cc \ + name_of.hh name_of.cc \ + policy.hh policy.cc \ + ruby_stream.hh ruby_stream.cc \ + ansidecl.h demangle.h config.hh + +libdyn_la_LIBADD = @LIBERTYARG@ @RUBY_LIBRUBYARG_SHARED@ \ + $(LIBLTDL) + +libdyn_la_DEPENDENCIES = $(LIBLTDL) + +libdyn_la_CPPFLAGS = $(LTDLINCL) \ + -I$(top_builddir) \ + -I$(srcdir) -I. -I@RUBY_topdir@ + +libdyn_la_CXXFLAGS = $(WARNING_CXXFLAGS) + +libdyn_la_LDFLAGS = -version-info 0:1:0 + +CLEANFILES = $(BUILT_SOURCES) + + +############# +### RULES ### +############# + +cut_local_includes = grep -v '^.[\t ]*include[\t ]*".*"' + +dyn-all.hh: $(dyn_all_hh_DEPENDECIES) + rm -f $@ + echo "// Generated: do not edit by hand!" > $@ + echo "#define DYN_FULL_IMPLEMENTATION" >> $@ + cat $(dyn_all_hh_DEPENDECIES) | $(cut_local_includes) >> $@ + chmod -w $@ + +dyn-light.hh: $(dyn_light_hh_DEPENDECIES) + rm -f $@ + echo "// Generated: do not edit by hand!" > $@ + cat $(dyn_light_hh_DEPENDECIES) | $(cut_local_includes) >> $@ + chmod -w $@ + +%.hh: %.erb.hh + $(ERB) -i $< -o $@ + +%.cc: %.erb.cc + $(ERB) -i $< -o $@ diff --git a/dynamic-use-of-static-c++/src/all_methods.erb.cc b/dynamic-use-of-static-c++/src/all_methods.erb.cc new file mode 100644 index 0000000..ae973f3 --- /dev/null +++ b/dynamic-use-of-static-c++/src/all_methods.erb.cc @@ -0,0 +1,37 @@ +#ifndef DYN_ALL_METHODS_CC +# define DYN_ALL_METHODS_CC + +# define DYN_FULL_IMPLEMENTATION +# include "all_methods.hh" +# include "data.hh" +# include "function.hh" + +namespace dyn +{ + +<%- (DYN_MAX_ARGUMENTS - 1).times do |i| -%> + <%- arguments = (0 .. i - 1).map { |j| "const data& arg#{j}" } -%> + <%- objects = (0 .. i - 1).map { |j| "arg#{j}" } -%> + + data + all_methods::send (<%= (['const std::string& meth_name'] + arguments).join(', ') %>) const + { + meth m(meth_name); + return m(<%= (['self()'] + objects).join(', ') %>); + } + + <%- ALL_METHODS.each do |meth_name, includes| -%> + + data + all_methods::<%= meth_name %> (<%= arguments.join(', ') %>) const + { + meth m("<%= meth_name %>", "<%= includes.join(':') %>"); + return m(<%= (['self()'] + objects).join(', ') %>); + } + + <%- end -%> +<%- end -%> + +} + +#endif // !DYN_ALL_METHODS_CC diff --git a/dynamic-use-of-static-c++/src/all_methods.erb.hh b/dynamic-use-of-static-c++/src/all_methods.erb.hh new file mode 100644 index 0000000..8f67a80 --- /dev/null +++ b/dynamic-use-of-static-c++/src/all_methods.erb.hh @@ -0,0 +1,37 @@ +#ifndef DYN_ALL_METHODS_HH +# define DYN_ALL_METHODS_HH + +# include <string> + +namespace dyn +{ + struct data; + + struct all_methods + { + + virtual const data& self() const = 0; + virtual data& self() = 0; + + virtual ~all_methods() {}; + +# ifdef DYN_FULL_IMPLEMENTATION +<%- (DYN_MAX_ARGUMENTS - 1).times do |i| -%> + <%- arguments = (0 .. i - 1).map { |j| "const data& arg#{j}" } -%> + <%- ALL_METHODS.each do |meth, includes| -%> + + data <%= meth %>(<%= arguments.join(', ') %>) const; + + <%- end -%> + + data send(<%= (['const std::string& meth_name'] + arguments).join(', ') %>) const; + + <%- end -%> + +# endif + + }; + +} + +#endif // !DYN_ALL_METHODS_HH diff --git a/dynamic-use-of-static-c++/src/ansidecl.h b/dynamic-use-of-static-c++/src/ansidecl.h new file mode 100644 index 0000000..f8f2d73 --- /dev/null +++ b/dynamic-use-of-static-c++/src/ansidecl.h @@ -0,0 +1,326 @@ +/* ANSI and traditional C compatability macros + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + +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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* ANSI and traditional C compatibility macros + + ANSI C is assumed if __STDC__ is #defined. + + Macro ANSI C definition Traditional C definition + ----- ---- - ---------- ----------- - ---------- + ANSI_PROTOTYPES 1 not defined + PTR `void *' `char *' + PTRCONST `void *const' `char *' + LONG_DOUBLE `long double' `double' + const not defined `' + volatile not defined `' + signed not defined `' + VA_START(ap, var) va_start(ap, var) va_start(ap) + + Note that it is safe to write "void foo();" indicating a function + with no return value, in all K+R compilers we have been able to test. + + For declaring functions with prototypes, we also provide these: + + PARAMS ((prototype)) + -- for functions which take a fixed number of arguments. Use this + when declaring the function. When defining the function, write a + K+R style argument list. For example: + + char *strcpy PARAMS ((char *dest, char *source)); + ... + char * + strcpy (dest, source) + char *dest; + char *source; + { ... } + + + VPARAMS ((prototype, ...)) + -- for functions which take a variable number of arguments. Use + PARAMS to declare the function, VPARAMS to define it. For example: + + int printf PARAMS ((const char *format, ...)); + ... + int + printf VPARAMS ((const char *format, ...)) + { + ... + } + + For writing functions which take variable numbers of arguments, we + also provide the VA_OPEN, VA_CLOSE, and VA_FIXEDARG macros. These + hide the differences between K+R <varargs.h> and C89 <stdarg.h> more + thoroughly than the simple VA_START() macro mentioned above. + + VA_OPEN and VA_CLOSE are used *instead of* va_start and va_end. + Immediately after VA_OPEN, put a sequence of VA_FIXEDARG calls + corresponding to the list of fixed arguments. Then use va_arg + normally to get the variable arguments, or pass your va_list object + around. You do not declare the va_list yourself; VA_OPEN does it + for you. + + Here is a complete example: + + int + printf VPARAMS ((const char *format, ...)) + { + int result; + + VA_OPEN (ap, format); + VA_FIXEDARG (ap, const char *, format); + + result = vfprintf (stdout, format, ap); + VA_CLOSE (ap); + + return result; + } + + + You can declare variables either before or after the VA_OPEN, + VA_FIXEDARG sequence. Also, VA_OPEN and VA_CLOSE are the beginning + and end of a block. They must appear at the same nesting level, + and any variables declared after VA_OPEN go out of scope at + VA_CLOSE. Unfortunately, with a K+R compiler, that includes the + argument list. You can have multiple instances of VA_OPEN/VA_CLOSE + pairs in a single function in case you need to traverse the + argument list more than once. + + For ease of writing code which uses GCC extensions but needs to be + portable to other compilers, we provide the GCC_VERSION macro that + simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various + wrappers around __attribute__. Also, __extension__ will be #defined + to nothing if it doesn't work. See below. + + This header also defines a lot of obsolete macros: + CONST, VOLATILE, SIGNED, PROTO, EXFUN, DEFUN, DEFUN_VOID, + AND, DOTS, NOARGS. Don't use them. */ + +#ifndef _ANSIDECL_H +#define _ANSIDECL_H 1 + +/* Every source file includes this file, + so they will all get the switch for lint. */ +/* LINTLIBRARY */ + +/* Using MACRO(x,y) in cpp #if conditionals does not work with some + older preprocessors. Thus we can't define something like this: + +#define HAVE_GCC_VERSION(MAJOR, MINOR) \ + (__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR))) + +and then test "#if HAVE_GCC_VERSION(2,7)". + +So instead we use the macro below and test it against specific values. */ + +/* This macro simplifies testing whether we are using gcc, and if it + is of a particular minimum version. (Both major & minor numbers are + significant.) This macro will evaluate to 0 if we are not using + gcc at all. */ +#ifndef GCC_VERSION +#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) +#endif /* GCC_VERSION */ + +#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) || (defined(__alpha) && defined(__cplusplus)) +/* All known AIX compilers implement these things (but don't always + define __STDC__). The RISC/OS MIPS compiler defines these things + in SVR4 mode, but does not define __STDC__. */ +/* eraxxon@alumni.rice.edu: The Compaq C++ compiler, unlike many other + C++ compilers, does not define __STDC__, though it acts as if this + was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */ + +#define ANSI_PROTOTYPES 1 +#define PTR void * +#define PTRCONST void *const +#define LONG_DOUBLE long double + +#define PARAMS(ARGS) ARGS +#define VPARAMS(ARGS) ARGS +#define VA_START(VA_LIST, VAR) va_start(VA_LIST, VAR) + +/* variadic function helper macros */ +/* "struct Qdmy" swallows the semicolon after VA_OPEN/VA_FIXEDARG's + use without inhibiting further decls and without declaring an + actual variable. */ +#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP, VAR); { struct Qdmy +#define VA_CLOSE(AP) } va_end(AP); } +#define VA_FIXEDARG(AP, T, N) struct Qdmy + +#undef const +#undef volatile +#undef signed + +/* inline requires special treatment; it's in C99, and GCC >=2.7 supports + it too, but it's not in C89. */ +#undef inline +#if __STDC_VERSION__ > 199901L +/* it's a keyword */ +#else +# if GCC_VERSION >= 2007 +# define inline __inline__ /* __inline__ prevents -pedantic warnings */ +# else +# define inline /* nothing */ +# endif +#endif + +/* These are obsolete. Do not use. */ +#ifndef IN_GCC +#define CONST const +#define VOLATILE volatile +#define SIGNED signed + +#define PROTO(type, name, arglist) type name arglist +#define EXFUN(name, proto) name proto +#define DEFUN(name, arglist, args) name(args) +#define DEFUN_VOID(name) name(void) +#define AND , +#define DOTS , ... +#define NOARGS void +#endif /* ! IN_GCC */ + +#else /* Not ANSI C. */ + +#undef ANSI_PROTOTYPES +#define PTR char * +#define PTRCONST PTR +#define LONG_DOUBLE double + +#define PARAMS(args) () +#define VPARAMS(args) (va_alist) va_dcl +#define VA_START(va_list, var) va_start(va_list) + +#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP); { struct Qdmy +#define VA_CLOSE(AP) } va_end(AP); } +#define VA_FIXEDARG(AP, TYPE, NAME) TYPE NAME = va_arg(AP, TYPE) + +/* some systems define these in header files for non-ansi mode */ +#undef const +#undef volatile +#undef signed +#undef inline +#define const +#define volatile +#define signed +#define inline + +#ifndef IN_GCC +#define CONST +#define VOLATILE +#define SIGNED + +#define PROTO(type, name, arglist) type name () +#define EXFUN(name, proto) name() +#define DEFUN(name, arglist, args) name arglist args; +#define DEFUN_VOID(name) name() +#define AND ; +#define DOTS +#define NOARGS +#endif /* ! IN_GCC */ + +#endif /* ANSI C. */ + +/* Define macros for some gcc attributes. This permits us to use the + macros freely, and know that they will come into play for the + version of gcc in which they are supported. */ + +#if (GCC_VERSION < 2007) +# define __attribute__(x) +#endif + +/* Attribute __malloc__ on functions was valid as of gcc 2.96. */ +#ifndef ATTRIBUTE_MALLOC +# if (GCC_VERSION >= 2096) +# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) +# else +# define ATTRIBUTE_MALLOC +# endif /* GNUC >= 2.96 */ +#endif /* ATTRIBUTE_MALLOC */ + +/* Attributes on labels were valid as of gcc 2.93. */ +#ifndef ATTRIBUTE_UNUSED_LABEL +# if (GCC_VERSION >= 2093) +# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED +# else +# define ATTRIBUTE_UNUSED_LABEL +# endif /* GNUC >= 2.93 */ +#endif /* ATTRIBUTE_UNUSED_LABEL */ + +#ifndef ATTRIBUTE_UNUSED +#define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#endif /* ATTRIBUTE_UNUSED */ + +#ifndef ATTRIBUTE_NORETURN +#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) +#endif /* ATTRIBUTE_NORETURN */ + +/* Attribute `nonnull' was valid as of gcc 3.3. */ +#ifndef ATTRIBUTE_NONNULL +# if (GCC_VERSION >= 3003) +# define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m))) +# else +# define ATTRIBUTE_NONNULL(m) +# endif /* GNUC >= 3.3 */ +#endif /* ATTRIBUTE_NONNULL */ + +/* Use ATTRIBUTE_PRINTF when the format specifier must not be NULL. + This was the case for the `printf' format attribute by itself + before GCC 3.3, but as of 3.3 we need to add the `nonnull' + attribute to retain this behavior. */ +#ifndef ATTRIBUTE_PRINTF +#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m) +#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2) +#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3) +#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4) +#define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5) +#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6) +#endif /* ATTRIBUTE_PRINTF */ + +/* Use ATTRIBUTE_NULL_PRINTF when the format specifier may be NULL. A + NULL format specifier was allowed as of gcc 3.3. */ +#ifndef ATTRIBUTE_NULL_PRINTF +# if (GCC_VERSION >= 3003) +# define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) +# else +# define ATTRIBUTE_NULL_PRINTF(m, n) +# endif /* GNUC >= 3.3 */ +# define ATTRIBUTE_NULL_PRINTF_1 ATTRIBUTE_NULL_PRINTF(1, 2) +# define ATTRIBUTE_NULL_PRINTF_2 ATTRIBUTE_NULL_PRINTF(2, 3) +# define ATTRIBUTE_NULL_PRINTF_3 ATTRIBUTE_NULL_PRINTF(3, 4) +# define ATTRIBUTE_NULL_PRINTF_4 ATTRIBUTE_NULL_PRINTF(4, 5) +# define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6) +#endif /* ATTRIBUTE_NULL_PRINTF */ + +/* We use __extension__ in some places to suppress -pedantic warnings + about GCC extensions. This feature didn't work properly before + gcc 2.8. */ +#if GCC_VERSION < 2008 +#define __extension__ +#endif + +/* Bootstrap support: Adjust certain macros defined by Autoconf, + which are only valid for the stage1 compiler. If we detect + a modern version of GCC, we are probably in stage2 or beyond, + so unconditionally reset the values. Note that const, inline, + etc. have been dealt with above. */ +#if (GCC_VERSION >= 2007) +# ifndef HAVE_LONG_DOUBLE +# define HAVE_LONG_DOUBLE 1 +# endif +#endif /* GCC >= 2.7 */ + +#endif /* ansidecl.h */ diff --git a/dynamic-use-of-static-c++/src/config.hh.in b/dynamic-use-of-static-c++/src/config.hh.in new file mode 100644 index 0000000..9165c7c --- /dev/null +++ b/dynamic-use-of-static-c++/src/config.hh.in @@ -0,0 +1,3 @@ +#define DYNDIR "@DYNDIR@" +#define DYN_FIXTURES "@DYN_FIXTURES@" +#define OLENA_PROTO_STL_STYLE "@OLENA_PROTO_STL_STYLE@" diff --git a/dynamic-use-of-static-c++/src/cxx_symbols.rb b/dynamic-use-of-static-c++/src/cxx_symbols.rb new file mode 100644 index 0000000..cdf52bd --- /dev/null +++ b/dynamic-use-of-static-c++/src/cxx_symbols.rb @@ -0,0 +1,115 @@ +class SimpleSymbol + attr_reader :code + def initialize ( code ) + @code = code + end + def to_s + @code.to_s + end +end # class SimpleSymbol + +class EncodedSymbol + attr_reader :name, :code, :cxx_char, :patt + @@codes ||= [] + def initialize ( name, code, cxx_char=nil ) + @name = name + @code = (code.is_a? Integer)? code.chr.to_sym : code + if cxx_char.is_a? Regexp + @patt = cxx_char + @cxx_char = " #@name " + else + @cxx_char = (cxx_char.is_a? Integer)? cxx_char.chr.to_sym : cxx_char + @patt = to_s.strip + end + raise if @@codes.include? @code + @@codes << self + end + def self.[] ( arg ) + @@codes.find { |x| x.code == arg.to_sym } + end + def to_s + (@cxx_char || " #@name ").to_s + end + @@operators ||= + { + '<<' => 'push', + '>>' => 'pop', + '<<=' => 'push_assign', + '>>=' => 'pop_assign', + '=' => 'assign', + '==' => 'equal', + '!=' => 'not_equal', + '<=' => 'less_or_equal', + '<' => 'less', + '>=' => 'greater_or_equal', + '>' => 'greater', + '++' => 'incr', + '--' => 'decr', + '()' => 'paren', + '[]' => 'square_brackets', + '->' => 'arrow', + '!' => 'bang', + '~' => 'tilde', + '&' => 'ampersand', + '->*' => 'arrow_deref', + '*' => 'star', + '/' => 'slash', + '%' => 'percent', + '+' => 'plus', + '-' => 'minus', + '^' => 'xor', + '|' => 'bar', + '&&' => 'ampersand_ampersand', + '||' => 'bar_bar', + '+=' => 'plus_assign', + '-=' => 'minus_assign', + '*=' => 'star_assign', + '/=' => 'slash_assign', + '%=' => 'percent_assign', + '&=' => 'ampersand_assign', + '^=' => 'xor_assign', + '|=' => 'bar_assign', + ',' => 'comma' + } + def self.encode ( str ) + result = str.gsub '_', '_U_' + result.gsub!(/operator\s*/, 'operator') + @@codes.each do |v| + next if v.code == :U + result.gsub!(v.patt, "_#{v.code}_") + end + result.gsub!(/\s*/, '') + result.gsub!(/operator\s*([a-zA-Z]+)/, 'operator_convert_\1') + result.gsub!(/\s*/, '') + result.gsub!(/operator\s*([a-zA-Z]+)/, 'OPERATOR_CONVERT_\1') + result.gsub!(/\s*/, '') + result.gsub!(/_+/, '_') + result.gsub!(/^_/, '') + result.gsub!(/_$/, '') + result + end + def self.enc ( name, code, cxx_char=nil ) + EncodedSymbol.new(name, code, cxx_char) + end + @@operators.to_a.sort{|x,y| y.first.size <=> x.first.size}.each do |k, v| + enc "operator#{v}".to_sym, "operator#{v}".upcase.gsub('_', '').to_sym, "operator#{k}" + end + enc :const, :CONST, /\bconst\b/ + enc :underscore, :U, ?_ + enc :slash, :S, ?/ + enc :dot, :D, ?. + enc :function, :F + enc :left, :L, '< ' + enc :right, :R, ' >' + enc :ref, :REF, ?& + enc :ptr, :PTR, ?* + enc :namespace, :N, '::' + enc :path_sep, :P, ':' + enc :comma, :C, ', ' + enc :right_sqr_bra, :RSB, ' [' + enc :left_sqr_bra, :LSB, ']' +end # class EncodedSymbol + +def mangle ( aString ) + EncodedSymbol.encode(aString) +end diff --git a/dynamic-use-of-static-c++/src/data.cc b/dynamic-use-of-static-c++/src/data.cc new file mode 100644 index 0000000..3af1dcd --- /dev/null +++ b/dynamic-use-of-static-c++/src/data.cc @@ -0,0 +1,128 @@ +#ifndef DYN_DATA_CC +# define DYN_DATA_CC + +# include "dyn.hh" +# include "data.hh" + +# ifdef DYNDEBUG +# include <iostream> +# else +# include <fstream> +# endif + +namespace dyn { + +# ifdef DYNDEBUG + std::ostream& logger(std::cerr); +# else +# ifdef NDEBUG + std::ofstream dev_null("/dev/null"); + std::ostream& logger(dev_null); +# else + std::ofstream dyn_log("dyn.log"); + std::ostream& logger(dyn_log); +# endif +# endif + + const NilClass nil_object(0); + data_nil* nil_proxy = new data_nil(nil_object); + const data nil; + + namespace internal { + op operator_push("<<"); + op operator_pop(">>"); + op operator_incr("++"); + op operator_decr("--"); + op operator_plus("+"); + op operator_star("*"); + op operator_equal("=="); + op operator_not_equal("!="); + meth operator_square_brackets("operator[]"); + } + + + meth data::method(const std::string& method_name) + { + meth m(method_name, "*", this); + return m; + } + + const data& data::operator*() const + { + return internal::operator_star(*this).self(); + } + + data data::operator*() + { + return internal::operator_star(*this); + } + + data data::operator[](const data& at) + { + return internal::operator_square_brackets(*this, at); + } + + data::data(const language::var& rhs) : proxy_(0) + { + logger << "data(const language::var& rhs) [ rhs.type() = " << rhs.type() << " ]" << std::endl; + assign(rhs); + } + + data::data(const language::val& rhs) : proxy_(0) + { + logger << "data(const language::val& rhs) [ rhs.type() = " << rhs.type() << " ]" << std::endl; + assign(rhs); + } + + data::data(language::var& rhs) : proxy_(0) + { + logger << "data(language::var& rhs) [ rhs.type() = " << rhs.type() << " ]" << std::endl; + assign(rhs); + } + + data::data(language::val& rhs) : proxy_(0) + { + logger << "data(language::val& rhs) [ rhs.type() = " << rhs.type() << " ]" << std::endl; + assign(rhs); // FIXME should copy it's contents not just the proxy + } +} + +std::ostream& operator<<(std::ostream& ostr, const dyn::data& d) +{ + return dyn::internal::operator_push(ostr, d).get_ref_on<std::ostream>(); +} + +std::istream& operator>>(std::istream& istr, dyn::data& d) +{ + return dyn::internal::operator_pop(istr, d).get_ref_on<std::istream>(); +} + +dyn::data& operator++(dyn::data& d) +{ + dyn::internal::operator_incr(d); + return d; +} + +dyn::data& operator--(dyn::data& d) +{ + dyn::internal::operator_decr(d); + return d; +} + +bool operator!=(const dyn::data& lhs, const dyn::data& rhs) +{ + return dyn::internal::operator_not_equal(lhs, rhs); +} + +bool operator==(const dyn::data& lhs, const dyn::data& rhs) +{ + return dyn::internal::operator_equal(lhs, rhs); +} + + +dyn::data operator+(const dyn::data& lhs, const dyn::data& rhs) +{ + return dyn::internal::operator_plus(lhs, rhs); +} + +#endif diff --git a/dynamic-use-of-static-c++/src/data.erb.hh b/dynamic-use-of-static-c++/src/data.erb.hh new file mode 100644 index 0000000..b4c14e1 --- /dev/null +++ b/dynamic-use-of-static-c++/src/data.erb.hh @@ -0,0 +1,418 @@ +#ifndef DYN_DATA_HH +# define DYN_DATA_HH + +// FIXME: rename me without the .erb + +# include <string> +# include <cassert> +# include "function.hh" +# include "name_of.hh" +# include "all_methods.hh" + +namespace dyn { + + extern std::ostream& logger; + + namespace language + { + struct val; + struct var; + } + + namespace policy + { + enum type + { + none = 0, + is_const = 1, + is_ref = 2, + is_ptr = 4, + is_pod = 8, + is_void = 16 + }; + } + struct proxy_tag; + + // data --> abstract_data + // ^ + // | + // data_proxy<T> --> T + + + // abstract_data + + struct abstract_data + { + virtual abstract_data* clone() const = 0; + virtual abstract_data* const_clone() const { return clone(); } + virtual std::string proxy_type() const = 0; + virtual std::string type() const = 0; + virtual ~abstract_data() {} + }; + + // data_proxy<T> + + template <class T> + struct data_proxy : public abstract_data + { +# define gen_ctor \ + data_proxy() \ + { \ + logger << "ctor: " << proxy_type() << std::endl; \ + } + +# define gen_proxy_type \ + virtual std::string proxy_type() const \ + { \ + return mlc_name_of(*this); \ + } + + gen_proxy_type + + template <typename V> + operator V() const + { + V ret(const_ref()); + return ret; + } + + virtual std::string type() const + { + return mlc_name_of(const_ref()); + } + + virtual const T& const_ref() const = 0; + }; + + + // FIXME Perhaps we can use smart pointers here. + template <class T> + struct data_proxy_by_ptr : public data_proxy<T> + { + data_proxy_by_ptr(T* obj) : p_obj_(obj) { logger << "ctor: " << proxy_type() << std::endl; } + + virtual data_proxy_by_ptr<T>* clone() const + { + return new data_proxy_by_ptr<T>(p_obj_); + } + + virtual data_proxy_by_ptr<const T>* const_clone() const + { + return new data_proxy_by_ptr<const T>(p_obj_); + } + + gen_proxy_type + + T& obj() + { + assert(p_obj_); + return *p_obj_; + } + + const T& obj() const + { + assert(p_obj_); + return *p_obj_; + } + + virtual const T& const_ref() const { return obj(); } + + protected: + T* p_obj_; + }; + + + template <class T> + struct data_proxy_by_ref : public data_proxy<T> + { + data_proxy_by_ref(T& obj) : obj_(obj) { logger << "ctor: " << proxy_type() << std::endl; } + + virtual data_proxy_by_ref<T>* clone() const + { + return new data_proxy_by_ref<T>(obj_); + } + + virtual data_proxy_by_ref<const T>* const_clone() const + { + return new data_proxy_by_ref<const T>(obj_); + } + + virtual const T& const_ref() const { return obj_; } + const T& obj() const { return obj_; } + T& obj() { return obj_; } + + gen_proxy_type + + protected: + T& obj_; + }; + + + template <class T> + struct data_proxy_by_cpy : public data_proxy<T> + { + data_proxy_by_cpy(const T obj) : obj_(T(obj)) { logger << "ctor: " << proxy_type() << std::endl; } + + virtual data_proxy_by_cpy<T>* clone() const + { + return new data_proxy_by_cpy<T>(obj_); + } + + virtual data_proxy_by_cpy<const T>* const_clone() const + { + return new data_proxy_by_cpy<const T>(obj_); + } + + virtual const T& const_ref() const { return obj_; } + const T& obj() const { return obj_; } + T& obj() { return obj_; } + + gen_proxy_type + + protected: + T obj_; + }; + + + struct NilClass + { + NilClass(int) {} + }; + + struct data_nil : public data_proxy<NilClass> + { + data_nil() : nil_object_(NilClass(0)) { logger << "ctor: " << proxy_type() << std::endl; } + data_nil(const NilClass& nil_object) : nil_object_(nil_object) {} + const NilClass& const_ref() const { return nil_object_; } + const NilClass& obj() const { return nil_object_; } + virtual data_nil* clone() const { return new data_nil; } + gen_proxy_type + const NilClass nil_object_; + }; + + extern const NilClass nil_object; + extern data_nil* nil_proxy; + + template <typename T1, typename T2> + T2 + data_cast(const T1& src) + { + T2 tmp(src); + return tmp; + } + + template <typename T1, typename T2> + void + data_assign(T1& lhs, const T2& rhs) + { + lhs = rhs; + } + + // data + + struct data : public all_methods + { + + virtual const data& self() const + { + return *this; + } + + virtual data& self() + { + return *this; + } + + data& assign(const data& rhs) + { + if (&rhs == this) return *this; + if (rhs.proxy_ == 0) + { + logger << "assign(const data& rhs) [ rhs.proxy_ == 0 ]" << std::endl; + proxy_ = nil_proxy; + } + else + { + assert(rhs.proxy_ != proxy_); + // if (proxy_ != 0) + // delete proxy_; + proxy_ = rhs.proxy_->clone(); + } + return *this; + } + + data& const_assign(const data& rhs) + { + if (&rhs == this) return *this; + if (rhs.proxy_ == 0) + { + logger << "const_assign(const data& rhs) [ rhs.proxy_ == 0 ]" << std::endl; + proxy_ = nil_proxy; + } + else + { + assert(rhs.proxy_ != proxy_); + // if (proxy_ != 0) + // delete proxy_; + proxy_ = rhs.proxy_->const_clone(); + } + return *this; + } + + data& operator=(const data& rhs) { return assign(rhs); } + + data& operator=(data& rhs) { return assign(rhs); } + + + template <typename T> + data& operator=(const T& rhs); + + + template <typename T> + T convert_to() const; + + + template <typename T> + T& get_ref_on(); + + template <typename T> + const T& get_ref_on() const; + + std::string& const_stripping(std::string& str) const + { + size_t pos; + while ((pos = str.find("const ")) != std::string::npos) + str.erase(pos, 6); + while ((pos = str.find(" const")) != std::string::npos) + str.erase(pos, 6); + return str; + } + + template <typename T> + operator T() const + { + std::string src_type(proxy()->type()); + std::string dest_type(mlc_name<T>::of()); + if (const_stripping(src_type) == const_stripping(dest_type)) + return get_ref_on<T>(); + else + return convert_to<T>(); + } + + + ~data() + { + if (proxy_ != nil_proxy) + { + logger << "~data [ type() = " << type() << " ]" << std::endl; + delete proxy_; + proxy_ = nil_proxy; + } + } + + + std::string type() const + { + return proxy()->proxy_type(); + } + + + data operator[](const data&); + const data& operator[](const data&) const; + data operator*(); + const data& operator*() const; + + + abstract_data* proxy() const + { + assert(proxy_); + return proxy_; + } + + bool is_const() + { + std::string type_(type()); + return type_.find("dyn::data_proxy_by_ref<") == 0 + && type_.rfind("const>") == type_.length() - 6; + } + + meth method(const std::string& method_name); + + data() : proxy_(nil_proxy) {} + + data(abstract_data* proxy, proxy_tag*) : all_methods(), proxy_(proxy) {} + + template <class T> + data(T& obj) : all_methods() + { + logger << "data(T& obj) [ T = " << mlc_name<T>::of() << " ]" << std::endl; + proxy_ = new data_proxy_by_ref<T>(obj); + } + + template <class T> + data(const T& obj) : all_methods() + { + logger << "data(const T& obj) [ T = " << mlc_name<T>::of() << " ]" << std::endl; + proxy_ = new data_proxy_by_ref<const T>(obj); + } + + data(language::var& rhs); + data(language::val& rhs); + data(const language::var& rhs); + data(const language::val& rhs); + + data(data& rhs) : all_methods(), proxy_(0) + { + logger << "data(data& rhs) [ rhs.type() = " << rhs.type() << " ]" << std::endl; + assign(rhs); + } + + data(const data& rhs) : all_methods(), proxy_(0) + { + logger << "data(const data& rhs) [ rhs.type() = " << rhs.type() << " ]" << std::endl; + assign(rhs); + } + + protected: + abstract_data* proxy_; + }; + + extern const data nil; + + namespace internal { + extern op operator_push; + extern op operator_pop; + extern op operator_incr; + extern op operator_decr; + extern op operator_plus; + extern op operator_star; + extern op operator_equal; + extern op operator_not_equal; + extern meth operator_square_brackets; + } + +} + +template <typename T, dyn::policy::type policy> +struct dyn_choose_data_proxy +{ + typedef dyn::data_proxy_by_cpy<T> ret; +}; + +template <typename T> +struct dyn_choose_data_proxy<T, dyn::policy::is_ref> +{ + typedef dyn::data_proxy_by_ref<T> ret; +}; + +template <typename T> +struct dyn_choose_data_proxy<T, (dyn::policy::type)(dyn::policy::is_ref + dyn::policy::is_const)> +{ + typedef dyn::data_proxy_by_ref<const T> ret; +}; + +# ifdef DYN_FULL_IMPLEMENTATION +# include "data.hxx" +# endif + +#endif diff --git a/dynamic-use-of-static-c++/src/data.hxx b/dynamic-use-of-static-c++/src/data.hxx new file mode 100644 index 0000000..5b993a9 --- /dev/null +++ b/dynamic-use-of-static-c++/src/data.hxx @@ -0,0 +1,61 @@ +#ifndef DYN_DATA_HXX +# define DYN_DATA_HXX + +# include <string> +# include <cassert> +# include <iostream> + +# include "function.hh" +# include "name_of.hh" + +namespace dyn { + + template <typename T> + T data::convert_to() const + { + static fun dyn_data_cast(std::string("data_cast< ") + + type() + ", " + mlc_name<T>::of() + " >"); + return dyn_data_cast(*this); + } + + + template <typename T> + T& data::get_ref_on() + { + assert(proxy_); + data_proxy_by_ref<T>* reinterpret_cast_returned_pointer = reinterpret_cast<data_proxy_by_ref<T>*>(proxy_); + assert(reinterpret_cast_returned_pointer); + return reinterpret_cast_returned_pointer->obj(); + } + + + template <typename T> + const T& data::get_ref_on() const + { + assert(proxy_); + data_proxy<T>* reinterpret_cast_returned_pointer = reinterpret_cast<data_proxy<T>*>(proxy_); + assert(reinterpret_cast_returned_pointer); + return reinterpret_cast_returned_pointer->const_ref(); + } + + + template <typename T> + data& data::operator=(const T& rhs) + { + assert(proxy_); + static fun dyn_data_assign(std::string("data_assign<") + proxy()->type() + ", " + mlc_name<T>::of() + ">"); + dyn_data_assign(*this, rhs); + return *this; + } + +} + +std::ostream& operator<<(std::ostream& ostr, const dyn::data& d); +std::istream& operator>>(std::istream& istr, dyn::data& d); +dyn::data& operator++(dyn::data& d); +dyn::data& operator--(dyn::data& d); +bool operator!=(const dyn::data& lhs, const dyn::data& rhs); +bool operator==(const dyn::data& lhs, const dyn::data& rhs); +dyn::data operator+(const dyn::data& lhs, const dyn::data& rhs); + +#endif diff --git a/dynamic-use-of-static-c++/src/demangle.h b/dynamic-use-of-static-c++/src/demangle.h new file mode 100644 index 0000000..21e9dd3 --- /dev/null +++ b/dynamic-use-of-static-c++/src/demangle.h @@ -0,0 +1,163 @@ +/* Defs for interface to demanglers. + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002 + Free Software Foundation, Inc. + + 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, 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + +#if !defined (DEMANGLE_H) +#define DEMANGLE_H + +#include "ansidecl.h" + +/* Options passed to cplus_demangle (in 2nd parameter). */ + +#define DMGL_NO_OPTS 0 /* For readability... */ +#define DMGL_PARAMS (1 << 0) /* Include function args */ +#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */ +#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */ +#define DMGL_VERBOSE (1 << 3) /* Include implementation details. */ +#define DMGL_TYPES (1 << 4) /* Also try to demangle type encodings. */ + +#define DMGL_AUTO (1 << 8) +#define DMGL_GNU (1 << 9) +#define DMGL_LUCID (1 << 10) +#define DMGL_ARM (1 << 11) +#define DMGL_HP (1 << 12) /* For the HP aCC compiler; + same as ARM except for + template arguments, etc. */ +#define DMGL_EDG (1 << 13) +#define DMGL_GNU_V3 (1 << 14) +#define DMGL_GNAT (1 << 15) + +/* If none of these are set, use 'current_demangling_style' as the default. */ +#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG|DMGL_GNU_V3|DMGL_JAVA|DMGL_GNAT) + +/* Enumeration of possible demangling styles. + + Lucid and ARM styles are still kept logically distinct, even though + they now both behave identically. The resulting style is actual the + union of both. I.E. either style recognizes both "__pt__" and "__rf__" + for operator "->", even though the first is lucid style and the second + is ARM style. (FIXME?) */ + +extern enum demangling_styles +{ + no_demangling = -1, + unknown_demangling = 0, + auto_demangling = DMGL_AUTO, + gnu_demangling = DMGL_GNU, + lucid_demangling = DMGL_LUCID, + arm_demangling = DMGL_ARM, + hp_demangling = DMGL_HP, + edg_demangling = DMGL_EDG, + gnu_v3_demangling = DMGL_GNU_V3, + java_demangling = DMGL_JAVA, + gnat_demangling = DMGL_GNAT +} current_demangling_style; + +/* Define string names for the various demangling styles. */ + +#define NO_DEMANGLING_STYLE_STRING "none" +#define AUTO_DEMANGLING_STYLE_STRING "auto" +#define GNU_DEMANGLING_STYLE_STRING "gnu" +#define LUCID_DEMANGLING_STYLE_STRING "lucid" +#define ARM_DEMANGLING_STYLE_STRING "arm" +#define HP_DEMANGLING_STYLE_STRING "hp" +#define EDG_DEMANGLING_STYLE_STRING "edg" +#define GNU_V3_DEMANGLING_STYLE_STRING "gnu-v3" +#define JAVA_DEMANGLING_STYLE_STRING "java" +#define GNAT_DEMANGLING_STYLE_STRING "gnat" + +/* Some macros to test what demangling style is active. */ + +#define CURRENT_DEMANGLING_STYLE current_demangling_style +#define AUTO_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_AUTO) +#define GNU_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU) +#define LUCID_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_LUCID) +#define ARM_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_ARM) +#define HP_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_HP) +#define EDG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_EDG) +#define GNU_V3_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU_V3) +#define JAVA_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_JAVA) +#define GNAT_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNAT) + +/* Provide information about the available demangle styles. This code is + pulled from gdb into libiberty because it is useful to binutils also. */ + +extern const struct demangler_engine +{ + const char *const demangling_style_name; + const enum demangling_styles demangling_style; + const char *const demangling_style_doc; +} libiberty_demanglers[]; + +extern char * +cplus_demangle PARAMS ((const char *mangled, int options)); + +extern int +cplus_demangle_opname PARAMS ((const char *opname, char *result, int options)); + +extern const char * +cplus_mangle_opname PARAMS ((const char *opname, int options)); + +/* Note: This sets global state. FIXME if you care about multi-threading. */ + +extern void +set_cplus_marker_for_demangling PARAMS ((int ch)); + +extern enum demangling_styles +cplus_demangle_set_style PARAMS ((enum demangling_styles style)); + +extern enum demangling_styles +cplus_demangle_name_to_style PARAMS ((const char *name)); + +/* V3 ABI demangling entry points, defined in cp-demangle.c. */ +extern char* +cplus_demangle_v3 PARAMS ((const char* mangled, int options)); + +extern char* +java_demangle_v3 PARAMS ((const char* mangled)); + + +enum gnu_v3_ctor_kinds { + gnu_v3_complete_object_ctor = 1, + gnu_v3_base_object_ctor, + gnu_v3_complete_object_allocating_ctor +}; + +/* Return non-zero iff NAME is the mangled form of a constructor name + in the G++ V3 ABI demangling style. Specifically, return an `enum + gnu_v3_ctor_kinds' value indicating what kind of constructor + it is. */ +extern enum gnu_v3_ctor_kinds + is_gnu_v3_mangled_ctor PARAMS ((const char *name)); + + +enum gnu_v3_dtor_kinds { + gnu_v3_deleting_dtor = 1, + gnu_v3_complete_object_dtor, + gnu_v3_base_object_dtor +}; + +/* Return non-zero iff NAME is the mangled form of a destructor name + in the G++ V3 ABI demangling style. Specifically, return an `enum + gnu_v3_dtor_kinds' value, indicating what kind of destructor + it is. */ +extern enum gnu_v3_dtor_kinds + is_gnu_v3_mangled_dtor PARAMS ((const char *name)); + +#endif /* DEMANGLE_H */ diff --git a/dynamic-use-of-static-c++/src/dyn.hh b/dynamic-use-of-static-c++/src/dyn.hh new file mode 100644 index 0000000..f816c28 --- /dev/null +++ b/dynamic-use-of-static-c++/src/dyn.hh @@ -0,0 +1,62 @@ +#ifndef DYN_HH +# define DYN_HH + +# include "config.hh" + +# define DYN_FULL_IMPLEMENTATION + +# include "data.hh" + +# include "function.hh" + +namespace dyn +{ + namespace language + { + struct val; + + struct var : public data + { + var() : data() { logger << "var()" << std::endl; } + + template <class T> + var(const T& obj) : data((abstract_data*)new data_proxy_by_cpy<T>(obj), (proxy_tag*)0) + { + logger << "var(const T& obj) [ T = " << mlc_name<T>::of() << " ]" << std::endl; + } + + template <class T> + var(T& obj) : data(obj) { logger << "var(T& obj) [ T = " << mlc_name<T>::of() << " ]" << std::endl; } + + var(const data& rhs) : data(rhs) { logger << "var(const data& rhs)" << std::endl; } + var(const var& rhs) : data(rhs) { logger << "var(const var& rhs)" << std::endl; } + var(const val& rhs) : data(rhs) { logger << "var(const val& rhs)" << std::endl; } + var(data& rhs) : data(rhs) { logger << "var(data& rhs)" << std::endl; } + var(var& rhs) : data(rhs) { logger << "var(var& rhs)" << std::endl; } + var(val& rhs) : data(rhs) { logger << "var(val& rhs)" << std::endl; } + }; + + struct val : public data + { + template <class T> + val(const T& obj) : data(obj) { logger << "val(const T& obj) [ T = " << mlc_name<T>::of() << " ]" << std::endl; } + + val(const data& rhs) : data(rhs) { logger << "val(const data& rhs)" << std::endl; } + val(const var& rhs) : data() { + logger << "val(const var& rhs)" << std::endl; + const_assign(rhs); + } + val(const val& rhs) : data(rhs) { logger << "val(const val& rhs)" << std::endl; } + }; + + typedef ::dyn::fun fun; + typedef ::dyn::ctor ctor; + typedef ::dyn::meth meth; + typedef ::dyn::meth method; + } +} + +# include "function_loader.hh" + +#endif + diff --git a/dynamic-use-of-static-c++/src/function.erb.cc b/dynamic-use-of-static-c++/src/function.erb.cc new file mode 100644 index 0000000..4624aed --- /dev/null +++ b/dynamic-use-of-static-c++/src/function.erb.cc @@ -0,0 +1,47 @@ +#ifndef FUNCTION_HXX +#define FUNCTION_HXX + +# include <cassert> +# include <string> +# include "data.hh" +# include <list> +# include "function_loader.hh" + +namespace dyn +{ + + <%- DYN_MAX_ARGUMENTS.times do |i| -%> + + <%- arguments = (0 .. i - 1).map { |j| "const data& arg#{j}" }.join(', ') -%> + <%- objects = (0 .. i - 1).map { |j| "arg#{j}" } -%> + + data + generic_fun::operator() (<%= arguments %>) const + { + typedef data (*func_t)(<%= (['const dyn::data&'] * i).join(', ') %>); + arguments_types_t arguments_types; + + if (obj_ptr_) + arguments_types.push_back(obj_ptr_->type()); + + <%- i.times do |j| -%> + arguments_types.push_back(arg<%= j %>.type()); + <%- end -%> + + void* ptr = load_function(kind_, name_, arguments_types, header_paths_); + assert(ptr); + + if (obj_ptr_) + { + typedef data (*func_t2)(<%= (['const dyn::data&'] * (i + 1)).join(', ') %>); + return ((func_t2)ptr)(<%= (['*obj_ptr_'] + objects).join(', ') %>); + } + + return ((func_t)ptr)(<%= objects.join(', ') %>); + } + + <%- end -%> + +} // end of namespace dyn + +#endif diff --git a/dynamic-use-of-static-c++/src/function.erb.hh b/dynamic-use-of-static-c++/src/function.erb.hh new file mode 100644 index 0000000..f608679 --- /dev/null +++ b/dynamic-use-of-static-c++/src/function.erb.hh @@ -0,0 +1,63 @@ +#ifndef FUNCTION_HH +#define FUNCTION_HH + +# include <cassert> +# include <string> + +namespace dyn +{ + + enum fun_kind + { + FUN, + OP, + METH, + CTOR + }; + + struct data; + + struct generic_fun + { + + generic_fun(fun_kind kind, + const std::string name, + const std::string header_paths, + const data* obj_ptr) : + kind_(kind), name_(name), + header_paths_(header_paths), obj_ptr_(obj_ptr) {} + + + <%- DYN_MAX_ARGUMENTS.times do |i| -%> + data + operator() (<%= (["const data&"] * i).join(', ') %>) const; + <%- end -%> + + const fun_kind kind_; + const std::string name_; + const std::string header_paths_; + const data* obj_ptr_; + }; + + <% %w[ fun ctor meth ].each do |name| %> + struct <%= name %> : public generic_fun + { + <%= name %>(const std::string name, + const std::string header_paths="*", + const data* obj_ptr=0) : + generic_fun(<%= name.upcase %>, name, header_paths, obj_ptr) {} + }; + <% end %> + + struct op : public generic_fun + { + op(const std::string name, + const std::string header_paths="*", + const data* obj_ptr=0) : + generic_fun(OP, std::string("operator") + name, + header_paths, obj_ptr) {} + }; + +} // end of namespace dyn + +#endif diff --git a/dynamic-use-of-static-c++/src/function_loader.cc b/dynamic-use-of-static-c++/src/function_loader.cc new file mode 100644 index 0000000..cdc0296 --- /dev/null +++ b/dynamic-use-of-static-c++/src/function_loader.cc @@ -0,0 +1,359 @@ +#ifndef DYN_FUNCTION_LOADER_CC +# define DYN_FUNCTION_LOADER_CC + +# include <ltdl.h> +# include <map> + +// FIXME use and improve the logger to avoid use of std::cerr +# include <iostream> + +# include "data.hh" +# include "function_loader.hh" +# include "ruby_stream.hh" + + +template <typename InputIterator, typename T, typename OStream> +OStream& join(const InputIterator& begin, const InputIterator& end, const T& elt, OStream& ostr) +{ + InputIterator it = begin; + + if (it != end) + ostr << *it; + + for (++it; it != end; ++it) + ostr << elt << *it; + + return ostr; +} + + +namespace dyn { + + ruby::environment ruby_environment; + + struct ltstr + { + bool operator()(const char* s1, const char* s2) const + { + return strcmp(s1, s2) < 0; + } + }; + + std::list<std::string> includes_; + + template <typename Fun> + void + foreach_path_in_paths(const std::string& header_paths, Fun& fun) + { + std::list<std::string>::const_iterator it; + unsigned last = 0, pos; + while (42) + { + pos = header_paths.find(":", last); + std::string sub = header_paths.substr(last, pos - last); + if (sub == "*") + { + for (it = includes_.begin(); it != includes_.end(); ++it) + fun(*it); + } + else if (sub != "") + fun(sub); + if (pos >= std::string::npos) break; + last = pos + 1; + } + } + + template <typename OStream> + struct gen_cxx_path + { + gen_cxx_path(OStream& ostr_) : ostr(ostr_) {} + void operator() (const std::string& path) + { + ostr << "#include "; + if (path.find("<") == std::string::npos || path.find("\"") == std::string::npos) + if (path.find(".hh") == path.length() - 3) + ostr << "\"" << path << "\""; + else + ostr << "<" << path << ">"; + else + ostr << path; + ostr << '\n'; + } + OStream& ostr; + }; + + template <typename OStream> + struct gen_path + { + gen_path(OStream& ostr_) : first(true), ostr(ostr_) {} + void operator() (const std::string& path) + { + if (first) + { + first = false; + ostr << path; + } + else + ostr << ':' << path; + } + bool first; + OStream& ostr; + }; + + struct function_loader_t + { + + function_loader_t() + { + lt_dlinit(); + ruby << "$: << \"" << DYNDIR << "\"" << ruby::eval; + ruby << "require 'function_loader'" << ruby::eval; + ruby << "require 'md5'" << ruby::eval; + ruby << "Signal.trap(:SEGV, 'IGNORE')" << ruby::eval; + } + + ~function_loader_t() + { + lt_dlexit(); + } + + template <typename OStream> + void + gen_cxx(const std::string& identifier, + const std::string& name, + const std::list<std::string>& args, + fun_kind kind, + const std::string paths, + OStream& ostr) + { + ruby::stream r; + typedef std::string str; + typedef std::list<str> str_list; + str_list call_args; + std::ostringstream body, call; + str nl("\n "); + bool first_type_is_ptr = false; + str_list::const_iterator it; + + ostr << "#include \"dyn-light.hh\"\n"; + + gen_cxx_path<OStream> fun(ostr); + foreach_path_in_paths(paths, fun); + + ostr << "extern \"C\" {\n" + << " namespace dyn {\n" + << " namespace generated {\n" + << " data\n" + << " dyn_" << identifier << "("; + + int i = 0; + for (it = args.begin(); it != args.end(); ++it, ++i) + { + std::ostringstream oarg; + oarg << "arg" << i; + str arg(oarg.str()); + + str type(*it); + // remove references cause they are forbidden on lhs + while (*type.rbegin() == '&') type.erase(--type.end()); + + if ( kind == METH and i == 0 ) + { + // check if the first type is a pointer to choose the good op (. or ->) + str stripped_type(type); + unsigned pos; + while ((pos = stripped_type.find(" ")) != str::npos) stripped_type.erase(pos, 1); + unsigned len = stripped_type.length(); + first_type_is_ptr = ((stripped_type.compare(len - 7, 7, "*const>") == 0) + || (stripped_type.compare(len - 2, 2, "*>") == 0)); + } + + if (it != args.begin()) ostr << ", "; + ostr << "const data& " << arg; + call_args.push_back(arg + "_reinterpret_cast_ptr->obj()"); + body << type << "* " << arg << "_reinterpret_cast_ptr = " + << "reinterpret_cast<" << type << "* >(" << arg << ".proxy());" + << nl << "assert(" << arg << "_reinterpret_cast_ptr);" << nl; + } + + if ( kind == METH) + { + call << call_args.front() << ((first_type_is_ptr)? "->" : "."); + call_args.pop_front(); + } + + call << name << "("; + join(call_args.begin(), call_args.end(), ", ", call); + call << ")"; + + str op(name); + + switch (kind) + { + case OP: + if ( op.compare(0, 8, "operator") == 0 ) + op.erase(0, 8); + call.str(std::string()); + switch (call_args.size()) + { + case 1: + call << op << "(" << *call_args.begin() << ")"; + break; + case 2: + it = call_args.begin(); + call << "(" << *it++ << ") "; + call << op + << " (" << *it << ")"; + break; + default: assert(0); + } + // no break here + case METH: + case FUN: + body << "policy::receiver<select_dyn_policy((" << call.str() << "))> receiver;" << nl + << "(receiver(), " << call.str() << ");" << nl + << "data ret(receiver.proxy(), (proxy_tag*)0);" << nl + << "return ret;\n"; + break; + case CTOR: + body << "typedef " << name << " T;" << nl + << "T* ptr = new T("; + join(call_args.begin(), call_args.end(), ", ", body); + body << ");" << nl + << "abstract_data* proxy = new data_proxy_by_ptr<T>(ptr);" << nl + << "data ret(proxy, (proxy_tag*)0);" << nl + << "return ret;\n"; + break; + default: + assert(!"Unknown kind"); + } + + ostr << ")\n" + << " {" << nl + << body.str() + << " }\n" + << " }\n" + << " }\n" + << "};\n"; + + } + + void + include_dir(const std::string& dir) + { + cflags_.push_back(std::string("-I") + dir); + } + + void + cflags(const std::string& elt) + { + cflags_.push_back(elt); + } + + void + ldflags(const std::string& elt) + { + ldflags_.push_back(elt); + } + + void* + load(fun_kind kind, + const std::string& name, + const arguments_types_t& arguments_types, + const std::string& paths) + { + std::ostringstream ostr; + ostr << name << '('; + arguments_types_t::const_iterator it(arguments_types.begin()); + if (it != arguments_types.end()) + { + ostr << *it; + for (++it; it != arguments_types.end(); ++it) + ostr << ", " << *it; + } + ostr << ')'; + if (paths != "") + { + ostr << ", paths: "; + gen_path<std::ostream> fun(ostr); + foreach_path_in_paths(paths, fun); + } + std::string prototype = ostr.str(); + + ruby << "Digest::MD5.new(%q{" << prototype.c_str() << "}).to_s" << ruby::eval; + const char* identifier = STR2CSTR(ruby.last_value()); + + cache_type::iterator ptr_it = cache.find(identifier); + + if ( ptr_it != cache.end() ) + { + std::cerr << "\e[36mJIT: \e[32mHIT: \e[0m " << prototype << std::endl; + return ptr_it->second; + } + + std::cerr << "\e[36mJIT: \e[31mMISS: compile: \e[0m " << prototype << std::endl; + + ruby << "compile %q{"; + gen_cxx(identifier, name, arguments_types, kind, paths, ruby); + ruby << "}, %q{" << identifier << "}, %q{" << name << "}, %q{"; + join(cflags_.begin(), cflags_.end(), ' ', ruby); + ruby << "}, %q{"; + join(ldflags_.begin(), ldflags_.end(), ' ', ruby); + ruby << "}" << ruby::eval; + + const char* error; + std::string lib_path = std::string("repository/") + identifier + + "/libdyn_" + identifier + ".la"; + std::string symb = std::string("dyn_") + identifier; + + lt_dlhandle lib = lt_dlopen(lib_path.c_str()); + if ((error = lt_dlerror())) std::cerr << error << std::endl; + void* ptr = lt_dlsym(lib, symb.c_str()); + cache[identifier] = ptr; + if ((error = lt_dlerror())) std::cerr << error << std::endl; + return ptr; + } + + protected: + typedef std::map<const char*, void*, ltstr> cache_type; + cache_type cache; + std::list<std::string> cflags_, ldflags_; + ruby::stream ruby; + }; + + function_loader_t function_loader; + + void + include(const std::string& file) + { + includes_.push_back(file); + } + + void + include_dir(const std::string& dir) + { + function_loader.include_dir(dir); + } + + void cflags(const std::string& elt) + { + function_loader.cflags(elt); + } + + void ldflags(const std::string& elt) + { + function_loader.ldflags(elt); + } + + void* + load_function(fun_kind kind, + const std::string& name, + const arguments_types_t& arguments_types, + const std::string& header_path) + { + return function_loader.load(kind, name, arguments_types, header_path); + } + +} // end of namespace dyn + +#endif diff --git a/dynamic-use-of-static-c++/src/function_loader.hh b/dynamic-use-of-static-c++/src/function_loader.hh new file mode 100644 index 0000000..29b5197 --- /dev/null +++ b/dynamic-use-of-static-c++/src/function_loader.hh @@ -0,0 +1,29 @@ +#ifndef DYN_FUNCTION_LOADER_HH +# define DYN_FUNCTION_LOADER_HH + +# include <string> +# include <list> + +namespace dyn { + + void + include(const std::string& file); + + void + include_dir(const std::string& dir); + + void cflags(const std::string& elt); + + void ldflags(const std::string& elt); + + typedef std::list<std::string> arguments_types_t; + + void* + load_function(fun_kind kind, + const std::string& name, + const arguments_types_t& arguments_types, + const std::string& header_path); + +} // end of namespace dyn + +#endif diff --git a/dynamic-use-of-static-c++/src/function_loader.rb b/dynamic-use-of-static-c++/src/function_loader.rb new file mode 100644 index 0000000..8ec56e6 --- /dev/null +++ b/dynamic-use-of-static-c++/src/function_loader.rb @@ -0,0 +1,39 @@ +require 'pathname' + +DYN_DATADIR = Pathname.new(__FILE__).dirname.parent + '_build/data' # FIXME + +def compile ( cxx, identifier, name, cflags, ldflags ) + repository = Pathname.new('repository') + unless repository.exist? + repository.mkpath + (repository + 'Makefile').make_symlink(DYN_DATADIR + 'Makefile.repository') + end + dir = repository + identifier + unless dir.exist? + dir.mkpath + makefile = (DYN_DATADIR + 'Makefile.template').read + makefile.gsub!(/libdyn_function\.la/, "libdyn_#{identifier}.la") + (dir + 'Makefile').open('w') { |f| f.puts makefile } + file = dir + "function.cc" + (dir + '.deps').mkpath + (dir + '.deps' + 'libdyn_function_la-function.Plo').open('w') + file.open('w') do |f| + f.puts cxx + end + (dir + 'Makefile').open('a') do |f| + f.puts "CXXFLAGS += #{cflags}" + f.puts "LDFLAGS += #{ldflags}" + end + end + out = dir + 'make.out' + cmd = "cd #{dir} && make > make.out 2>&1" + if system cmd + out.unlink if out.exist? + else + STDERR.puts 'JIT: Error when compiling this code' + STDERR.puts cxx + STDERR.puts cmd + STDERR.puts out.read + exit! 1 + end +end diff --git a/dynamic-use-of-static-c++/src/name_of.cc b/dynamic-use-of-static-c++/src/name_of.cc new file mode 100644 index 0000000..7b2b6da --- /dev/null +++ b/dynamic-use-of-static-c++/src/name_of.cc @@ -0,0 +1,25 @@ +#ifndef DYN_NAME_OF_CC +# define DYN_NAME_OF_CC + +# include "name_of.hh" + +# ifndef NO_COMPILER_DEMANGLING + +extern "C" { +# include "demangle.h" +} + +# define DEMANGLE_OPTIONS DMGL_VERBOSE | DMGL_TYPES | DMGL_ANSI | DMGL_PARAMS + +std::string demangle(const char* name) +{ + std::string result(cplus_demangle(name, DEMANGLE_OPTIONS)); + size_t pos; + if ((pos = result.find("char_traints")) != std::string::npos) + result.replace(pos, 12, "char_traits "); + return result; +} + +# endif + +#endif // ! DYN_NAME_OF_CC diff --git a/dynamic-use-of-static-c++/src/name_of.hh b/dynamic-use-of-static-c++/src/name_of.hh new file mode 100644 index 0000000..04b40ad --- /dev/null +++ b/dynamic-use-of-static-c++/src/name_of.hh @@ -0,0 +1,183 @@ +#ifndef NAME_OF +# define NAME_OF + +# include <string> +# include <sstream> + +# ifndef NO_COMPILER_DEMANGLING + +std::string demangle(const char* name); + +template <class T> +std::string mlc_name_of(const T&) +{ + return demangle(typeid(T).name()); +} + +template <typename T> +struct mlc_name +{ + static std::string of() + { + return demangle(typeid(T).name()); + } +}; + +# else + +# define mlc_set_name(NAME) \ +template <> struct mlc_name <NAME> { static std::string of() { return #NAME; } } + +# define mlc_set_name_TC(CLASS) \ +template <class C> struct mlc_name < CLASS<C> > \ +{ static std::string of() { return std::string(#CLASS) + "< " + mlc_name<C>::of() + " >"; } } + +# define mlc_set_name_TCC(CLASS) \ +template <class C1, class C2> struct mlc_name < CLASS<C1,C2> > \ +{ static std::string of() { return std::string(#CLASS) + "< " + mlc_name<C1>::of() + ", " + mlc_name<C2>::of() + " >"; } } + +# define mlc_set_name_TCc(CLASS) \ +template <class C1, class C2> struct mlc_name < CLASS<C1,C2> > \ +{ static std::string of() { return std::string(#CLASS) + "< " + mlc_name<C1>::of() + " >"; } } + +# define mlc_set_name_TCcc(CLASS) \ +template <class C1, class C2, class C3> struct mlc_name < CLASS<C1,C2,C3> > \ +{ static std::string of() { return std::string(#CLASS) + "< " + mlc_name<C1>::of() + " >"; } } + +template <typename message> +struct mlc_error_message +{ + private: + mlc_error_message() {} +}; + +template <class T> +struct mlc_name +{ + static std::string of() + { + struct mlc_name_of_on_an_unkown_type_please_use_mlc_set_name_on_this_T {}; + mlc_error_message<mlc_name_of_on_an_unkown_type_please_use_mlc_set_name_on_this_T> e; + return "UNKNOWN!"; + } +}; + +template <class T> +struct mlc_name2 +{ + static std::string of(const T&) + { + return mlc_name<T>::of(); + } +}; + +template <class T> +std::string mlc_name_of(const T& t) +{ + return mlc_name2<T>::of(t); +} + +// ptr +template <typename T> +struct mlc_name <T*> +{ + static std::string of() { return mlc_name<T>::of() + "*"; } +}; + +template <typename T> +struct mlc_name2 <T*> +{ + static std::string of(const T* const& t) { return mlc_name2<T>::of(*t) + "*"; } +}; + + +// const +template <typename T> +struct mlc_name <const T> +{ + static std::string of() { return std::string("const ") + mlc_name<T>::of(); } +}; + +template <typename T> +struct mlc_name2 <const T> +{ + static std::string of(const T& t) { return std::string("const ") + mlc_name2<T>::of(t); } +}; + +// ref +template <typename T> +struct mlc_name <T&> +{ + static std::string of() { return mlc_name<T>::of() + "&"; } +}; + +template <typename T> +struct mlc_name2 <T&> +{ + static std::string of(const T& t) { return mlc_name2<T>::of(t) + "&"; } +}; + +// T [] +template <typename T> +struct mlc_name <T[]> +{ + static std::string of() { return mlc_name<T>::of() + " []"; } +}; + +template <typename T> +struct mlc_name2 <T[]> +{ + static std::string of(const T []) { return mlc_name<T>::of() + " []"; } +}; + +// T [N] +template <typename T, unsigned int N> +struct mlc_name <T[N]> +{ + static std::string of() + { + std::ostringstream ostr; + ostr << mlc_name<T>::of() << " [" << N << "]"; + return ostr.str(); + } +}; + +// built-in + +mlc_set_name(void); +mlc_set_name(char); +mlc_set_name(signed char); +mlc_set_name(unsigned char); +mlc_set_name(short); +mlc_set_name(unsigned short); +mlc_set_name(int); +mlc_set_name(unsigned); +mlc_set_name(long); +mlc_set_name(unsigned long); +mlc_set_name(float); +mlc_set_name(double); +mlc_set_name(bool); + +// some std + +#include <iosfwd> + +namespace std { + template <class _Tp, class _Alloc> class vector; + template <class _Key, class _Compare, class _Alloc> class set; + template <class _Tp, class _Alloc> class list; +} +mlc_set_name_TCc(std::vector); +mlc_set_name_TCcc(std::set); +mlc_set_name_TCc(std::list); +mlc_set_name(std::string); +mlc_set_name(std::istream); +mlc_set_name(std::ostream); +mlc_set_name_TCc(std::basic_istream); +mlc_set_name_TCc(std::basic_ostream); +mlc_set_name(std::istringstream); +mlc_set_name(std::ostringstream); + +# endif + +#endif diff --git a/dynamic-use-of-static-c++/src/policy.cc b/dynamic-use-of-static-c++/src/policy.cc new file mode 100644 index 0000000..54b1d72 --- /dev/null +++ b/dynamic-use-of-static-c++/src/policy.cc @@ -0,0 +1,18 @@ +#ifndef DYN_POLICY_CC +# define DYN_POLICY_CC + +# include "policy.hh" + +namespace dyn +{ + namespace policy + { + + id_for_pod<2> id_for_pod_2; + + id_for_ptr_and_ref<2> id_for_ptr_and_ref_2; + + } +} + +#endif // ! DYN_POLICY_CC diff --git a/dynamic-use-of-static-c++/src/policy.hh b/dynamic-use-of-static-c++/src/policy.hh new file mode 100644 index 0000000..eae4201 --- /dev/null +++ b/dynamic-use-of-static-c++/src/policy.hh @@ -0,0 +1,107 @@ +#ifndef DYN_POLICY_HH +# define DYN_POLICY_HH + +# include "data.hh" + +namespace dyn +{ + namespace policy + { + +# define select_dyn_policy(e) \ + (dyn::policy::type)dyn::policy::simplify< \ + sizeof((dyn::policy::id_for_pod_2(), e, dyn::policy::id_for_pod_2())) \ + + sizeof((dyn::policy::id_for_ptr_and_ref_2(), e, \ + dyn::policy::id_for_ptr_and_ref_2()))>::val + + template <unsigned n> + struct id + { + char d[n]; + }; + + template <class T> struct check_is_const { enum { val = none }; }; + template <class T> struct check_is_const <const T> { enum { val = is_const }; }; + + template <unsigned N> + struct id_for_pod : id<N> + { + id_for_pod<N>() {} + template <unsigned M> id_for_pod<N>(id_for_pod<M>&) {} + id_for_pod<N>& operator() () { return *this; } + + template <typename T> + id_for_pod<N + is_pod> operator, (T) { assert(0); } + }; + extern id_for_pod<2> id_for_pod_2; + + template <unsigned N> + struct id_for_ptr_and_ref : id<N> + { + id_for_ptr_and_ref<N>() {} + template <unsigned M> id_for_ptr_and_ref<N>(id_for_ptr_and_ref<M>&) {} + id_for_ptr_and_ref<N>& operator() () { return *this; } + + template <typename T> + id_for_ptr_and_ref<N + is_ref + check_is_const<T>::val> operator, (T&) { assert(0); } + + template <typename T> + id_for_ptr_and_ref<N + is_ptr + check_is_const<T>::val> operator, (T*) { assert(0); } + }; + extern id_for_ptr_and_ref<2> id_for_ptr_and_ref_2; + + template <unsigned n> + struct simplify; + +# define set_simplify(x, y) \ + template <> struct simplify<x + 20> { enum { val = y }; } + + set_simplify(-16, is_void); + set_simplify(0, is_pod); + set_simplify(4, is_ref); + set_simplify(5, is_ref + is_const); + set_simplify(6, is_ptr); + set_simplify(7, is_ptr + is_const); + + template <type policy> + struct receiver + { + receiver() : proxy_(0) { logger << "receiver() [ policy = " << policy << " ]" << std::endl; } + + receiver& operator() () + { + return *this; + } + + template <typename T> + receiver& operator,(T& obj) + { + logger << "receiver::operator,(T&) [ T = " << mlc_name<T>::of() << " ]" << std::endl; + proxy_ = new typename dyn_choose_data_proxy<T, policy>::ret(obj); + return *this; + } + + template <typename T> + receiver& operator,(const T& obj) + { + logger << "receiver::operator,(const T&) [ T = " << mlc_name<const T>::of() << " ]" << std::endl; + proxy_ = new typename dyn_choose_data_proxy<T, policy>::ret(obj); + return *this; + } + + abstract_data* proxy() + { + if (proxy_) + return proxy_; + else + return new data_nil; + } + + protected: + abstract_data* proxy_; + }; + + } +} + +#endif // ! DYN_POLICY_HH diff --git a/dynamic-use-of-static-c++/src/ruby_stream.cc b/dynamic-use-of-static-c++/src/ruby_stream.cc new file mode 100644 index 0000000..2ae7ecb --- /dev/null +++ b/dynamic-use-of-static-c++/src/ruby_stream.cc @@ -0,0 +1,11 @@ +#ifndef RUBY_STREAM_CC +# define RUBY_STREAM_CC + +# include "ruby_stream.hh" + +namespace ruby +{ + eval_type eval; +} + +#endif diff --git a/dynamic-use-of-static-c++/src/ruby_stream.hh b/dynamic-use-of-static-c++/src/ruby_stream.hh new file mode 100644 index 0000000..af2ee61 --- /dev/null +++ b/dynamic-use-of-static-c++/src/ruby_stream.hh @@ -0,0 +1,100 @@ +#ifndef RUBY_STREAM_HH +#define RUBY_STREAM_HH + +// #define DEBUG_RUBY_STREAM + +// Protection against already loaded config.h +# undef PACKAGE_BUGREPORT +# undef PACKAGE_NAME +# undef PACKAGE_STRING +# undef PACKAGE_TARNAME +# undef PACKAGE_VERSION +# undef HAVE_DLFCN_H + +# ifdef DEBUG_RUBY_STREAM +# include <iostream> +# endif +# include <string> +# include <sstream> +# include <ruby.h> + +// Remove variables defined by the config.h of ruby +# undef PACKAGE_BUGREPORT +# undef PACKAGE_NAME +# undef PACKAGE_STRING +# undef PACKAGE_TARNAME +# undef PACKAGE_VERSION +# undef HAVE_DLFCN_H + +# include "_config/config.h" +# include "config.hh" + +namespace ruby +{ + struct environment + { + environment() + { + ruby_init(); + ruby_script("embeddeed ruby"); + ruby_init_loadpath(); + } + + ~environment() + { + ruby_finalize(); + } + }; + + struct eval_type {}; + extern eval_type eval; + + struct stream + { + stream() : last_value_(Qnil) {} + + void + push(const eval_type&) + { + eval(); + } + + template <class T> + void + push(const T& obj) + { + contents_ << obj; + } + + VALUE + eval() + { + if (contents_.str().size() != 0) + { +# ifdef DEBUG_RUBY_STREAM + std::cerr << "Eval (" << contents_.str() << ")" << std::endl; +# endif + last_value_ = rb_eval_string(contents_.str().c_str()); + contents_.str(std::string()); + } + return last_value_; + } + + VALUE last_value() { return last_value_; } + + protected: + + std::ostringstream contents_; + VALUE last_value_; + }; + +} + +template <class T> +ruby::stream& operator<< (ruby::stream& stream, const T& obj) +{ + stream.push(obj); + return stream; +} + +#endif diff --git a/dynamic-use-of-static-c++/test/Makefile.am b/dynamic-use-of-static-c++/test/Makefile.am new file mode 100644 index 0000000..68f3b34 --- /dev/null +++ b/dynamic-use-of-static-c++/test/Makefile.am @@ -0,0 +1,60 @@ +AM_CPPFLAGS = -I$(srcdir)/fixtures -I$(top_srcdir)/src -I$(top_builddir)/src +AM_CXXFLAGS = $(WARNING_CXXFLAGS) + +SUBDIRS = vaucanson + +#erb# =begin # Read the documentation of erbx to see how to change this part +#erb# <% +#erb# TESTS = %w[ +#erb# function_loader +#erb# damien +#erb# containers +#erb# var_and_val +#erb# methods +#erb# olena +#erb# ] +#erb# %> +#erb# check_PROGRAMS = <%= TESTS.map { |t| "#{t}.test" }.join ' ' %> +#erb# <% TESTS.each do |name| %> +#erb# <%= name %>_test_SOURCES = test_<%= name %>.cc +#erb# <%= name %>_test_LDADD = $(top_builddir)/src/libdyn.la +#erb# <%= name %>_test_DEPENDENCIES = $(top_builddir)/src/libdyn.la +#erb# <% end %> +#erb# =end + +#erb# =generated + +check_PROGRAMS = function_loader.test damien.test containers.test var_and_val.test methods.test olena.test + +function_loader_test_SOURCES = test_function_loader.cc +function_loader_test_LDADD = $(top_builddir)/src/libdyn.la +function_loader_test_DEPENDENCIES = $(top_builddir)/src/libdyn.la + +damien_test_SOURCES = test_damien.cc +damien_test_LDADD = $(top_builddir)/src/libdyn.la +damien_test_DEPENDENCIES = $(top_builddir)/src/libdyn.la + +containers_test_SOURCES = test_containers.cc +containers_test_LDADD = $(top_builddir)/src/libdyn.la +containers_test_DEPENDENCIES = $(top_builddir)/src/libdyn.la + +var_and_val_test_SOURCES = test_var_and_val.cc +var_and_val_test_LDADD = $(top_builddir)/src/libdyn.la +var_and_val_test_DEPENDENCIES = $(top_builddir)/src/libdyn.la + +methods_test_SOURCES = test_methods.cc +methods_test_LDADD = $(top_builddir)/src/libdyn.la +methods_test_DEPENDENCIES = $(top_builddir)/src/libdyn.la + +olena_test_SOURCES = test_olena.cc +olena_test_LDADD = $(top_builddir)/src/libdyn.la +olena_test_DEPENDENCIES = $(top_builddir)/src/libdyn.la + +#erb# =end_generated + +TESTS = $(check_PROGRAMS) + +tests: $(check_PROGRAMS) + +repository_clean: clean + rm -rf repository diff --git a/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hh b/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hh new file mode 100644 index 0000000..a045f1a --- /dev/null +++ b/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hh @@ -0,0 +1,60 @@ +#ifndef DAMIEN_HH +#define DAMIEN_HH + +#include <iostream> + +struct up +{ + up(int i) : i_(i) {} + virtual void print(std::ostream&) const = 0; + virtual void print_noarg() const = 0; + virtual up* fake_method(const up&) const = 0; + virtual ~up() {}; + virtual int get_i() const { return i_; } + int i_; +}; + + +template <typename T> +struct down : public up +{ + down(const T& t) : up(0), t_(t) {} + + virtual void print(std::ostream& ostr) const + { + ostr << "down< " << t_ << " >"; + } + + virtual void print_noarg() const + { + std::cout << t_ << std::endl; + } + + virtual up* fake_method(const up& rhs) const + { + return new down<int>(i_ + rhs.get_i()); + } + + const T* get_t() const; + const down<T>* clone(); + + const T& t_; + + virtual ~down() {} +}; + + +std::ostream& operator<<(std::ostream& ostr, const up& obj) +{ + obj.print(ostr); + return ostr; +} + +template <typename T> +void print(const T&); + +template <typename T> +T sqr(const T&); + +#endif + diff --git a/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hxx b/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hxx new file mode 100644 index 0000000..e7448e1 --- /dev/null +++ b/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hxx @@ -0,0 +1,57 @@ +#ifndef DAMIEN_HXX +#define DAMIEN_HXX + +#include <iostream> +#include "damien.hh" + +template <typename T> +const T* down<T>::get_t() const { return &t_; } + +template <typename T> +const down<T>* down<T>::clone() +{ + return new down<T>(t_); +} + +template <typename T> +down<T> +mk_down(const T& t) +{ + return t; +} + +void foo(const up& a) +{ + std::cout << "foo(" << a << ")" << std::endl; +} + +void foo(const int& i) +{ + std::cout << "foo(" << i << ")" << std::endl; +} + +void bar(const up& a, const up& b, int c=0) +{ + std::cout << "bar(" << a << ", " << b << ", " << c << ")" << std::endl; +} + +void change(up& a) +{ + a.i_++; +} + +template <typename T> +void print(const T& a) +{ + std::cout << a << std::endl; +} + +template <typename T> +T sqr(const T& a) +{ + return a * a; +} + + +#endif + diff --git a/dynamic-use-of-static-c++/test/fixtures/my_lib/lib.hh b/dynamic-use-of-static-c++/test/fixtures/my_lib/lib.hh new file mode 100644 index 0000000..8088724 --- /dev/null +++ b/dynamic-use-of-static-c++/test/fixtures/my_lib/lib.hh @@ -0,0 +1,105 @@ +// part of generic lib + +#include <cmath> +#include <iostream> +#include <sstream> // Warning does not work without me +#include <vector> + +template <class T> +struct u +{ + u(T& x) : x_(x) {} + T& x_; +}; + +template <class T, class V> +struct t +{ + t<T, V>(const T& x, const V& y) : x_(x), y_(y) {} + const T& x_, y_; +}; + +template <class T> +std::ostream& operator<< (std::ostream& ostr, const u<T>& x) +{ + return ostr << "u< " << x.x_ << " >"; +} + +template <class T> +std::istream& operator>> (std::istream& istr, u<T>& x) +{ + return istr >> x.x_; +} + +template <class T, class V> +std::ostream& operator<< (std::ostream& ostr, const t<T, V>& x) +{ + return ostr << "t< " << x.x_ << ", " << x.y_ << " >"; +} + +void foo1() +{ + std::cout << "foo1()" << std::endl; +} + +int* foo2() +{ + static int i = 42; + std::cout << "foo2() => &42" << std::endl; + return &i; +} + +int foo2b() +{ + std::cout << "foo2b() => 42" << std::endl; + return 42; +} + +template <class T> +const T* foo3(T t1, const T t2, const T& t3) +{ + std::cout << "foo3(" << t1 << ", " << t2 << ", " << t3 << ")" << std::endl; + return &t3; +} + +namespace my_lib +{ + namespace x + { + template <template<class, class> class T, template<class> class U > + U<char>*** foo4(U<float> a, T< T<char, char>, U<const int> > b) + { + std::cout << "foo4(" << a << ", " << b << ")" << std::endl; + } + } // end of x + + template <class T> + T sqr(const T& t) + { + std::cout << "sqr(" << t << ") => " << t * t << std::endl; + return t * t; + } + + template <class T> + float power(float f, const T& t) + { + std::cout << "power(" << f << "," << t << ")" << std::endl; + return std::exp(t * std::log(f)); + } + + struct boo + { + boo(std::ostream& ostr) : ostr_(ostr) {} + template <typename T1, typename T2> + void print(const T1& a, const T2& b) + { + ostr_ << "<[" << a << ", " << b << "]>" << std::endl; + } + std::ostream& ostr_; + }; + +#define stl_each(c, i) for (i = c.begin(); i != c.end(); ++i) + +#define echo(i) std::cout << i << std::endl + +} // end of my_lib diff --git a/dynamic-use-of-static-c++/test/fixtures/some_identifiers.yml.cc b/dynamic-use-of-static-c++/test/fixtures/some_identifiers.yml.cc new file mode 100644 index 0000000..b0fdb0e --- /dev/null +++ b/dynamic-use-of-static-c++/test/fixtures/some_identifiers.yml.cc @@ -0,0 +1,8 @@ +my_U_lib_S_lib_D_hh__foo1__: void foo1() {} +my_U_lib_S_lib_D_hh__foo2__: int* foo2() {} +my_U_lib_S_lib_D_hh__foo3__double_C_CONST_double_C_CONST_double_REF: + double* foo3(double, const double, const double&) {} +my_U_lib_S_lib_D_hh__my_U_lib_N_x_N_foo4__u_L_float_R_C_t_L_t_L_char_C_char_R_C_u_L_CONST_int_R_R: + u<char>*** my_lib::x::foo4(u<float>, t<t<char, char>, u<const int> >) {} +my_U_lib_S_lib_D_hh__foo3_L_t_L_int_C_char_R_R__t_L_int_C_char_R_C_CONST_t_L_int_C_char_R_C_CONST_t_L_int_C_char_R_REF: + t<int, char>* foo3(t<int, char>, const t<int, char>*, const t<int, char>&) {} diff --git a/dynamic-use-of-static-c++/test/fixtures/tree/tree.swig b/dynamic-use-of-static-c++/test/fixtures/tree/tree.swig new file mode 100644 index 0000000..1ba2136 --- /dev/null +++ b/dynamic-use-of-static-c++/test/fixtures/tree/tree.swig @@ -0,0 +1,2824 @@ ++++ top ---------------------------------------- +| outfile - "vcsn_wrap.cxx" +| name - "vcsn" +| module - 0xb7cf9cc8 +| classes - 0xb7cd61f8 +| infile - "vcsn.i" +| outfile_h - "vcsn_wrap.h" + + +++ include ---------------------------------------- + | name - "../../swig-1.3.27/Lib/swig.swg" + + +++ namespace ---------------------------------------- + | sym:name - "std" + | name - "std" + | csym:nextSibling - 0xb7cec638 + | sym:nextSibling - 0xb7cec638 + | typescope - 0xb7cf9d38 + | symtab - 0xb7cd4338 + | sym:symtab - 0xb7cd02e8 + | sym:overname - "__SWIG_0" + | + +++ typemap ---------------------------------------- + | code - "delete [] $1;" + | method - "newfree" + + +++ typemapitem ---------------------------------------- + | pattern - 0xb7cd44c8 + | + +++ typemap ---------------------------------------- + | code - "{\n if ($1) delete [] $1;\n if ($input) {\n $1 = ($1_type) (new char[strlen($input)+1]);\n strcpy((char *) $1,$input);\n } else {\n $1 = 0;\n }\n}" + | method - "memberin" + + +++ typemapitem ---------------------------------------- + | pattern - 0xb7cd4618 + | + +++ typemap ---------------------------------------- + | kwargs - 0xb7cd4688 + | code - "{\n if ($input) {\n $1 = ($1_type) (new char[strlen($input)+1]);\n strcpy((char *) $1,$input);\n } else {\n $1 = 0;\n }\n}" + | method - "memberin" + + +++ typemapitem ---------------------------------------- + | pattern - 0xb7cd4748 + | + +++ typemap ---------------------------------------- + | code - "{\n if ($1) delete [] $1;\n if ($input) {\n $1 = ($1_type) (new char[strlen($input)+1]);\n strcpy((char *) $1,$input);\n } else {\n $1 = 0;\n }\n}" + | method - "globalin" + + +++ typemapitem ---------------------------------------- + | pattern - 0xb7cd4848 + | + +++ typemap ---------------------------------------- + | kwargs - 0xb7cd48b8 + | code - "{\n if ($input) {\n $1 = ($1_type) (new char[strlen($input)+1]);\n strcpy((char *) $1,$input);\n } else {\n $1 = 0;\n }\n}" + | method - "globalin" + + +++ typemapitem ---------------------------------------- + | pattern - 0xb7cd4978 + | + +++ typemap ---------------------------------------- + | code - "{\n if ($input) strncpy($1,$input,$1_dim0);\n else $1[0] = 0;\n}" + | method - "memberin" + + +++ typemapitem ---------------------------------------- + | pattern - 0xb7cd4a88 + | + +++ typemap ---------------------------------------- + | code - "{\n if ($input) strncpy($1,$input,$1_dim0);\n else $1[0] = 0;\n}" + | method - "globalin" + + +++ typemapitem ---------------------------------------- + | pattern - 0xb7cd4b98 + | + +++ typemap ---------------------------------------- + | code - "{\n if ($input) strcpy($1,$input);\n else $1[0] = 0;\n}" + | method - "memberin" + + +++ typemapitem ---------------------------------------- + | pattern - 0xb7cd4c88 + | + +++ typemap ---------------------------------------- + | code - "{\n if ($input) strcpy($1,$input);\n else $1[0] = 0;\n}" + | method - "globalin" + + +++ typemapitem ---------------------------------------- + | pattern - 0xb7cd4d78 + | + +++ typemap ---------------------------------------- + | code - "{\n size_t ii;\n $1_basetype *b = ($1_basetype *) $1;\n for (ii = 0; ii < (size_t)$1_size; ii++) b[ii] = *(($1_basetype *) $input + ii);\n}" + | method - "memberin" + + +++ typemapitem ---------------------------------------- + | pattern - 0xb7cd4e88 + | + +++ typemap ---------------------------------------- + | code - "{\n size_t ii;\n $1_basetype *b = ($1_basetype *) $1;\n for (ii = 0; ii < (size_t)$1_size; ii++) b[ii] = *(($1_basetype *) $input + ii);\n}" + | method - "globalin" + + +++ typemapitem ---------------------------------------- + | pattern - 0xb7cd4f98 + | + +++ typemap ---------------------------------------- + | code - "{\n $basetype (*inp)[$dim1] = ($basetype (*)[$dim1])($input);\n $basetype (*dest)[$dim1] = ($basetype (*)[$dim1])($1);\n size_t ii = 0;\n for (; ii < $dim0; ++ii) {\n $basetype *ip = inp[ii];\n $basetype *dp = dest[ii];\n size_t jj = 0;\n for (; jj < $dim1; ++jj) dp[jj] = ip[jj];\n }\n}" + | method - "memberin" + + +++ typemapitem ---------------------------------------- + | pattern - 0xb7cd50c8 + | + +++ typemap ---------------------------------------- + | code - "{\n $basetype (*inp)[$dim1] = ($basetype (*)[$dim1])($input);\n $basetype (*dest)[$dim1] = ($basetype (*)[$dim1])($1);\n size_t ii = 0;\n for (; ii < $dim0; ++ii) {\n $basetype *ip = inp[ii];\n $basetype *dp = dest[ii];\n size_t jj = 0;\n for (; jj < $dim1; ++jj) dp[jj] = ip[jj];\n }\n}" + | method - "globalin" + + +++ typemapitem ---------------------------------------- + | pattern - 0xb7cd51f8 + | + +++ typemap ---------------------------------------- + | kwargs - 0xb7cd5278 + | code - "" + | method - "in" + + +++ typemapitem ---------------------------------------- + | pattern - 0xb7cd5348 + | + +++ typemapitem ---------------------------------------- + | pattern - 0xb7cd53f8 + | + +++ insert ---------------------------------------- + | code - "\n#ifdef __cplusplus\ntemplate<class T> class SwigValueWrapper {\n T *tt;\npublic:\n SwigValueWrapper() : tt(0) { }\n SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }\n SwigValueWrapper(const T& t) : tt(new T(t)) { }\n ~SwigValueWrapper() { delete tt; } \n SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }\n operator T&() const { return *tt; }\n T *operator&() { return tt; }\nprivate:\n SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);\n};\n#endif\n" + | section - "runtime" + | + +++ insert ---------------------------------------- + | code - "/***********************************************************************\n *\n * This section contains generic SWIG labels for method/variable\n * declarations/attributes, and other compiler dependent labels.\n *\n ************************************************************************/\n\n/* template workaround for compilers that cannot correctly implement the C++ standard */\n#ifndef SWIGTEMPLATEDISAMBIGUATOR\n# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)\n# define SWIGTEMPLATEDISAMBIGUATOR template\n# else\n# define SWIGTEMPLATEDISAMBIGUATOR \n# endif\n#endif\n\n/* inline attribute */\n#ifndef SWIGINLINE\n# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))\n# define SWIGINLINE inline\n# else\n# define SWIGINLINE\n# endif\n#endif\n\n/* attribute recognised by some compilers to avoid \'unused\' warnings */\n#ifndef SWIGUNUSED\n# if defined(__GNUC__) || defined(__ICC)\n# define SWIGUNUSED __attribute__ ((unused)) \n# else\n# define SWIGUNUSED \n# endif\n#endif\n\n/* internal SWIG method */\n#ifndef SWIGINTERN\n# define SWIGINTERN static SWIGUNUSED\n#endif\n\n/* internal inline SWIG method */\n#ifndef SWIGINTERNINLINE\n# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE\n#endif\n\n/* exporting methods for Windows DLLs */\n#ifndef SWIGEXPORT\n# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)\n# if defined(STATIC_LINKED)\n# define SWIGEXPORT\n# else\n# define SWIGEXPORT __declspec(dllexport)\n# endif\n# else\n# define SWIGEXPORT\n# endif\n#endif\n\n/* calling conventions for Windows */\n#ifndef SWIGSTDCALL\n# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)\n# define SWIGSTDCALL __stdcall\n# else\n# define SWIGSTDCALL\n# endif \n#endif\n\n" + | section - "runtime" + | + +++ include ---------------------------------------- + | name - "vcsn.i" + | module - "vcsn" + + +++ include ---------------------------------------- + | name - "vcsn/include/vaucanson/config/pconf.hh" + + +++ constant ---------------------------------------- + | sym:name - "VCSN_PACKAGE_BUGREPORT" + | name - "VCSN_PACKAGE_BUGREPORT" + | rawval - "\"vaucanson-bugs@lrde.epita.fr\"" + | feature:immutable - "1" + | value - "vaucanson-bugs@lrde.epita.fr" + | storage - "%constant" + | type - "p.char" + | sym:symtab - 0xb7cd02e8 + | sym:overname - "__SWIG_0" + | + +++ constant ---------------------------------------- + | sym:name - "VCSN_PACKAGE_NAME" + | name - "VCSN_PACKAGE_NAME" + | rawval - "\"vaucanson\"" + | feature:immutable - "1" + | value - "vaucanson" + | storage - "%constant" + | type - "p.char" + | sym:symtab - 0xb7cd02e8 + | sym:overname - "__SWIG_0" + | + +++ constant ---------------------------------------- + | sym:name - "VCSN_PACKAGE_STRING" + | name - "VCSN_PACKAGE_STRING" + | rawval - "\"vaucanson 0.7.2\"" + | feature:immutable - "1" + | value - "vaucanson 0.7.2" + | storage - "%constant" + | type - "p.char" + | sym:symtab - 0xb7cd02e8 + | sym:overname - "__SWIG_0" + | + +++ constant ---------------------------------------- + | sym:name - "VCSN_PACKAGE_VERSION" + | name - "VCSN_PACKAGE_VERSION" + | rawval - "\"0.7.2\"" + | feature:immutable - "1" + | value - "0.7.2" + | storage - "%constant" + | type - "p.char" + | sym:symtab - 0xb7cd02e8 + | sym:overname - "__SWIG_0" + | + +++ include ---------------------------------------- + | name - "vcsn/include/vaucanson/config/math.hh" + | + +++ include ---------------------------------------- + | name - "vcsn/include/vaucanson/config/system.hh" + | + +++ include ---------------------------------------- + | name - "vcsn/include/vaucanson/design_pattern/predecls.hh" + + +++ namespace ---------------------------------------- + | sym:name - "vcsn" + | name - "vcsn" + | csym:nextSibling - 0xb7cd8a98 + | sym:nextSibling - 0xb7cd8a98 + | typescope - 0xb7cf9e58 + | symtab - 0xb7cd59e8 + | sym:symtab - 0xb7cd02e8 + | sym:overname - "__SWIG_0" + + +++ template ---------------------------------------- + | sym:name - "dynamic_traits" + | templatetype - "classforward" + | name - "dynamic_traits" + | partials - 0xb7cda4c8 + | kind - "struct" + | sym:weak - "1" + | templateparms - typename S + | sym:symtab - 0xb7cd59e8 + | sym:overname - "__SWIG_0" + | + +++ template ---------------------------------------- + | sym:name - "SyntacticDecorator" + | templatetype - "classforward" + | name - "SyntacticDecorator" + | kind - "struct" + | sym:weak - "1" + | templateparms - typename S,typename T + | sym:symtab - 0xb7cd59e8 + | sym:overname - "__SWIG_0" + | + +++ template ---------------------------------------- + | sym:name - "MetaElement" + | templatetype - "classforward" + | name - "MetaElement" + | partials - 0xb7cde788 + | kind - "struct" + | sym:weak - "1" + | templateparms - typename S,typename T + | sym:symtab - 0xb7cd59e8 + | sym:overname - "__SWIG_0" + | + +++ template ---------------------------------------- + | sym:name - "Element" + | templatetype - "classforward" + | name - "Element" + | kind - "struct" + | sym:weak - "1" + | templateparms - typename S,typename T + | sym:symtab - 0xb7cd59e8 + | sym:overname - "__SWIG_0" + | + +++ class ---------------------------------------- + | name - "vcsn::default_slot_tag" + | sym:symtab - 0xb7cd59e8 + | symtab - 0xb7cd61a8 + | allows_typedef - "1" + | typepass:visit - "1" + | allocate:visit - "1" + | kind - "struct" + | sym:name - "default_slot_tag" + | allocate:default_constructor - "1" + | allocate:default_destructor - "1" + | module - 0xb7cf9cc8 + | sym:overname - "__SWIG_0" + | typescope - 0xb7cfa108 + | + +++ template ---------------------------------------- + | sym:name - "SetSlot" + | templatetype - "classforward" + | name - "SetSlot" + | kind - "struct" + | sym:weak - "1" + | templateparms - typename S,typename Tag + | sym:symtab - 0xb7cd59e8 + | sym:overname - "__SWIG_0" + | + +++ template ---------------------------------------- + | sym:name - "Structure" + | templatetype - "classforward" + | name - "Structure" + | kind - "struct" + | sym:weak - "1" + | templateparms - typename Self + | sym:symtab - 0xb7cd59e8 + | sym:overname - "__SWIG_0" + | + +++ template ---------------------------------------- + | sym:name - "virtual_types" + | templatetype - "classforward" + | name - "virtual_types" + | partials - 0xb7cda8d8 + | kind - "struct" + | sym:weak - "1" + | templateparms - typename Self + | sym:symtab - 0xb7cd59e8 + | sym:overname - "__SWIG_0" + | + +++ class ---------------------------------------- + | name - "vcsn::undefined_type" + | sym:symtab - 0xb7cd59e8 + | symtab - 0xb7cd6728 + | allows_typedef - "1" + | allocate:visit - "1" + | typepass:visit - "1" + | kind - "struct" + | sym:name - "undefined_type" + | allocate:default_constructor - "1" + | allocate:default_destructor - "1" + | module - 0xb7cf9cc8 + | sym:overname - "__SWIG_0" + | typescope - 0xb7cfa328 + | + +++ include ---------------------------------------- + | name - "vcsn/include/vaucanson/misc/selectors.hh" + | + +++ include ---------------------------------------- + | name - "vcsn/include/vaucanson/misc/unique.hh" + + +++ namespace ---------------------------------------- + | sym:name - "utility" + | name - "utility" + | typescope - 0xb7cfa358 + | symtab - 0xb7cd6868 + | sym:symtab - 0xb7cd02e8 + | sym:overname - "__SWIG_0" + + +++ namespace ---------------------------------------- + | sym:name - "unique" + | name - "unique" + | typescope - 0xb7cfa3a8 + | symtab - 0xb7cd7298 + | sym:symtab - 0xb7cd6868 + | sym:overname - "__SWIG_0" + + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "UniqueListBase" + | sym:symtab - 0xb7cd6908 + | symtab - 0xb7cd6a28 + | allows_typedef - "1" + | kind - "struct" + | sym:name - "UniqueListBase" + | sym:overname - "__SWIG_0" + | templateparms - class T + + +++ destructor ---------------------------------------- + | sym:name - "~UniqueListBase" + | name - "~UniqueListBase" + | decl - "f()." + | storage - "virtual" + | sym:symtab - 0xb7cd6a28 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "uniquelist_base" + | name - "utility::unique::UniqueMap::uniquelist_base" + | decl - "" + | storage - "typedef" + | type - "utility::unique::UniqueListBase<(int)>" + | sym:symtab - 0xb7cd6908 + | sym:overname - "__SWIG_0" + | + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "uniquelist" + | sym:symtab - 0xb7cd6908 + | symtab - 0xb7cd7018 + | allows_typedef - "1" + | kind - "struct" + | sym:name - "uniquelist" + | privatebaselist - 0xb7cd6f18 + | protectedbaselist - 0xb7cd6ef8 + | baselist - 0xb7cd6ed8 + | sym:overname - "__SWIG_0" + | templateparms - typename T + + +++ destructor ---------------------------------------- + | sym:name - "~uniquelist" + | name - "~uniquelist" + | decl - "f()." + | sym:symtab - 0xb7cd7018 + | sym:overname - "__SWIG_0" + | + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "UniqueMap" + | sym:symtab - 0xb7cd6908 + | symtab - 0xb7cd7298 + | allows_typedef - "1" + | kind - "struct" + | sym:name - "TiSlot" + | sym:overname - "__SWIG_0" + | templateparms - class T + + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "TiSlot" + | sym:symtab - 0xb7cd7298 + | symtab - 0xb7cd73f8 + | allows_typedef - "1" + | kind - "struct" + | sym:name - "TiSlot" + | sym:overname - "__SWIG_0" + | templateparms - class U + + +++ constructor ---------------------------------------- + | sym:name - "TiSlot" + | name - "TiSlot" + | parms - std::type_info const & + | decl - "f(r.q(const).std::type_info)." + | feature:new - "1" + | sym:symtab - 0xb7cd73f8 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "id" + | name - "id" + | decl - "r." + | type - "q(const).std::type_info" + | sym:symtab - 0xb7cd73f8 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "operator ==" + | name - "operator ==" + | decl - "q(const).f(r.q(const).TiSlot)." + | parms - TiSlot const & + | type - "bool" + | sym:symtab - 0xb7cd73f8 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "operator <" + | name - "operator <" + | decl - "q(const).f(r.q(const).TiSlot)." + | parms - TiSlot const & + | type - "bool" + | sym:symtab - 0xb7cd73f8 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "ti_slot" + | name - "ti_slot" + | decl - "" + | storage - "typedef" + | type - "TiSlot<(int)>" + | sym:symtab - 0xb7cd7298 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "map_t" + | name - "map_t" + | decl - "" + | storage - "typedef" + | type - "std::map<(ti_slot,p.uniquelist_base)>" + | sym:symtab - 0xb7cd7298 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "instance" + | name - "instance" + | decl - "f().r." + | storage - "static" + | type - "map_t" + | sym:symtab - 0xb7cd7298 + | sym:overname - "__SWIG_0" + | + +++ access ---------------------------------------- + | kind - "protected" + | + +++ cdecl ---------------------------------------- + | sym:name - "map_" + | name - "map_" + | decl - "" + | type - "map_t" + | sym:symtab - 0xb7cd7298 + | sym:overname - "__SWIG_0" + | + +++ destructor ---------------------------------------- + | sym:name - "~UniqueMap" + | name - "~UniqueMap" + | decl - "f()." + | sym:symtab - 0xb7cd7298 + | sym:overname - "__SWIG_0" + | + +++ access ---------------------------------------- + | kind - "public" + | + +++ cdecl ---------------------------------------- + | sym:name - "unique_map" + | name - "utility::unique::UniqueMap::unique_map" + | decl - "" + | storage - "typedef" + | type - "utility::unique::UniqueMap<(int)>" + | sym:symtab - 0xb7cd7298 + | sym:overname - "__SWIG_0" + | + +++ class ---------------------------------------- + | name - "utility::unique::UniqueMap::unifiable" + | sym:symtab - 0xb7cd7298 + | symtab - 0xb7cd8168 + | allows_typedef - "1" + | typepass:visit - "1" + | allocate:visit - "1" + | kind - "struct" + | sym:name - "unifiable" + | allocate:default_constructor - "1" + | allocate:has_constructor - "1" + | allocate:public_constructor - "1" + | allocate:default_destructor - "1" + | module - 0xb7cf9cc8 + | sym:overname - "__SWIG_0" + | typescope - 0xb7cfa818 + + +++ constructor ---------------------------------------- + | sym:name - "unifiable" + | name - "utility::unique::UniqueMap::unifiable" + | decl - "f()." + | feature:new - "1" + | sym:overloaded - 0xb7cd8148 + | csym:nextSibling - 0xb7cd8268 + | sym:nextSibling - 0xb7cd8268 + | sym:symtab - 0xb7cd8168 + | sym:overname - "__SWIG_0" + | + +++ constructor ---------------------------------------- + | sym:name - "unifiable" + | name - "utility::unique::UniqueMap::unifiable" + | parms - utility::unique::unifiable const & + | decl - "f(r.q(const).unifiable)." + | feature:new - "1" + | sym:overloaded - 0xb7cd8148 + | sym:previousSibling - 0xb7cd8148 + | sym:symtab - 0xb7cd8168 + | sym:overname - "__SWIG_1" + | + +++ access ---------------------------------------- + | kind - "private" + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "get" + | sym:symtab - 0xb7cd7298 + | sym:name - "get" + | csym:nextSibling - 0xb7cd8788 + | sym:nextSibling - 0xb7cd8988 + | decl - "f(r.q(const).T).r." + | parms - T const & + | sym:overloaded - 0xb7cd8428 + | type - "q(const).T" + | sym:overname - "__SWIG_0" + | storage - "friend" + | templateparms - typename T + | + +++ cdecl ---------------------------------------- + | name - "unique_" + | decl - "" + | access - "private" + | type - "bool" + | sym:symtab - 0xb7cd8168 + | + +++ access ---------------------------------------- + | kind - "public" + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | name - "get" + | decl - "f(r.q(const).T).r." + | parms - T const & + | error - "vcsn/include/vaucanson/misc/unique.hh:121:Identifier \'get\' redefined (ignored),\nvcsn/include/vaucanson/misc/unique.hh:108:previous definition of \'get\'.\n" + | sym:typename - "1" + | type - "q(const).T" + | csym:nextSibling - 0xb7cd8988 + | templateparms - typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "get" + | sym:symtab - 0xb7cd7298 + | sym:previousSibling - 0xb7cd8428 + | sym:name - "get" + | decl - "f(p.q(const).T).p." + | sym:overloaded - 0xb7cd8428 + | parms - T const * + | type - "q(const).T" + | sym:overname - "__SWIG_1" + | templateparms - typename T + | + +++ include ---------------------------------------- + | name - "vcsn/include/vaucanson/design_pattern/structure.hh" + + +++ namespace ---------------------------------------- + | sym:name - "vcsn" + | name - "vcsn" + | sym:previousSibling - 0xb7cd5a28 + | csym:nextSibling - 0xb7cda888 + | sym:nextSibling - 0xb7cda888 + | typescope - 0xb7cf9e58 + | symtab - 0xb7cd59e8 + | sym:symtab - 0xb7cd02e8 + + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "Structure" + | sym:symtab - 0xb7cd59e8 + | symtab - 0xb7cd8c98 + | allows_typedef - "1" + | kind - "struct" + | sym:name - "Structure" + | privatebaselist - 0xb7cd8c28 + | protectedbaselist - 0xb7cd8c18 + | baselist - 0xb7cd8c08 + | sym:overname - "__SWIG_0" + | templateparms - typename S + + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "contains" + | sym:symtab - 0xb7cd8c98 + | sym:nextSibling - 0xb7cd9238 + | csym:nextSibling - 0xb7cd9238 + | sym:name - "contains" + | decl - "q(const).f(r.q(const).Element<(S,T)>)." + | sym:overloaded - 0xb7cd8f28 + | parms - Element<S,T > const & + | type - "bool" + | sym:overname - "__SWIG_0" + | templateparms - typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "contains" + | sym:symtab - 0xb7cd8c98 + | csym:nextSibling - 0xb7cd9448 + | sym:previousSibling - 0xb7cd8f28 + | sym:name - "contains" + | sym:nextSibling - 0xb7cd9448 + | decl - "q(const).f(r.q(const).Element<(OtherS,T)>)." + | sym:overloaded - 0xb7cd8f28 + | parms - Element<OtherS,T > const & + | type - "bool" + | sym:overname - "__SWIG_1" + | templateparms - typename OtherS,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "contains" + | sym:symtab - 0xb7cd8c98 + | sym:previousSibling - 0xb7cd9238 + | sym:name - "contains" + | decl - "q(const).f(r.q(const).T)." + | sym:overloaded - 0xb7cd8f28 + | parms - T const & + | type - "bool" + | sym:overname - "__SWIG_2" + | templateparms - typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:name - "choose" + | name - "choose" + | decl - "q(const).f(r.q(const).T)." + | parms - T const & + | sym:typename - "1" + | type - "Element<(S,T)>" + | templateparms - class T + | sym:symtab - 0xb7cd8c98 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "self_t" + | name - "self_t" + | decl - "" + | storage - "typedef" + | type - "S" + | sym:symtab - 0xb7cd8c98 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "self" + | name - "self" + | decl - "f().r." + | sym:overloaded - 0xb7cd9848 + | type - "self_t" + | csym:nextSibling - 0xb7cd9918 + | sym:nextSibling - 0xb7cd9918 + | sym:symtab - 0xb7cd8c98 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "self" + | name - "self" + | decl - "q(const).f().r." + | sym:overloaded - 0xb7cd9848 + | type - "q(const).self_t" + | sym:previousSibling - 0xb7cd9848 + | sym:symtab - 0xb7cd8c98 + | sym:overname - "__SWIG_1" + | + +++ access ---------------------------------------- + | kind - "protected" + | + +++ constructor ---------------------------------------- + | name - "Structure" + | decl - "f()." + | access - "protected" + | feature:new - "1" + | csym:nextSibling - 0xb7cd9af8 + | sym:symtab - 0xb7cd8c98 + | + +++ constructor ---------------------------------------- + | name - "Structure" + | parms - Structure const & + | decl - "f(r.q(const).Structure)." + | access - "protected" + | feature:new - "1" + | sym:symtab - 0xb7cd8c98 + | + +++ access ---------------------------------------- + | kind - "public" + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator !=" + | sym:symtab - 0xb7cd59e8 + | sym:name - "operator !=" + | csym:nextSibling - 0xb7ce5608 + | sym:nextSibling - 0xb7ce5608 + | decl - "f(r.q(const).vcsn::Structure<(S)>,r.q(const).vcsn::Structure<(S)>)." + | parms - vcsn::Structure<S > const &,vcsn::Structure<S > const & + | sym:overloaded - 0xb7cd9f48 + | type - "bool" + | sym:overname - "__SWIG_0" + | templateparms - typename S + | + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "dynamic_traits<(Structure<(S)>)>" + | sym:symtab - 0xb7cd59e8 + | symtab - 0xb7cda158 + | allows_typedef - "1" + | kind - "struct" + | sym:name - "dynamic_traits<(Structure<(S)>)>" + | partialargs - "dynamic_traits<(vcsn::Structure<($1)>)>" + | sym:overname - "__SWIG_0" + | templateparms - Structure<S > + | partialspecialization - "1" + + +++ cdecl ---------------------------------------- + | sym:name - "ret" + | name - "ret" + | decl - "" + | storage - "static" + | value - "false" + | type - "q(const).bool" + | sym:symtab - 0xb7cda158 + | sym:overname - "__SWIG_0" + | + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "virtual_types<(Structure<(S)>)>" + | sym:symtab - 0xb7cd59e8 + | symtab - 0xb7cda6c8 + | allows_typedef - "1" + | kind - "struct" + | sym:name - "virtual_types<(Structure<(S)>)>" + | partialargs - "virtual_types<(vcsn::Structure<($1)>)>" + | sym:overname - "__SWIG_0" + | templateparms - Structure<S > + | partialspecialization - "1" + | + +++ include ---------------------------------------- + | name - "vcsn/include/vaucanson/design_pattern/syntactic_decorator.hh" + + +++ namespace ---------------------------------------- + | sym:name - "vcsn" + | name - "vcsn" + | sym:previousSibling - 0xb7cd8a98 + | csym:nextSibling - 0xb7cdddc8 + | sym:nextSibling - 0xb7cdddc8 + | typescope - 0xb7cf9e58 + | symtab - 0xb7cd59e8 + | sym:symtab - 0xb7cd02e8 + + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "SyntacticDecorator" + | sym:symtab - 0xb7cd59e8 + | symtab - 0xb7cdaa08 + | allows_typedef - "1" + | kind - "struct" + | sym:name - "SyntacticDecorator" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T + + +++ cdecl ---------------------------------------- + | sym:name - "dynamic_value" + | name - "dynamic_value" + | decl - "" + | storage - "static" + | value - "true" + | type - "q(const).bool" + | sym:symtab - 0xb7cdaa08 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "structure" + | name - "structure" + | decl - "q(const).f().r." + | type - "q(const).S" + | sym:symtab - 0xb7cdaa08 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "value" + | name - "value" + | decl - "f().r." + | sym:overloaded - 0xb7cdace8 + | type - "T" + | csym:nextSibling - 0xb7cdadb8 + | sym:nextSibling - 0xb7cdadb8 + | sym:symtab - 0xb7cdaa08 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "value" + | name - "value" + | decl - "q(const).f().r." + | sym:overloaded - 0xb7cdace8 + | type - "q(const).T" + | sym:previousSibling - 0xb7cdace8 + | sym:symtab - 0xb7cdaa08 + | sym:overname - "__SWIG_1" + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator +=" + | sym:symtab - 0xb7cdaa08 + | sym:nextSibling - 0xb7cdb3e8 + | csym:nextSibling - 0xb7cdb3e8 + | sym:name - "operator +=" + | decl - "f(r.q(const).Element<(OtherS,U)>).r." + | sym:overloaded - 0xb7cdb128 + | parms - Element<OtherS,U > const & + | type - "Element<(S,T)>" + | sym:overname - "__SWIG_0" + | templateparms - typename OtherS,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator +=" + | sym:symtab - 0xb7cdaa08 + | sym:previousSibling - 0xb7cdb128 + | sym:name - "operator +=" + | decl - "f(r.q(const).U).r." + | sym:overloaded - 0xb7cdb128 + | parms - U const & + | type - "Element<(S,T)>" + | sym:overname - "__SWIG_1" + | templateparms - typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator -=" + | sym:symtab - 0xb7cdaa08 + | sym:nextSibling - 0xb7cdba68 + | csym:nextSibling - 0xb7cdba68 + | sym:name - "operator -=" + | decl - "f(r.q(const).Element<(OtherS,U)>).r." + | sym:overloaded - 0xb7cdb7a8 + | parms - Element<OtherS,U > const & + | type - "Element<(S,T)>" + | sym:overname - "__SWIG_0" + | templateparms - typename OtherS,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator -=" + | sym:symtab - 0xb7cdaa08 + | sym:previousSibling - 0xb7cdb7a8 + | sym:name - "operator -=" + | decl - "f(r.q(const).U).r." + | sym:overloaded - 0xb7cdb7a8 + | parms - U const & + | type - "Element<(S,T)>" + | sym:overname - "__SWIG_1" + | templateparms - typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator /=" + | sym:symtab - 0xb7cdaa08 + | sym:nextSibling - 0xb7cdc0e8 + | csym:nextSibling - 0xb7cdc0e8 + | sym:name - "operator /=" + | decl - "f(r.q(const).Element<(OtherS,U)>).r." + | sym:overloaded - 0xb7cdbe28 + | parms - Element<OtherS,U > const & + | type - "Element<(S,T)>" + | sym:overname - "__SWIG_0" + | templateparms - typename OtherS,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator /=" + | sym:symtab - 0xb7cdaa08 + | sym:previousSibling - 0xb7cdbe28 + | sym:name - "operator /=" + | decl - "f(r.q(const).U).r." + | sym:overloaded - 0xb7cdbe28 + | parms - U const & + | type - "Element<(S,T)>" + | sym:overname - "__SWIG_1" + | templateparms - typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator *=" + | sym:symtab - 0xb7cdaa08 + | sym:nextSibling - 0xb7cdc768 + | csym:nextSibling - 0xb7cdc768 + | sym:name - "operator *=" + | decl - "f(r.q(const).Element<(OtherS,U)>).r." + | sym:overloaded - 0xb7cdc4a8 + | parms - Element<OtherS,U > const & + | type - "Element<(S,T)>" + | sym:overname - "__SWIG_0" + | templateparms - typename OtherS,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator *=" + | sym:symtab - 0xb7cdaa08 + | sym:previousSibling - 0xb7cdc4a8 + | sym:name - "operator *=" + | decl - "f(r.q(const).U).r." + | sym:overloaded - 0xb7cdc4a8 + | parms - U const & + | type - "Element<(S,T)>" + | sym:overname - "__SWIG_1" + | templateparms - typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator %=" + | sym:symtab - 0xb7cdaa08 + | sym:nextSibling - 0xb7cdcde8 + | csym:nextSibling - 0xb7cdcde8 + | sym:name - "operator %=" + | decl - "f(r.q(const).Element<(OtherS,U)>).r." + | sym:overloaded - 0xb7cdcb28 + | parms - Element<OtherS,U > const & + | type - "Element<(S,T)>" + | sym:overname - "__SWIG_0" + | templateparms - typename OtherS,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator %=" + | sym:symtab - 0xb7cdaa08 + | sym:previousSibling - 0xb7cdcb28 + | sym:name - "operator %=" + | decl - "f(r.q(const).U).r." + | sym:overloaded - 0xb7cdcb28 + | parms - U const & + | type - "Element<(S,T)>" + | sym:overname - "__SWIG_1" + | templateparms - typename U + | + +++ cdecl ---------------------------------------- + | sym:name - "operator ++" + | name - "operator ++" + | decl - "f().r." + | sym:overloaded - 0xb7cdcf78 + | type - "Element<(S,T)>" + | csym:nextSibling - 0xb7cdd128 + | sym:nextSibling - 0xb7cdd128 + | sym:symtab - 0xb7cdaa08 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "operator ++" + | name - "operator ++" + | decl - "f(int)." + | parms - int + | sym:overloaded - 0xb7cdcf78 + | type - "Element<(S,T)>" + | sym:previousSibling - 0xb7cdcf78 + | sym:symtab - 0xb7cdaa08 + | sym:overname - "__SWIG_1" + | + +++ cdecl ---------------------------------------- + | sym:name - "operator --" + | name - "operator --" + | decl - "f().r." + | sym:overloaded - 0xb7cdd268 + | type - "Element<(S,T)>" + | csym:nextSibling - 0xb7cdd418 + | sym:nextSibling - 0xb7cdd418 + | sym:symtab - 0xb7cdaa08 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "operator --" + | name - "operator --" + | decl - "f(int)." + | parms - int + | sym:overloaded - 0xb7cdd268 + | type - "Element<(S,T)>" + | sym:previousSibling - 0xb7cdd268 + | sym:symtab - 0xb7cdaa08 + | sym:overname - "__SWIG_1" + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:name - "swap" + | name - "swap" + | decl - "f(r.Element<(S,U)>).r." + | parms - Element<S,U > & + | sym:typename - "1" + | type - "Element<(S,T)>" + | templateparms - typename U + | sym:symtab - 0xb7cdaa08 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "self" + | name - "self" + | decl - "f().r." + | sym:overloaded - 0xb7cdd898 + | type - "Element<(S,T)>" + | csym:nextSibling - 0xb7cdda18 + | sym:nextSibling - 0xb7cdda18 + | sym:symtab - 0xb7cdaa08 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "self" + | name - "self" + | decl - "q(const).f().r." + | sym:overloaded - 0xb7cdd898 + | type - "q(const).Element<(S,T)>" + | sym:previousSibling - 0xb7cdd898 + | sym:symtab - 0xb7cdaa08 + | sym:overname - "__SWIG_1" + | + +++ access ---------------------------------------- + | kind - "protected" + | + +++ constructor ---------------------------------------- + | name - "SyntacticDecorator" + | decl - "f()." + | access - "protected" + | feature:new - "1" + | csym:nextSibling - 0xb7cddbf8 + | sym:symtab - 0xb7cdaa08 + | + +++ constructor ---------------------------------------- + | name - "SyntacticDecorator" + | parms - SyntacticDecorator const & + | decl - "f(r.q(const).SyntacticDecorator)." + | access - "protected" + | feature:new - "1" + | sym:symtab - 0xb7cdaa08 + | + +++ access ---------------------------------------- + | kind - "public" + | + +++ include ---------------------------------------- + | name - "vcsn/include/vaucanson/design_pattern/meta_element_root.hh" + + +++ namespace ---------------------------------------- + | sym:name - "vcsn" + | name - "vcsn" + | sym:previousSibling - 0xb7cda888 + | csym:nextSibling - 0xb7cde7b8 + | sym:nextSibling - 0xb7cde7b8 + | typescope - 0xb7cf9e58 + | symtab - 0xb7cd59e8 + | sym:symtab - 0xb7cd02e8 + + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "MetaElement<(Structure<(S)>,T)>" + | sym:symtab - 0xb7cd59e8 + | symtab - 0xb7cde208 + | allows_typedef - "1" + | kind - "struct" + | sym:name - "MetaElement<(Structure<(S)>,T)>" + | privatebaselist - 0xb7cde178 + | protectedbaselist - 0xb7cde168 + | baselist - 0xb7cde158 + | partialargs - "MetaElement<(vcsn::Structure<($1)>,$2)>" + | sym:overname - "__SWIG_0" + | templateparms - Structure<S >,typename T + | partialspecialization - "1" + + +++ access ---------------------------------------- + | kind - "protected" + | + +++ constructor ---------------------------------------- + | name - "MetaElement" + | decl - "f()." + | access - "protected" + | feature:new - "1" + | csym:nextSibling - 0xb7cde478 + | sym:symtab - 0xb7cde208 + | + +++ constructor ---------------------------------------- + | name - "MetaElement" + | parms - MetaElement const & + | decl - "f(r.q(const).MetaElement)." + | access - "protected" + | feature:new - "1" + | sym:symtab - 0xb7cde208 + | + +++ access ---------------------------------------- + | kind - "public" + | + +++ include ---------------------------------------- + | name - "vcsn/include/vaucanson/design_pattern/element_op_traits.hh" + + +++ namespace ---------------------------------------- + | sym:name - "vcsn" + | name - "vcsn" + | sym:previousSibling - 0xb7cdddc8 + | csym:nextSibling - 0xb7ce0778 + | sym:nextSibling - 0xb7ce0778 + | typescope - 0xb7cf9e58 + | symtab - 0xb7cd59e8 + | sym:symtab - 0xb7cd02e8 + + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "op_add_traits" + | sym:symtab - 0xb7cd59e8 + | symtab - 0xb7cde9f8 + | allows_typedef - "1" + | kind - "struct" + | sym:name - "op_add_traits" + | sym:overname - "__SWIG_0" + | templateparms - typename S1,typename S2,typename T1,typename T2 + + +++ cdecl ---------------------------------------- + | sym:name - "ret_t" + | name - "ret_t" + | decl - "" + | storage - "typedef" + | type - "Element<(S1,T1)>" + | sym:symtab - 0xb7cde9f8 + | sym:overname - "__SWIG_0" + | + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "op_sub_traits" + | sym:symtab - 0xb7cd59e8 + | symtab - 0xb7cdf048 + | allows_typedef - "1" + | kind - "struct" + | sym:name - "op_sub_traits" + | sym:overname - "__SWIG_0" + | templateparms - typename S1,typename S2,typename T1,typename T2 + + +++ cdecl ---------------------------------------- + | sym:name - "ret_t" + | name - "ret_t" + | decl - "" + | storage - "typedef" + | type - "Element<(S1,T1)>" + | sym:symtab - 0xb7cdf048 + | sym:overname - "__SWIG_0" + | + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "op_mul_traits" + | sym:symtab - 0xb7cd59e8 + | symtab - 0xb7cdf698 + | allows_typedef - "1" + | kind - "struct" + | sym:name - "op_mul_traits" + | sym:overname - "__SWIG_0" + | templateparms - typename S1,typename S2,typename T1,typename T2 + + +++ cdecl ---------------------------------------- + | sym:name - "ret_t" + | name - "ret_t" + | decl - "" + | storage - "typedef" + | type - "Element<(S1,T1)>" + | sym:symtab - 0xb7cdf698 + | sym:overname - "__SWIG_0" + | + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "op_div_traits" + | sym:symtab - 0xb7cd59e8 + | symtab - 0xb7cdfce8 + | allows_typedef - "1" + | kind - "struct" + | sym:name - "op_div_traits" + | sym:overname - "__SWIG_0" + | templateparms - typename S1,typename S2,typename T1,typename T2 + + +++ cdecl ---------------------------------------- + | sym:name - "ret_t" + | name - "ret_t" + | decl - "" + | storage - "typedef" + | type - "Element<(S1,T1)>" + | sym:symtab - 0xb7cdfce8 + | sym:overname - "__SWIG_0" + | + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "op_mod_traits" + | sym:symtab - 0xb7cd59e8 + | symtab - 0xb7ce0338 + | allows_typedef - "1" + | kind - "struct" + | sym:name - "op_mod_traits" + | sym:overname - "__SWIG_0" + | templateparms - typename S1,typename S2,typename T1,typename T2 + + +++ cdecl ---------------------------------------- + | sym:name - "ret_t" + | name - "ret_t" + | decl - "" + | storage - "typedef" + | type - "Element<(S1,T1)>" + | sym:symtab - 0xb7ce0338 + | sym:overname - "__SWIG_0" + | + +++ include ---------------------------------------- + | name - "vcsn/include/vaucanson/design_pattern/element_ops.hh" + + +++ namespace ---------------------------------------- + | sym:name - "vcsn" + | name - "vcsn" + | sym:previousSibling - 0xb7cde7b8 + | csym:nextSibling - 0xb7ced2a8 + | sym:nextSibling - 0xb7ced2a8 + | typescope - 0xb7cf9e58 + | symtab - 0xb7cd59e8 + | sym:symtab - 0xb7cd02e8 + + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator <" + | sym:symtab - 0xb7cd59e8 + | sym:name - "operator <" + | csym:nextSibling - 0xb7ce22b8 + | sym:nextSibling - 0xb7ce22b8 + | decl - "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + | parms - vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + | sym:overloaded - 0xb7ce0ce8 + | type - "bool" + | sym:overname - "__SWIG_0" + | storage - "static" + | templateparms - typename S1,typename T1,typename S2,typename T2 + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator >" + | sym:symtab - 0xb7cd59e8 + | sym:name - "operator >" + | csym:nextSibling - 0xb7ce2728 + | sym:nextSibling - 0xb7ce2728 + | decl - "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + | parms - vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + | sym:overloaded - 0xb7ce12a8 + | type - "bool" + | sym:overname - "__SWIG_0" + | storage - "static" + | templateparms - typename S1,typename T1,typename S2,typename T2 + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator <=" + | sym:symtab - 0xb7cd59e8 + | sym:name - "operator <=" + | csym:nextSibling - 0xb7ce3008 + | sym:nextSibling - 0xb7ce3008 + | decl - "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + | parms - vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + | sym:overloaded - 0xb7ce1868 + | type - "bool" + | sym:overname - "__SWIG_0" + | storage - "static" + | templateparms - typename S1,typename T1,typename S2,typename T2 + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator >=" + | sym:symtab - 0xb7cd59e8 + | sym:name - "operator >=" + | csym:nextSibling - 0xb7ce2b98 + | sym:nextSibling - 0xb7ce2b98 + | decl - "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + | parms - vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + | sym:overloaded - 0xb7ce1e28 + | type - "bool" + | sym:overname - "__SWIG_0" + | storage - "static" + | templateparms - typename S1,typename T1,typename S2,typename T2 + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator <" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce0ce8 + | sym:name - "operator <" + | csym:nextSibling - 0xb7ce3478 + | sym:nextSibling - 0xb7ce3478 + | decl - "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + | sym:overloaded - 0xb7ce0ce8 + | parms - vcsn::Element<S,T > const &,U const & + | type - "bool" + | sym:overname - "__SWIG_1" + | storage - "static" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator >" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce12a8 + | sym:name - "operator >" + | csym:nextSibling - 0xb7ce38e8 + | sym:nextSibling - 0xb7ce38e8 + | decl - "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + | sym:overloaded - 0xb7ce12a8 + | parms - vcsn::Element<S,T > const &,U const & + | type - "bool" + | sym:overname - "__SWIG_1" + | storage - "static" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator >=" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce1e28 + | sym:name - "operator >=" + | csym:nextSibling - 0xb7ce3d58 + | sym:nextSibling - 0xb7ce3d58 + | decl - "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + | sym:overloaded - 0xb7ce1e28 + | parms - vcsn::Element<S,T > const &,U const & + | type - "bool" + | sym:overname - "__SWIG_1" + | storage - "static" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator <=" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce1868 + | sym:name - "operator <=" + | csym:nextSibling - 0xb7ce41c8 + | sym:nextSibling - 0xb7ce41c8 + | decl - "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + | sym:overloaded - 0xb7ce1868 + | parms - vcsn::Element<S,T > const &,U const & + | type - "bool" + | sym:overname - "__SWIG_1" + | storage - "static" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator <" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce22b8 + | sym:name - "operator <" + | decl - "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + | sym:overloaded - 0xb7ce0ce8 + | parms - U const &,vcsn::Element<S,T > const & + | type - "bool" + | sym:overname - "__SWIG_2" + | storage - "static" + | templateparms - typename U,typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator >" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce2728 + | sym:name - "operator >" + | decl - "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + | sym:overloaded - 0xb7ce12a8 + | parms - U const &,vcsn::Element<S,T > const & + | type - "bool" + | sym:overname - "__SWIG_2" + | storage - "static" + | templateparms - typename U,typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator >=" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce2b98 + | sym:name - "operator >=" + | decl - "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + | sym:overloaded - 0xb7ce1e28 + | parms - U const &,vcsn::Element<S,T > const & + | type - "bool" + | sym:overname - "__SWIG_2" + | storage - "static" + | templateparms - typename U,typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator <=" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce3008 + | sym:name - "operator <=" + | decl - "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + | sym:overloaded - 0xb7ce1868 + | parms - U const &,vcsn::Element<S,T > const & + | type - "bool" + | sym:overname - "__SWIG_2" + | storage - "static" + | templateparms - typename U,typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator ==" + | sym:symtab - 0xb7cd59e8 + | sym:name - "operator ==" + | csym:nextSibling - 0xb7ce4bf8 + | sym:nextSibling - 0xb7ce4bf8 + | decl - "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + | parms - vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + | sym:overloaded - 0xb7ce4768 + | type - "bool" + | sym:overname - "__SWIG_0" + | storage - "static" + | templateparms - typename S1,typename T1,typename S2,typename T2 + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator ==" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce4768 + | sym:name - "operator ==" + | csym:nextSibling - 0xb7ce5068 + | sym:nextSibling - 0xb7ce5068 + | decl - "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + | sym:overloaded - 0xb7ce4768 + | parms - vcsn::Element<S,T > const &,U const & + | type - "bool" + | sym:overname - "__SWIG_1" + | storage - "static" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator ==" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce4bf8 + | sym:name - "operator ==" + | decl - "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + | sym:overloaded - 0xb7ce4768 + | parms - U const &,vcsn::Element<S,T > const & + | type - "bool" + | sym:overname - "__SWIG_2" + | storage - "static" + | templateparms - typename U,typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator !=" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7cd9f48 + | sym:name - "operator !=" + | csym:nextSibling - 0xb7ce5a98 + | sym:nextSibling - 0xb7ce5a98 + | decl - "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + | sym:overloaded - 0xb7cd9f48 + | parms - vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + | type - "bool" + | sym:overname - "__SWIG_1" + | storage - "static" + | templateparms - typename S1,typename T1,typename S2,typename T2 + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator !=" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce5608 + | sym:name - "operator !=" + | csym:nextSibling - 0xb7ce5f08 + | sym:nextSibling - 0xb7ce5f08 + | decl - "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + | sym:overloaded - 0xb7cd9f48 + | parms - vcsn::Element<S,T > const &,U const & + | type - "bool" + | sym:overname - "__SWIG_2" + | storage - "static" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator !=" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce5a98 + | sym:name - "operator !=" + | decl - "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + | sym:overloaded - 0xb7cd9f48 + | parms - U const &,vcsn::Element<S,T > const & + | type - "bool" + | sym:overname - "__SWIG_3" + | storage - "static" + | templateparms - typename U,typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator +" + | sym:symtab - 0xb7cd59e8 + | sym:name - "operator +" + | csym:nextSibling - 0xb7ce6b98 + | sym:nextSibling - 0xb7ce6b98 + | decl - "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + | parms - vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + | sym:overloaded - 0xb7ce6638 + | type - "vcsn::op_add_traits<(S1,S2,T1,T2)>::ret_t" + | sym:overname - "__SWIG_0" + | storage - "static" + | templateparms - typename S1,typename T1,typename S2,typename T2 + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator +" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce6638 + | sym:name - "operator +" + | csym:nextSibling - 0xb7ce70d8 + | sym:nextSibling - 0xb7ce70d8 + | decl - "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + | sym:overloaded - 0xb7ce6638 + | parms - vcsn::Element<S,T > const &,U const & + | type - "vcsn::Element<(S,T)>" + | sym:overname - "__SWIG_1" + | storage - "static" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator +" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce6b98 + | sym:name - "operator +" + | decl - "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + | sym:overloaded - 0xb7ce6638 + | parms - U const &,vcsn::Element<S,T > const & + | type - "vcsn::Element<(S,T)>" + | sym:overname - "__SWIG_2" + | storage - "static" + | templateparms - typename U,typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator -" + | sym:symtab - 0xb7cd59e8 + | sym:name - "operator -" + | csym:nextSibling - 0xb7ce7d68 + | sym:nextSibling - 0xb7ce7d68 + | decl - "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + | parms - vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + | sym:overloaded - 0xb7ce7808 + | type - "vcsn::op_sub_traits<(S1,S2,T1,T2)>::ret_t" + | sym:overname - "__SWIG_0" + | storage - "static" + | templateparms - typename S1,typename T1,typename S2,typename T2 + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator -" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce7808 + | sym:name - "operator -" + | csym:nextSibling - 0xb7ce82a8 + | sym:nextSibling - 0xb7ce82a8 + | decl - "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + | sym:overloaded - 0xb7ce7808 + | parms - vcsn::Element<S,T > const &,U const & + | type - "vcsn::Element<(S,T)>" + | sym:overname - "__SWIG_1" + | storage - "static" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator -" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce7d68 + | sym:name - "operator -" + | csym:nextSibling - 0xb7cebc18 + | sym:nextSibling - 0xb7cebc18 + | decl - "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + | sym:overloaded - 0xb7ce7808 + | parms - U const &,vcsn::Element<S,T > const & + | type - "vcsn::Element<(S,T)>" + | sym:overname - "__SWIG_2" + | storage - "static" + | templateparms - typename U,typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator *" + | sym:symtab - 0xb7cd59e8 + | sym:name - "operator *" + | csym:nextSibling - 0xb7ce8f38 + | sym:nextSibling - 0xb7ce8f38 + | decl - "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + | parms - vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + | sym:overloaded - 0xb7ce89d8 + | type - "vcsn::op_mul_traits<(S1,S2,T1,T2)>::ret_t" + | sym:overname - "__SWIG_0" + | storage - "static" + | templateparms - typename S1,typename T1,typename S2,typename T2 + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator *" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce89d8 + | sym:name - "operator *" + | csym:nextSibling - 0xb7ce9478 + | sym:nextSibling - 0xb7ce9478 + | decl - "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + | sym:overloaded - 0xb7ce89d8 + | parms - vcsn::Element<S,T > const &,U const & + | type - "vcsn::Element<(S,T)>" + | sym:overname - "__SWIG_1" + | storage - "static" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator *" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce8f38 + | sym:name - "operator *" + | decl - "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + | sym:overloaded - 0xb7ce89d8 + | parms - U const &,vcsn::Element<S,T > const & + | type - "vcsn::Element<(S,T)>" + | sym:overname - "__SWIG_2" + | storage - "static" + | templateparms - typename U,typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator /" + | sym:symtab - 0xb7cd59e8 + | sym:name - "operator /" + | csym:nextSibling - 0xb7cea108 + | sym:nextSibling - 0xb7cea108 + | decl - "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + | parms - vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + | sym:overloaded - 0xb7ce9ba8 + | type - "vcsn::op_div_traits<(S1,S2,T1,T2)>::ret_t" + | sym:overname - "__SWIG_0" + | storage - "static" + | templateparms - typename S1,typename T1,typename S2,typename T2 + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator /" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce9ba8 + | sym:name - "operator /" + | csym:nextSibling - 0xb7cea648 + | sym:nextSibling - 0xb7cea648 + | decl - "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + | sym:overloaded - 0xb7ce9ba8 + | parms - vcsn::Element<S,T > const &,U const & + | type - "vcsn::Element<(S,T)>" + | sym:overname - "__SWIG_1" + | storage - "static" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator /" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7cea108 + | sym:name - "operator /" + | decl - "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + | sym:overloaded - 0xb7ce9ba8 + | parms - U const &,vcsn::Element<S,T > const & + | type - "vcsn::Element<(S,T)>" + | sym:overname - "__SWIG_2" + | storage - "static" + | templateparms - typename U,typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator %" + | sym:symtab - 0xb7cd59e8 + | sym:name - "operator %" + | csym:nextSibling - 0xb7ceb2d8 + | sym:nextSibling - 0xb7ceb2d8 + | decl - "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + | parms - vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + | sym:overloaded - 0xb7cead78 + | type - "vcsn::op_mod_traits<(S1,S2,T1,T2)>::ret_t" + | sym:overname - "__SWIG_0" + | storage - "static" + | templateparms - typename S1,typename T1,typename S2,typename T2 + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator %" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7cead78 + | sym:name - "operator %" + | csym:nextSibling - 0xb7ceb818 + | sym:nextSibling - 0xb7ceb818 + | decl - "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + | sym:overloaded - 0xb7cead78 + | parms - vcsn::Element<S,T > const &,U const & + | type - "vcsn::Element<(S,T)>" + | sym:overname - "__SWIG_1" + | storage - "static" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator %" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ceb2d8 + | sym:name - "operator %" + | decl - "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + | sym:overloaded - 0xb7cead78 + | parms - U const &,vcsn::Element<S,T > const & + | type - "vcsn::Element<(S,T)>" + | sym:overname - "__SWIG_2" + | storage - "static" + | templateparms - typename U,typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator -" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ce82a8 + | sym:name - "operator -" + | decl - "f(r.q(const).vcsn::Element<(S,T)>)." + | sym:overloaded - 0xb7ce7808 + | parms - vcsn::Element<S,T > const & + | type - "vcsn::Element<(S,T)>" + | sym:overname - "__SWIG_3" + | storage - "static" + | templateparms - typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator <<" + | sym:symtab - 0xb7cd59e8 + | sym:name - "operator <<" + | decl - "f(r.St,r.q(const).vcsn::Element<(S,T)>).r." + | parms - St &,vcsn::Element<S,T > const & + | type - "St" + | sym:overname - "__SWIG_0" + | storage - "static" + | templateparms - typename St,typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator >>" + | sym:symtab - 0xb7cd59e8 + | sym:name - "operator >>" + | decl - "f(r.St,r.q(const).vcsn::Element<(S,T)>).r." + | parms - St &,vcsn::Element<S,T > const & + | type - "St" + | sym:overname - "__SWIG_0" + | storage - "static" + | templateparms - typename St,typename S,typename T + | + +++ namespace ---------------------------------------- + | sym:name - "std" + | name - "std" + | sym:previousSibling - 0xb7cd4398 + | typescope - 0xb7cf9d38 + | symtab - 0xb7cd4338 + | sym:symtab - 0xb7cd02e8 + + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "swap" + | sym:symtab - 0xb7cd4338 + | sym:nextSibling - 0xb7cece18 + | csym:nextSibling - 0xb7cece18 + | sym:name - "swap" + | decl - "f(r.vcsn::Element<(S,T1)>,r.vcsn::Element<(S,T2)>)." + | parms - vcsn::Element<S,T1 > &,vcsn::Element<S,T2 > & + | sym:overloaded - 0xb7ceca48 + | type - "void" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T1,typename T2 + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "swap" + | sym:symtab - 0xb7cd4338 + | sym:previousSibling - 0xb7ceca48 + | sym:name - "swap" + | csym:nextSibling - 0xb7ced1c8 + | sym:nextSibling - 0xb7ced1c8 + | decl - "f(r.vcsn::Element<(S,T)>,r.T)." + | sym:overloaded - 0xb7ceca48 + | parms - vcsn::Element<S,T > &,T & + | type - "void" + | sym:overname - "__SWIG_1" + | templateparms - typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "swap" + | sym:symtab - 0xb7cd4338 + | sym:previousSibling - 0xb7cece18 + | sym:name - "swap" + | decl - "f(r.T,r.vcsn::Element<(S,T)>)." + | sym:overloaded - 0xb7ceca48 + | parms - T &,vcsn::Element<S,T > & + | type - "void" + | sym:overname - "__SWIG_2" + | templateparms - typename T,typename S + | + +++ include ---------------------------------------- + | name - "vcsn/include/vaucanson/design_pattern/default_ops.hh" + + +++ namespace ---------------------------------------- + | sym:name - "vcsn" + | name - "vcsn" + | sym:previousSibling - 0xb7ce0778 + | csym:nextSibling - 0xb7cf4b78 + | sym:nextSibling - 0xb7cf4b78 + | typescope - 0xb7cf9e58 + | symtab - 0xb7cd59e8 + | sym:symtab - 0xb7cd02e8 + + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:name - "op_contains" + | name - "op_contains" + | decl - "f(r.q(const).Structure<(S)>,r.q(const).T)." + | parms - Structure<S > const &,T const & + | sym:typename - "1" + | type - "bool" + | templateparms - typename S,typename T + | sym:symtab - 0xb7cd59e8 + | sym:overname - "__SWIG_0" + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_eq" + | sym:symtab - 0xb7cd59e8 + | csym:nextSibling - 0xb7cedfd8 + | sym:name - "op_eq" + | sym:nextSibling - 0xb7cedfd8 + | decl - "f(r.q(const).Structure<(S)>,r.q(const).T,r.q(const).U)." + | parms - Structure<S > const &,T const &,U const & + | sym:overloaded - 0xb7ceda28 + | type - "bool" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_eq" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ceda28 + | sym:name - "op_eq" + | decl - "f(r.q(const).Structure<(S)>,r.q(const).Structure<(V)>,r.q(const).T,r.q(const).U)." + | sym:overloaded - 0xb7ceda28 + | parms - Structure<S > const &,Structure<V > const &,T const &,U const & + | type - "bool" + | sym:overname - "__SWIG_1" + | templateparms - typename S,typename V,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_lt" + | sym:symtab - 0xb7cd59e8 + | csym:nextSibling - 0xb7ceea18 + | sym:name - "op_lt" + | sym:nextSibling - 0xb7ceea18 + | decl - "f(r.q(const).Structure<(S)>,r.q(const).T,r.q(const).U)." + | parms - Structure<S > const &,T const &,U const & + | sym:overloaded - 0xb7cee468 + | type - "bool" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_lt" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7cee468 + | sym:name - "op_lt" + | decl - "f(r.q(const).Structure<(S)>,r.q(const).Structure<(V)>,r.q(const).T,r.q(const).U)." + | sym:overloaded - 0xb7cee468 + | parms - Structure<S > const &,Structure<V > const &,T const &,U const & + | type - "bool" + | sym:overname - "__SWIG_1" + | templateparms - typename S,typename V,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_convert" + | sym:symtab - 0xb7cd59e8 + | csym:nextSibling - 0xb7cef2c8 + | sym:name - "op_convert" + | sym:nextSibling - 0xb7cef2c8 + | decl - "f(r.q(const).Structure<(S)>,r.q(const).R,r.q(const).T)." + | parms - Structure<S > const &,R const &,T const & + | sym:overloaded - 0xb7ceeeb8 + | type - "R" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename R,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_convert" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7ceeeb8 + | sym:name - "op_convert" + | csym:nextSibling - 0xb7cef7c8 + | sym:nextSibling - 0xb7cef7c8 + | decl - "f(r.q(const).Structure<(S)>,r.q(const).T,r.q(const).T).r." + | sym:overloaded - 0xb7ceeeb8 + | parms - Structure<S > const &,T const &,T const & + | type - "q(const).T" + | sym:overname - "__SWIG_1" + | templateparms - typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_convert" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7cef2c8 + | sym:name - "op_convert" + | decl - "f(r.q(const).Structure<(S)>,r.q(const).T,r.q(const).Structure<(S)>,r.q(const).T).r." + | sym:overloaded - 0xb7ceeeb8 + | parms - Structure<S > const &,T const &,Structure<S > const &,T const & + | type - "q(const).T" + | sym:overname - "__SWIG_2" + | templateparms - typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_default" + | sym:symtab - 0xb7cd59e8 + | sym:name - "op_default" + | decl - "f(r.q(const).Structure<(S)>,r.q(const).T)." + | parms - Structure<S > const &,T const & + | type - "T" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_swap" + | sym:symtab - 0xb7cd59e8 + | sym:name - "op_swap" + | decl - "f(r.q(const).Structure<(S)>,r.T,r.T)." + | parms - Structure<S > const &,T &,T & + | type - "void" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_assign" + | sym:symtab - 0xb7cd59e8 + | csym:nextSibling - 0xb7cf0918 + | sym:name - "op_assign" + | sym:nextSibling - 0xb7cf0918 + | decl - "f(r.q(const).Structure<(S)>,r.T,r.q(const).U)." + | parms - Structure<S > const &,T &,U const & + | sym:overloaded - 0xb7cf0388 + | type - "void" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_assign" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7cf0388 + | sym:name - "op_assign" + | decl - "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.T,r.q(const).U)." + | sym:overloaded - 0xb7cf0388 + | parms - Structure<S > const &,Structure<S > const &,T &,U const & + | type - "void" + | sym:overname - "__SWIG_1" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_in_add" + | sym:symtab - 0xb7cd59e8 + | sym:name - "op_in_add" + | decl - "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.T,r.q(const).U)." + | parms - Structure<S > const &,Structure<S > const &,T &,U const & + | type - "void" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_in_sub" + | sym:symtab - 0xb7cd59e8 + | sym:name - "op_in_sub" + | decl - "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.T,r.q(const).U)." + | parms - Structure<S > const &,Structure<S > const &,T &,U const & + | type - "void" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_in_mul" + | sym:symtab - 0xb7cd59e8 + | sym:name - "op_in_mul" + | decl - "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.T,r.q(const).U)." + | parms - Structure<S > const &,Structure<S > const &,T &,U const & + | type - "void" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_in_div" + | sym:symtab - 0xb7cd59e8 + | sym:name - "op_in_div" + | decl - "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.T,r.q(const).U)." + | parms - Structure<S > const &,Structure<S > const &,T &,U const & + | type - "void" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_in_mod" + | sym:symtab - 0xb7cd59e8 + | sym:name - "op_in_mod" + | decl - "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.T,r.q(const).U)." + | parms - Structure<S > const &,Structure<S > const &,T &,U const & + | type - "void" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_add" + | sym:symtab - 0xb7cd59e8 + | sym:name - "op_add" + | decl - "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.q(const).T,r.q(const).U)." + | parms - Structure<S > const &,Structure<S > const &,T const &,U const & + | type - "T" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_sub" + | sym:symtab - 0xb7cd59e8 + | sym:name - "op_sub" + | decl - "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.q(const).T,r.q(const).U)." + | parms - Structure<S > const &,Structure<S > const &,T const &,U const & + | type - "T" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_mul" + | sym:symtab - 0xb7cd59e8 + | sym:name - "op_mul" + | decl - "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.q(const).T,r.q(const).U)." + | parms - Structure<S > const &,Structure<S > const &,T const &,U const & + | type - "T" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_div" + | sym:symtab - 0xb7cd59e8 + | sym:name - "op_div" + | decl - "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.q(const).T,r.q(const).U)." + | parms - Structure<S > const &,Structure<S > const &,T const &,U const & + | type - "T" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_mod" + | sym:symtab - 0xb7cd59e8 + | sym:name - "op_mod" + | decl - "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.q(const).T,r.q(const).U)." + | parms - Structure<S > const &,Structure<S > const &,T const &,U const & + | type - "T" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "op_rin" + | sym:symtab - 0xb7cd59e8 + | sym:name - "op_rin" + | decl - "f(r.q(const).Structure<(S)>,r.St,r.q(const).T).r." + | parms - Structure<S > const &,St &,T const & + | type - "St" + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename St,typename T + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:name - "op_rout" + | name - "op_rout" + | decl - "f(r.q(const).Structure<(S)>,r.St,r.q(const).T).r." + | parms - Structure<S > const &,St &,T const & + | sym:typename - "1" + | type - "St" + | templateparms - typename S,typename St,typename T + | sym:symtab - 0xb7cd59e8 + | sym:overname - "__SWIG_0" + | + +++ include ---------------------------------------- + | name - "vcsn/include/vaucanson/design_pattern/slots.hh" + + +++ namespace ---------------------------------------- + | sym:name - "vcsn" + | name - "vcsn" + | sym:previousSibling - 0xb7ced2a8 + | csym:nextSibling - 0xb7cf6a18 + | sym:nextSibling - 0xb7cf6a18 + | typescope - 0xb7cf9e58 + | symtab - 0xb7cd59e8 + | sym:symtab - 0xb7cd02e8 + + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "SetSlotAttribute" + | sym:symtab - 0xb7cd59e8 + | symtab - 0xb7cf4d38 + | allows_typedef - "1" + | kind - "struct" + | sym:name - "SetSlotAttribute" + | partials - 0xb7cf6128 + | sym:overname - "__SWIG_0" + | templateparms - typename S,bool + + +++ constructor ---------------------------------------- + | sym:name - "SetSlotAttribute" + | name - "SetSlotAttribute" + | decl - "f()." + | feature:new - "1" + | sym:overloaded - 0xb7cf4e28 + | csym:nextSibling - 0xb7cf4f48 + | sym:nextSibling - 0xb7cf4f48 + | sym:symtab - 0xb7cf4d38 + | sym:overname - "__SWIG_0" + | + +++ constructor ---------------------------------------- + | name - "SetSlotAttribute" + | sym:symtab - 0xb7cf4d38 + | sym:nextSibling - 0xb7cf5068 + | csym:nextSibling - 0xb7cf5068 + | sym:previousSibling - 0xb7cf4e28 + | sym:name - "SetSlotAttribute" + | decl - "f(r.q(const).SetSlotAttribute)." + | sym:overloaded - 0xb7cf4e28 + | parms - SetSlotAttribute const & + | sym:overname - "__SWIG_1" + | feature:new - "1" + | + +++ constructor ---------------------------------------- + | sym:name - "SetSlotAttribute" + | name - "SetSlotAttribute" + | parms - S const & + | decl - "f(r.q(const).S)." + | feature:new - "1" + | sym:overloaded - 0xb7cf4e28 + | sym:previousSibling - 0xb7cf4f48 + | sym:symtab - 0xb7cf4d38 + | sym:overname - "__SWIG_2" + | + +++ cdecl ---------------------------------------- + | sym:name - "_structure_get" + | name - "_structure_get" + | decl - "q(const).f().r." + | type - "q(const).S" + | sym:symtab - 0xb7cf4d38 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "_structure_assign" + | name - "_structure_assign" + | decl - "f(r.q(const).SetSlotAttribute)." + | parms - SetSlotAttribute const & + | type - "void" + | sym:symtab - 0xb7cf4d38 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "_structure_attach" + | name - "_structure_attach" + | decl - "f(r.q(const).S)." + | parms - S const & + | type - "void" + | sym:symtab - 0xb7cf4d38 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "_structure_bound" + | name - "_structure_bound" + | decl - "q(const).f()." + | type - "bool" + | sym:symtab - 0xb7cf4d38 + | sym:overname - "__SWIG_0" + | + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "SetSlotAttribute<(S,true)>" + | sym:symtab - 0xb7cd59e8 + | symtab - 0xb7cf56f8 + | allows_typedef - "1" + | kind - "struct" + | sym:name - "SetSlotAttribute<(S,true)>" + | partialargs - "SetSlotAttribute<($1,true)>" + | sym:overname - "__SWIG_0" + | templateparms - typename S,true + | partialspecialization - "1" + + +++ constructor ---------------------------------------- + | sym:name - "SetSlotAttribute" + | name - "SetSlotAttribute" + | decl - "f()." + | feature:new - "1" + | sym:overloaded - 0xb7cf57b8 + | csym:nextSibling - 0xb7cf58d8 + | sym:nextSibling - 0xb7cf58d8 + | sym:symtab - 0xb7cf56f8 + | sym:overname - "__SWIG_0" + | + +++ constructor ---------------------------------------- + | name - "SetSlotAttribute" + | sym:symtab - 0xb7cf56f8 + | sym:nextSibling - 0xb7cf59f8 + | csym:nextSibling - 0xb7cf59f8 + | sym:previousSibling - 0xb7cf57b8 + | sym:name - "SetSlotAttribute" + | decl - "f(r.q(const).SetSlotAttribute)." + | sym:overloaded - 0xb7cf57b8 + | parms - SetSlotAttribute const & + | sym:overname - "__SWIG_1" + | feature:new - "1" + | + +++ constructor ---------------------------------------- + | sym:name - "SetSlotAttribute" + | name - "SetSlotAttribute" + | parms - S const & + | decl - "f(r.q(const).S)." + | feature:new - "1" + | sym:overloaded - 0xb7cf57b8 + | sym:previousSibling - 0xb7cf58d8 + | sym:symtab - 0xb7cf56f8 + | sym:overname - "__SWIG_2" + | + +++ cdecl ---------------------------------------- + | sym:name - "_structure_get" + | name - "_structure_get" + | decl - "q(const).f().r." + | type - "q(const).S" + | sym:symtab - 0xb7cf56f8 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "_structure_assign" + | name - "_structure_assign" + | decl - "f(r.q(const).SetSlotAttribute)." + | parms - SetSlotAttribute const & + | type - "void" + | sym:symtab - 0xb7cf56f8 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "_structure_attach" + | name - "_structure_attach" + | decl - "f(r.q(const).S)." + | parms - S const & + | type - "void" + | sym:symtab - 0xb7cf56f8 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "_structure_bound" + | name - "_structure_bound" + | decl - "q(const).f()." + | type - "bool" + | sym:symtab - 0xb7cf56f8 + | sym:overname - "__SWIG_0" + | + +++ access ---------------------------------------- + | kind - "protected" + | + +++ cdecl ---------------------------------------- + | name - "s_" + | decl - "p." + | access - "protected" + | type - "q(const).S" + | sym:symtab - 0xb7cf56f8 + | + +++ access ---------------------------------------- + | kind - "public" + | + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "SetSlot" + | sym:symtab - 0xb7cd59e8 + | symtab - 0xb7cf64a8 + | allows_typedef - "1" + | kind - "struct" + | sym:name - "SetSlot" + | privatebaselist - 0xb7cf63d8 + | protectedbaselist - 0xb7cf63c8 + | baselist - 0xb7cf63b8 + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename Tag + + +++ cdecl ---------------------------------------- + | sym:name - "tag_type" + | name - "tag_type" + | decl - "" + | storage - "typedef" + | type - "Tag" + | sym:symtab - 0xb7cf64a8 + | sym:overname - "__SWIG_0" + | + +++ constructor ---------------------------------------- + | sym:name - "SetSlot" + | name - "SetSlot" + | decl - "f()." + | feature:new - "1" + | sym:overloaded - 0xb7cf6648 + | csym:nextSibling - 0xb7cf6768 + | sym:nextSibling - 0xb7cf6768 + | sym:symtab - 0xb7cf64a8 + | sym:overname - "__SWIG_0" + | + +++ constructor ---------------------------------------- + | name - "SetSlot" + | sym:symtab - 0xb7cf64a8 + | sym:nextSibling - 0xb7cf6888 + | csym:nextSibling - 0xb7cf6888 + | sym:previousSibling - 0xb7cf6648 + | sym:name - "SetSlot" + | decl - "f(r.q(const).SetSlot)." + | sym:overloaded - 0xb7cf6648 + | parms - SetSlot const & + | sym:overname - "__SWIG_1" + | feature:new - "1" + | + +++ constructor ---------------------------------------- + | sym:name - "SetSlot" + | name - "SetSlot" + | parms - S const & + | decl - "f(r.q(const).S)." + | feature:new - "1" + | sym:overloaded - 0xb7cf6648 + | sym:previousSibling - 0xb7cf6768 + | sym:symtab - 0xb7cf64a8 + | sym:overname - "__SWIG_2" + | + +++ include ---------------------------------------- + | name - "vcsn/include/vaucanson/design_pattern/element.hh" + + +++ namespace ---------------------------------------- + | sym:name - "vcsn" + | name - "vcsn" + | sym:previousSibling - 0xb7cf4b78 + | csym:nextSibling - 0xb7cf9498 + | sym:nextSibling - 0xb7cf9498 + | typescope - 0xb7cf9e58 + | symtab - 0xb7cd59e8 + | sym:symtab - 0xb7cd02e8 + + +++ template ---------------------------------------- + | templatetype - "class" + | sym:typename - "1" + | name - "Element" + | sym:symtab - 0xb7cd59e8 + | symtab - 0xb7cf6de8 + | allows_typedef - "1" + | kind - "class" + | sym:name - "Element" + | privatebaselist - 0xb7cf6cb8 + | protectedbaselist - 0xb7cf6ca8 + | baselist - 0xb7cf6c98 + | sym:overname - "__SWIG_0" + | templateparms - typename S,typename T + + +++ access ---------------------------------------- + | kind - "public" + | + +++ cdecl ---------------------------------------- + | sym:name - "set_t" + | name - "set_t" + | decl - "" + | storage - "typedef" + | type - "S" + | sym:symtab - 0xb7cf6de8 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "value_t" + | name - "value_t" + | decl - "" + | storage - "typedef" + | type - "T" + | sym:symtab - 0xb7cf6de8 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "dynamic" + | name - "dynamic" + | decl - "" + | storage - "static" + | value - "dynamic_traits<(S)>::ret||MetaElement<(S,T)>::dynamic_value" + | type - "q(const).bool" + | sym:symtab - 0xb7cf6de8 + | sym:overname - "__SWIG_0" + | + +++ constructor ---------------------------------------- + | sym:name - "Element" + | name - "Element" + | decl - "f()." + | feature:new - "1" + | sym:overloaded - 0xb7cf72a8 + | csym:nextSibling - 0xb7cf73c8 + | sym:nextSibling - 0xb7cf73c8 + | sym:symtab - 0xb7cf6de8 + | sym:overname - "__SWIG_0" + | + +++ constructor ---------------------------------------- + | name - "Element" + | sym:symtab - 0xb7cf6de8 + | csym:nextSibling - 0xb7cf78f8 + | sym:nextSibling - 0xb7cf7608 + | sym:previousSibling - 0xb7cf72a8 + | sym:name - "Element" + | decl - "f(r.q(const).Element)." + | sym:overloaded - 0xb7cf72a8 + | parms - Element const & + | sym:overname - "__SWIG_1" + | feature:new - "1" + | + +++ template ---------------------------------------- + | templatetype - "constructor" + | sym:typename - "1" + | name - "Element" + | sym:symtab - 0xb7cf6de8 + | sym:previousSibling - 0xb7cf73c8 + | csym:nextSibling - 0xb7cf72a8 + | sym:name - "Element" + | sym:nextSibling - 0xb7cf78f8 + | decl - "f(r.q(const).Element<(S,U)>)." + | sym:overloaded - 0xb7cf72a8 + | parms - Element<S,U > const & + | sym:overname - "__SWIG_2" + | templateparms - typename U + | feature:new - "1" + | + +++ template ---------------------------------------- + | templatetype - "constructor" + | sym:typename - "1" + | name - "Element" + | sym:symtab - 0xb7cf6de8 + | csym:nextSibling - 0xb7cf7a78 + | sym:previousSibling - 0xb7cf7608 + | sym:name - "Element" + | sym:nextSibling - 0xb7cf7a78 + | decl - "f(r.q(const).Element<(OtherS,U)>)." + | sym:overloaded - 0xb7cf72a8 + | parms - Element<OtherS,U > const & + | sym:overname - "__SWIG_3" + | templateparms - typename OtherS,typename U + | feature:new - "1" + | + +++ constructor ---------------------------------------- + | name - "Element" + | sym:symtab - 0xb7cf6de8 + | sym:nextSibling - 0xb7cf7c08 + | csym:nextSibling - 0xb7cf7c08 + | sym:previousSibling - 0xb7cf78f8 + | sym:name - "Element" + | decl - "f(r.q(const).T)." + | sym:overloaded - 0xb7cf72a8 + | parms - T const & + | sym:overname - "__SWIG_4" + | feature:new - "1" + | + +++ template ---------------------------------------- + | templatetype - "constructor" + | sym:typename - "1" + | name - "Element" + | sym:symtab - 0xb7cf6de8 + | csym:nextSibling - 0xb7cf7d68 + | sym:previousSibling - 0xb7cf7a78 + | sym:name - "Element" + | sym:nextSibling - 0xb7cf7d68 + | decl - "f(r.q(const).U)." + | sym:overloaded - 0xb7cf72a8 + | parms - U const & + | sym:overname - "__SWIG_5" + | templateparms - typename U + | feature:new - "1" + | + +++ constructor ---------------------------------------- + | name - "Element" + | sym:symtab - 0xb7cf6de8 + | sym:nextSibling - 0xb7cf7f28 + | csym:nextSibling - 0xb7cf7f28 + | sym:previousSibling - 0xb7cf7c08 + | sym:name - "Element" + | decl - "f(r.q(const).S)." + | sym:overloaded - 0xb7cf72a8 + | parms - S const & + | sym:overname - "__SWIG_6" + | feature:new - "1" + | + +++ constructor ---------------------------------------- + | name - "Element" + | sym:symtab - 0xb7cf6de8 + | sym:nextSibling - 0xb7cf8158 + | csym:nextSibling - 0xb7cf8158 + | sym:previousSibling - 0xb7cf7d68 + | sym:name - "Element" + | decl - "f(r.q(const).S,r.q(const).T)." + | sym:overloaded - 0xb7cf72a8 + | parms - S const &,T const & + | sym:overname - "__SWIG_7" + | feature:new - "1" + | + +++ template ---------------------------------------- + | templatetype - "constructor" + | sym:typename - "1" + | name - "Element" + | sym:symtab - 0xb7cf6de8 + | csym:nextSibling - 0xb7cf84e8 + | sym:previousSibling - 0xb7cf7f28 + | sym:name - "Element" + | sym:nextSibling - 0xb7cf84e8 + | decl - "f(r.q(const).S,r.q(const).U)." + | sym:overloaded - 0xb7cf72a8 + | parms - S const &,U const & + | sym:overname - "__SWIG_8" + | templateparms - typename U + | feature:new - "1" + | + +++ template ---------------------------------------- + | templatetype - "constructor" + | sym:typename - "1" + | name - "Element" + | sym:symtab - 0xb7cf6de8 + | sym:previousSibling - 0xb7cf8158 + | sym:name - "Element" + | decl - "f(r.q(const).S,r.q(const).Element<(OtherS,U)>)." + | sym:overloaded - 0xb7cf72a8 + | parms - S const &,Element<OtherS,U > const & + | sym:overname - "__SWIG_9" + | templateparms - typename OtherS,typename U + | feature:new - "1" + | + +++ cdecl ---------------------------------------- + | sym:name - "operator =" + | name - "operator =" + | decl - "f(r.q(const).Element).r." + | parms - Element const & + | sym:overloaded - 0xb7cf8678 + | type - "Element" + | sym:nextSibling - 0xb7cf88d8 + | csym:nextSibling - 0xb7cf8be8 + | sym:symtab - 0xb7cf6de8 + | sym:overname - "__SWIG_0" + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator =" + | sym:symtab - 0xb7cf6de8 + | sym:previousSibling - 0xb7cf8678 + | csym:nextSibling - 0xb7cf8678 + | sym:name - "operator =" + | sym:nextSibling - 0xb7cf8be8 + | decl - "f(r.q(const).Element<(S,U)>).r." + | sym:overloaded - 0xb7cf8678 + | parms - Element<S,U > const & + | type - "Element" + | sym:overname - "__SWIG_1" + | templateparms - typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator =" + | sym:symtab - 0xb7cf6de8 + | csym:nextSibling - 0xb7cf8df8 + | sym:previousSibling - 0xb7cf88d8 + | sym:name - "operator =" + | sym:nextSibling - 0xb7cf8df8 + | decl - "f(r.q(const).Element<(OtherS,U)>).r." + | sym:overloaded - 0xb7cf8678 + | parms - Element<OtherS,U > const & + | type - "Element" + | sym:overname - "__SWIG_2" + | templateparms - typename OtherS,typename U + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "operator =" + | sym:symtab - 0xb7cf6de8 + | sym:previousSibling - 0xb7cf8be8 + | sym:name - "operator =" + | decl - "f(r.q(const).U).r." + | sym:overloaded - 0xb7cf8678 + | parms - U const & + | type - "Element" + | sym:overname - "__SWIG_3" + | templateparms - typename U + | + +++ cdecl ---------------------------------------- + | sym:name - "structure" + | name - "structure" + | decl - "q(const).f().r." + | type - "q(const).S" + | sym:symtab - 0xb7cf6de8 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "attach" + | name - "attach" + | decl - "f(r.q(const).S)." + | parms - S const & + | type - "void" + | sym:symtab - 0xb7cf6de8 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "value" + | name - "value" + | decl - "f().r." + | sym:overloaded - 0xb7cf90c8 + | type - "T" + | csym:nextSibling - 0xb7cf9198 + | sym:nextSibling - 0xb7cf9198 + | sym:symtab - 0xb7cf6de8 + | sym:overname - "__SWIG_0" + | + +++ cdecl ---------------------------------------- + | sym:name - "value" + | name - "value" + | decl - "q(const).f().r." + | sym:overloaded - 0xb7cf90c8 + | type - "q(const).T" + | sym:previousSibling - 0xb7cf90c8 + | sym:symtab - 0xb7cf6de8 + | sym:overname - "__SWIG_1" + | + +++ access ---------------------------------------- + | kind - "private" + | + +++ cdecl ---------------------------------------- + | name - "value_" + | decl - "" + | access - "private" + | type - "T" + | sym:symtab - 0xb7cf6de8 + | + +++ access ---------------------------------------- + | kind - "public" + | + +++ include ---------------------------------------- + | name - "vcsn/include/vaucanson/design_pattern/design_pattern.hh" + | + +++ include ---------------------------------------- + | name - "vcsn/include/vaucanson/algorithms/standard_of.hh" + + +++ namespace ---------------------------------------- + | sym:name - "vcsn" + | name - "vcsn" + | sym:previousSibling - 0xb7cf6a18 + | typescope - 0xb7cf9e58 + | symtab - 0xb7cd59e8 + | sym:symtab - 0xb7cd02e8 + + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "standard_of" + | sym:symtab - 0xb7cd59e8 + | sym:nextSibling - 0xb7cf9c28 + | csym:nextSibling - 0xb7cf9c28 + | sym:name - "standard_of" + | decl - "f(r.Element<(A,T)>,r.q(const).Exp)." + | parms - Element<A,T > &,Exp const & + | sym:overloaded - 0xb7cf9868 + | type - "void" + | sym:overname - "__SWIG_0" + | templateparms - typename A,typename T,typename Exp + | + +++ template ---------------------------------------- + | templatetype - "cdecl" + | sym:typename - "1" + | name - "standard_of" + | sym:symtab - 0xb7cd59e8 + | sym:previousSibling - 0xb7cf9868 + | sym:name - "standard_of" + | decl - "f(r.q(const).Exp)." + | sym:overloaded - 0xb7cf9868 + | parms - Exp const & + | type - "Element<(A,T)>" + | sym:overname - "__SWIG_1" + | templateparms - typename A,typename T,typename Exp + | + +++ module ---------------------------------------- + | name - "vcsn" + | diff --git a/dynamic-use-of-static-c++/test/fixtures/tree/tree.yml b/dynamic-use-of-static-c++/test/fixtures/tree/tree.yml new file mode 100644 index 0000000..a79bdc3 --- /dev/null +++ b/dynamic-use-of-static-c++/test/fixtures/tree/tree.yml @@ -0,0 +1,2943 @@ +top: + outfile: "vcsn_wrap.cxx" + name: "vcsn" + module: 0xb7cf9cc8 + classes: 0xb7cd61f8 + infile: "vcsn.i" + outfile_h: "vcsn_wrap.h" + + contents: + + - include: + name: "../../swig-1.3.27/Lib/swig.swg" + + contents: + + - namespace: + sym:name: "std" + name: "std" + csym:nextSibling: 0xb7cec638 + sym:nextSibling: 0xb7cec638 + typescope: 0xb7cf9d38 + symtab: 0xb7cd4338 + sym:symtab: 0xb7cd02e8 + sym:overname: "__SWIG_0" + + - typemap: + code: "delete [] $1;" + method: "newfree" + + contents: + + - typemapitem: + pattern: 0xb7cd44c8 + + - typemap: + code: "{\n if ($1) delete [] $1;\n if ($input) {\n $1 = ($1_type) (new char[strlen($input)+1]);\n strcpy((char *) $1,$input);\n } else {\n $1 = 0;\n }\n}" + method: "memberin" + + contents: + + - typemapitem: + pattern: 0xb7cd4618 + + - typemap: + kwargs: 0xb7cd4688 + code: "{\n if ($input) {\n $1 = ($1_type) (new char[strlen($input)+1]);\n strcpy((char *) $1,$input);\n } else {\n $1 = 0;\n }\n}" + method: "memberin" + + contents: + + - typemapitem: + pattern: 0xb7cd4748 + + - typemap: + code: "{\n if ($1) delete [] $1;\n if ($input) {\n $1 = ($1_type) (new char[strlen($input)+1]);\n strcpy((char *) $1,$input);\n } else {\n $1 = 0;\n }\n}" + method: "globalin" + + contents: + + - typemapitem: + pattern: 0xb7cd4848 + + - typemap: + kwargs: 0xb7cd48b8 + code: "{\n if ($input) {\n $1 = ($1_type) (new char[strlen($input)+1]);\n strcpy((char *) $1,$input);\n } else {\n $1 = 0;\n }\n}" + method: "globalin" + + contents: + + - typemapitem: + pattern: 0xb7cd4978 + + - typemap: + code: "{\n if ($input) strncpy($1,$input,$1_dim0);\n else $1[0] = 0;\n}" + method: "memberin" + + contents: + + - typemapitem: + pattern: 0xb7cd4a88 + + - typemap: + code: "{\n if ($input) strncpy($1,$input,$1_dim0);\n else $1[0] = 0;\n}" + method: "globalin" + + contents: + + - typemapitem: + pattern: 0xb7cd4b98 + + - typemap: + code: "{\n if ($input) strcpy($1,$input);\n else $1[0] = 0;\n}" + method: "memberin" + + contents: + + - typemapitem: + pattern: 0xb7cd4c88 + + - typemap: + code: "{\n if ($input) strcpy($1,$input);\n else $1[0] = 0;\n}" + method: "globalin" + + contents: + + - typemapitem: + pattern: 0xb7cd4d78 + + - typemap: + code: "{\n size_t ii;\n $1_basetype *b = ($1_basetype *) $1;\n for (ii = 0; ii < (size_t)$1_size; ii++) b[ii] = *(($1_basetype *) $input + ii);\n}" + method: "memberin" + + contents: + + - typemapitem: + pattern: 0xb7cd4e88 + + - typemap: + code: "{\n size_t ii;\n $1_basetype *b = ($1_basetype *) $1;\n for (ii = 0; ii < (size_t)$1_size; ii++) b[ii] = *(($1_basetype *) $input + ii);\n}" + method: "globalin" + + contents: + + - typemapitem: + pattern: 0xb7cd4f98 + + - typemap: + code: "{\n $basetype (*inp)[$dim1] = ($basetype (*)[$dim1])($input);\n $basetype (*dest)[$dim1] = ($basetype (*)[$dim1])($1);\n size_t ii = 0;\n for (; ii < $dim0; ++ii) {\n $basetype *ip = inp[ii];\n $basetype *dp = dest[ii];\n size_t jj = 0;\n for (; jj < $dim1; ++jj) dp[jj] = ip[jj];\n }\n}" + method: "memberin" + + contents: + + - typemapitem: + pattern: 0xb7cd50c8 + + - typemap: + code: "{\n $basetype (*inp)[$dim1] = ($basetype (*)[$dim1])($input);\n $basetype (*dest)[$dim1] = ($basetype (*)[$dim1])($1);\n size_t ii = 0;\n for (; ii < $dim0; ++ii) {\n $basetype *ip = inp[ii];\n $basetype *dp = dest[ii];\n size_t jj = 0;\n for (; jj < $dim1; ++jj) dp[jj] = ip[jj];\n }\n}" + method: "globalin" + + contents: + + - typemapitem: + pattern: 0xb7cd51f8 + + - typemap: + kwargs: 0xb7cd5278 + code: "" + method: "in" + + contents: + + - typemapitem: + pattern: 0xb7cd5348 + + - typemapitem: + pattern: 0xb7cd53f8 + + - insert: + code: "\n#ifdef __cplusplus\ntemplate<class T> class SwigValueWrapper {\n T *tt;\npublic:\n SwigValueWrapper() : tt(0) { }\n SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }\n SwigValueWrapper(const T& t) : tt(new T(t)) { }\n ~SwigValueWrapper() { delete tt; } \n SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }\n operator T&() const { return *tt; }\n T *operator&() { return tt; }\nprivate:\n SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);\n};\n#endif\n" + section: "runtime" + + - insert: + code: "/***********************************************************************\n *\n * This section contains generic SWIG labels for method/variable\n * declarations/attributes, and other compiler dependent labels.\n *\n ************************************************************************/\n\n/* template workaround for compilers that cannot correctly implement the C++ standard */\n#ifndef SWIGTEMPLATEDISAMBIGUATOR\n# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)\n# define SWIGTEMPLATEDISAMBIGUATOR template\n# else\n# define SWIGTEMPLATEDISAMBIGUATOR \n# endif\n#endif\n\n/* inline attribute */\n#ifndef SWIGINLINE\n# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))\n# define SWIGINLINE inline\n# else\n# define SWIGINLINE\n# endif\n#endif\n\n/* attribute recognised by some compilers to avoid \'unused\' warnings */\n#ifndef SWIGUNUSED\n# if defined(__GNUC__) || defined(__ICC)\n# define SWIGUNUSED __attribute__ ((unused)) \n# else\n# define SWIGUNUSED \n# endif\n#endif\n\n/* internal SWIG method */\n#ifndef SWIGINTERN\n# define SWIGINTERN static SWIGUNUSED\n#endif\n\n/* internal inline SWIG method */\n#ifndef SWIGINTERNINLINE\n# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE\n#endif\n\n/* exporting methods for Windows DLLs */\n#ifndef SWIGEXPORT\n# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)\n# if defined(STATIC_LINKED)\n# define SWIGEXPORT\n# else\n# define SWIGEXPORT __declspec(dllexport)\n# endif\n# else\n# define SWIGEXPORT\n# endif\n#endif\n\n/* calling conventions for Windows */\n#ifndef SWIGSTDCALL\n# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)\n# define SWIGSTDCALL __stdcall\n# else\n# define SWIGSTDCALL\n# endif \n#endif\n\n" + section: "runtime" + + - include: + name: "vcsn.i" + module: "vcsn" + + contents: + + - include: + name: "vcsn/include/vaucanson/config/pconf.hh" + + contents: + + - constant: + sym:name: "VCSN_PACKAGE_BUGREPORT" + name: "VCSN_PACKAGE_BUGREPORT" + rawval: "\"vaucanson-bugs@lrde.epita.fr\"" + feature:immutable: "1" + value: "vaucanson-bugs@lrde.epita.fr" + storage: "%constant" + type: "p.char" + sym:symtab: 0xb7cd02e8 + sym:overname: "__SWIG_0" + + - constant: + sym:name: "VCSN_PACKAGE_NAME" + name: "VCSN_PACKAGE_NAME" + rawval: "\"vaucanson\"" + feature:immutable: "1" + value: "vaucanson" + storage: "%constant" + type: "p.char" + sym:symtab: 0xb7cd02e8 + sym:overname: "__SWIG_0" + + - constant: + sym:name: "VCSN_PACKAGE_STRING" + name: "VCSN_PACKAGE_STRING" + rawval: "\"vaucanson 0.7.2\"" + feature:immutable: "1" + value: "vaucanson 0.7.2" + storage: "%constant" + type: "p.char" + sym:symtab: 0xb7cd02e8 + sym:overname: "__SWIG_0" + + - constant: + sym:name: "VCSN_PACKAGE_VERSION" + name: "VCSN_PACKAGE_VERSION" + rawval: "\"0.7.2\"" + feature:immutable: "1" + value: "0.7.2" + storage: "%constant" + type: "p.char" + sym:symtab: 0xb7cd02e8 + sym:overname: "__SWIG_0" + + - include: + name: "vcsn/include/vaucanson/config/math.hh" + + - include: + name: "vcsn/include/vaucanson/config/system.hh" + + - include: + name: "vcsn/include/vaucanson/design_pattern/predecls.hh" + + contents: + + - namespace: + sym:name: "vcsn" + name: "vcsn" + csym:nextSibling: 0xb7cd8a98 + sym:nextSibling: 0xb7cd8a98 + typescope: 0xb7cf9e58 + symtab: 0xb7cd59e8 + sym:symtab: 0xb7cd02e8 + sym:overname: "__SWIG_0" + + contents: + + - template: + sym:name: "dynamic_traits" + templatetype: "classforward" + name: "dynamic_traits" + partials: 0xb7cda4c8 + kind: "struct" + sym:weak: "1" + templateparms: typename S + sym:symtab: 0xb7cd59e8 + sym:overname: "__SWIG_0" + + - template: + sym:name: "SyntacticDecorator" + templatetype: "classforward" + name: "SyntacticDecorator" + kind: "struct" + sym:weak: "1" + templateparms: typename S,typename T + sym:symtab: 0xb7cd59e8 + sym:overname: "__SWIG_0" + + - template: + sym:name: "MetaElement" + templatetype: "classforward" + name: "MetaElement" + partials: 0xb7cde788 + kind: "struct" + sym:weak: "1" + templateparms: typename S,typename T + sym:symtab: 0xb7cd59e8 + sym:overname: "__SWIG_0" + + - template: + sym:name: "Element" + templatetype: "classforward" + name: "Element" + kind: "struct" + sym:weak: "1" + templateparms: typename S,typename T + sym:symtab: 0xb7cd59e8 + sym:overname: "__SWIG_0" + + - class: + name: "vcsn::default_slot_tag" + sym:symtab: 0xb7cd59e8 + symtab: 0xb7cd61a8 + allows_typedef: "1" + typepass:visit: "1" + allocate:visit: "1" + kind: "struct" + sym:name: "default_slot_tag" + allocate:default_constructor: "1" + allocate:default_destructor: "1" + module: 0xb7cf9cc8 + sym:overname: "__SWIG_0" + typescope: 0xb7cfa108 + + - template: + sym:name: "SetSlot" + templatetype: "classforward" + name: "SetSlot" + kind: "struct" + sym:weak: "1" + templateparms: typename S,typename Tag + sym:symtab: 0xb7cd59e8 + sym:overname: "__SWIG_0" + + - template: + sym:name: "Structure" + templatetype: "classforward" + name: "Structure" + kind: "struct" + sym:weak: "1" + templateparms: typename Self + sym:symtab: 0xb7cd59e8 + sym:overname: "__SWIG_0" + + - template: + sym:name: "virtual_types" + templatetype: "classforward" + name: "virtual_types" + partials: 0xb7cda8d8 + kind: "struct" + sym:weak: "1" + templateparms: typename Self + sym:symtab: 0xb7cd59e8 + sym:overname: "__SWIG_0" + + - class: + name: "vcsn::undefined_type" + sym:symtab: 0xb7cd59e8 + symtab: 0xb7cd6728 + allows_typedef: "1" + allocate:visit: "1" + typepass:visit: "1" + kind: "struct" + sym:name: "undefined_type" + allocate:default_constructor: "1" + allocate:default_destructor: "1" + module: 0xb7cf9cc8 + sym:overname: "__SWIG_0" + typescope: 0xb7cfa328 + + - include: + name: "vcsn/include/vaucanson/misc/selectors.hh" + + - include: + name: "vcsn/include/vaucanson/misc/unique.hh" + + contents: + + - namespace: + sym:name: "utility" + name: "utility" + typescope: 0xb7cfa358 + symtab: 0xb7cd6868 + sym:symtab: 0xb7cd02e8 + sym:overname: "__SWIG_0" + + contents: + + - namespace: + sym:name: "unique" + name: "unique" + typescope: 0xb7cfa3a8 + symtab: 0xb7cd7298 + sym:symtab: 0xb7cd6868 + sym:overname: "__SWIG_0" + + contents: + + - template: + templatetype: "class" + sym:typename: "1" + name: "UniqueListBase" + sym:symtab: 0xb7cd6908 + symtab: 0xb7cd6a28 + allows_typedef: "1" + kind: "struct" + sym:name: "UniqueListBase" + sym:overname: "__SWIG_0" + templateparms: class T + + contents: + + - destructor: + sym:name: "~UniqueListBase" + name: "~UniqueListBase" + decl: "f()." + storage: "virtual" + sym:symtab: 0xb7cd6a28 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "uniquelist_base" + name: "utility::unique::UniqueMap::uniquelist_base" + decl: "" + storage: "typedef" + type: "utility::unique::UniqueListBase<(int)>" + sym:symtab: 0xb7cd6908 + sym:overname: "__SWIG_0" + + - template: + templatetype: "class" + sym:typename: "1" + name: "uniquelist" + sym:symtab: 0xb7cd6908 + symtab: 0xb7cd7018 + allows_typedef: "1" + kind: "struct" + sym:name: "uniquelist" + privatebaselist: 0xb7cd6f18 + protectedbaselist: 0xb7cd6ef8 + baselist: 0xb7cd6ed8 + sym:overname: "__SWIG_0" + templateparms: typename T + + contents: + + - destructor: + sym:name: "~uniquelist" + name: "~uniquelist" + decl: "f()." + sym:symtab: 0xb7cd7018 + sym:overname: "__SWIG_0" + + - template: + templatetype: "class" + sym:typename: "1" + name: "UniqueMap" + sym:symtab: 0xb7cd6908 + symtab: 0xb7cd7298 + allows_typedef: "1" + kind: "struct" + sym:name: "TiSlot" + sym:overname: "__SWIG_0" + templateparms: class T + + contents: + + - template: + templatetype: "class" + sym:typename: "1" + name: "TiSlot" + sym:symtab: 0xb7cd7298 + symtab: 0xb7cd73f8 + allows_typedef: "1" + kind: "struct" + sym:name: "TiSlot" + sym:overname: "__SWIG_0" + templateparms: class U + + contents: + + - constructor: + sym:name: "TiSlot" + name: "TiSlot" + parms: std::type_info const & + decl: "f(r.q(const).std::type_info)." + feature:new: "1" + sym:symtab: 0xb7cd73f8 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "id" + name: "id" + decl: "r." + type: "q(const).std::type_info" + sym:symtab: 0xb7cd73f8 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "operator ==" + name: "operator ==" + decl: "q(const).f(r.q(const).TiSlot)." + parms: TiSlot const & + type: "bool" + sym:symtab: 0xb7cd73f8 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "operator <" + name: "operator <" + decl: "q(const).f(r.q(const).TiSlot)." + parms: TiSlot const & + type: "bool" + sym:symtab: 0xb7cd73f8 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "ti_slot" + name: "ti_slot" + decl: "" + storage: "typedef" + type: "TiSlot<(int)>" + sym:symtab: 0xb7cd7298 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "map_t" + name: "map_t" + decl: "" + storage: "typedef" + type: "std::map<(ti_slot,p.uniquelist_base)>" + sym:symtab: 0xb7cd7298 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "instance" + name: "instance" + decl: "f().r." + storage: "static" + type: "map_t" + sym:symtab: 0xb7cd7298 + sym:overname: "__SWIG_0" + + - access: + kind: "protected" + + - cdecl: + sym:name: "map_" + name: "map_" + decl: "" + type: "map_t" + sym:symtab: 0xb7cd7298 + sym:overname: "__SWIG_0" + + - destructor: + sym:name: "~UniqueMap" + name: "~UniqueMap" + decl: "f()." + sym:symtab: 0xb7cd7298 + sym:overname: "__SWIG_0" + + - access: + kind: "public" + + - cdecl: + sym:name: "unique_map" + name: "utility::unique::UniqueMap::unique_map" + decl: "" + storage: "typedef" + type: "utility::unique::UniqueMap<(int)>" + sym:symtab: 0xb7cd7298 + sym:overname: "__SWIG_0" + + - class: + name: "utility::unique::UniqueMap::unifiable" + sym:symtab: 0xb7cd7298 + symtab: 0xb7cd8168 + allows_typedef: "1" + typepass:visit: "1" + allocate:visit: "1" + kind: "struct" + sym:name: "unifiable" + allocate:default_constructor: "1" + allocate:has_constructor: "1" + allocate:public_constructor: "1" + allocate:default_destructor: "1" + module: 0xb7cf9cc8 + sym:overname: "__SWIG_0" + typescope: 0xb7cfa818 + + contents: + + - constructor: + sym:name: "unifiable" + name: "utility::unique::UniqueMap::unifiable" + decl: "f()." + feature:new: "1" + sym:overloaded: 0xb7cd8148 + csym:nextSibling: 0xb7cd8268 + sym:nextSibling: 0xb7cd8268 + sym:symtab: 0xb7cd8168 + sym:overname: "__SWIG_0" + + - constructor: + sym:name: "unifiable" + name: "utility::unique::UniqueMap::unifiable" + parms: utility::unique::unifiable const & + decl: "f(r.q(const).unifiable)." + feature:new: "1" + sym:overloaded: 0xb7cd8148 + sym:previousSibling: 0xb7cd8148 + sym:symtab: 0xb7cd8168 + sym:overname: "__SWIG_1" + + - access: + kind: "private" + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "get" + sym:symtab: 0xb7cd7298 + sym:name: "get" + csym:nextSibling: 0xb7cd8788 + sym:nextSibling: 0xb7cd8988 + decl: "f(r.q(const).T).r." + parms: T const & + sym:overloaded: 0xb7cd8428 + type: "q(const).T" + sym:overname: "__SWIG_0" + storage: "friend" + templateparms: typename T + + - cdecl: + name: "unique_" + decl: "" + access: "private" + type: "bool" + sym:symtab: 0xb7cd8168 + + - access: + kind: "public" + + - template: + templatetype: "cdecl" + name: "get" + decl: "f(r.q(const).T).r." + parms: T const & + error: "vcsn/include/vaucanson/misc/unique.hh:121:Identifier \'get\' redefined (ignored),\nvcsn/include/vaucanson/misc/unique.hh:108:previous definition of \'get\'.\n" + sym:typename: "1" + type: "q(const).T" + csym:nextSibling: 0xb7cd8988 + templateparms: typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "get" + sym:symtab: 0xb7cd7298 + sym:previousSibling: 0xb7cd8428 + sym:name: "get" + decl: "f(p.q(const).T).p." + sym:overloaded: 0xb7cd8428 + parms: T const * + type: "q(const).T" + sym:overname: "__SWIG_1" + templateparms: typename T + + - include: + name: "vcsn/include/vaucanson/design_pattern/structure.hh" + + contents: + + - namespace: + sym:name: "vcsn" + name: "vcsn" + sym:previousSibling: 0xb7cd5a28 + csym:nextSibling: 0xb7cda888 + sym:nextSibling: 0xb7cda888 + typescope: 0xb7cf9e58 + symtab: 0xb7cd59e8 + sym:symtab: 0xb7cd02e8 + + contents: + + - template: + templatetype: "class" + sym:typename: "1" + name: "Structure" + sym:symtab: 0xb7cd59e8 + symtab: 0xb7cd8c98 + allows_typedef: "1" + kind: "struct" + sym:name: "Structure" + privatebaselist: 0xb7cd8c28 + protectedbaselist: 0xb7cd8c18 + baselist: 0xb7cd8c08 + sym:overname: "__SWIG_0" + templateparms: typename S + + contents: + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "contains" + sym:symtab: 0xb7cd8c98 + sym:nextSibling: 0xb7cd9238 + csym:nextSibling: 0xb7cd9238 + sym:name: "contains" + decl: "q(const).f(r.q(const).Element<(S,T)>)." + sym:overloaded: 0xb7cd8f28 + parms: Element<S,T > const & + type: "bool" + sym:overname: "__SWIG_0" + templateparms: typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "contains" + sym:symtab: 0xb7cd8c98 + csym:nextSibling: 0xb7cd9448 + sym:previousSibling: 0xb7cd8f28 + sym:name: "contains" + sym:nextSibling: 0xb7cd9448 + decl: "q(const).f(r.q(const).Element<(OtherS,T)>)." + sym:overloaded: 0xb7cd8f28 + parms: Element<OtherS,T > const & + type: "bool" + sym:overname: "__SWIG_1" + templateparms: typename OtherS,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "contains" + sym:symtab: 0xb7cd8c98 + sym:previousSibling: 0xb7cd9238 + sym:name: "contains" + decl: "q(const).f(r.q(const).T)." + sym:overloaded: 0xb7cd8f28 + parms: T const & + type: "bool" + sym:overname: "__SWIG_2" + templateparms: typename T + + - template: + templatetype: "cdecl" + sym:name: "choose" + name: "choose" + decl: "q(const).f(r.q(const).T)." + parms: T const & + sym:typename: "1" + type: "Element<(S,T)>" + templateparms: class T + sym:symtab: 0xb7cd8c98 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "self_t" + name: "self_t" + decl: "" + storage: "typedef" + type: "S" + sym:symtab: 0xb7cd8c98 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "self" + name: "self" + decl: "f().r." + sym:overloaded: 0xb7cd9848 + type: "self_t" + csym:nextSibling: 0xb7cd9918 + sym:nextSibling: 0xb7cd9918 + sym:symtab: 0xb7cd8c98 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "self" + name: "self" + decl: "q(const).f().r." + sym:overloaded: 0xb7cd9848 + type: "q(const).self_t" + sym:previousSibling: 0xb7cd9848 + sym:symtab: 0xb7cd8c98 + sym:overname: "__SWIG_1" + + - access: + kind: "protected" + + - constructor: + name: "Structure" + decl: "f()." + access: "protected" + feature:new: "1" + csym:nextSibling: 0xb7cd9af8 + sym:symtab: 0xb7cd8c98 + + - constructor: + name: "Structure" + parms: Structure const & + decl: "f(r.q(const).Structure)." + access: "protected" + feature:new: "1" + sym:symtab: 0xb7cd8c98 + + - access: + kind: "public" + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator !=" + sym:symtab: 0xb7cd59e8 + sym:name: "operator !=" + csym:nextSibling: 0xb7ce5608 + sym:nextSibling: 0xb7ce5608 + decl: "f(r.q(const).vcsn::Structure<(S)>,r.q(const).vcsn::Structure<(S)>)." + parms: vcsn::Structure<S > const &,vcsn::Structure<S > const & + sym:overloaded: 0xb7cd9f48 + type: "bool" + sym:overname: "__SWIG_0" + templateparms: typename S + + - template: + templatetype: "class" + sym:typename: "1" + name: "dynamic_traits<(Structure<(S)>)>" + sym:symtab: 0xb7cd59e8 + symtab: 0xb7cda158 + allows_typedef: "1" + kind: "struct" + sym:name: "dynamic_traits<(Structure<(S)>)>" + partialargs: "dynamic_traits<(vcsn::Structure<($1)>)>" + sym:overname: "__SWIG_0" + templateparms: Structure<S > + partialspecialization: "1" + + contents: + + - cdecl: + sym:name: "ret" + name: "ret" + decl: "" + storage: "static" + value: "false" + type: "q(const).bool" + sym:symtab: 0xb7cda158 + sym:overname: "__SWIG_0" + + - template: + templatetype: "class" + sym:typename: "1" + name: "virtual_types<(Structure<(S)>)>" + sym:symtab: 0xb7cd59e8 + symtab: 0xb7cda6c8 + allows_typedef: "1" + kind: "struct" + sym:name: "virtual_types<(Structure<(S)>)>" + partialargs: "virtual_types<(vcsn::Structure<($1)>)>" + sym:overname: "__SWIG_0" + templateparms: Structure<S > + partialspecialization: "1" + + - include: + name: "vcsn/include/vaucanson/design_pattern/syntactic_decorator.hh" + + contents: + + - namespace: + sym:name: "vcsn" + name: "vcsn" + sym:previousSibling: 0xb7cd8a98 + csym:nextSibling: 0xb7cdddc8 + sym:nextSibling: 0xb7cdddc8 + typescope: 0xb7cf9e58 + symtab: 0xb7cd59e8 + sym:symtab: 0xb7cd02e8 + + contents: + + - template: + templatetype: "class" + sym:typename: "1" + name: "SyntacticDecorator" + sym:symtab: 0xb7cd59e8 + symtab: 0xb7cdaa08 + allows_typedef: "1" + kind: "struct" + sym:name: "SyntacticDecorator" + sym:overname: "__SWIG_0" + templateparms: typename S,typename T + + contents: + + - cdecl: + sym:name: "dynamic_value" + name: "dynamic_value" + decl: "" + storage: "static" + value: "true" + type: "q(const).bool" + sym:symtab: 0xb7cdaa08 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "structure" + name: "structure" + decl: "q(const).f().r." + type: "q(const).S" + sym:symtab: 0xb7cdaa08 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "value" + name: "value" + decl: "f().r." + sym:overloaded: 0xb7cdace8 + type: "T" + csym:nextSibling: 0xb7cdadb8 + sym:nextSibling: 0xb7cdadb8 + sym:symtab: 0xb7cdaa08 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "value" + name: "value" + decl: "q(const).f().r." + sym:overloaded: 0xb7cdace8 + type: "q(const).T" + sym:previousSibling: 0xb7cdace8 + sym:symtab: 0xb7cdaa08 + sym:overname: "__SWIG_1" + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator +=" + sym:symtab: 0xb7cdaa08 + sym:nextSibling: 0xb7cdb3e8 + csym:nextSibling: 0xb7cdb3e8 + sym:name: "operator +=" + decl: "f(r.q(const).Element<(OtherS,U)>).r." + sym:overloaded: 0xb7cdb128 + parms: Element<OtherS,U > const & + type: "Element<(S,T)>" + sym:overname: "__SWIG_0" + templateparms: typename OtherS,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator +=" + sym:symtab: 0xb7cdaa08 + sym:previousSibling: 0xb7cdb128 + sym:name: "operator +=" + decl: "f(r.q(const).U).r." + sym:overloaded: 0xb7cdb128 + parms: U const & + type: "Element<(S,T)>" + sym:overname: "__SWIG_1" + templateparms: typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator -=" + sym:symtab: 0xb7cdaa08 + sym:nextSibling: 0xb7cdba68 + csym:nextSibling: 0xb7cdba68 + sym:name: "operator -=" + decl: "f(r.q(const).Element<(OtherS,U)>).r." + sym:overloaded: 0xb7cdb7a8 + parms: Element<OtherS,U > const & + type: "Element<(S,T)>" + sym:overname: "__SWIG_0" + templateparms: typename OtherS,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator -=" + sym:symtab: 0xb7cdaa08 + sym:previousSibling: 0xb7cdb7a8 + sym:name: "operator -=" + decl: "f(r.q(const).U).r." + sym:overloaded: 0xb7cdb7a8 + parms: U const & + type: "Element<(S,T)>" + sym:overname: "__SWIG_1" + templateparms: typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator /=" + sym:symtab: 0xb7cdaa08 + sym:nextSibling: 0xb7cdc0e8 + csym:nextSibling: 0xb7cdc0e8 + sym:name: "operator /=" + decl: "f(r.q(const).Element<(OtherS,U)>).r." + sym:overloaded: 0xb7cdbe28 + parms: Element<OtherS,U > const & + type: "Element<(S,T)>" + sym:overname: "__SWIG_0" + templateparms: typename OtherS,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator /=" + sym:symtab: 0xb7cdaa08 + sym:previousSibling: 0xb7cdbe28 + sym:name: "operator /=" + decl: "f(r.q(const).U).r." + sym:overloaded: 0xb7cdbe28 + parms: U const & + type: "Element<(S,T)>" + sym:overname: "__SWIG_1" + templateparms: typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator *=" + sym:symtab: 0xb7cdaa08 + sym:nextSibling: 0xb7cdc768 + csym:nextSibling: 0xb7cdc768 + sym:name: "operator *=" + decl: "f(r.q(const).Element<(OtherS,U)>).r." + sym:overloaded: 0xb7cdc4a8 + parms: Element<OtherS,U > const & + type: "Element<(S,T)>" + sym:overname: "__SWIG_0" + templateparms: typename OtherS,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator *=" + sym:symtab: 0xb7cdaa08 + sym:previousSibling: 0xb7cdc4a8 + sym:name: "operator *=" + decl: "f(r.q(const).U).r." + sym:overloaded: 0xb7cdc4a8 + parms: U const & + type: "Element<(S,T)>" + sym:overname: "__SWIG_1" + templateparms: typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator %=" + sym:symtab: 0xb7cdaa08 + sym:nextSibling: 0xb7cdcde8 + csym:nextSibling: 0xb7cdcde8 + sym:name: "operator %=" + decl: "f(r.q(const).Element<(OtherS,U)>).r." + sym:overloaded: 0xb7cdcb28 + parms: Element<OtherS,U > const & + type: "Element<(S,T)>" + sym:overname: "__SWIG_0" + templateparms: typename OtherS,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator %=" + sym:symtab: 0xb7cdaa08 + sym:previousSibling: 0xb7cdcb28 + sym:name: "operator %=" + decl: "f(r.q(const).U).r." + sym:overloaded: 0xb7cdcb28 + parms: U const & + type: "Element<(S,T)>" + sym:overname: "__SWIG_1" + templateparms: typename U + + - cdecl: + sym:name: "operator ++" + name: "operator ++" + decl: "f().r." + sym:overloaded: 0xb7cdcf78 + type: "Element<(S,T)>" + csym:nextSibling: 0xb7cdd128 + sym:nextSibling: 0xb7cdd128 + sym:symtab: 0xb7cdaa08 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "operator ++" + name: "operator ++" + decl: "f(int)." + parms: int + sym:overloaded: 0xb7cdcf78 + type: "Element<(S,T)>" + sym:previousSibling: 0xb7cdcf78 + sym:symtab: 0xb7cdaa08 + sym:overname: "__SWIG_1" + + - cdecl: + sym:name: "operator --" + name: "operator --" + decl: "f().r." + sym:overloaded: 0xb7cdd268 + type: "Element<(S,T)>" + csym:nextSibling: 0xb7cdd418 + sym:nextSibling: 0xb7cdd418 + sym:symtab: 0xb7cdaa08 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "operator --" + name: "operator --" + decl: "f(int)." + parms: int + sym:overloaded: 0xb7cdd268 + type: "Element<(S,T)>" + sym:previousSibling: 0xb7cdd268 + sym:symtab: 0xb7cdaa08 + sym:overname: "__SWIG_1" + + - template: + templatetype: "cdecl" + sym:name: "swap" + name: "swap" + decl: "f(r.Element<(S,U)>).r." + parms: Element<S,U > & + sym:typename: "1" + type: "Element<(S,T)>" + templateparms: typename U + sym:symtab: 0xb7cdaa08 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "self" + name: "self" + decl: "f().r." + sym:overloaded: 0xb7cdd898 + type: "Element<(S,T)>" + csym:nextSibling: 0xb7cdda18 + sym:nextSibling: 0xb7cdda18 + sym:symtab: 0xb7cdaa08 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "self" + name: "self" + decl: "q(const).f().r." + sym:overloaded: 0xb7cdd898 + type: "q(const).Element<(S,T)>" + sym:previousSibling: 0xb7cdd898 + sym:symtab: 0xb7cdaa08 + sym:overname: "__SWIG_1" + + - access: + kind: "protected" + + - constructor: + name: "SyntacticDecorator" + decl: "f()." + access: "protected" + feature:new: "1" + csym:nextSibling: 0xb7cddbf8 + sym:symtab: 0xb7cdaa08 + + - constructor: + name: "SyntacticDecorator" + parms: SyntacticDecorator const & + decl: "f(r.q(const).SyntacticDecorator)." + access: "protected" + feature:new: "1" + sym:symtab: 0xb7cdaa08 + + - access: + kind: "public" + + - include: + name: "vcsn/include/vaucanson/design_pattern/meta_element_root.hh" + + contents: + + - namespace: + sym:name: "vcsn" + name: "vcsn" + sym:previousSibling: 0xb7cda888 + csym:nextSibling: 0xb7cde7b8 + sym:nextSibling: 0xb7cde7b8 + typescope: 0xb7cf9e58 + symtab: 0xb7cd59e8 + sym:symtab: 0xb7cd02e8 + + contents: + + - template: + templatetype: "class" + sym:typename: "1" + name: "MetaElement<(Structure<(S)>,T)>" + sym:symtab: 0xb7cd59e8 + symtab: 0xb7cde208 + allows_typedef: "1" + kind: "struct" + sym:name: "MetaElement<(Structure<(S)>,T)>" + privatebaselist: 0xb7cde178 + protectedbaselist: 0xb7cde168 + baselist: 0xb7cde158 + partialargs: "MetaElement<(vcsn::Structure<($1)>,$2)>" + sym:overname: "__SWIG_0" + templateparms: Structure<S >,typename T + partialspecialization: "1" + + contents: + + - access: + kind: "protected" + + - constructor: + name: "MetaElement" + decl: "f()." + access: "protected" + feature:new: "1" + csym:nextSibling: 0xb7cde478 + sym:symtab: 0xb7cde208 + + - constructor: + name: "MetaElement" + parms: MetaElement const & + decl: "f(r.q(const).MetaElement)." + access: "protected" + feature:new: "1" + sym:symtab: 0xb7cde208 + + - access: + kind: "public" + + - include: + name: "vcsn/include/vaucanson/design_pattern/element_op_traits.hh" + + contents: + + - namespace: + sym:name: "vcsn" + name: "vcsn" + sym:previousSibling: 0xb7cdddc8 + csym:nextSibling: 0xb7ce0778 + sym:nextSibling: 0xb7ce0778 + typescope: 0xb7cf9e58 + symtab: 0xb7cd59e8 + sym:symtab: 0xb7cd02e8 + + contents: + + - template: + templatetype: "class" + sym:typename: "1" + name: "op_add_traits" + sym:symtab: 0xb7cd59e8 + symtab: 0xb7cde9f8 + allows_typedef: "1" + kind: "struct" + sym:name: "op_add_traits" + sym:overname: "__SWIG_0" + templateparms: typename S1,typename S2,typename T1,typename T2 + + contents: + + - cdecl: + sym:name: "ret_t" + name: "ret_t" + decl: "" + storage: "typedef" + type: "Element<(S1,T1)>" + sym:symtab: 0xb7cde9f8 + sym:overname: "__SWIG_0" + + - template: + templatetype: "class" + sym:typename: "1" + name: "op_sub_traits" + sym:symtab: 0xb7cd59e8 + symtab: 0xb7cdf048 + allows_typedef: "1" + kind: "struct" + sym:name: "op_sub_traits" + sym:overname: "__SWIG_0" + templateparms: typename S1,typename S2,typename T1,typename T2 + + contents: + + - cdecl: + sym:name: "ret_t" + name: "ret_t" + decl: "" + storage: "typedef" + type: "Element<(S1,T1)>" + sym:symtab: 0xb7cdf048 + sym:overname: "__SWIG_0" + + - template: + templatetype: "class" + sym:typename: "1" + name: "op_mul_traits" + sym:symtab: 0xb7cd59e8 + symtab: 0xb7cdf698 + allows_typedef: "1" + kind: "struct" + sym:name: "op_mul_traits" + sym:overname: "__SWIG_0" + templateparms: typename S1,typename S2,typename T1,typename T2 + + contents: + + - cdecl: + sym:name: "ret_t" + name: "ret_t" + decl: "" + storage: "typedef" + type: "Element<(S1,T1)>" + sym:symtab: 0xb7cdf698 + sym:overname: "__SWIG_0" + + - template: + templatetype: "class" + sym:typename: "1" + name: "op_div_traits" + sym:symtab: 0xb7cd59e8 + symtab: 0xb7cdfce8 + allows_typedef: "1" + kind: "struct" + sym:name: "op_div_traits" + sym:overname: "__SWIG_0" + templateparms: typename S1,typename S2,typename T1,typename T2 + + contents: + + - cdecl: + sym:name: "ret_t" + name: "ret_t" + decl: "" + storage: "typedef" + type: "Element<(S1,T1)>" + sym:symtab: 0xb7cdfce8 + sym:overname: "__SWIG_0" + + - template: + templatetype: "class" + sym:typename: "1" + name: "op_mod_traits" + sym:symtab: 0xb7cd59e8 + symtab: 0xb7ce0338 + allows_typedef: "1" + kind: "struct" + sym:name: "op_mod_traits" + sym:overname: "__SWIG_0" + templateparms: typename S1,typename S2,typename T1,typename T2 + + contents: + + - cdecl: + sym:name: "ret_t" + name: "ret_t" + decl: "" + storage: "typedef" + type: "Element<(S1,T1)>" + sym:symtab: 0xb7ce0338 + sym:overname: "__SWIG_0" + + - include: + name: "vcsn/include/vaucanson/design_pattern/element_ops.hh" + + contents: + + - namespace: + sym:name: "vcsn" + name: "vcsn" + sym:previousSibling: 0xb7cde7b8 + csym:nextSibling: 0xb7ced2a8 + sym:nextSibling: 0xb7ced2a8 + typescope: 0xb7cf9e58 + symtab: 0xb7cd59e8 + sym:symtab: 0xb7cd02e8 + + contents: + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator <" + sym:symtab: 0xb7cd59e8 + sym:name: "operator <" + csym:nextSibling: 0xb7ce22b8 + sym:nextSibling: 0xb7ce22b8 + decl: "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + parms: vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + sym:overloaded: 0xb7ce0ce8 + type: "bool" + sym:overname: "__SWIG_0" + storage: "static" + templateparms: typename S1,typename T1,typename S2,typename T2 + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator >" + sym:symtab: 0xb7cd59e8 + sym:name: "operator >" + csym:nextSibling: 0xb7ce2728 + sym:nextSibling: 0xb7ce2728 + decl: "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + parms: vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + sym:overloaded: 0xb7ce12a8 + type: "bool" + sym:overname: "__SWIG_0" + storage: "static" + templateparms: typename S1,typename T1,typename S2,typename T2 + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator <=" + sym:symtab: 0xb7cd59e8 + sym:name: "operator <=" + csym:nextSibling: 0xb7ce3008 + sym:nextSibling: 0xb7ce3008 + decl: "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + parms: vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + sym:overloaded: 0xb7ce1868 + type: "bool" + sym:overname: "__SWIG_0" + storage: "static" + templateparms: typename S1,typename T1,typename S2,typename T2 + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator >=" + sym:symtab: 0xb7cd59e8 + sym:name: "operator >=" + csym:nextSibling: 0xb7ce2b98 + sym:nextSibling: 0xb7ce2b98 + decl: "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + parms: vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + sym:overloaded: 0xb7ce1e28 + type: "bool" + sym:overname: "__SWIG_0" + storage: "static" + templateparms: typename S1,typename T1,typename S2,typename T2 + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator <" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce0ce8 + sym:name: "operator <" + csym:nextSibling: 0xb7ce3478 + sym:nextSibling: 0xb7ce3478 + decl: "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + sym:overloaded: 0xb7ce0ce8 + parms: vcsn::Element<S,T > const &,U const & + type: "bool" + sym:overname: "__SWIG_1" + storage: "static" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator >" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce12a8 + sym:name: "operator >" + csym:nextSibling: 0xb7ce38e8 + sym:nextSibling: 0xb7ce38e8 + decl: "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + sym:overloaded: 0xb7ce12a8 + parms: vcsn::Element<S,T > const &,U const & + type: "bool" + sym:overname: "__SWIG_1" + storage: "static" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator >=" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce1e28 + sym:name: "operator >=" + csym:nextSibling: 0xb7ce3d58 + sym:nextSibling: 0xb7ce3d58 + decl: "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + sym:overloaded: 0xb7ce1e28 + parms: vcsn::Element<S,T > const &,U const & + type: "bool" + sym:overname: "__SWIG_1" + storage: "static" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator <=" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce1868 + sym:name: "operator <=" + csym:nextSibling: 0xb7ce41c8 + sym:nextSibling: 0xb7ce41c8 + decl: "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + sym:overloaded: 0xb7ce1868 + parms: vcsn::Element<S,T > const &,U const & + type: "bool" + sym:overname: "__SWIG_1" + storage: "static" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator <" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce22b8 + sym:name: "operator <" + decl: "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + sym:overloaded: 0xb7ce0ce8 + parms: U const &,vcsn::Element<S,T > const & + type: "bool" + sym:overname: "__SWIG_2" + storage: "static" + templateparms: typename U,typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator >" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce2728 + sym:name: "operator >" + decl: "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + sym:overloaded: 0xb7ce12a8 + parms: U const &,vcsn::Element<S,T > const & + type: "bool" + sym:overname: "__SWIG_2" + storage: "static" + templateparms: typename U,typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator >=" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce2b98 + sym:name: "operator >=" + decl: "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + sym:overloaded: 0xb7ce1e28 + parms: U const &,vcsn::Element<S,T > const & + type: "bool" + sym:overname: "__SWIG_2" + storage: "static" + templateparms: typename U,typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator <=" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce3008 + sym:name: "operator <=" + decl: "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + sym:overloaded: 0xb7ce1868 + parms: U const &,vcsn::Element<S,T > const & + type: "bool" + sym:overname: "__SWIG_2" + storage: "static" + templateparms: typename U,typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator ==" + sym:symtab: 0xb7cd59e8 + sym:name: "operator ==" + csym:nextSibling: 0xb7ce4bf8 + sym:nextSibling: 0xb7ce4bf8 + decl: "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + parms: vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + sym:overloaded: 0xb7ce4768 + type: "bool" + sym:overname: "__SWIG_0" + storage: "static" + templateparms: typename S1,typename T1,typename S2,typename T2 + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator ==" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce4768 + sym:name: "operator ==" + csym:nextSibling: 0xb7ce5068 + sym:nextSibling: 0xb7ce5068 + decl: "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + sym:overloaded: 0xb7ce4768 + parms: vcsn::Element<S,T > const &,U const & + type: "bool" + sym:overname: "__SWIG_1" + storage: "static" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator ==" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce4bf8 + sym:name: "operator ==" + decl: "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + sym:overloaded: 0xb7ce4768 + parms: U const &,vcsn::Element<S,T > const & + type: "bool" + sym:overname: "__SWIG_2" + storage: "static" + templateparms: typename U,typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator !=" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7cd9f48 + sym:name: "operator !=" + csym:nextSibling: 0xb7ce5a98 + sym:nextSibling: 0xb7ce5a98 + decl: "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + sym:overloaded: 0xb7cd9f48 + parms: vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + type: "bool" + sym:overname: "__SWIG_1" + storage: "static" + templateparms: typename S1,typename T1,typename S2,typename T2 + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator !=" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce5608 + sym:name: "operator !=" + csym:nextSibling: 0xb7ce5f08 + sym:nextSibling: 0xb7ce5f08 + decl: "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + sym:overloaded: 0xb7cd9f48 + parms: vcsn::Element<S,T > const &,U const & + type: "bool" + sym:overname: "__SWIG_2" + storage: "static" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator !=" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce5a98 + sym:name: "operator !=" + decl: "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + sym:overloaded: 0xb7cd9f48 + parms: U const &,vcsn::Element<S,T > const & + type: "bool" + sym:overname: "__SWIG_3" + storage: "static" + templateparms: typename U,typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator +" + sym:symtab: 0xb7cd59e8 + sym:name: "operator +" + csym:nextSibling: 0xb7ce6b98 + sym:nextSibling: 0xb7ce6b98 + decl: "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + parms: vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + sym:overloaded: 0xb7ce6638 + type: "vcsn::op_add_traits<(S1,S2,T1,T2)>::ret_t" + sym:overname: "__SWIG_0" + storage: "static" + templateparms: typename S1,typename T1,typename S2,typename T2 + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator +" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce6638 + sym:name: "operator +" + csym:nextSibling: 0xb7ce70d8 + sym:nextSibling: 0xb7ce70d8 + decl: "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + sym:overloaded: 0xb7ce6638 + parms: vcsn::Element<S,T > const &,U const & + type: "vcsn::Element<(S,T)>" + sym:overname: "__SWIG_1" + storage: "static" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator +" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce6b98 + sym:name: "operator +" + decl: "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + sym:overloaded: 0xb7ce6638 + parms: U const &,vcsn::Element<S,T > const & + type: "vcsn::Element<(S,T)>" + sym:overname: "__SWIG_2" + storage: "static" + templateparms: typename U,typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator -" + sym:symtab: 0xb7cd59e8 + sym:name: "operator -" + csym:nextSibling: 0xb7ce7d68 + sym:nextSibling: 0xb7ce7d68 + decl: "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + parms: vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + sym:overloaded: 0xb7ce7808 + type: "vcsn::op_sub_traits<(S1,S2,T1,T2)>::ret_t" + sym:overname: "__SWIG_0" + storage: "static" + templateparms: typename S1,typename T1,typename S2,typename T2 + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator -" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce7808 + sym:name: "operator -" + csym:nextSibling: 0xb7ce82a8 + sym:nextSibling: 0xb7ce82a8 + decl: "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + sym:overloaded: 0xb7ce7808 + parms: vcsn::Element<S,T > const &,U const & + type: "vcsn::Element<(S,T)>" + sym:overname: "__SWIG_1" + storage: "static" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator -" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce7d68 + sym:name: "operator -" + csym:nextSibling: 0xb7cebc18 + sym:nextSibling: 0xb7cebc18 + decl: "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + sym:overloaded: 0xb7ce7808 + parms: U const &,vcsn::Element<S,T > const & + type: "vcsn::Element<(S,T)>" + sym:overname: "__SWIG_2" + storage: "static" + templateparms: typename U,typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator *" + sym:symtab: 0xb7cd59e8 + sym:name: "operator *" + csym:nextSibling: 0xb7ce8f38 + sym:nextSibling: 0xb7ce8f38 + decl: "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + parms: vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + sym:overloaded: 0xb7ce89d8 + type: "vcsn::op_mul_traits<(S1,S2,T1,T2)>::ret_t" + sym:overname: "__SWIG_0" + storage: "static" + templateparms: typename S1,typename T1,typename S2,typename T2 + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator *" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce89d8 + sym:name: "operator *" + csym:nextSibling: 0xb7ce9478 + sym:nextSibling: 0xb7ce9478 + decl: "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + sym:overloaded: 0xb7ce89d8 + parms: vcsn::Element<S,T > const &,U const & + type: "vcsn::Element<(S,T)>" + sym:overname: "__SWIG_1" + storage: "static" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator *" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce8f38 + sym:name: "operator *" + decl: "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + sym:overloaded: 0xb7ce89d8 + parms: U const &,vcsn::Element<S,T > const & + type: "vcsn::Element<(S,T)>" + sym:overname: "__SWIG_2" + storage: "static" + templateparms: typename U,typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator /" + sym:symtab: 0xb7cd59e8 + sym:name: "operator /" + csym:nextSibling: 0xb7cea108 + sym:nextSibling: 0xb7cea108 + decl: "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + parms: vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + sym:overloaded: 0xb7ce9ba8 + type: "vcsn::op_div_traits<(S1,S2,T1,T2)>::ret_t" + sym:overname: "__SWIG_0" + storage: "static" + templateparms: typename S1,typename T1,typename S2,typename T2 + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator /" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce9ba8 + sym:name: "operator /" + csym:nextSibling: 0xb7cea648 + sym:nextSibling: 0xb7cea648 + decl: "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + sym:overloaded: 0xb7ce9ba8 + parms: vcsn::Element<S,T > const &,U const & + type: "vcsn::Element<(S,T)>" + sym:overname: "__SWIG_1" + storage: "static" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator /" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7cea108 + sym:name: "operator /" + decl: "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + sym:overloaded: 0xb7ce9ba8 + parms: U const &,vcsn::Element<S,T > const & + type: "vcsn::Element<(S,T)>" + sym:overname: "__SWIG_2" + storage: "static" + templateparms: typename U,typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator %" + sym:symtab: 0xb7cd59e8 + sym:name: "operator %" + csym:nextSibling: 0xb7ceb2d8 + sym:nextSibling: 0xb7ceb2d8 + decl: "f(r.q(const).vcsn::Element<(S1,T1)>,r.q(const).vcsn::Element<(S2,T2)>)." + parms: vcsn::Element<S1,T1 > const &,vcsn::Element<S2,T2 > const & + sym:overloaded: 0xb7cead78 + type: "vcsn::op_mod_traits<(S1,S2,T1,T2)>::ret_t" + sym:overname: "__SWIG_0" + storage: "static" + templateparms: typename S1,typename T1,typename S2,typename T2 + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator %" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7cead78 + sym:name: "operator %" + csym:nextSibling: 0xb7ceb818 + sym:nextSibling: 0xb7ceb818 + decl: "f(r.q(const).vcsn::Element<(S,T)>,r.q(const).U)." + sym:overloaded: 0xb7cead78 + parms: vcsn::Element<S,T > const &,U const & + type: "vcsn::Element<(S,T)>" + sym:overname: "__SWIG_1" + storage: "static" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator %" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ceb2d8 + sym:name: "operator %" + decl: "f(r.q(const).U,r.q(const).vcsn::Element<(S,T)>)." + sym:overloaded: 0xb7cead78 + parms: U const &,vcsn::Element<S,T > const & + type: "vcsn::Element<(S,T)>" + sym:overname: "__SWIG_2" + storage: "static" + templateparms: typename U,typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator -" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ce82a8 + sym:name: "operator -" + decl: "f(r.q(const).vcsn::Element<(S,T)>)." + sym:overloaded: 0xb7ce7808 + parms: vcsn::Element<S,T > const & + type: "vcsn::Element<(S,T)>" + sym:overname: "__SWIG_3" + storage: "static" + templateparms: typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator <<" + sym:symtab: 0xb7cd59e8 + sym:name: "operator <<" + decl: "f(r.St,r.q(const).vcsn::Element<(S,T)>).r." + parms: St &,vcsn::Element<S,T > const & + type: "St" + sym:overname: "__SWIG_0" + storage: "static" + templateparms: typename St,typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator >>" + sym:symtab: 0xb7cd59e8 + sym:name: "operator >>" + decl: "f(r.St,r.q(const).vcsn::Element<(S,T)>).r." + parms: St &,vcsn::Element<S,T > const & + type: "St" + sym:overname: "__SWIG_0" + storage: "static" + templateparms: typename St,typename S,typename T + + - namespace: + sym:name: "std" + name: "std" + sym:previousSibling: 0xb7cd4398 + typescope: 0xb7cf9d38 + symtab: 0xb7cd4338 + sym:symtab: 0xb7cd02e8 + + contents: + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "swap" + sym:symtab: 0xb7cd4338 + sym:nextSibling: 0xb7cece18 + csym:nextSibling: 0xb7cece18 + sym:name: "swap" + decl: "f(r.vcsn::Element<(S,T1)>,r.vcsn::Element<(S,T2)>)." + parms: vcsn::Element<S,T1 > &,vcsn::Element<S,T2 > & + sym:overloaded: 0xb7ceca48 + type: "void" + sym:overname: "__SWIG_0" + templateparms: typename S,typename T1,typename T2 + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "swap" + sym:symtab: 0xb7cd4338 + sym:previousSibling: 0xb7ceca48 + sym:name: "swap" + csym:nextSibling: 0xb7ced1c8 + sym:nextSibling: 0xb7ced1c8 + decl: "f(r.vcsn::Element<(S,T)>,r.T)." + sym:overloaded: 0xb7ceca48 + parms: vcsn::Element<S,T > &,T & + type: "void" + sym:overname: "__SWIG_1" + templateparms: typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "swap" + sym:symtab: 0xb7cd4338 + sym:previousSibling: 0xb7cece18 + sym:name: "swap" + decl: "f(r.T,r.vcsn::Element<(S,T)>)." + sym:overloaded: 0xb7ceca48 + parms: T &,vcsn::Element<S,T > & + type: "void" + sym:overname: "__SWIG_2" + templateparms: typename T,typename S + + - include: + name: "vcsn/include/vaucanson/design_pattern/default_ops.hh" + + contents: + + - namespace: + sym:name: "vcsn" + name: "vcsn" + sym:previousSibling: 0xb7ce0778 + csym:nextSibling: 0xb7cf4b78 + sym:nextSibling: 0xb7cf4b78 + typescope: 0xb7cf9e58 + symtab: 0xb7cd59e8 + sym:symtab: 0xb7cd02e8 + + contents: + + - template: + templatetype: "cdecl" + sym:name: "op_contains" + name: "op_contains" + decl: "f(r.q(const).Structure<(S)>,r.q(const).T)." + parms: Structure<S > const &,T const & + sym:typename: "1" + type: "bool" + templateparms: typename S,typename T + sym:symtab: 0xb7cd59e8 + sym:overname: "__SWIG_0" + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_eq" + sym:symtab: 0xb7cd59e8 + csym:nextSibling: 0xb7cedfd8 + sym:name: "op_eq" + sym:nextSibling: 0xb7cedfd8 + decl: "f(r.q(const).Structure<(S)>,r.q(const).T,r.q(const).U)." + parms: Structure<S > const &,T const &,U const & + sym:overloaded: 0xb7ceda28 + type: "bool" + sym:overname: "__SWIG_0" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_eq" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ceda28 + sym:name: "op_eq" + decl: "f(r.q(const).Structure<(S)>,r.q(const).Structure<(V)>,r.q(const).T,r.q(const).U)." + sym:overloaded: 0xb7ceda28 + parms: Structure<S > const &,Structure<V > const &,T const &,U const & + type: "bool" + sym:overname: "__SWIG_1" + templateparms: typename S,typename V,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_lt" + sym:symtab: 0xb7cd59e8 + csym:nextSibling: 0xb7ceea18 + sym:name: "op_lt" + sym:nextSibling: 0xb7ceea18 + decl: "f(r.q(const).Structure<(S)>,r.q(const).T,r.q(const).U)." + parms: Structure<S > const &,T const &,U const & + sym:overloaded: 0xb7cee468 + type: "bool" + sym:overname: "__SWIG_0" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_lt" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7cee468 + sym:name: "op_lt" + decl: "f(r.q(const).Structure<(S)>,r.q(const).Structure<(V)>,r.q(const).T,r.q(const).U)." + sym:overloaded: 0xb7cee468 + parms: Structure<S > const &,Structure<V > const &,T const &,U const & + type: "bool" + sym:overname: "__SWIG_1" + templateparms: typename S,typename V,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_convert" + sym:symtab: 0xb7cd59e8 + csym:nextSibling: 0xb7cef2c8 + sym:name: "op_convert" + sym:nextSibling: 0xb7cef2c8 + decl: "f(r.q(const).Structure<(S)>,r.q(const).R,r.q(const).T)." + parms: Structure<S > const &,R const &,T const & + sym:overloaded: 0xb7ceeeb8 + type: "R" + sym:overname: "__SWIG_0" + templateparms: typename S,typename R,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_convert" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7ceeeb8 + sym:name: "op_convert" + csym:nextSibling: 0xb7cef7c8 + sym:nextSibling: 0xb7cef7c8 + decl: "f(r.q(const).Structure<(S)>,r.q(const).T,r.q(const).T).r." + sym:overloaded: 0xb7ceeeb8 + parms: Structure<S > const &,T const &,T const & + type: "q(const).T" + sym:overname: "__SWIG_1" + templateparms: typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_convert" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7cef2c8 + sym:name: "op_convert" + decl: "f(r.q(const).Structure<(S)>,r.q(const).T,r.q(const).Structure<(S)>,r.q(const).T).r." + sym:overloaded: 0xb7ceeeb8 + parms: Structure<S > const &,T const &,Structure<S > const &,T const & + type: "q(const).T" + sym:overname: "__SWIG_2" + templateparms: typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_default" + sym:symtab: 0xb7cd59e8 + sym:name: "op_default" + decl: "f(r.q(const).Structure<(S)>,r.q(const).T)." + parms: Structure<S > const &,T const & + type: "T" + sym:overname: "__SWIG_0" + templateparms: typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_swap" + sym:symtab: 0xb7cd59e8 + sym:name: "op_swap" + decl: "f(r.q(const).Structure<(S)>,r.T,r.T)." + parms: Structure<S > const &,T &,T & + type: "void" + sym:overname: "__SWIG_0" + templateparms: typename S,typename T + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_assign" + sym:symtab: 0xb7cd59e8 + csym:nextSibling: 0xb7cf0918 + sym:name: "op_assign" + sym:nextSibling: 0xb7cf0918 + decl: "f(r.q(const).Structure<(S)>,r.T,r.q(const).U)." + parms: Structure<S > const &,T &,U const & + sym:overloaded: 0xb7cf0388 + type: "void" + sym:overname: "__SWIG_0" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_assign" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7cf0388 + sym:name: "op_assign" + decl: "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.T,r.q(const).U)." + sym:overloaded: 0xb7cf0388 + parms: Structure<S > const &,Structure<S > const &,T &,U const & + type: "void" + sym:overname: "__SWIG_1" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_in_add" + sym:symtab: 0xb7cd59e8 + sym:name: "op_in_add" + decl: "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.T,r.q(const).U)." + parms: Structure<S > const &,Structure<S > const &,T &,U const & + type: "void" + sym:overname: "__SWIG_0" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_in_sub" + sym:symtab: 0xb7cd59e8 + sym:name: "op_in_sub" + decl: "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.T,r.q(const).U)." + parms: Structure<S > const &,Structure<S > const &,T &,U const & + type: "void" + sym:overname: "__SWIG_0" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_in_mul" + sym:symtab: 0xb7cd59e8 + sym:name: "op_in_mul" + decl: "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.T,r.q(const).U)." + parms: Structure<S > const &,Structure<S > const &,T &,U const & + type: "void" + sym:overname: "__SWIG_0" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_in_div" + sym:symtab: 0xb7cd59e8 + sym:name: "op_in_div" + decl: "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.T,r.q(const).U)." + parms: Structure<S > const &,Structure<S > const &,T &,U const & + type: "void" + sym:overname: "__SWIG_0" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_in_mod" + sym:symtab: 0xb7cd59e8 + sym:name: "op_in_mod" + decl: "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.T,r.q(const).U)." + parms: Structure<S > const &,Structure<S > const &,T &,U const & + type: "void" + sym:overname: "__SWIG_0" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_add" + sym:symtab: 0xb7cd59e8 + sym:name: "op_add" + decl: "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.q(const).T,r.q(const).U)." + parms: Structure<S > const &,Structure<S > const &,T const &,U const & + type: "T" + sym:overname: "__SWIG_0" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_sub" + sym:symtab: 0xb7cd59e8 + sym:name: "op_sub" + decl: "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.q(const).T,r.q(const).U)." + parms: Structure<S > const &,Structure<S > const &,T const &,U const & + type: "T" + sym:overname: "__SWIG_0" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_mul" + sym:symtab: 0xb7cd59e8 + sym:name: "op_mul" + decl: "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.q(const).T,r.q(const).U)." + parms: Structure<S > const &,Structure<S > const &,T const &,U const & + type: "T" + sym:overname: "__SWIG_0" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_div" + sym:symtab: 0xb7cd59e8 + sym:name: "op_div" + decl: "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.q(const).T,r.q(const).U)." + parms: Structure<S > const &,Structure<S > const &,T const &,U const & + type: "T" + sym:overname: "__SWIG_0" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_mod" + sym:symtab: 0xb7cd59e8 + sym:name: "op_mod" + decl: "f(r.q(const).Structure<(S)>,r.q(const).Structure<(S)>,r.q(const).T,r.q(const).U)." + parms: Structure<S > const &,Structure<S > const &,T const &,U const & + type: "T" + sym:overname: "__SWIG_0" + templateparms: typename S,typename T,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "op_rin" + sym:symtab: 0xb7cd59e8 + sym:name: "op_rin" + decl: "f(r.q(const).Structure<(S)>,r.St,r.q(const).T).r." + parms: Structure<S > const &,St &,T const & + type: "St" + sym:overname: "__SWIG_0" + templateparms: typename S,typename St,typename T + + - template: + templatetype: "cdecl" + sym:name: "op_rout" + name: "op_rout" + decl: "f(r.q(const).Structure<(S)>,r.St,r.q(const).T).r." + parms: Structure<S > const &,St &,T const & + sym:typename: "1" + type: "St" + templateparms: typename S,typename St,typename T + sym:symtab: 0xb7cd59e8 + sym:overname: "__SWIG_0" + + - include: + name: "vcsn/include/vaucanson/design_pattern/slots.hh" + + contents: + + - namespace: + sym:name: "vcsn" + name: "vcsn" + sym:previousSibling: 0xb7ced2a8 + csym:nextSibling: 0xb7cf6a18 + sym:nextSibling: 0xb7cf6a18 + typescope: 0xb7cf9e58 + symtab: 0xb7cd59e8 + sym:symtab: 0xb7cd02e8 + + contents: + + - template: + templatetype: "class" + sym:typename: "1" + name: "SetSlotAttribute" + sym:symtab: 0xb7cd59e8 + symtab: 0xb7cf4d38 + allows_typedef: "1" + kind: "struct" + sym:name: "SetSlotAttribute" + partials: 0xb7cf6128 + sym:overname: "__SWIG_0" + templateparms: typename S,bool + + contents: + + - constructor: + sym:name: "SetSlotAttribute" + name: "SetSlotAttribute" + decl: "f()." + feature:new: "1" + sym:overloaded: 0xb7cf4e28 + csym:nextSibling: 0xb7cf4f48 + sym:nextSibling: 0xb7cf4f48 + sym:symtab: 0xb7cf4d38 + sym:overname: "__SWIG_0" + + - constructor: + name: "SetSlotAttribute" + sym:symtab: 0xb7cf4d38 + sym:nextSibling: 0xb7cf5068 + csym:nextSibling: 0xb7cf5068 + sym:previousSibling: 0xb7cf4e28 + sym:name: "SetSlotAttribute" + decl: "f(r.q(const).SetSlotAttribute)." + sym:overloaded: 0xb7cf4e28 + parms: SetSlotAttribute const & + sym:overname: "__SWIG_1" + feature:new: "1" + + - constructor: + sym:name: "SetSlotAttribute" + name: "SetSlotAttribute" + parms: S const & + decl: "f(r.q(const).S)." + feature:new: "1" + sym:overloaded: 0xb7cf4e28 + sym:previousSibling: 0xb7cf4f48 + sym:symtab: 0xb7cf4d38 + sym:overname: "__SWIG_2" + + - cdecl: + sym:name: "_structure_get" + name: "_structure_get" + decl: "q(const).f().r." + type: "q(const).S" + sym:symtab: 0xb7cf4d38 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "_structure_assign" + name: "_structure_assign" + decl: "f(r.q(const).SetSlotAttribute)." + parms: SetSlotAttribute const & + type: "void" + sym:symtab: 0xb7cf4d38 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "_structure_attach" + name: "_structure_attach" + decl: "f(r.q(const).S)." + parms: S const & + type: "void" + sym:symtab: 0xb7cf4d38 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "_structure_bound" + name: "_structure_bound" + decl: "q(const).f()." + type: "bool" + sym:symtab: 0xb7cf4d38 + sym:overname: "__SWIG_0" + + - template: + templatetype: "class" + sym:typename: "1" + name: "SetSlotAttribute<(S,true)>" + sym:symtab: 0xb7cd59e8 + symtab: 0xb7cf56f8 + allows_typedef: "1" + kind: "struct" + sym:name: "SetSlotAttribute<(S,true)>" + partialargs: "SetSlotAttribute<($1,true)>" + sym:overname: "__SWIG_0" + templateparms: typename S,true + partialspecialization: "1" + + contents: + + - constructor: + sym:name: "SetSlotAttribute" + name: "SetSlotAttribute" + decl: "f()." + feature:new: "1" + sym:overloaded: 0xb7cf57b8 + csym:nextSibling: 0xb7cf58d8 + sym:nextSibling: 0xb7cf58d8 + sym:symtab: 0xb7cf56f8 + sym:overname: "__SWIG_0" + + - constructor: + name: "SetSlotAttribute" + sym:symtab: 0xb7cf56f8 + sym:nextSibling: 0xb7cf59f8 + csym:nextSibling: 0xb7cf59f8 + sym:previousSibling: 0xb7cf57b8 + sym:name: "SetSlotAttribute" + decl: "f(r.q(const).SetSlotAttribute)." + sym:overloaded: 0xb7cf57b8 + parms: SetSlotAttribute const & + sym:overname: "__SWIG_1" + feature:new: "1" + + - constructor: + sym:name: "SetSlotAttribute" + name: "SetSlotAttribute" + parms: S const & + decl: "f(r.q(const).S)." + feature:new: "1" + sym:overloaded: 0xb7cf57b8 + sym:previousSibling: 0xb7cf58d8 + sym:symtab: 0xb7cf56f8 + sym:overname: "__SWIG_2" + + - cdecl: + sym:name: "_structure_get" + name: "_structure_get" + decl: "q(const).f().r." + type: "q(const).S" + sym:symtab: 0xb7cf56f8 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "_structure_assign" + name: "_structure_assign" + decl: "f(r.q(const).SetSlotAttribute)." + parms: SetSlotAttribute const & + type: "void" + sym:symtab: 0xb7cf56f8 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "_structure_attach" + name: "_structure_attach" + decl: "f(r.q(const).S)." + parms: S const & + type: "void" + sym:symtab: 0xb7cf56f8 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "_structure_bound" + name: "_structure_bound" + decl: "q(const).f()." + type: "bool" + sym:symtab: 0xb7cf56f8 + sym:overname: "__SWIG_0" + + - access: + kind: "protected" + + - cdecl: + name: "s_" + decl: "p." + access: "protected" + type: "q(const).S" + sym:symtab: 0xb7cf56f8 + + - access: + kind: "public" + + - template: + templatetype: "class" + sym:typename: "1" + name: "SetSlot" + sym:symtab: 0xb7cd59e8 + symtab: 0xb7cf64a8 + allows_typedef: "1" + kind: "struct" + sym:name: "SetSlot" + privatebaselist: 0xb7cf63d8 + protectedbaselist: 0xb7cf63c8 + baselist: 0xb7cf63b8 + sym:overname: "__SWIG_0" + templateparms: typename S,typename Tag + + contents: + + - cdecl: + sym:name: "tag_type" + name: "tag_type" + decl: "" + storage: "typedef" + type: "Tag" + sym:symtab: 0xb7cf64a8 + sym:overname: "__SWIG_0" + + - constructor: + sym:name: "SetSlot" + name: "SetSlot" + decl: "f()." + feature:new: "1" + sym:overloaded: 0xb7cf6648 + csym:nextSibling: 0xb7cf6768 + sym:nextSibling: 0xb7cf6768 + sym:symtab: 0xb7cf64a8 + sym:overname: "__SWIG_0" + + - constructor: + name: "SetSlot" + sym:symtab: 0xb7cf64a8 + sym:nextSibling: 0xb7cf6888 + csym:nextSibling: 0xb7cf6888 + sym:previousSibling: 0xb7cf6648 + sym:name: "SetSlot" + decl: "f(r.q(const).SetSlot)." + sym:overloaded: 0xb7cf6648 + parms: SetSlot const & + sym:overname: "__SWIG_1" + feature:new: "1" + + - constructor: + sym:name: "SetSlot" + name: "SetSlot" + parms: S const & + decl: "f(r.q(const).S)." + feature:new: "1" + sym:overloaded: 0xb7cf6648 + sym:previousSibling: 0xb7cf6768 + sym:symtab: 0xb7cf64a8 + sym:overname: "__SWIG_2" + + - include: + name: "vcsn/include/vaucanson/design_pattern/element.hh" + + contents: + + - namespace: + sym:name: "vcsn" + name: "vcsn" + sym:previousSibling: 0xb7cf4b78 + csym:nextSibling: 0xb7cf9498 + sym:nextSibling: 0xb7cf9498 + typescope: 0xb7cf9e58 + symtab: 0xb7cd59e8 + sym:symtab: 0xb7cd02e8 + + contents: + + - template: + templatetype: "class" + sym:typename: "1" + name: "Element" + sym:symtab: 0xb7cd59e8 + symtab: 0xb7cf6de8 + allows_typedef: "1" + kind: "class" + sym:name: "Element" + privatebaselist: 0xb7cf6cb8 + protectedbaselist: 0xb7cf6ca8 + baselist: 0xb7cf6c98 + sym:overname: "__SWIG_0" + templateparms: typename S,typename T + + contents: + + - access: + kind: "public" + + - cdecl: + sym:name: "set_t" + name: "set_t" + decl: "" + storage: "typedef" + type: "S" + sym:symtab: 0xb7cf6de8 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "value_t" + name: "value_t" + decl: "" + storage: "typedef" + type: "T" + sym:symtab: 0xb7cf6de8 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "dynamic" + name: "dynamic" + decl: "" + storage: "static" + value: "dynamic_traits<(S)>::ret||MetaElement<(S,T)>::dynamic_value" + type: "q(const).bool" + sym:symtab: 0xb7cf6de8 + sym:overname: "__SWIG_0" + + - constructor: + sym:name: "Element" + name: "Element" + decl: "f()." + feature:new: "1" + sym:overloaded: 0xb7cf72a8 + csym:nextSibling: 0xb7cf73c8 + sym:nextSibling: 0xb7cf73c8 + sym:symtab: 0xb7cf6de8 + sym:overname: "__SWIG_0" + + - constructor: + name: "Element" + sym:symtab: 0xb7cf6de8 + csym:nextSibling: 0xb7cf78f8 + sym:nextSibling: 0xb7cf7608 + sym:previousSibling: 0xb7cf72a8 + sym:name: "Element" + decl: "f(r.q(const).Element)." + sym:overloaded: 0xb7cf72a8 + parms: Element const & + sym:overname: "__SWIG_1" + feature:new: "1" + + - template: + templatetype: "constructor" + sym:typename: "1" + name: "Element" + sym:symtab: 0xb7cf6de8 + sym:previousSibling: 0xb7cf73c8 + csym:nextSibling: 0xb7cf72a8 + sym:name: "Element" + sym:nextSibling: 0xb7cf78f8 + decl: "f(r.q(const).Element<(S,U)>)." + sym:overloaded: 0xb7cf72a8 + parms: Element<S,U > const & + sym:overname: "__SWIG_2" + templateparms: typename U + feature:new: "1" + + - template: + templatetype: "constructor" + sym:typename: "1" + name: "Element" + sym:symtab: 0xb7cf6de8 + csym:nextSibling: 0xb7cf7a78 + sym:previousSibling: 0xb7cf7608 + sym:name: "Element" + sym:nextSibling: 0xb7cf7a78 + decl: "f(r.q(const).Element<(OtherS,U)>)." + sym:overloaded: 0xb7cf72a8 + parms: Element<OtherS,U > const & + sym:overname: "__SWIG_3" + templateparms: typename OtherS,typename U + feature:new: "1" + + - constructor: + name: "Element" + sym:symtab: 0xb7cf6de8 + sym:nextSibling: 0xb7cf7c08 + csym:nextSibling: 0xb7cf7c08 + sym:previousSibling: 0xb7cf78f8 + sym:name: "Element" + decl: "f(r.q(const).T)." + sym:overloaded: 0xb7cf72a8 + parms: T const & + sym:overname: "__SWIG_4" + feature:new: "1" + + - template: + templatetype: "constructor" + sym:typename: "1" + name: "Element" + sym:symtab: 0xb7cf6de8 + csym:nextSibling: 0xb7cf7d68 + sym:previousSibling: 0xb7cf7a78 + sym:name: "Element" + sym:nextSibling: 0xb7cf7d68 + decl: "f(r.q(const).U)." + sym:overloaded: 0xb7cf72a8 + parms: U const & + sym:overname: "__SWIG_5" + templateparms: typename U + feature:new: "1" + + - constructor: + name: "Element" + sym:symtab: 0xb7cf6de8 + sym:nextSibling: 0xb7cf7f28 + csym:nextSibling: 0xb7cf7f28 + sym:previousSibling: 0xb7cf7c08 + sym:name: "Element" + decl: "f(r.q(const).S)." + sym:overloaded: 0xb7cf72a8 + parms: S const & + sym:overname: "__SWIG_6" + feature:new: "1" + + - constructor: + name: "Element" + sym:symtab: 0xb7cf6de8 + sym:nextSibling: 0xb7cf8158 + csym:nextSibling: 0xb7cf8158 + sym:previousSibling: 0xb7cf7d68 + sym:name: "Element" + decl: "f(r.q(const).S,r.q(const).T)." + sym:overloaded: 0xb7cf72a8 + parms: S const &,T const & + sym:overname: "__SWIG_7" + feature:new: "1" + + - template: + templatetype: "constructor" + sym:typename: "1" + name: "Element" + sym:symtab: 0xb7cf6de8 + csym:nextSibling: 0xb7cf84e8 + sym:previousSibling: 0xb7cf7f28 + sym:name: "Element" + sym:nextSibling: 0xb7cf84e8 + decl: "f(r.q(const).S,r.q(const).U)." + sym:overloaded: 0xb7cf72a8 + parms: S const &,U const & + sym:overname: "__SWIG_8" + templateparms: typename U + feature:new: "1" + + - template: + templatetype: "constructor" + sym:typename: "1" + name: "Element" + sym:symtab: 0xb7cf6de8 + sym:previousSibling: 0xb7cf8158 + sym:name: "Element" + decl: "f(r.q(const).S,r.q(const).Element<(OtherS,U)>)." + sym:overloaded: 0xb7cf72a8 + parms: S const &,Element<OtherS,U > const & + sym:overname: "__SWIG_9" + templateparms: typename OtherS,typename U + feature:new: "1" + + - cdecl: + sym:name: "operator =" + name: "operator =" + decl: "f(r.q(const).Element).r." + parms: Element const & + sym:overloaded: 0xb7cf8678 + type: "Element" + sym:nextSibling: 0xb7cf88d8 + csym:nextSibling: 0xb7cf8be8 + sym:symtab: 0xb7cf6de8 + sym:overname: "__SWIG_0" + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator =" + sym:symtab: 0xb7cf6de8 + sym:previousSibling: 0xb7cf8678 + csym:nextSibling: 0xb7cf8678 + sym:name: "operator =" + sym:nextSibling: 0xb7cf8be8 + decl: "f(r.q(const).Element<(S,U)>).r." + sym:overloaded: 0xb7cf8678 + parms: Element<S,U > const & + type: "Element" + sym:overname: "__SWIG_1" + templateparms: typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator =" + sym:symtab: 0xb7cf6de8 + csym:nextSibling: 0xb7cf8df8 + sym:previousSibling: 0xb7cf88d8 + sym:name: "operator =" + sym:nextSibling: 0xb7cf8df8 + decl: "f(r.q(const).Element<(OtherS,U)>).r." + sym:overloaded: 0xb7cf8678 + parms: Element<OtherS,U > const & + type: "Element" + sym:overname: "__SWIG_2" + templateparms: typename OtherS,typename U + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "operator =" + sym:symtab: 0xb7cf6de8 + sym:previousSibling: 0xb7cf8be8 + sym:name: "operator =" + decl: "f(r.q(const).U).r." + sym:overloaded: 0xb7cf8678 + parms: U const & + type: "Element" + sym:overname: "__SWIG_3" + templateparms: typename U + + - cdecl: + sym:name: "structure" + name: "structure" + decl: "q(const).f().r." + type: "q(const).S" + sym:symtab: 0xb7cf6de8 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "attach" + name: "attach" + decl: "f(r.q(const).S)." + parms: S const & + type: "void" + sym:symtab: 0xb7cf6de8 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "value" + name: "value" + decl: "f().r." + sym:overloaded: 0xb7cf90c8 + type: "T" + csym:nextSibling: 0xb7cf9198 + sym:nextSibling: 0xb7cf9198 + sym:symtab: 0xb7cf6de8 + sym:overname: "__SWIG_0" + + - cdecl: + sym:name: "value" + name: "value" + decl: "q(const).f().r." + sym:overloaded: 0xb7cf90c8 + type: "q(const).T" + sym:previousSibling: 0xb7cf90c8 + sym:symtab: 0xb7cf6de8 + sym:overname: "__SWIG_1" + + - access: + kind: "private" + + - cdecl: + name: "value_" + decl: "" + access: "private" + type: "T" + sym:symtab: 0xb7cf6de8 + + - access: + kind: "public" + + - include: + name: "vcsn/include/vaucanson/design_pattern/design_pattern.hh" + + - include: + name: "vcsn/include/vaucanson/algorithms/standard_of.hh" + + contents: + + - namespace: + sym:name: "vcsn" + name: "vcsn" + sym:previousSibling: 0xb7cf6a18 + typescope: 0xb7cf9e58 + symtab: 0xb7cd59e8 + sym:symtab: 0xb7cd02e8 + + contents: + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "standard_of" + sym:symtab: 0xb7cd59e8 + sym:nextSibling: 0xb7cf9c28 + csym:nextSibling: 0xb7cf9c28 + sym:name: "standard_of" + decl: "f(r.Element<(A,T)>,r.q(const).Exp)." + parms: Element<A,T > &,Exp const & + sym:overloaded: 0xb7cf9868 + type: "void" + sym:overname: "__SWIG_0" + templateparms: typename A,typename T,typename Exp + + - template: + templatetype: "cdecl" + sym:typename: "1" + name: "standard_of" + sym:symtab: 0xb7cd59e8 + sym:previousSibling: 0xb7cf9868 + sym:name: "standard_of" + decl: "f(r.q(const).Exp)." + sym:overloaded: 0xb7cf9868 + parms: Exp const & + type: "Element<(A,T)>" + sym:overname: "__SWIG_1" + templateparms: typename A,typename T,typename Exp + + - module: + name: "vcsn" diff --git a/dynamic-use-of-static-c++/test/fixtures/vaucanson/dyn_vaucanson_dyn_mirror.hh b/dynamic-use-of-static-c++/test/fixtures/vaucanson/dyn_vaucanson_dyn_mirror.hh new file mode 100644 index 0000000..b04ee79 --- /dev/null +++ b/dynamic-use-of-static-c++/test/fixtures/vaucanson/dyn_vaucanson_dyn_mirror.hh @@ -0,0 +1,887 @@ +namespace dyn { + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + namespace xml { + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace xml { + fun xml2str("dyn::vcsn::xml::xml2str", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/xml/strings.hh"); + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace xml { + // struct myDOMErrorHandler { + ctor myDOMErrorHandler("vcsn::xml::myDOMErrorHandler"); + // }; + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace xml { + // struct xerces_parser { + ctor xerces_parser("vcsn::xml::xerces_parser"); + // }; + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace z_automaton { + fun automaton_t("dyn::vcsn::z_automaton::automaton_t", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/z_automaton.hh"); + } // end of namespace z_automaton + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct TropicalSemiring { + ctor TropicalSemiring("vcsn::algebra::TropicalSemiring"); + // }; + } // end of namespace algebra + namespace algebra { + // struct TropicalMin { + ctor TropicalMin("vcsn::algebra::TropicalMin"); + // }; + // struct TropicalMax { + ctor TropicalMax("vcsn::algebra::TropicalMax"); + // }; + // struct TropicalSemiring { + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace z_max_plus_automaton { + fun automaton_t("dyn::vcsn::z_max_plus_automaton::automaton_t", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/z_max_plus_automaton.hh"); + } // end of namespace z_max_plus_automaton + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace z_min_plus_automaton { + fun automaton_t("dyn::vcsn::z_min_plus_automaton::automaton_t", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/z_min_plus_automaton.hh"); + } // end of namespace z_min_plus_automaton + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace r_automaton { + fun automaton_t("dyn::vcsn::r_automaton::automaton_t", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/r_automaton.hh"); + } // end of namespace r_automaton + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct Transducer { + ctor Transducer("vcsn::Transducer"); + // }; + // struct input_projection_helper { + ctor input_projection_helper("vcsn::input_projection_helper"); + // }; + // struct output_projection_helper { + ctor output_projection_helper("vcsn::output_projection_helper"); + // }; + // struct identity_transducer_helper { + ctor identity_transducer_helper("vcsn::identity_transducer_helper"); + // }; + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace fmp_transducer { + } // end of namespace fmp_transducer + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + fun automaton_t("dyn::vcsn::VCSN_CONTEXT_NAMESPACE::automaton_t", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/contexts/transducer.thh"); + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace boolean_transducer { + } // end of namespace boolean_transducer + } // end of namespace vcsn + namespace vcsn { + namespace boolean_transducer { + fun automaton_t("dyn::vcsn::boolean_transducer::automaton_t", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/boolean_transducer.hh"); + } // end of namespace boolean_transducer + } // end of namespace vcsn + namespace vcsn { + namespace xml { + namespace tools { + } // end of namespace tools + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace xml { + // struct xml_chooser_base { + ctor xml_chooser_base("vcsn::xml::xml_chooser_base"); + // }; + // struct xml_chooser { + ctor xml_chooser("vcsn::xml::xml_chooser"); + // }; + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace xml { + // struct reference_pair { + ctor reference_pair("vcsn::xml::reference_pair"); + // }; + // struct Node { + ctor Node("vcsn::xml::Node"); + // }; + // struct automatonNode { + ctor automatonNode("vcsn::xml::automatonNode"); + // }; + // struct transducerNode { + ctor transducerNode("vcsn::xml::transducerNode"); + // }; + // struct typeNode { + ctor typeNode("vcsn::xml::typeNode"); + // }; + // struct contentNode { + ctor contentNode("vcsn::xml::contentNode"); + // }; + // struct statesNode { + ctor statesNode("vcsn::xml::statesNode"); + // }; + // struct transitionsNode { + ctor transitionsNode("vcsn::xml::transitionsNode"); + // }; + // struct stateNode { + ctor stateNode("vcsn::xml::stateNode"); + // }; + // struct transitionNode { + ctor transitionNode("vcsn::xml::transitionNode"); + // }; + // struct initialNode { + ctor initialNode("vcsn::xml::initialNode"); + // }; + // struct finalNode { + ctor finalNode("vcsn::xml::finalNode"); + // }; + // struct semiringNode { + ctor semiringNode("vcsn::xml::semiringNode"); + // }; + // struct monoidNode { + ctor monoidNode("vcsn::xml::monoidNode"); + // }; + // struct freemonoidNode { + ctor freemonoidNode("vcsn::xml::freemonoidNode"); + // }; + // struct generatorNode { + ctor generatorNode("vcsn::xml::generatorNode"); + // }; + // struct geometryNode { + ctor geometryNode("vcsn::xml::geometryNode"); + // }; + // struct drawingNode { + ctor drawingNode("vcsn::xml::drawingNode"); + // }; + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace xml { + // struct xml_converter { + ctor xml_converter("vcsn::xml::xml_converter"); + // }; + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace xml { + // struct XML { + ctor XML("vcsn::xml::XML"); + // }; + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct AlphabetSet { + ctor AlphabetSet("vcsn::algebra::AlphabetSet"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct FreeMonoid { + ctor FreeMonoid("vcsn::algebra::FreeMonoid"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + } // end of namespace algebra + } // end of namespace vcsn + namespace utility { + // struct generic_int_type { + ctor generic_int_type("utility::generic_int_type"); + // }; + // struct char_traits { + ctor char_traits("utility::char_traits"); + // }; + } // end of namespace utility + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct NumericalSemiring { + ctor NumericalSemiring("vcsn::algebra::NumericalSemiring"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + fun op_can_choose_non_starable("dyn::vcsn::op_can_choose_non_starable", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + fun op_choose_starable("dyn::vcsn::op_choose_starable", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + fun op_choose_non_starable("dyn::vcsn::op_choose_non_starable", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + fun op_mul("dyn::vcsn::op_mul", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + proc op_in_add("dyn::vcsn::op_in_add", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + fun op_add("dyn::vcsn::op_add", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + fun identity_value("dyn::vcsn::identity_value", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + fun zero_value("dyn::vcsn::zero_value", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + fun op_starable("dyn::vcsn::op_starable", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + proc op_in_star("dyn::vcsn::op_in_star", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct DefaultTransposeFun { + ctor DefaultTransposeFun("vcsn::algebra::DefaultTransposeFun"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace utility { + } // end of namespace utility + namespace std { + } // end of namespace std + namespace utility { + } // end of namespace utility + namespace vcsn { + namespace algebra { + } // end of namespace algebra + } // end of namespace vcsn + namespace std { + } // end of namespace std + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace rat { + // struct setpm { + ctor setpm("vcsn::rat::setpm"); + // }; + fun getpm("dyn::vcsn::rat::getpm", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/algebra/implementation/series/rat/dump_visitor.hh"); + // struct setzero { + ctor setzero("vcsn::rat::setzero"); + // }; + // struct setid { + ctor setid("vcsn::rat::setid"); + // }; + } // end of namespace rat + } // end of namespace vcsn + namespace vcsn { + namespace rat { + } // end of namespace rat + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct Automata { + ctor Automata("vcsn::Automata"); + // }; + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct TransducerBase { + ctor TransducerBase("vcsn::TransducerBase"); + // }; + // struct transducer_traits { + ctor transducer_traits("vcsn::transducer_traits"); + // }; + // struct extension_traits { + ctor extension_traits("vcsn::extension_traits"); + // }; + // struct projection_traits { + ctor projection_traits("vcsn::projection_traits"); + // }; + // struct output_projection_traits { + ctor output_projection_traits("vcsn::output_projection_traits"); + // }; + } // end of namespace vcsn + namespace vcsn { + // struct labels_are_letters { + ctor labels_are_letters("vcsn::labels_are_letters"); + // }; + // struct labels_are_words { + ctor labels_are_words("vcsn::labels_are_words"); + // }; + // struct labels_are_series { + ctor labels_are_series("vcsn::labels_are_series"); + // }; + // struct labels_are_couples { + ctor labels_are_couples("vcsn::labels_are_couples"); + // }; + // struct LabelOf { + ctor LabelOf("vcsn::LabelOf"); + // }; + } // end of namespace vcsn + namespace vcsn { + // struct NoTag { + ctor NoTag("vcsn::NoTag"); + // }; + } // end of namespace vcsn + fun operator_equal("dyn::operator_equal", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/automata/concept/tags.hh"); + fun operator_not_equal("dyn::operator_not_equal", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/automata/concept/tags.hh"); + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct geometry { + ctor geometry("vcsn::geometry"); + // }; + } // end of namespace vcsn + namespace vcsn { + // struct edge_value { + ctor edge_value("vcsn::edge_value"); + // }; + // struct state_value { + ctor state_value("vcsn::state_value"); + // }; + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct generalized_traits { + ctor generalized_traits("vcsn::generalized_traits"); + // }; + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace io { + // struct automaton_saver_ { + ctor automaton_saver_("vcsn::io::automaton_saver_"); + // }; + // struct string_out { + ctor string_out("vcsn::io::string_out"); + // }; + } // end of namespace io + namespace io { + // struct automaton_loader_ { + ctor automaton_loader_("vcsn::io::automaton_loader_"); + // }; + } // end of namespace io + } // end of namespace vcsn + namespace vcsn { + namespace io { + // struct dot { + ctor dot("vcsn::io::dot"); + // }; + // struct transducer_dot { + ctor transducer_dot("vcsn::io::transducer_dot"); + // }; + } // end of namespace io + } // end of namespace vcsn + namespace vcsn { + namespace tools { + } // end of namespace tools + } // end of namespace vcsn + namespace vcsn { + namespace algorithm_patterns { + // struct Comparator { + ctor Comparator("vcsn::algorithm_patterns::Comparator"); + // }; + } // end of namespace algorithm_patterns + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct reference_type { + ctor reference_type("vcsn::reference_type"); + // }; + // struct iterator_type { + ctor iterator_type("vcsn::iterator_type"); + // }; + // struct PartialExp { + // struct internal_iterator { + ctor internal_iterator("vcsn::PartialExp::internal_iterator"); + // }; + ctor PartialExp("vcsn::PartialExp"); + // }; + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + fun aut_to_exp("dyn::vcsn::VCSN_CONTEXT_NAMESPACE::aut_to_exp", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/contexts/automaton_functions.thh"); + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace boolean_automaton { + fun automaton_t("dyn::vcsn::boolean_automaton::automaton_t", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/boolean_automaton.hh"); + } // end of namespace boolean_automaton + } // end of namespace vcsn + namespace vcsn { + // struct dynamic_traits { + ctor dynamic_traits("vcsn::dynamic_traits"); + // }; + // struct SyntacticDecorator { + ctor SyntacticDecorator("vcsn::SyntacticDecorator"); + // }; + // struct MetaElement { + ctor MetaElement("vcsn::MetaElement"); + // }; + // struct Element { + ctor Element("vcsn::Element"); + // }; + // struct default_slot_tag { + ctor default_slot_tag("vcsn::default_slot_tag"); + // }; + // struct SetSlot { + ctor SetSlot("vcsn::SetSlot"); + // }; + // struct Structure { + ctor Structure("vcsn::Structure"); + // }; + // struct virtual_types { + ctor virtual_types("vcsn::virtual_types"); + // }; + // struct undefined_type { + ctor undefined_type("vcsn::undefined_type"); + // }; + } // end of namespace vcsn + namespace utility { + namespace unique { + // struct UniqueListBase { + ctor UniqueListBase("utility::unique::UniqueListBase"); + // }; + // struct uniquelist { + ctor uniquelist("utility::unique::uniquelist"); + // }; + // struct UniqueMap { + // struct TiSlot { + ctor TiSlot("utility::unique::UniqueMap::TiSlot"); + // }; + ctor UniqueMap("utility::unique::UniqueMap"); + // }; + // struct unifiable { + ctor unifiable("utility::unique::unifiable"); + // }; + } // end of namespace unique + } // end of namespace utility + namespace vcsn { + // struct Structure { + // }; + } // end of namespace vcsn + namespace utility { + namespace contract { + proc trap("dyn::utility::contract::trap", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/misc/contract.hh"); + // struct fail { + ctor fail("utility::contract::fail"); + // }; + } // end of namespace contract + } // end of namespace utility + namespace vcsn { + // struct SyntacticDecorator { + // }; + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct op_add_traits { + ctor op_add_traits("vcsn::op_add_traits"); + // }; + // struct op_sub_traits { + ctor op_sub_traits("vcsn::op_sub_traits"); + // }; + // struct op_mul_traits { + ctor op_mul_traits("vcsn::op_mul_traits"); + // }; + // struct op_div_traits { + ctor op_div_traits("vcsn::op_div_traits"); + // }; + // struct op_mod_traits { + ctor op_mod_traits("vcsn::op_mod_traits"); + // }; + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace std { + } // end of namespace std + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct SetSlotAttribute { + ctor SetSlotAttribute("vcsn::SetSlotAttribute"); + // }; + // struct SetSlot { + // }; + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct mul_kind { + ctor mul_kind("vcsn::algebra::mul_kind"); + // }; + // struct add_kind { + ctor add_kind("vcsn::algebra::add_kind"); + // }; + // struct SemigroupBase { + ctor SemigroupBase("vcsn::algebra::SemigroupBase"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct MonoidBase { + ctor MonoidBase("vcsn::algebra::MonoidBase"); + // }; + // struct identity_as { + ctor identity_as("vcsn::algebra::identity_as"); + // }; + // struct zero_as { + ctor zero_as("vcsn::algebra::zero_as"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct SemiringBase { + ctor SemiringBase("vcsn::algebra::SemiringBase"); + // }; + } // end of namespace algebra + // struct op_star_traits { + ctor op_star_traits("vcsn::op_star_traits"); + // }; + } // end of namespace vcsn + namespace vcsn { + // struct op_begin_traits { + ctor op_begin_traits("vcsn::op_begin_traits"); + // }; + // struct op_rbegin_traits { + ctor op_rbegin_traits("vcsn::op_rbegin_traits"); + // }; + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct static_char_interval { + ctor static_char_interval("vcsn::algebra::static_char_interval"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace utility { + // struct limits { + ctor limits("utility::limits"); + // }; + } // end of namespace utility + namespace vcsn { + namespace algebra { + fun operator_push("dyn::vcsn::algebra::operator_push", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/rational_number.hh"); + fun gcd("dyn::vcsn::algebra::gcd", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/rational_number.hh"); + fun lcm("dyn::vcsn::algebra::lcm", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/rational_number.hh"); + } // end of namespace algebra + } // end of namespace vcsn + namespace std { + } // end of namespace std + namespace utility { + } // end of namespace utility + namespace utility { + namespace random { + fun generate_letter("dyn::utility::random::generate_letter", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/misc/random.hh"); + fun generate_digit("dyn::utility::random::generate_digit", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/misc/random.hh"); + } // end of namespace random + } // end of namespace utility + namespace vcsn { + namespace algebra { + // struct AlphabetSetBase { + ctor AlphabetSetBase("vcsn::algebra::AlphabetSetBase"); + // }; + // struct alphabet_traits { + ctor alphabet_traits("vcsn::algebra::alphabet_traits"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace utility { + // struct iomanip { + ctor iomanip("utility::iomanip"); + // }; + } // end of namespace utility + namespace vcsn { + namespace tools { + fun usual_escaped_characters("dyn::vcsn::tools::usual_escaped_characters", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/tools/usual_escaped_characters.hh"); + } // end of namespace tools + } // end of namespace vcsn + namespace utility { + // struct escaper { + ctor escaper("utility::escaper"); + // }; + // struct setesc { + ctor setesc("utility::setesc"); + // }; + fun getesc("dyn::utility::getesc", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/seminar_dynamic_static_bridge/test/vaucanson/sources/include/vaucanson/misc/escaper.hh"); + } // end of namespace utility + namespace vcsn { + namespace algebra { + // struct FreeMonoidBase { + ctor FreeMonoidBase("vcsn::algebra::FreeMonoidBase"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct SeriesBase { + ctor SeriesBase("vcsn::algebra::SeriesBase"); + // }; + // struct series_traits { + ctor series_traits("vcsn::algebra::series_traits"); + // }; + // struct mute_series_impl { + ctor mute_series_impl("vcsn::algebra::mute_series_impl"); + // }; + // struct mute_series_traits { + ctor mute_series_traits("vcsn::algebra::mute_series_traits"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct semiring_slot_tag { + ctor semiring_slot_tag("vcsn::algebra::semiring_slot_tag"); + // }; + // struct monoid_slot_tag { + ctor monoid_slot_tag("vcsn::algebra::monoid_slot_tag"); + // }; + // struct Series { + ctor Series("vcsn::algebra::Series"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace rat { + } // end of namespace rat + } // end of namespace vcsn + namespace vcsn { + namespace rat { + } // end of namespace rat + } // end of namespace vcsn + namespace vcsn { + namespace rat { + } // end of namespace rat + } // end of namespace vcsn + namespace vcsn { + namespace rat { + } // end of namespace rat + } // end of namespace vcsn + namespace vcsn { + namespace rat { + } // end of namespace rat + } // end of namespace vcsn + namespace utility { + // struct DeferrerDebugPart { + ctor DeferrerDebugPart("utility::DeferrerDebugPart"); + // }; + // struct Deferrer { + ctor Deferrer("utility::Deferrer"); + // }; + } // end of namespace utility + namespace vcsn { + namespace algebra { + // struct DispatchFunction { + ctor DispatchFunction("vcsn::algebra::DispatchFunction"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct BinaryOp { + ctor BinaryOp("vcsn::algebra::BinaryOp"); + // }; + // struct UnaryOp { + ctor UnaryOp("vcsn::algebra::UnaryOp"); + // }; + // struct Value { + ctor Value("vcsn::algebra::Value"); + // }; + // struct GenericMatcher { + ctor GenericMatcher("vcsn::algebra::GenericMatcher"); + // }; + // struct KRatExpMatcher { + ctor KRatExpMatcher("vcsn::algebra::KRatExpMatcher"); + // }; + // struct KRatExpIdentity { + ctor KRatExpIdentity("vcsn::algebra::KRatExpIdentity"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + // struct state_h { + ctor state_h("vcsn::state_h"); + // }; + // struct edge_h { + ctor edge_h("vcsn::edge_h"); + // }; + } // end of namespace vcsn + namespace std { + } // end of namespace std + namespace vcsn { + namespace delta_kind { + // struct edges { + ctor edges("vcsn::delta_kind::edges"); + // }; + // struct states { + ctor states("vcsn::delta_kind::states"); + // }; + } // end of namespace delta_kind + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct AutomataBase { + ctor AutomataBase("vcsn::AutomataBase"); + // }; + // struct automaton_traits { + ctor automaton_traits("vcsn::automaton_traits"); + // }; + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct TransposeView { + ctor TransposeView("vcsn::TransposeView"); + // }; + // struct transpose_traits { + ctor transpose_traits("vcsn::transpose_traits"); + // }; + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn +} // end of namespace dyn diff --git a/dynamic-use-of-static-c++/test/fixtures/vaucanson/dyn_vaucanson_mlc_name_of.hh b/dynamic-use-of-static-c++/test/fixtures/vaucanson/dyn_vaucanson_mlc_name_of.hh new file mode 100644 index 0000000..4c370ea --- /dev/null +++ b/dynamic-use-of-static-c++/test/fixtures/vaucanson/dyn_vaucanson_mlc_name_of.hh @@ -0,0 +1,126 @@ +mlc_set_name(vcsn::xml::myDOMErrorHandler); +mlc_set_name(vcsn::xml::xerces_parser); +template <class TropicalKind> struct mlc_name < vcsn::algebra::TropicalSemiring<TropicalKind> > { static std::string of() { return std::string("vcsn::algebra::TropicalSemiring") + "< " + mlc_name<TropicalKind>::of() + " >"; } }; +mlc_set_name(vcsn::algebra::TropicalMin); +mlc_set_name(vcsn::algebra::TropicalMax); +template <class Series> struct mlc_name < vcsn::Transducer<Series> > { static std::string of() { return std::string("vcsn::Transducer") + "< " + mlc_name<Series>::of() + " >"; } }; +template <class S, class T> struct mlc_name < vcsn::input_projection_helper<S, T> > { static std::string of() { return std::string("vcsn::input_projection_helper") + "< " + mlc_name<S>::of() + ", " + mlc_name<T>::of() + " >"; } }; +template <class S, class T> struct mlc_name < vcsn::output_projection_helper<S, T> > { static std::string of() { return std::string("vcsn::output_projection_helper") + "< " + mlc_name<S>::of() + ", " + mlc_name<T>::of() + " >"; } }; +template <class S, class T> struct mlc_name < vcsn::identity_transducer_helper<S, T> > { static std::string of() { return std::string("vcsn::identity_transducer_helper") + "< " + mlc_name<S>::of() + ", " + mlc_name<T>::of() + " >"; } }; +template <class S, class T> struct mlc_name < vcsn::xml::xml_chooser_base<S, T> > { static std::string of() { return std::string("vcsn::xml::xml_chooser_base") + "< " + mlc_name<S>::of() + ", " + mlc_name<T>::of() + " >"; } }; +template <class S, class T> struct mlc_name < vcsn::xml::xml_chooser<S, T> > { static std::string of() { return std::string("vcsn::xml::xml_chooser") + "< " + mlc_name<S>::of() + ", " + mlc_name<T>::of() + " >"; } }; +template <class T1, class T2> struct mlc_name < vcsn::xml::reference_pair<T1, T2> > { static std::string of() { return std::string("vcsn::xml::reference_pair") + "< " + mlc_name<T1>::of() + ", " + mlc_name<T2>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::xml::Node<T> > { static std::string of() { return std::string("vcsn::xml::Node") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::xml::automatonNode<T> > { static std::string of() { return std::string("vcsn::xml::automatonNode") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::xml::transducerNode<T> > { static std::string of() { return std::string("vcsn::xml::transducerNode") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::xml::typeNode<T> > { static std::string of() { return std::string("vcsn::xml::typeNode") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::xml::contentNode<T> > { static std::string of() { return std::string("vcsn::xml::contentNode") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::xml::statesNode<T> > { static std::string of() { return std::string("vcsn::xml::statesNode") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::xml::transitionsNode<T> > { static std::string of() { return std::string("vcsn::xml::transitionsNode") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::xml::stateNode<T> > { static std::string of() { return std::string("vcsn::xml::stateNode") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::xml::transitionNode<T> > { static std::string of() { return std::string("vcsn::xml::transitionNode") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::xml::initialNode<T> > { static std::string of() { return std::string("vcsn::xml::initialNode") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::xml::finalNode<T> > { static std::string of() { return std::string("vcsn::xml::finalNode") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::xml::semiringNode<T> > { static std::string of() { return std::string("vcsn::xml::semiringNode") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::xml::monoidNode<T> > { static std::string of() { return std::string("vcsn::xml::monoidNode") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::xml::freemonoidNode<T> > { static std::string of() { return std::string("vcsn::xml::freemonoidNode") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::xml::generatorNode<T> > { static std::string of() { return std::string("vcsn::xml::generatorNode") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::xml::geometryNode<T> > { static std::string of() { return std::string("vcsn::xml::geometryNode") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::xml::drawingNode<T> > { static std::string of() { return std::string("vcsn::xml::drawingNode") + "< " + mlc_name<T>::of() + " >"; } }; +template <class Auto> struct mlc_name < vcsn::xml::xml_converter<Auto> > { static std::string of() { return std::string("vcsn::xml::xml_converter") + "< " + mlc_name<Auto>::of() + " >"; } }; +mlc_set_name(vcsn::xml::XML); +template <typename L> struct mlc_name < vcsn::algebra::AlphabetSet<L> > { static std::string of() { return std::string("vcsn::algebra::AlphabetSet") + "< " + mlc_name<L>::of() + " >"; } }; +template <typename A> struct mlc_name < vcsn::algebra::FreeMonoid<A> > { static std::string of() { return std::string("vcsn::algebra::FreeMonoid") + "< " + mlc_name<A>::of() + " >"; } }; +template <class CharT> struct mlc_name < utility::generic_int_type<CharT> > { static std::string of() { return std::string("utility::generic_int_type") + "< " + mlc_name<CharT>::of() + " >"; } }; +template <typename CharT> struct mlc_name < utility::char_traits<CharT> > { static std::string of() { return std::string("utility::char_traits") + "< " + mlc_name<CharT>::of() + " >"; } }; +mlc_set_name(vcsn::algebra::NumericalSemiring); +template <class S, class T> struct mlc_name < vcsn::algebra::DefaultTransposeFun<S, T> > { static std::string of() { return std::string("vcsn::algebra::DefaultTransposeFun") + "< " + mlc_name<S>::of() + ", " + mlc_name<T>::of() + " >"; } }; +mlc_set_name(vcsn::rat::setpm); +mlc_set_name(vcsn::rat::setzero); +mlc_set_name(vcsn::rat::setid); +template <class Series> struct mlc_name < vcsn::Automata<Series> > { static std::string of() { return std::string("vcsn::Automata") + "< " + mlc_name<Series>::of() + " >"; } }; +template <typename Self> struct mlc_name < vcsn::TransducerBase<Self> > { static std::string of() { return std::string("vcsn::TransducerBase") + "< " + mlc_name<Self>::of() + " >"; } }; +template <typename T> struct mlc_name < vcsn::transducer_traits<T> > { static std::string of() { return std::string("vcsn::transducer_traits") + "< " + mlc_name<T>::of() + " >"; } }; +template <typename T> struct mlc_name < vcsn::extension_traits<T> > { static std::string of() { return std::string("vcsn::extension_traits") + "< " + mlc_name<T>::of() + " >"; } }; +template <class S, class T> struct mlc_name < vcsn::projection_traits<S, T> > { static std::string of() { return std::string("vcsn::projection_traits") + "< " + mlc_name<S>::of() + ", " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::output_projection_traits<T> > { static std::string of() { return std::string("vcsn::output_projection_traits") + "< " + mlc_name<T>::of() + " >"; } }; +mlc_set_name(vcsn::labels_are_letters); +mlc_set_name(vcsn::labels_are_words); +mlc_set_name(vcsn::labels_are_series); +mlc_set_name(vcsn::labels_are_couples); +template <class Kind, class WordValue, class WeightValue, class SeriesValue, class Letter> struct mlc_name < vcsn::LabelOf<Kind, WordValue, WeightValue, SeriesValue, Letter> > { static std::string of() { return std::string("vcsn::LabelOf") + "< " + mlc_name<Kind>::of() + ", " + mlc_name<WordValue>::of() + ", " + mlc_name<WeightValue>::of() + ", " + mlc_name<SeriesValue>::of() + ", " + mlc_name<Letter>::of() + " >"; } }; +mlc_set_name(vcsn::NoTag); +mlc_set_name(vcsn::geometry); +template <typename EdgeLabel> struct mlc_name < vcsn::edge_value<EdgeLabel> > { static std::string of() { return std::string("vcsn::edge_value") + "< " + mlc_name<EdgeLabel>::of() + " >"; } }; +mlc_set_name(vcsn::state_value); +template <class Auto_> struct mlc_name < vcsn::generalized_traits<Auto_> > { static std::string of() { return std::string("vcsn::generalized_traits") + "< " + mlc_name<Auto_>::of() + " >"; } }; +template <typename Auto, typename EdgeConverter, typename Format> struct mlc_name < vcsn::io::automaton_saver_<Auto, EdgeConverter, Format> > { static std::string of() { return std::string("vcsn::io::automaton_saver_") + "< " + mlc_name<Auto>::of() + ", " + mlc_name<EdgeConverter>::of() + ", " + mlc_name<Format>::of() + " >"; } }; +mlc_set_name(vcsn::io::string_out); +template <typename Auto, typename EdgeConverter, typename Format> struct mlc_name < vcsn::io::automaton_loader_<Auto, EdgeConverter, Format> > { static std::string of() { return std::string("vcsn::io::automaton_loader_") + "< " + mlc_name<Auto>::of() + ", " + mlc_name<EdgeConverter>::of() + ", " + mlc_name<Format>::of() + " >"; } }; +mlc_set_name(vcsn::io::dot); +mlc_set_name(vcsn::io::transducer_dot); +template <typename Self, typename Etiq> struct mlc_name < vcsn::algorithm_patterns::Comparator<Self, Etiq> > { static std::string of() { return std::string("vcsn::algorithm_patterns::Comparator") + "< " + mlc_name<Self>::of() + ", " + mlc_name<Etiq>::of() + " >"; } }; +template <bool B0, typename T> struct mlc_name < vcsn::reference_type<B0, T> > { static std::string of() { return std::string("vcsn::reference_type") + "< " + ((B0)? "true" : "false") + ", " + mlc_name<T>::of() + " >"; } }; +template <bool B0, typename T> struct mlc_name < vcsn::iterator_type<B0, T> > { static std::string of() { return std::string("vcsn::iterator_type") + "< " + ((B0)? "true" : "false") + ", " + mlc_name<T>::of() + " >"; } }; +template <typename S> struct mlc_name < vcsn::dynamic_traits<S> > { static std::string of() { return std::string("vcsn::dynamic_traits") + "< " + mlc_name<S>::of() + " >"; } }; +template <typename S, typename T> struct mlc_name < vcsn::SyntacticDecorator<S, T> > { static std::string of() { return std::string("vcsn::SyntacticDecorator") + "< " + mlc_name<S>::of() + ", " + mlc_name<T>::of() + " >"; } }; +template <typename S, typename T> struct mlc_name < vcsn::MetaElement<S, T> > { static std::string of() { return std::string("vcsn::MetaElement") + "< " + mlc_name<S>::of() + ", " + mlc_name<T>::of() + " >"; } }; +template <typename S, typename T> struct mlc_name < vcsn::Element<S, T> > { static std::string of() { return std::string("vcsn::Element") + "< " + mlc_name<S>::of() + ", " + mlc_name<T>::of() + " >"; } }; +mlc_set_name(vcsn::default_slot_tag); +template <typename S, typename Tag> struct mlc_name < vcsn::SetSlot<S, Tag> > { static std::string of() { return std::string("vcsn::SetSlot") + "< " + mlc_name<S>::of() + ", " + mlc_name<Tag>::of() + " >"; } }; +template <typename Self> struct mlc_name < vcsn::Structure<Self> > { static std::string of() { return std::string("vcsn::Structure") + "< " + mlc_name<Self>::of() + " >"; } }; +template <typename Self> struct mlc_name < vcsn::virtual_types<Self> > { static std::string of() { return std::string("vcsn::virtual_types") + "< " + mlc_name<Self>::of() + " >"; } }; +mlc_set_name(vcsn::undefined_type); +template <class T> struct mlc_name < utility::unique::UniqueListBase<T> > { static std::string of() { return std::string("utility::unique::UniqueListBase") + "< " + mlc_name<T>::of() + " >"; } }; +template <typename T> struct mlc_name < utility::unique::uniquelist<T> > { static std::string of() { return std::string("utility::unique::uniquelist") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < utility::unique::UniqueMap<T> > { static std::string of() { return std::string("utility::unique::UniqueMap") + "< " + mlc_name<T>::of() + " >"; } }; +mlc_set_name(utility::unique::unifiable); +template <typename T> struct mlc_name < utility::contract::fail<T> > { static std::string of() { return std::string("utility::contract::fail") + "< " + mlc_name<T>::of() + " >"; } }; +template <typename S1, typename S2, typename T1, typename T2> struct mlc_name < vcsn::op_add_traits<S1, S2, T1, T2> > { static std::string of() { return std::string("vcsn::op_add_traits") + "< " + mlc_name<S1>::of() + ", " + mlc_name<S2>::of() + ", " + mlc_name<T1>::of() + ", " + mlc_name<T2>::of() + " >"; } }; +template <typename S1, typename S2, typename T1, typename T2> struct mlc_name < vcsn::op_sub_traits<S1, S2, T1, T2> > { static std::string of() { return std::string("vcsn::op_sub_traits") + "< " + mlc_name<S1>::of() + ", " + mlc_name<S2>::of() + ", " + mlc_name<T1>::of() + ", " + mlc_name<T2>::of() + " >"; } }; +template <typename S1, typename S2, typename T1, typename T2> struct mlc_name < vcsn::op_mul_traits<S1, S2, T1, T2> > { static std::string of() { return std::string("vcsn::op_mul_traits") + "< " + mlc_name<S1>::of() + ", " + mlc_name<S2>::of() + ", " + mlc_name<T1>::of() + ", " + mlc_name<T2>::of() + " >"; } }; +template <typename S1, typename S2, typename T1, typename T2> struct mlc_name < vcsn::op_div_traits<S1, S2, T1, T2> > { static std::string of() { return std::string("vcsn::op_div_traits") + "< " + mlc_name<S1>::of() + ", " + mlc_name<S2>::of() + ", " + mlc_name<T1>::of() + ", " + mlc_name<T2>::of() + " >"; } }; +template <typename S1, typename S2, typename T1, typename T2> struct mlc_name < vcsn::op_mod_traits<S1, S2, T1, T2> > { static std::string of() { return std::string("vcsn::op_mod_traits") + "< " + mlc_name<S1>::of() + ", " + mlc_name<S2>::of() + ", " + mlc_name<T1>::of() + ", " + mlc_name<T2>::of() + " >"; } }; +template <typename S, bool B0> struct mlc_name < vcsn::SetSlotAttribute<S, B0> > { static std::string of() { return std::string("vcsn::SetSlotAttribute") + "< " + mlc_name<S>::of() + ", " + ((B0)? "true" : "false") + " >"; } }; +mlc_set_name(vcsn::algebra::mul_kind); +mlc_set_name(vcsn::algebra::add_kind); +template <class Self> struct mlc_name < vcsn::algebra::SemigroupBase<Self> > { static std::string of() { return std::string("vcsn::algebra::SemigroupBase") + "< " + mlc_name<Self>::of() + " >"; } }; +template <class Self> struct mlc_name < vcsn::algebra::MonoidBase<Self> > { static std::string of() { return std::string("vcsn::algebra::MonoidBase") + "< " + mlc_name<Self>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::algebra::identity_as<T> > { static std::string of() { return std::string("vcsn::algebra::identity_as") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::algebra::zero_as<T> > { static std::string of() { return std::string("vcsn::algebra::zero_as") + "< " + mlc_name<T>::of() + " >"; } }; +template <class Self> struct mlc_name < vcsn::algebra::SemiringBase<Self> > { static std::string of() { return std::string("vcsn::algebra::SemiringBase") + "< " + mlc_name<Self>::of() + " >"; } }; +template <typename S, typename T> struct mlc_name < vcsn::op_star_traits<S, T> > { static std::string of() { return std::string("vcsn::op_star_traits") + "< " + mlc_name<S>::of() + ", " + mlc_name<T>::of() + " >"; } }; +template <typename S, typename T> struct mlc_name < vcsn::op_begin_traits<S, T> > { static std::string of() { return std::string("vcsn::op_begin_traits") + "< " + mlc_name<S>::of() + ", " + mlc_name<T>::of() + " >"; } }; +template <typename S, typename T> struct mlc_name < vcsn::op_rbegin_traits<S, T> > { static std::string of() { return std::string("vcsn::op_rbegin_traits") + "< " + mlc_name<S>::of() + ", " + mlc_name<T>::of() + " >"; } }; +template <char B0, char B1> struct mlc_name < vcsn::algebra::static_char_interval<B0, B1> > { static std::string of() { return std::string("vcsn::algebra::static_char_interval") + "< " + "'" + std::string(B0) + "'" + ", " + "'" + std::string(B1) + "'" + " >"; } }; +template <typename T> struct mlc_name < utility::limits<T> > { static std::string of() { return std::string("utility::limits") + "< " + mlc_name<T>::of() + " >"; } }; +template <class S> struct mlc_name < vcsn::algebra::AlphabetSetBase<S> > { static std::string of() { return std::string("vcsn::algebra::AlphabetSetBase") + "< " + mlc_name<S>::of() + " >"; } }; +template <typename S, typename T> struct mlc_name < vcsn::algebra::alphabet_traits<S, T> > { static std::string of() { return std::string("vcsn::algebra::alphabet_traits") + "< " + mlc_name<S>::of() + ", " + mlc_name<T>::of() + " >"; } }; +template <class Self> struct mlc_name < utility::iomanip<Self> > { static std::string of() { return std::string("utility::iomanip") + "< " + mlc_name<Self>::of() + " >"; } }; +template <class T> struct mlc_name < utility::escaper<T> > { static std::string of() { return std::string("utility::escaper") + "< " + mlc_name<T>::of() + " >"; } }; +mlc_set_name(utility::setesc); +template <class Self> struct mlc_name < vcsn::algebra::FreeMonoidBase<Self> > { static std::string of() { return std::string("vcsn::algebra::FreeMonoidBase") + "< " + mlc_name<Self>::of() + " >"; } }; +template <class Self> struct mlc_name < vcsn::algebra::SeriesBase<Self> > { static std::string of() { return std::string("vcsn::algebra::SeriesBase") + "< " + mlc_name<Self>::of() + " >"; } }; +template <typename T> struct mlc_name < vcsn::algebra::series_traits<T> > { static std::string of() { return std::string("vcsn::algebra::series_traits") + "< " + mlc_name<T>::of() + " >"; } }; +template <typename T, typename W, typename M> struct mlc_name < vcsn::algebra::mute_series_impl<T, W, M> > { static std::string of() { return std::string("vcsn::algebra::mute_series_impl") + "< " + mlc_name<T>::of() + ", " + mlc_name<W>::of() + ", " + mlc_name<M>::of() + " >"; } }; +template <typename T, typename W, typename M> struct mlc_name < vcsn::algebra::mute_series_traits<T, W, M> > { static std::string of() { return std::string("vcsn::algebra::mute_series_traits") + "< " + mlc_name<T>::of() + ", " + mlc_name<W>::of() + ", " + mlc_name<M>::of() + " >"; } }; +mlc_set_name(vcsn::algebra::semiring_slot_tag); +mlc_set_name(vcsn::algebra::monoid_slot_tag); +template <typename Semiring, typename Monoid> struct mlc_name < vcsn::algebra::Series<Semiring, Monoid> > { static std::string of() { return std::string("vcsn::algebra::Series") + "< " + mlc_name<Semiring>::of() + ", " + mlc_name<Monoid>::of() + " >"; } }; +template <class T, bool B0> struct mlc_name < utility::DeferrerDebugPart<T, B0> > { static std::string of() { return std::string("utility::DeferrerDebugPart") + "< " + mlc_name<T>::of() + ", " + ((B0)? "true" : "false") + " >"; } }; +template <class T, bool B0> struct mlc_name < utility::Deferrer<T, B0> > { static std::string of() { return std::string("utility::Deferrer") + "< " + mlc_name<T>::of() + ", " + ((B0)? "true" : "false") + " >"; } }; +template <class T> struct mlc_name < vcsn::algebra::DispatchFunction<T> > { static std::string of() { return std::string("vcsn::algebra::DispatchFunction") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T, class U> struct mlc_name < vcsn::algebra::BinaryOp<T, U> > { static std::string of() { return std::string("vcsn::algebra::BinaryOp") + "< " + mlc_name<T>::of() + ", " + mlc_name<U>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::algebra::UnaryOp<T> > { static std::string of() { return std::string("vcsn::algebra::UnaryOp") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::algebra::Value<T> > { static std::string of() { return std::string("vcsn::algebra::Value") + "< " + mlc_name<T>::of() + " >"; } }; +template <class Self, class T, class U, class F> struct mlc_name < vcsn::algebra::GenericMatcher<Self, T, U, F> > { static std::string of() { return std::string("vcsn::algebra::GenericMatcher") + "< " + mlc_name<Self>::of() + ", " + mlc_name<T>::of() + ", " + mlc_name<U>::of() + ", " + mlc_name<F>::of() + " >"; } }; +template <class Self, class T, class U, class F> struct mlc_name < vcsn::algebra::KRatExpMatcher<Self, T, U, F> > { static std::string of() { return std::string("vcsn::algebra::KRatExpMatcher") + "< " + mlc_name<Self>::of() + ", " + mlc_name<T>::of() + ", " + mlc_name<U>::of() + ", " + mlc_name<F>::of() + " >"; } }; +template <class Self, class Series, class T, class Dispatch> struct mlc_name < vcsn::algebra::KRatExpIdentity<Self, Series, T, Dispatch> > { static std::string of() { return std::string("vcsn::algebra::KRatExpIdentity") + "< " + mlc_name<Self>::of() + ", " + mlc_name<Series>::of() + ", " + mlc_name<T>::of() + ", " + mlc_name<Dispatch>::of() + " >"; } }; +mlc_set_name(vcsn::state_h); +mlc_set_name(vcsn::edge_h); +mlc_set_name(vcsn::delta_kind::edges); +mlc_set_name(vcsn::delta_kind::states); +template <typename Self> struct mlc_name < vcsn::AutomataBase<Self> > { static std::string of() { return std::string("vcsn::AutomataBase") + "< " + mlc_name<Self>::of() + " >"; } }; +template <typename T> struct mlc_name < vcsn::automaton_traits<T> > { static std::string of() { return std::string("vcsn::automaton_traits") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::TransposeView<T> > { static std::string of() { return std::string("vcsn::TransposeView") + "< " + mlc_name<T>::of() + " >"; } }; +template <class T> struct mlc_name < vcsn::transpose_traits<T> > { static std::string of() { return std::string("vcsn::transpose_traits") + "< " + mlc_name<T>::of() + " >"; } }; diff --git a/dynamic-use-of-static-c++/test/test_containers.cc b/dynamic-use-of-static-c++/test/test_containers.cc new file mode 100644 index 0000000..2413b30 --- /dev/null +++ b/dynamic-use-of-static-c++/test/test_containers.cc @@ -0,0 +1,89 @@ +#include <algorithm> + +#include "my_lib/lib.hh" + +#include "dyn-all.hh" +using namespace dyn::language; + +int main() +{ + dyn::include_dir(DYN_FIXTURES); + dyn::include("my_lib/lib.hh"); + + echo("Test containers"); + std::vector<int> v(4); + std::generate(v.begin(), v.end(), rand); + std::vector<int>::iterator it; + stl_each(v, it) + echo(*it); + it = v.begin(); + + meth begin("begin"); + meth end("end"); + var dv = v; + var dit = it; + echo(dv[2]); + v[2] = 51; + echo(v[2]); + echo(dv[2]); + dv[2] = 42; + int dv_2 = dv[2]; + echo(dv_2); + assert(dv_2 == 42); + std::cout << "v[0] => " << *dit << std::endl; + var my_begin = *begin(dv); + int my_begin_i = *begin(dv); + int my_begin_i2 = my_begin; + int ref_begin_i = *v.begin(); + int ref_begin_i2 = v[0]; + echo("my_begin: " << my_begin); + echo("my_begin_i: " << my_begin_i); + echo("my_begin_i2: " << my_begin_i2); + echo("ref_begin_i: " << ref_begin_i); + echo("ref_begin_i2: " << ref_begin_i2); + assert(my_begin_i == ref_begin_i); + const std::vector<int>::iterator& tmp1b(begin(dv)); + const std::vector<int>::iterator& tmp2b(v.begin()); + const std::vector<int>::iterator& tmp3b(v.begin()); + var tmp4b = v.begin(); + assert((bool)(tmp3b == tmp2b)); + echo("a: " << dv[4]); + echo("b: " << *begin(dv)); + echo("c: " << *begin(v)); + echo("e: " << *tmp1b); + echo("f: " << *tmp2b); + assert((bool)(*tmp1b == *tmp2b)); + assert((bool)(tmp1b == tmp2b)); + assert((bool)(begin(dv) == v.begin())); + assert((bool)(ref_begin_i2 == my_begin_i2)); + + // end + int my_end_i = *end(dv); + int ref_end_i = *v.end(); + echo(my_end_i); + echo(ref_end_i); + assert(my_end_i == ref_end_i); + const std::vector<int>::iterator& tmp1(end(dv)); + const std::vector<int>::iterator& tmp2(v.end()); + const std::vector<int>::iterator& tmp3(v.end()); + var tmp4 = v.end(); + assert((bool)(tmp3 == tmp2)); + + echo("a: " << dv[4]); + echo("b: " << *end(dv)); + echo("c: " << *end(v)); + echo("e: " << *tmp1); + echo("f: " << *tmp2); + assert((bool)(*tmp1 == *tmp2)); + assert((bool)(tmp1 == tmp2)); + assert((bool)(end(dv) == v.end())); + int i = 0; + // stl_each(v, i) + for (dit = begin(dv); v.end() != dit && i < 20; ++dit, ++i) + std::cout << i << ": " << *dit << std::endl; + + assert(i == 4); + + echo("exiting"); + return 0; +} diff --git a/dynamic-use-of-static-c++/test/test_damien.cc b/dynamic-use-of-static-c++/test/test_damien.cc new file mode 100644 index 0000000..4b30fbd --- /dev/null +++ b/dynamic-use-of-static-c++/test/test_damien.cc @@ -0,0 +1,96 @@ +#include "my_lib/damien.hh" + +#include "dyn-all.hh" +using namespace dyn::language; + +namespace dyn +{ + fun down("mk_down"); + + template <typename T> + data mk_down(const T& t) + { + fun ctor(std::string("down< ") + mlc_name_of(t) + " >"); + return ctor(t); + } +} + +int main() +{ + dyn::include_dir(DYN_FIXTURES); + dyn::include("my_lib/damien.hxx"); + + down<char> a('x'); + down<int> b(10); + std::string bar("bar"); + down<std::string> c(bar); // c("bar"); // it's worst + down<down<std::string> > d(c); + down<int> e(20); + + var d2 = d; + + std::cout << d2 << std::endl; + + fun dyn_foo("foo"); + fun dyn_change("change"); + ctor mk_down_char("down<char>"); + ctor mk_down_int("down<int>"); + meth dyn_print_noarg("print_noarg"); + meth dyn_get_i("get_i"); + meth dyn_get_t("get_t"); + method dyn_clone("clone"); // Same as meth + + var f = mk_down_char('x'); + + std::cout << mlc_name_of(f) << std::endl; + + var g = mk_down_int(44); + var h = dyn::mk_down(e); + + var j = dyn::down(46); + + meth j_print_noarg = j.method("print_noarg"); + + // std::cout is not printable + // but a data containing std::cout yes + var dyn_std_cout = std::cout; + std::cout << dyn_std_cout << std::endl; + + for ( int i = 0; i < 5; ++i ) + { + std::cout << "*** Turn " << i << " ***" << std::endl; + dyn_print_noarg(a); + + dyn_foo(a); + + dyn_foo(b); + dyn_foo(c); + dyn_foo(d); + dyn_foo(e); + dyn_foo(42); + + dyn_print_noarg(f); + + dyn_foo(g); + + dyn_change(c); + + var x1 = dyn_get_i(b); + std::cout << "dyn_get_i(b) => " << x1 << std::endl; + var x2 = *dyn_get_t(d); + std::cout << "dyn_get_t(d) => " << x2 << std::endl; + + var x3 = *dyn_clone(a); + std::cout << "*clone(a) => " << x3 << std::endl; + + j.send("print_noarg"); + + j.fake_method(a).send("print_noarg"); + h.fake_method(a).send("print_noarg"); + + j_print_noarg(); + } + + std::cout << "exiting" << std::endl; + return 0; +} diff --git a/dynamic-use-of-static-c++/test/test_function_loader.cc b/dynamic-use-of-static-c++/test/test_function_loader.cc new file mode 100644 index 0000000..50ee9d4 --- /dev/null +++ b/dynamic-use-of-static-c++/test/test_function_loader.cc @@ -0,0 +1,75 @@ +#include <sstream> + +#include "my_lib/lib.hh" + +#include "dyn-all.hh" + +using namespace dyn::language; + +int main() +{ + dyn::include_dir(DYN_FIXTURES); + + dyn::fun dfoo1("foo1", "my_lib/lib.hh"); // With the include + + dyn::include("my_lib/lib.hh"); // setup a default include + + dyn::fun dfoo2("foo2"); // use the default includes + dyn::fun dfoo2b("foo2b"); + dyn::fun dfoo3("foo3"); + dyn::fun dfoo4("foo4"); + dyn::fun dsqr("my_lib::sqr"); + dyn::fun dpower("my_lib::power"); + + dfoo1(); + dfoo1(); + + int* x1 = dfoo3(1, 2, 3); + std::cout << x1 << std::endl; + + t<int, int> t12(1, 2); + + t<int, int>* x2 = dfoo3(t12, t<int, int>(3, 4), t<int, int>(5, 6)); + std::cout << x2 << std::endl; + // var x2b = dfoo3(t12, t<int, int>(3, 4), t<int, int>(5, 6)); + + var x4c = dfoo2b(); + std::cout << x4c << std::endl; + int x4b = 2; + x4b = dfoo2b(); + std::cout << x4b << std::endl; + int* x4 = dfoo2(); + std::cout << *x4 << std::endl; + var x4d = dfoo2(); + int* x4e = x4d; + std::cout << x4d << std::endl; + std::cout << *x4e << std::endl; + + float f2a = dsqr(3.4); + std::cout << "f2a: " << f2a << std::endl; + double f2b = dsqr(3.4); + std::cout << "f2b: " << f2b << std::endl; + assert(fabs(f2a - f2b) < 0.00001); + var f2c = dsqr(3.4); + std::cout << f2c << std::endl; + int i1 = dsqr(3); + std::cout << i1 << std::endl; + + echo("Test istreams"); + std::istringstream istr("32"); + int uii = 4; + u<int> ui(uii); + var dui = ui; + std::cout << dui << std::endl; + istr >> dui; + std::cout << dui << std::endl; + + echo("Test affectations"); + var count = 0; + ++count; + echo(count); + assert(count == 1); + + echo("exiting"); + return 0; +} diff --git a/dynamic-use-of-static-c++/test/test_function_loader.rb b/dynamic-use-of-static-c++/test/test_function_loader.rb new file mode 100644 index 0000000..ee2c4ed --- /dev/null +++ b/dynamic-use-of-static-c++/test/test_function_loader.rb @@ -0,0 +1,23 @@ +require 'pathname' +require 'yaml' +test = Pathname.new(__FILE__).dirname +root = test.parent +fixtures = test + 'fixtures' +src = root + 'src' +$: << src +require 'function_loader' + +FunctionLoader.include_dir fixtures +FunctionLoader.include_dir src + +Pathname.glob(fixtures + '*.yml.cc').each do |file| + YAML.load(file.read).each do |identifier, ref| + fun = FunctionLoader.new identifier + puts fun + puts ref + puts fun.to_cxx + fun_ptr = fun.get_function + puts fun_ptr + puts '-' * 79 + end +end diff --git a/dynamic-use-of-static-c++/test/test_function_loader_cxx.rb b/dynamic-use-of-static-c++/test/test_function_loader_cxx.rb new file mode 100644 index 0000000..ddbb118 --- /dev/null +++ b/dynamic-use-of-static-c++/test/test_function_loader_cxx.rb @@ -0,0 +1,26 @@ +require 'pathname' +require 'yaml' +test = Pathname.new(__FILE__).dirname +root = test.parent +fixtures = test + 'fixtures' +src = root + 'src' +$: << src +require 'function_loader' + +FunctionLoader.include_dir fixtures +FunctionLoader.include_dir src + +funs = [] + +funs << FunctionLoader.call(:proc, 'foo1', [], 'my_lib/lib.hh') +funs << FunctionLoader.call(:fun, 'foo2', [], 'my_lib/lib.hh') +funs << FunctionLoader.call(:fun, 'foo3', + ['double', 'const double', 'const double&'], + 'my_lib/lib.hh') +funs << FunctionLoader.call(:fun, 'my_lib::x::foo4', + ['u<float>', 't<t<char, char>, u<const int> >'], + 'my_lib/lib.hh') +funs << FunctionLoader.call(:fun, 'foo3', ['t<int, char>', + 'const t<int, char>', 'const t<int, char>&'], + 'my_lib/lib.hh') + diff --git a/dynamic-use-of-static-c++/test/test_methods.cc b/dynamic-use-of-static-c++/test/test_methods.cc new file mode 100644 index 0000000..079e49e --- /dev/null +++ b/dynamic-use-of-static-c++/test/test_methods.cc @@ -0,0 +1,26 @@ +#include "dyn-all.hh" +using namespace dyn::language; +#include <iostream> + +int main() +{ + dyn::include_dir(DYN_FIXTURES); + + std::cout << "Test methods" << std::endl; + ctor mk_down_int("down<int>", "my_lib/damien.hh"); + ctor mk_boo("my_lib::boo", "my_lib/lib.hh"); + meth print("print", "my_lib/lib.hh:my_lib/damien.hh"); + + var v1 = mk_down_int(42); + print(v1, std::cout); + std::cout << std::endl; + + val v2 = mk_boo(std::cout); + print(v2, 42, "foo"); + print(v2, "bar", 51); + print(v2, 16, 64); + print(v2, 2, "21"); + + std::cout << "exiting" << std::endl; + return 0; +} diff --git a/dynamic-use-of-static-c++/test/test_olena.cc b/dynamic-use-of-static-c++/test/test_olena.cc new file mode 100644 index 0000000..d814767 --- /dev/null +++ b/dynamic-use-of-static-c++/test/test_olena.cc @@ -0,0 +1,21 @@ +#include "dyn-all.hh" +using namespace dyn::language; + +int main() +{ + dyn::include_dir(OLENA_PROTO_STL_STYLE); // FIXME: Move it into fixtures/olean-proto-stl-style + // FIXME: Add + dyn::include("all.hh"); + + fun iota("iota"); + fun println_2d("println_2d"); + ctor mk_image2d_int("image2d<int>"); + + var ima = mk_image2d_int(3, 3); + + println_2d(std::cout, "ima_before=", ima); + iota(ima); + println_2d(std::cout, "ima-after=", ima); + + std::cout << "exiting" << std::endl; +} diff --git a/dynamic-use-of-static-c++/test/test_var_and_val.cc b/dynamic-use-of-static-c++/test/test_var_and_val.cc new file mode 100644 index 0000000..e890e18 --- /dev/null +++ b/dynamic-use-of-static-c++/test/test_var_and_val.cc @@ -0,0 +1,95 @@ +#include "my_lib/lib.hh" + +#include "dyn-all.hh" +using namespace dyn::language; + +int main() +{ + dyn::include_dir(DYN_FIXTURES); + dyn::include("my_lib/lib.hh"); + + echo("Test vars and vals"); + val i = 4; + val j = 3 + i; + var k1(i); + var k2 = i; + // var l1 = "foo"; + // var l2("foo"); + echo("i: " << i); + echo("j: " << j); + echo("k: " << k1 << ", " << k2); + + std::string str(" youhou"); + const std::string cst_str(" const youhou"); + + echo("var_str1"); + var var_str1(str); + assert(not var_str1.is_const()); + var_str1[0] = 'a'; + assert(var_str1 == "a youhou"); + assert(str == "a youhou"); + + echo("var_str2"); + var var_str2(cst_str); + assert(not var_str2.is_const()); + var_str2[0] = 'a'; + assert(var_str2 == "a const youhou"); + assert(cst_str == " const youhou"); + + echo("var_str3"); + var var_str3(var_str1); + assert(not var_str3.is_const()); + var_str3[0] = 'b'; + assert(var_str3 == "b youhou"); + assert(var_str1 == "b youhou"); + assert(str == "b youhou"); + + echo("var_str4"); + var var_str4(var_str2); + assert(not var_str4.is_const()); + var_str4[0] = 'b'; + assert(var_str4 == "b const youhou"); + assert(var_str2 == "a const youhou"); // here we see that we have another copy + assert(cst_str == " const youhou"); + + echo("val_str1"); + val val_str1(str); + assert(val_str1.is_const()); + // val_str1[0] = 'a'; // Does not compile + assert(val_str1 == "b youhou"); + + echo("val_str2"); + val val_str2(cst_str); + assert(val_str2.is_const()); + // val_str2[0] = 'a'; // Does not compile + assert(val_str2 == " const youhou"); + + echo("val_str3"); + val val_str3(val_str1); + assert(val_str3.is_const()); + // val_str3[0] = 'b'; // Does not compile + assert(val_str3 == "b youhou"); + + echo("val_str4"); + val val_str4(val_str2); + assert(val_str4.is_const()); + // val_str4[0] = 'b'; // Does not compile + assert(val_str4 == " const youhou"); + + echo("val_str5"); + val val_str5(var_str1); + assert(val_str5.is_const()); + // val_str5[0] = 'b'; // Does not compile + assert(val_str5 == "b youhou"); + + echo("var_str6"); + var var_str6(val_str1); + assert(var_str6.is_const()); // FIXME should be not const + // var_str6[0] = 'c'; // FIXME should compile + // assert(var_str6 == "c youhou"); + assert(var_str1 == "b youhou"); + assert(str == "b youhou"); + + echo("exiting"); + return 0; +} diff --git a/dynamic-use-of-static-c++/test/vaucanson/Makefile.am b/dynamic-use-of-static-c++/test/vaucanson/Makefile.am new file mode 100644 index 0000000..12719b1 --- /dev/null +++ b/dynamic-use-of-static-c++/test/vaucanson/Makefile.am @@ -0,0 +1,18 @@ +# FIXME: Clean me! + +check-local_DISABLE: tree.yml + @@BIN@@/yaml_to_dyn_decls < $< + cp dyn_vaucanson_dyn_mirror.hh @@VCSN@@/src/demos/function_library + wc tree.swig tree.yml dyn_vaucanson_dyn_mirror.hh dyn_vaucanson_methods.yml + +vcsn.i: @@BIN@@/mk_swig_input + @@BIN@@/mk_swig_input @@VCSN@@/include + +tree.swig: vcsn.i + -@@SWIG@@ @@SWIGINCLUDES@@ -I@@VCSN@@/include -c++ -tree-dumper $< > $@ + +tree.yml: tree.swig + @@BIN@@/swig_tree_to_yaml < $< > $@ + +clean-local: + rm -f tree.swig tree.yml vcsn.i dyn_vaucanson_methods.hh dyn_vaucanson_dyn_mirror.hh diff --git a/dynamic-use-of-static-c++/test/vaucanson/dyn_algorithms.cc b/dynamic-use-of-static-c++/test/vaucanson/dyn_algorithms.cc new file mode 100644 index 0000000..6270a74 --- /dev/null +++ b/dynamic-use-of-static-c++/test/vaucanson/dyn_algorithms.cc @@ -0,0 +1,464 @@ +// algorithms.cc: this file is part of the Vaucanson project. +// +// Vaucanson, a generic library for finite state machines. +// +// Copyright (C) 2004, 2005 The Vaucanson Group. +// +// 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. +// +// The complete GNU General Public Licence Notice can be found as the +// `COPYING' file in the root directory. +// +// The Vaucanson Group consists of people listed in the `AUTHORS' file. +// +#include <fstream> +// #include <sstream> +// #include <cstdlib> +// #include <list> + +#include "dyn.hh" +#include "dyn_vaucanson_dyn_mirror.hh" +#include "vaucanson_tools_dyn.hh" +#include "vaucanson_tools_dyn_xml.hh" + +using namespace dyn::vcsn::io; +using dyn::vcsn::xml::XML; +using namespace dyn::language; +using namespace dyn::vcsn::tools; + +// static +// void +// usage(int, char** argv) +// { + // std::cerr << "Usage: " << std::endl + // << "\t" << argv[0] << " <algorithm> <args...>" << std::endl; + // exit(1); +// } + +// static +// var +// alphabet() +// { + // var a = dyn::alphabet('a'); + // a.insert('a'); + // a.insert('b'); + // return a; +// } + +// static +// var +// get_exp(std::string s) +// { + // return new_rat_exp(alphabet(), s); +// } + +static +var +get_aut(std::string s) +{ + std::istream* is (s == "-" ? &std::cin : new std::ifstream (s.c_str())); + if (not is->fail()) + { + var automaton = dyn::vcsn::tools::xml::load_from_xml(*is); + // var loader = dyn::automaton_loader(context_automaton, string_out (), XML ()); + // *is >> loader; + + if (s != "-") + delete is; + return automaton; + } + else + { + std::cerr << "FATAL: Could not load automaton." << std::endl; + exit(1); + } +} + +#if 0 +static +void +derived_term_automaton_command(int argc, char** argv) +{ + if (argc != 3) + usage(argc, argv); + + rat_exp_t e = get_exp(argv[2]); + automaton_t a = new_automaton(alphabet()); + derived_term_automaton(a, e); + std::cout << automaton_saver(a, string_out (), XML ()); +} + +static +void +aut_to_exp_command(int argc, char** argv) +{ + if (argc < 3) + usage(argc, argv); + else if (argc == 3) + std::cout << aut_to_exp(get_aut(argv[2]), DMChooser()) << std::endl; + else + { + automaton_t a = get_aut(argv[2]); + if (a.states().size() != unsigned (argc - 3)) + { + std::cerr << "ERROR: Invalid state list." << std::endl; + exit(2); + } + + std::list<hstate_t> l; + for (int i = 3; i < argc; ++i) + { + std::istringstream is (argv[i]); + int s; + + is >> s; + if (s < 0 or unsigned (s) >= a.states().size()) + { + std::cerr << "ERROR: " << s << " is not a valid state." + << std::endl; + exit(2); + } + l.push_back(s); + } + + std::cout << aut_to_exp(a, ListChooser (l)) << std::endl; + } +} + +static +void +product_command(int argc, char** argv) +{ + if (argc != 4) + usage(argc, argv); + + std::cout << automaton_saver(product(get_aut(argv[2]), get_aut(argv[3])), + string_out (), + XML ()); +} + + +static +void +are_isomorphic_command(int argc, char** argv) +{ + if (argc != 4) + usage(argc, argv); + + std::cout << are_isomorphic(get_aut(argv[2]), get_aut(argv[3])) << std::endl; +} + + +void +eval_command(int argc, char** argv) +{ + if (argc != 4) + usage(argc, argv); + + std::cout << eval(realtime(get_aut(argv[2])), std::string (argv[3])) + << std::endl; +} + +void +is_empty_command(int argc, char** argv) +{ + if (argc != 3) + usage(argc, argv); + + automaton_t a = coaccessible(accessible(get_aut(argv[2]))); + + if (a.states().size() > 0) + std::cout << false << std::endl; + else + std::cout << true << std::endl; +} + + +void +power_command(int argc, char** argv) +{ + if (argc != 4) + usage(argc, argv); + + int n = atoi(argv[3]); + + automaton_t a = get_aut(argv[2]); + automaton_t p(a); + + for (int i = 1; i < n; ++i) + p = product(p, a); + + std::cout << automaton_saver(p, string_out (), XML ()); +} + +static +void +display_command(int argc, char** argv) +{ + if (argc != 3) + usage(argc, argv); + + vcsn::tools::dot_display(get_aut(argv[2]), "A", true); +} + +static +void +info_command(int argc, char** argv) +{ + if (argc != 3) + usage(argc, argv); + + automaton_t a = get_aut(argv[2]); + + std::cout << "States: " << a.states().size() << std::endl; + std::cout << "Transitions: " << a.edges().size() << std::endl; + std::cout << "Initial states: " << a.initial().size() << std::endl; + std::cout << "Final states: " << a.final().size() << std::endl; +} + +static +void +expand_command(int argc, char** argv) +{ + if (argc != 3) + usage(argc, argv); + + std::cout << expand(get_exp(argv[2])) << std::endl; +} + +static +void +minimize_command(int argc, char** argv) +{ + if (argc < 3) + usage(argc, argv); + else if (argc == 3) + std::cout << automaton_saver(minimization_hopcroft(get_aut(argv[2])), + string_out (), XML ()) + << std::endl; + else + { + std::string arg (argv[3]); + automaton_t a = get_aut(argv[2]); + + if (arg == "-m") + std::cout << automaton_saver(minimization_moore(get_aut(argv[2])), + string_out (), XML ()) + << std::endl; + + else if (arg == "-h") + std::cout << automaton_saver(minimization_hopcroft(get_aut(argv[2])), + string_out (), XML ()) + << std::endl; + } +} + +static +void +concatenate_command(int argc, char** argv) +{ + if (argc != 4) + usage(argc, argv); + + std::cout << automaton_saver(concatenate(get_aut(argv[2]), get_aut(argv[3])), + string_out (), XML ()) + << std::endl; +} + +static +void +sum_command(int argc, char** argv) +{ + if (argc != 4) + usage(argc, argv); + + std::cout << automaton_saver(sum(get_aut(argv[2]), get_aut(argv[3])), + string_out (), XML ()) + << std::endl; +} + +static +void +closure_command(int argc, char** argv) +{ + if (argc != 3) + usage(argc, argv); + + std::cout << automaton_saver(accessible(closure(get_aut(argv[2]))), + string_out (), XML ()) + << std::endl; +} + +static +void +determinize_command(int argc, char** argv) +{ + if (argc != 3) + usage(argc, argv); + + std::cout << automaton_saver(determinize(realtime(get_aut(argv[2]))), + string_out (), XML ()) + << std::endl; +} + +static +void +quotient_command(int argc, char** argv) +{ + if (argc != 3) + usage(argc, argv); + + std::cout << automaton_saver(quotient(realtime(get_aut(argv[2]))), + string_out (), XML ()) + << std::endl; +} + +static +void +standardize_command(int argc, char** argv) +{ + if (argc != 3) + usage(argc, argv); + + automaton_t a = get_aut(argv[2]); + standardize(a); + + std::cout << automaton_saver(a, string_out (), XML ()) << std::endl; +} +#endif + +#define ONE_ARG_COMMAND(GetArg, Algo) one_arg_command_ ## Algo ## _ ## GetArg + +#define DEFINE_ONE_ARG_COMMAND(GetArg, Algo) \ +static \ +void \ +ONE_ARG_COMMAND(GetArg, Algo)(int argc, char** argv) \ +{ \ + if (argc != 3) \ + usage(argc, argv); \ + std::cout << dyn::automaton_saver(dyn::Algo(GetArg(argv[2])), \ + string_out (), \ + XML ()); \ +} + +// DEFINE_ONE_ARG_COMMAND(get_exp, standard_of) +// DEFINE_ONE_ARG_COMMAND(get_exp, thompson_of) +// DEFINE_ONE_ARG_COMMAND(get_aut, trim) +// DEFINE_ONE_ARG_COMMAND(get_aut, transpose) +// DEFINE_ONE_ARG_COMMAND(get_aut, realtime) +// DEFINE_ONE_ARG_COMMAND(get_aut, coaccessible) +// DEFINE_ONE_ARG_COMMAND(get_aut, accessible) +// DEFINE_ONE_ARG_COMMAND(get_aut, normalize) + +#undef DEFINE_ONE_ARG_COMMAND + +// const struct +// { + // char* name; + // void (*command)(int, char**); +// } +// command_map[] = + // { + // { "expand", expand_command }, + // { "standard_of", ONE_ARG_COMMAND(get_exp, standard_of) }, + // { "thompson_of", ONE_ARG_COMMAND(get_exp, thompson_of) }, + // { "derived_terms", derived_term_automaton_command }, + // { "aut_to_exp", aut_to_exp_command }, + // { "quotient", quotient_command }, + // { "product", product_command }, + // { "closure", closure_command }, + // { "is-empty", is_empty_command }, + // { "are-isomorphic", are_isomorphic_command }, + // { "closure", closure_command }, + // { "determinize", determinize_command }, + // { "minimize", minimize_command }, + // { "trim", ONE_ARG_COMMAND(get_aut, trim) }, + // { "transpose", ONE_ARG_COMMAND(get_aut, transpose) }, + // { "accessible", ONE_ARG_COMMAND(get_aut, coaccessible) }, + // { "coaccessible", ONE_ARG_COMMAND(get_aut, accessible) }, + // { "sum", sum_command }, + // { "concatenate", concatenate_command }, + // { "realtime", ONE_ARG_COMMAND(get_aut, realtime) }, + // { "eval", eval_command }, + // { "power", power_command }, + // { "normalize", ONE_ARG_COMMAND(get_aut, normalize) }, + // { "standardize", standardize_command }, + // { "display", display_command }, + // { "info", info_command }, + // { 0, 0 } + // }; + +#undef ONE_ARG_COMMAND + +int +main(int argc, char** argv) +{ + argc = 0; + // if (argc < 2) + // usage(argc, argv); + + dyn::include_dir(DYNDIR); + dyn::include_dir("../../../include"); + dyn::include_dir("."); + dyn::include("vaucanson/xml/XML.hh"); + + std::cout << "context" << std::endl; + // algebraic_context context(argv[1], argv[2]); + + // dyn::proc insert("insert", "method"); + + // var context_automaton = context.mk_automaton(); + + var automaton = get_aut(argv[4]); + + std::cout << dyn::vcsn::automaton_saver(automaton, string_out(), XML()); + + std::string algorithms("vaucanson/algorithms/"); + dyn::fun algo(argv[3], algorithms + argv[3] + ".hh"); + + std::cout << dyn::vcsn::automaton_saver(algo(automaton), string_out(), XML()); + + // std::string cmd (argv[1]); + // int i; + + // for (i = 0; command_map[i].name != 0; ++i) + // if (cmd == command_map[i].name) + // { + // command_map[i].command(argc, argv); + // break ; + // } + // if (command_map[i].name == 0) + // { + // std::cerr << "Available algorithms:" << std::endl; + // std::cerr << " * is-empty" << std::endl; + // std::cerr << " * are-isomorphic" << std::endl; + // std::cerr << " * accessible" << std::endl; + // std::cerr << " * coaccessible" << std::endl; + // std::cerr << " * realtime" << std::endl; + // std::cerr << " * trim" << std::endl; + // std::cerr << " * transpose" << std::endl; + // std::cerr << " * aut_to_exp" << std::endl; + // std::cerr << " * expand" << std::endl; + // std::cerr << " * standard_of" << std::endl; + // std::cerr << " * thompson_of" << std::endl; + // std::cerr << " * derived_terms" << std::endl; + // std::cerr << " * product" << std::endl; + // std::cerr << " * power" << std::endl; + // std::cerr << " * determinize" << std::endl; + // std::cerr << " * minimize" << std::endl; + // std::cerr << " * quotient" << std::endl; + // std::cerr << " * closure" << std::endl; + // std::cerr << " * eval" << std::endl; + // std::cerr << " * display" << std::endl; + // std::cerr << " * info" << std::endl; + // exit(1); + // } + + std::cout << "Exiting, segv in approch..." << std::endl; + +} + + diff --git a/dynamic-use-of-static-c++/test/vaucanson/dyn_vaucanson_dyn_mirror.hh b/dynamic-use-of-static-c++/test/vaucanson/dyn_vaucanson_dyn_mirror.hh new file mode 100644 index 0000000..58e68ed --- /dev/null +++ b/dynamic-use-of-static-c++/test/vaucanson/dyn_vaucanson_dyn_mirror.hh @@ -0,0 +1,1277 @@ +namespace dyn { + namespace vcsn { + namespace z_transducer { + } // end of namespace z_transducer + } // end of namespace vcsn + namespace vcsn { + namespace z_transducer { + fun automaton_t("dyn::vcsn::z_transducer::automaton_t", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/z_transducer.hh"); + } // end of namespace z_transducer + } // end of namespace vcsn + namespace vcsn { + namespace z_fmp_transducer { + } // end of namespace z_fmp_transducer + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace xml { + // struct xerces_parser { + ctor xerces_parser("vcsn::xml::xerces_parser"); + // }; + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace z_max_plus_automaton { + fun automaton_t("dyn::vcsn::z_max_plus_automaton::automaton_t", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/z_max_plus_automaton.hh"); + } // end of namespace z_max_plus_automaton + } // end of namespace vcsn + namespace vcsn { + namespace z_min_plus_automaton { + fun automaton_t("dyn::vcsn::z_min_plus_automaton::automaton_t", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/z_min_plus_automaton.hh"); + } // end of namespace z_min_plus_automaton + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + fun automaton_t("dyn::vcsn::VCSN_CONTEXT_NAMESPACE::automaton_t", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/contexts/automaton.thh"); + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + fun aut_to_exp("dyn::vcsn::VCSN_CONTEXT_NAMESPACE::aut_to_exp", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/contexts/automaton_functions.thh"); + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace fmp_transducer { + } // end of namespace fmp_transducer + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace VCSN_CONTEXT_NAMESPACE { + } // end of namespace VCSN_CONTEXT_NAMESPACE + } // end of namespace vcsn + namespace vcsn { + namespace xml { + fun xml2str("dyn::vcsn::xml::xml2str", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/xml/strings.hh"); + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace xml { + // struct xml_session { + ctor xml_session("vcsn::xml::xml_session"); + // }; + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace xml { + // struct BinCxxInputStream { + ctor BinCxxInputStream("vcsn::xml::BinCxxInputStream"); + // }; + // struct CxxInputSource { + ctor CxxInputSource("vcsn::xml::CxxInputSource"); + // }; + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace xml { + // struct xml_converter { + ctor xml_converter("vcsn::xml::xml_converter"); + // }; + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace xml { + namespace tools { + } // end of namespace tools + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace xml { + // struct reference_pair { + ctor reference_pair("vcsn::xml::reference_pair"); + // }; + // struct Node { + ctor Node("vcsn::xml::Node"); + // }; + // struct automatonNode { + ctor automatonNode("vcsn::xml::automatonNode"); + // }; + // struct transducerNode { + ctor transducerNode("vcsn::xml::transducerNode"); + // }; + // struct typeNode { + ctor typeNode("vcsn::xml::typeNode"); + // }; + // struct contentNode { + ctor contentNode("vcsn::xml::contentNode"); + // }; + // struct statesNode { + ctor statesNode("vcsn::xml::statesNode"); + // }; + // struct transitionsNode { + ctor transitionsNode("vcsn::xml::transitionsNode"); + // }; + // struct stateNode { + ctor stateNode("vcsn::xml::stateNode"); + // }; + // struct transitionNode { + ctor transitionNode("vcsn::xml::transitionNode"); + // }; + // struct initialNode { + ctor initialNode("vcsn::xml::initialNode"); + // }; + // struct finalNode { + ctor finalNode("vcsn::xml::finalNode"); + // }; + // struct semiringNode { + ctor semiringNode("vcsn::xml::semiringNode"); + // }; + // struct monoidNode { + ctor monoidNode("vcsn::xml::monoidNode"); + // }; + // struct freemonoidNode { + ctor freemonoidNode("vcsn::xml::freemonoidNode"); + // }; + // struct generatorNode { + ctor generatorNode("vcsn::xml::generatorNode"); + // }; + // struct geometryNode { + ctor geometryNode("vcsn::xml::geometryNode"); + // }; + // struct drawingNode { + ctor drawingNode("vcsn::xml::drawingNode"); + // }; + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace xml { + // struct xml_chooser_base { + ctor xml_chooser_base("vcsn::xml::xml_chooser_base"); + // }; + // struct xml_chooser { + ctor xml_chooser("vcsn::xml::xml_chooser"); + // }; + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace xml { + // struct myDOMErrorHandler { + ctor myDOMErrorHandler("vcsn::xml::myDOMErrorHandler"); + // }; + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace r_automaton { + fun automaton_t("dyn::vcsn::r_automaton::automaton_t", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/r_automaton.hh"); + } // end of namespace r_automaton + } // end of namespace vcsn + namespace vcsn { + namespace z_automaton { + fun automaton_t("dyn::vcsn::z_automaton::automaton_t", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/z_automaton.hh"); + } // end of namespace z_automaton + } // end of namespace vcsn + namespace vcsn { + namespace boolean_automaton { + fun automaton_t("dyn::vcsn::boolean_automaton::automaton_t", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/boolean_automaton.hh"); + } // end of namespace boolean_automaton + } // end of namespace vcsn + namespace vcsn { + namespace boolean_transducer { + } // end of namespace boolean_transducer + } // end of namespace vcsn + namespace vcsn { + namespace boolean_transducer { + fun automaton_t("dyn::vcsn::boolean_transducer::automaton_t", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/boolean_transducer.hh"); + } // end of namespace boolean_transducer + } // end of namespace vcsn + namespace vcsn { + namespace xml { + // struct XML { + ctor XML("vcsn::xml::XML"); + // }; + } // end of namespace xml + } // end of namespace vcsn + namespace vcsn { + namespace tools { + } // end of namespace tools + } // end of namespace vcsn + namespace vcsn { + namespace tools { + fun xml_argv("dyn::vcsn::tools::xml_argv", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/tools/xml_display.hh"); + } // end of namespace tools + } // end of namespace vcsn + namespace vcsn { + namespace io { + // struct usual_converter_exp { + ctor usual_converter_exp("vcsn::io::usual_converter_exp"); + // }; + // struct usual_converter_poly { + ctor usual_converter_poly("vcsn::io::usual_converter_poly"); + // }; + } // end of namespace io + } // end of namespace vcsn + namespace vcsn { + namespace tools { + } // end of namespace tools + } // end of namespace vcsn + namespace vcsn { + namespace tools { + } // end of namespace tools + } // end of namespace vcsn + namespace vcsn { + namespace io { + // struct simple { + ctor simple("vcsn::io::simple"); + // }; + } // end of namespace io + } // end of namespace vcsn + namespace vcsn { + namespace io { + // struct automaton_saver_ { + ctor automaton_saver_("vcsn::io::automaton_saver_"); + // }; + // struct string_out { + ctor string_out("vcsn::io::string_out"); + // }; + } // end of namespace io + namespace io { + // struct automaton_loader_ { + ctor automaton_loader_("vcsn::io::automaton_loader_"); + // }; + } // end of namespace io + } // end of namespace vcsn + namespace vcsn { + // struct GenRandomAutomataSet { + ctor GenRandomAutomataSet("vcsn::GenRandomAutomataSet"); + // }; + // struct GenRandomAutomata { + ctor GenRandomAutomata("vcsn::GenRandomAutomata"); + // }; + fun alea("dyn::vcsn::alea", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/tools/gen_random.hh"); + } // end of namespace vcsn + namespace vcsn { + namespace tools { + } // end of namespace tools + } // end of namespace vcsn + namespace vcsn { + namespace tools { + } // end of namespace tools + } // end of namespace vcsn + namespace vcsn { + namespace io { + // struct dot { + ctor dot("vcsn::io::dot"); + // }; + // struct transducer_dot { + ctor transducer_dot("vcsn::io::transducer_dot"); + // }; + } // end of namespace io + } // end of namespace vcsn + namespace vcsn { + namespace tools { + } // end of namespace tools + } // end of namespace vcsn + namespace vcsn { + namespace tools { + fun dotty_argv("dyn::vcsn::tools::dotty_argv", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/tools/dot_display.hh"); + } // end of namespace tools + } // end of namespace vcsn + namespace vcsn { + // struct op_begin_traits { + ctor op_begin_traits("vcsn::op_begin_traits"); + // }; + // struct op_rbegin_traits { + ctor op_rbegin_traits("vcsn::op_rbegin_traits"); + // }; + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + namespace tools { + fun usual_escaped_characters("dyn::vcsn::tools::usual_escaped_characters", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/tools/usual_escaped_characters.hh"); + } // end of namespace tools + } // end of namespace vcsn + namespace utility { + // struct pair { + ctor pair("utility::pair"); + // }; + // struct discrepancy { + ctor discrepancy("utility::discrepancy"); + // }; + } // end of namespace utility + namespace utility { + // struct iomanip { + ctor iomanip("utility::iomanip"); + // }; + } // end of namespace utility + namespace utility { + // struct escaper { + ctor escaper("utility::escaper"); + // }; + // struct setesc { + ctor setesc("utility::setesc"); + // }; + fun getesc("dyn::utility::getesc", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/misc/escaper.hh"); + } // end of namespace utility + namespace utility { + // struct Window { + ctor Window("utility::Window"); + // }; + } // end of namespace utility + namespace utility { + } // end of namespace utility + namespace utility { + namespace unique { + // struct UniqueListBase { + ctor UniqueListBase("utility::unique::UniqueListBase"); + // }; + // struct uniquelist { + ctor uniquelist("utility::unique::uniquelist"); + // }; + // struct UniqueMap { + // struct TiSlot { + ctor TiSlot("utility::unique::UniqueMap::TiSlot"); + // }; + ctor UniqueMap("utility::unique::UniqueMap"); + // }; + // struct unifiable { + ctor unifiable("utility::unique::unifiable"); + // }; + } // end of namespace unique + } // end of namespace utility + namespace utility { + // struct Support { + ctor Support("utility::Support"); + // }; + // struct SupportIterator { + ctor SupportIterator("utility::SupportIterator"); + // }; + // struct SparseIterator { + ctor SparseIterator("utility::SparseIterator"); + // }; + } // end of namespace utility + namespace std { + } // end of namespace std + namespace utility { + // struct SparseInterval { + ctor SparseInterval("utility::SparseInterval"); + // }; + // struct SelfIterator { + ctor SelfIterator("utility::SelfIterator"); + // }; + } // end of namespace utility + namespace utility { + namespace random { + fun generate_letter("dyn::utility::random::generate_letter", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/misc/random.hh"); + fun generate_digit("dyn::utility::random::generate_digit", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/misc/random.hh"); + } // end of namespace random + } // end of namespace utility + namespace utility { + // struct limits { + ctor limits("utility::limits"); + // }; + } // end of namespace utility + namespace utility { + // struct DeferrerDebugPart { + ctor DeferrerDebugPart("utility::DeferrerDebugPart"); + // }; + // struct Deferrer { + ctor Deferrer("utility::Deferrer"); + // }; + } // end of namespace utility + namespace utility { + namespace contract { + fun trap("dyn::utility::contract::trap", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/misc/contract.hh"); + // struct fail { + ctor fail("utility::contract::fail"); + // }; + } // end of namespace contract + } // end of namespace utility + namespace utility { + namespace concepts { + } // end of namespace concepts + } // end of namespace utility + namespace std { + } // end of namespace std + namespace utility { + // struct Bitset { + // struct BitActionCount { + ctor BitActionCount("utility::Bitset::BitActionCount"); + // }; + ctor Bitset("utility::Bitset"); + // }; + fun OPERATORPUSH("dyn::utility::OPERATORPUSH", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/misc/bitset.hh"); + } // end of namespace utility + namespace std { + } // end of namespace std + namespace utility { + // struct generic_int_type { + ctor generic_int_type("utility::generic_int_type"); + // }; + // struct char_traits { + ctor char_traits("utility::char_traits"); + // }; + } // end of namespace utility + namespace vcsn { + // struct DefaultFactoryError { + ctor DefaultFactoryError("vcsn::DefaultFactoryError"); + // }; + // struct Factory { + ctor Factory("vcsn::Factory"); + // }; + } // end of namespace vcsn + namespace vcsn { + // struct SyntacticDecorator { + ctor SyntacticDecorator("vcsn::SyntacticDecorator"); + // }; + } // end of namespace vcsn + namespace vcsn { + // struct Structure { + ctor Structure("vcsn::Structure"); + // }; + } // end of namespace vcsn + namespace vcsn { + // struct dynamic_traits { + ctor dynamic_traits("vcsn::dynamic_traits"); + // }; + // struct SyntacticDecorator { + // }; + // struct MetaElement { + ctor MetaElement("vcsn::MetaElement"); + // }; + // struct Element { + ctor Element("vcsn::Element"); + // }; + // struct default_slot_tag { + ctor default_slot_tag("vcsn::default_slot_tag"); + // }; + // struct SetSlot { + ctor SetSlot("vcsn::SetSlot"); + // }; + // struct Structure { + // }; + // struct virtual_types { + ctor virtual_types("vcsn::virtual_types"); + // }; + // struct undefined_type { + ctor undefined_type("vcsn::undefined_type"); + // }; + } // end of namespace vcsn + namespace vcsn { + // struct SetSlotAttribute { + ctor SetSlotAttribute("vcsn::SetSlotAttribute"); + // }; + // struct SetSlot { + // }; + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace std { + } // end of namespace std + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct Element { + // }; + } // end of namespace vcsn + namespace vcsn { + // struct op_add_traits { + ctor op_add_traits("vcsn::op_add_traits"); + // }; + // struct op_sub_traits { + ctor op_sub_traits("vcsn::op_sub_traits"); + // }; + // struct op_mul_traits { + ctor op_mul_traits("vcsn::op_mul_traits"); + // }; + // struct op_div_traits { + ctor op_div_traits("vcsn::op_div_traits"); + // }; + // struct op_mod_traits { + ctor op_mod_traits("vcsn::op_mod_traits"); + // }; + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct geometry { + ctor geometry("vcsn::geometry"); + // }; + } // end of namespace vcsn + namespace vcsn { + // struct TransposeView { + ctor TransposeView("vcsn::TransposeView"); + // }; + // struct transpose_traits { + ctor transpose_traits("vcsn::transpose_traits"); + // }; + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct generalized_traits { + ctor generalized_traits("vcsn::generalized_traits"); + // }; + } // end of namespace vcsn + namespace vcsn { + // struct IdentityView { + ctor IdentityView("vcsn::IdentityView"); + // }; + } // end of namespace vcsn + namespace vcsn { + // struct edge_value { + ctor edge_value("vcsn::edge_value"); + // }; + // struct state_value { + ctor state_value("vcsn::state_value"); + // }; + // struct Graph { + ctor Graph("vcsn::Graph"); + // }; + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct TransducerBase { + ctor TransducerBase("vcsn::TransducerBase"); + // }; + // struct transducer_traits { + ctor transducer_traits("vcsn::transducer_traits"); + // }; + // struct extension_traits { + ctor extension_traits("vcsn::extension_traits"); + // }; + // struct projection_traits { + ctor projection_traits("vcsn::projection_traits"); + // }; + // struct output_projection_traits { + ctor output_projection_traits("vcsn::output_projection_traits"); + // }; + } // end of namespace vcsn + namespace vcsn { + // struct Transducer { + ctor Transducer("vcsn::Transducer"); + // }; + // struct Transducer { + // }; + // struct input_projection_helper { + ctor input_projection_helper("vcsn::input_projection_helper"); + // }; + // struct output_projection_helper { + ctor output_projection_helper("vcsn::output_projection_helper"); + // }; + // struct identity_transducer_helper { + ctor identity_transducer_helper("vcsn::identity_transducer_helper"); + // }; + } // end of namespace vcsn + namespace vcsn { + // struct NoTag { + ctor NoTag("vcsn::NoTag"); + // }; + } // end of namespace vcsn + fun OPERATOREQUAL("dyn::OPERATOREQUAL", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/automata/concept/tags.hh"); + fun OPERATORNOTEQUAL("dyn::OPERATORNOTEQUAL", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/automata/concept/tags.hh"); + namespace vcsn { + // struct AutoKind { + ctor AutoKind("vcsn::AutoKind"); + // }; + namespace delta_kind { + // struct edges { + ctor edges("vcsn::delta_kind::edges"); + // }; + // struct states { + ctor states("vcsn::delta_kind::states"); + // }; + } // end of namespace delta_kind + // struct labels_are_series { + ctor labels_are_series("vcsn::labels_are_series"); + // }; + // struct ls_delta_letter_query { + ctor ls_delta_letter_query("vcsn::ls_delta_letter_query"); + // }; + // struct labels_are_couples { + ctor labels_are_couples("vcsn::labels_are_couples"); + // }; + // struct lc_delta_letter_query { + ctor lc_delta_letter_query("vcsn::lc_delta_letter_query"); + // }; + } // end of namespace vcsn + namespace vcsn { + namespace history { + // struct Event { + ctor Event("vcsn::history::Event"); + // }; + // struct BinaryEvent { + ctor BinaryEvent("vcsn::history::BinaryEvent"); + // }; + // struct UnaryEvent { + ctor UnaryEvent("vcsn::history::UnaryEvent"); + // }; + // struct AutomatonHistory { + ctor AutomatonHistory("vcsn::history::AutomatonHistory"); + // }; + } // end of namespace history + } // end of namespace vcsn + namespace vcsn { + // struct state_h { + ctor state_h("vcsn::state_h"); + // }; + // struct edge_h { + ctor edge_h("vcsn::edge_h"); + // }; + // struct handler { + ctor handler("vcsn::handler"); + // }; + } // end of namespace vcsn + namespace std { + } // end of namespace std + namespace vcsn { + namespace delta_kind { + // struct edges { + // }; + // struct states { + // }; + } // end of namespace delta_kind + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct labels_are_letters { + ctor labels_are_letters("vcsn::labels_are_letters"); + // }; + // struct labels_are_words { + ctor labels_are_words("vcsn::labels_are_words"); + // }; + // struct labels_are_series { + // }; + // struct labels_are_couples { + // }; + // struct LabelOf { + ctor LabelOf("vcsn::LabelOf"); + // }; + } // end of namespace vcsn + namespace vcsn { + // struct Automata { + ctor Automata("vcsn::Automata"); + // }; + // struct Automata { + // }; + } // end of namespace vcsn + namespace vcsn { + // struct AutomataBase { + ctor AutomataBase("vcsn::AutomataBase"); + // }; + // struct automaton_traits { + ctor automaton_traits("vcsn::automaton_traits"); + // }; + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct FindBestSearch { + ctor FindBestSearch("vcsn::FindBestSearch"); + // }; + // struct WindowedBackSearch { + ctor WindowedBackSearch("vcsn::WindowedBackSearch"); + // }; + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct linearize_element { + ctor linearize_element("vcsn::linearize_element"); + // }; + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct Skeleton { + ctor Skeleton("vcsn::Skeleton"); + // }; + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + // struct reference_type { + ctor reference_type("vcsn::reference_type"); + // }; + // struct iterator_type { + ctor iterator_type("vcsn::iterator_type"); + // }; + // struct PartialExp { + // struct internal_iterator { + ctor internal_iterator("vcsn::PartialExp::internal_iterator"); + // }; + ctor PartialExp("vcsn::PartialExp"); + // }; + } // end of namespace vcsn + namespace vcsn { + namespace algorithm_patterns { + // struct Comparator { + ctor Comparator("vcsn::algorithm_patterns::Comparator"); + // }; + // struct IncAutomataConstructor { + ctor IncAutomataConstructor("vcsn::algorithm_patterns::IncAutomataConstructor"); + // }; + // struct MathAutomataConstructor { + ctor MathAutomataConstructor("vcsn::algorithm_patterns::MathAutomataConstructor"); + // }; + } // end of namespace algorithm_patterns + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct DefaultTransposeFun { + ctor DefaultTransposeFun("vcsn::algebra::DefaultTransposeFun"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct semiring_slot_tag { + ctor semiring_slot_tag("vcsn::algebra::semiring_slot_tag"); + // }; + // struct monoid_slot_tag { + ctor monoid_slot_tag("vcsn::algebra::monoid_slot_tag"); + // }; + // struct Series { + ctor Series("vcsn::algebra::Series"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct polynom { + ctor polynom("vcsn::algebra::polynom"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace std { + } // end of namespace std + namespace vcsn { + namespace algebra { + // struct BinaryOp { + ctor BinaryOp("vcsn::algebra::BinaryOp"); + // }; + // struct UnaryOp { + ctor UnaryOp("vcsn::algebra::UnaryOp"); + // }; + // struct Value { + ctor Value("vcsn::algebra::Value"); + // }; + // struct GenericMatcher { + ctor GenericMatcher("vcsn::algebra::GenericMatcher"); + // }; + // struct KRatExpMatcher { + ctor KRatExpMatcher("vcsn::algebra::KRatExpMatcher"); + // }; + // struct KRatExpIdentity { + ctor KRatExpIdentity("vcsn::algebra::KRatExpIdentity"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct ExpConvertVisitor { + ctor ExpConvertVisitor("vcsn::algebra::ExpConvertVisitor"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace rat { + // struct StarHeightVisitor { + ctor StarHeightVisitor("vcsn::rat::StarHeightVisitor"); + // }; + } // end of namespace rat + } // end of namespace vcsn + namespace vcsn { + namespace rat { + // struct LengthVisitor { + ctor LengthVisitor("vcsn::rat::LengthVisitor"); + // }; + } // end of namespace rat + } // end of namespace vcsn + namespace vcsn { + namespace rat { + // struct ReverseVisitor { + ctor ReverseVisitor("vcsn::rat::ReverseVisitor"); + // }; + } // end of namespace rat + namespace algebra { + // struct DefaultTransposeFun { + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace rat { + // struct RandomVisitor { + ctor RandomVisitor("vcsn::rat::RandomVisitor"); + // }; + } // end of namespace rat + } // end of namespace vcsn + namespace vcsn { + namespace rat { + // struct Node { + ctor Node("vcsn::rat::Node"); + // }; + // struct ConstNodeVisitor { + ctor ConstNodeVisitor("vcsn::rat::ConstNodeVisitor"); + // }; + // struct DefaultMutableNodeVisitor { + ctor DefaultMutableNodeVisitor("vcsn::rat::DefaultMutableNodeVisitor"); + // }; + // struct Node { + // }; + // struct Zero { + ctor Zero("vcsn::rat::Zero"); + // }; + // struct One { + ctor One("vcsn::rat::One"); + // }; + // struct Constant { + ctor Constant("vcsn::rat::Constant"); + // }; + // struct LeftWeighted { + ctor LeftWeighted("vcsn::rat::LeftWeighted"); + // }; + // struct RightWeighted { + ctor RightWeighted("vcsn::rat::RightWeighted"); + // }; + // struct Star { + ctor Star("vcsn::rat::Star"); + // }; + // struct Product { + ctor Product("vcsn::rat::Product"); + // }; + // struct Sum { + ctor Sum("vcsn::rat::Sum"); + // }; + } // end of namespace rat + } // end of namespace vcsn + namespace vcsn { + namespace rat { + // struct exp { + ctor exp("vcsn::rat::exp"); + // }; + } // end of namespace rat + } // end of namespace vcsn + namespace vcsn { + namespace rat { + // struct setpm { + ctor setpm("vcsn::rat::setpm"); + // }; + fun getpm("dyn::vcsn::rat::getpm", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/algebra/implementation/series/rat/dump_visitor.hh"); + // struct setzero { + ctor setzero("vcsn::rat::setzero"); + // }; + // struct setid { + ctor setid("vcsn::rat::setid"); + // }; + } // end of namespace rat + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct DispatchVisitor { + ctor DispatchVisitor("vcsn::algebra::DispatchVisitor"); + // }; + // struct DispatchFunction { + ctor DispatchFunction("vcsn::algebra::DispatchFunction"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace rat { + // struct DepthVisitor { + ctor DepthVisitor("vcsn::rat::DepthVisitor"); + // }; + } // end of namespace rat + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct RationalNumber { + ctor RationalNumber("vcsn::algebra::RationalNumber"); + // }; + fun OPERATORPUSH("dyn::vcsn::algebra::OPERATORPUSH", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/rational_number.hh"); + fun gcd("dyn::vcsn::algebra::gcd", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/rational_number.hh"); + fun lcm("dyn::vcsn::algebra::lcm", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/rational_number.hh"); + } // end of namespace algebra + } // end of namespace vcsn + namespace std { + } // end of namespace std + namespace utility { + } // end of namespace utility + namespace vcsn { + fun op_can_choose_non_starable("dyn::vcsn::op_can_choose_non_starable", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + fun op_choose_starable("dyn::vcsn::op_choose_starable", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + fun op_choose_non_starable("dyn::vcsn::op_choose_non_starable", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + fun op_mul("dyn::vcsn::op_mul", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + fun op_in_add("dyn::vcsn::op_in_add", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + fun op_add("dyn::vcsn::op_add", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + fun identity_value("dyn::vcsn::identity_value", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + fun zero_value("dyn::vcsn::zero_value", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + fun op_starable("dyn::vcsn::op_starable", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + fun op_in_star("dyn::vcsn::op_in_star", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/algebra/implementation/semiring/numerical_semiring.hh"); + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct static_ranged { + ctor static_ranged("vcsn::algebra::static_ranged"); + // }; + // struct static_char_interval { + ctor static_char_interval("vcsn::algebra::static_char_interval"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace std { + fun OPERATORPUSH("dyn::std::OPERATORPUSH", "", "/home/lrde/lrde-2006/pouill_n/w/oln/prototypes/dynamic-use-of-static-c++/trunk/test/vaucanson/sources/include/vaucanson/algebra/implementation/letter/int_letter.hh"); + } // end of namespace std + namespace vcsn { + namespace algebra { + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace utility { + } // end of namespace utility + namespace vcsn { + namespace algebra { + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct FreeMonoid { + ctor FreeMonoid("vcsn::algebra::FreeMonoid"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct list_or_string { + ctor list_or_string("vcsn::algebra::list_or_string"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + namespace small_alpha_letter { + } // end of namespace small_alpha_letter + namespace char_letter { + } // end of namespace char_letter + namespace char_pair { + } // end of namespace char_pair + namespace weighted_letter { + } // end of namespace weighted_letter + namespace int_letter { + } // end of namespace int_letter + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct AlphabetDecorator { + ctor AlphabetDecorator("vcsn::algebra::AlphabetDecorator"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + namespace small_alpha_letter { + } // end of namespace small_alpha_letter + namespace char_letter { + } // end of namespace char_letter + namespace char_pair { + } // end of namespace char_pair + namespace weighted_letter { + } // end of namespace weighted_letter + namespace int_letter { + } // end of namespace int_letter + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct AlphabetSet { + ctor AlphabetSet("vcsn::algebra::AlphabetSet"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct TropicalSemiring { + ctor TropicalSemiring("vcsn::algebra::TropicalSemiring"); + // }; + } // end of namespace algebra + namespace algebra { + // struct TropicalMin { + ctor TropicalMin("vcsn::algebra::TropicalMin"); + // }; + // struct TropicalMax { + ctor TropicalMax("vcsn::algebra::TropicalMax"); + // }; + // struct TropicalSemiring { + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct SeriesBase { + ctor SeriesBase("vcsn::algebra::SeriesBase"); + // }; + // struct series_traits { + ctor series_traits("vcsn::algebra::series_traits"); + // }; + // struct mute_series_impl { + ctor mute_series_impl("vcsn::algebra::mute_series_impl"); + // }; + // struct mute_series_traits { + ctor mute_series_traits("vcsn::algebra::mute_series_traits"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct SemiringBase { + ctor SemiringBase("vcsn::algebra::SemiringBase"); + // }; + } // end of namespace algebra + // struct op_star_traits { + ctor op_star_traits("vcsn::op_star_traits"); + // }; + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct mul_kind { + ctor mul_kind("vcsn::algebra::mul_kind"); + // }; + // struct add_kind { + ctor add_kind("vcsn::algebra::add_kind"); + // }; + // struct SemigroupBase { + ctor SemigroupBase("vcsn::algebra::SemigroupBase"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct MonoidBase { + ctor MonoidBase("vcsn::algebra::MonoidBase"); + // }; + // struct identity_as { + ctor identity_as("vcsn::algebra::identity_as"); + // }; + // struct zero_as { + ctor zero_as("vcsn::algebra::zero_as"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct FreeMonoidBase { + ctor FreeMonoidBase("vcsn::algebra::FreeMonoidBase"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct AlphabetSetBase { + ctor AlphabetSetBase("vcsn::algebra::AlphabetSetBase"); + // }; + // struct alphabet_traits { + ctor alphabet_traits("vcsn::algebra::alphabet_traits"); + // }; + } // end of namespace algebra + } // end of namespace vcsn + namespace vcsn { + namespace algebra { + // struct NumericalSemiring { + ctor NumericalSemiring("vcsn::algebra::NumericalSemiring"); + // }; + } // end of namespace algebra + } // end of namespace vcsn +} // end of namespace dyn diff --git a/dynamic-use-of-static-c++/test/vaucanson/test-loader.cc b/dynamic-use-of-static-c++/test/vaucanson/test-loader.cc new file mode 100644 index 0000000..64fac50 --- /dev/null +++ b/dynamic-use-of-static-c++/test/vaucanson/test-loader.cc @@ -0,0 +1,39 @@ +#include "dyn.hh" +using namespace dyn::language; + +#include <vaucanson/xml/XML.hh> +// #include <dyn_vaucanson_mlc_name.hh> + // dyn::post_include("dyn_vaucanson_mlc_name.hh"); +// #include <vaucanson/xml/xml_converter.hh> +using namespace vcsn; +using namespace vcsn::io; +// using dyn::vcsn::xml::XML; +using namespace vcsn::xml; +using namespace xercesc; + +int main(int, char**argv) +{ + std::string s = argv[1]; + std::cout << "load(" << s << ")" << std::endl; + std::istream* is (s == "-" ? &std::cin : new std::ifstream (s.c_str())); + if (not is->fail()) + { + xercesc::XMLPlatformUtils::Initialize(); + + xercesc::DOMElement* root_ = xerces_parser::stream_parser(*is); + + typedef Node<var> node_t; + Factory<node_t, std::string> f; + register_all_factory(f, var); + node_t::map_t str2state; + + node_t* node = factory_create(f, xml2str(root_->getNodeName())); + node->process(root_, var(), str2state, f); + // xercesc::DOMNodeList* nodelist; + + // nodelist = doc->getElementsByTagName(STR2XML("type")); + // std::cout << nodelist->getLength() << std::endl; + + xercesc::XMLPlatformUtils::Terminate(); + } +} diff --git a/dynamic-use-of-static-c++/vcs/dynamic_static_bridge_vcs.rb b/dynamic-use-of-static-c++/vcs/dynamic_static_bridge_vcs.rb new file mode 100644 index 0000000..7457fe5 --- /dev/null +++ b/dynamic-use-of-static-c++/vcs/dynamic_static_bridge_vcs.rb @@ -0,0 +1,19 @@ +class Vcs + # See http://rubyforge.org/projects/vcs + # and http://vcs.rubyforge.org + + protocol_version '0.1' + + def dynamic_static_bridge_commit! ( *args ) + + common_commit!("[DynamicStaticBridge]: <%= rev %>: <%= title %>", *args) do |subject| + + mail! :to => ["damien.thivolle@gmail.com", "nicolas.pouillard@gmail.com"], :subject => subject + + end + + end + alias_command :dystci, :dynamic_static_bridge_commit + default_commit :dynamic_static_bridge_commit + +end # class Vcs -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4641 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/.gitignore | 21 +++++++++++++++++++++ dynamic-use-of-static-c++/config/.gitignore | 7 +++++++ 2 files changed, 28 insertions(+), 0 deletions(-) create mode 100644 dynamic-use-of-static-c++/.gitignore create mode 100644 dynamic-use-of-static-c++/config/.gitignore diff --git a/dynamic-use-of-static-c++/.gitignore b/dynamic-use-of-static-c++/.gitignore new file mode 100644 index 0000000..26254f4 --- /dev/null +++ b/dynamic-use-of-static-c++/.gitignore @@ -0,0 +1,21 @@ +/*-stamp +/*.patch +/*TAGS +/*aclocal.m4 +/*stamp-* +/_build* +/_config +/_inst* +/autom4te.cache* +/autoscan.log +/config.cache* +/config.h +/config.h?in* +/config.hin +/config.log* +/config.status* +/configure +/configure.scan +/diffs.patch +/libltdl +/stamp-h1 diff --git a/dynamic-use-of-static-c++/config/.gitignore b/dynamic-use-of-static-c++/config/.gitignore new file mode 100644 index 0000000..86d9151 --- /dev/null +++ b/dynamic-use-of-static-c++/config/.gitignore @@ -0,0 +1,7 @@ +/argz.m4 +/libtool.m4 +/ltdl.m4 +/ltoptions.m4 +/ltsugar.m4 +/ltversion.m4 +/lt~obsolete.m4 -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4642 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 5a65dfe..e9619f4 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -3,7 +3,7 @@ Add another version of libiberty. * lib/libiberty-powerpc-darwin8.3.0.la: A copy of - libiberty-powerpc-darwin.la + libiberty-powerpc-darwin.la. 2005-12-06 Nicolas Pouillard <ertai@lrde.epita.fr> @@ -152,7 +152,7 @@ 2005-12-01 Nicolas Pouillard <ertai@lrde.epita.fr> - Dyn now use the autotools! + Dyn now uses the autotools! * README: Deal with the new the schema. * bin/dyn-config.in: New. A nice tool to use the project. @@ -340,7 +340,8 @@ * src/dyn.hh: Update. * bin/yaml_to_dyn_decls: No more generate proc decls. - * lib/libiberty-macos.a: Use a new and patched version (no use of environ). + * lib/libiberty-macos.a: Use a new and patched version (no use of + environ). * test/test_damien.cc, * test/test_olena.cc, @@ -496,7 +497,7 @@ * test/fixtures/some_identifiers.yml.cc, * test/test_function_loader.rb, * test/test_function_loader_cxx.rb: Adapt these tests to the current - version. + version. * src/function_loader.rb: Improve the void detection. 2005-11-16 Nicolas Pouillard <ertai@lrde.epita.fr> @@ -559,7 +560,8 @@ Add the vaucanson test. - * src/name_of.hh: Error at compile time for default case of mlc_name<T>. + * src/name_of.hh: Error at compile time for default case of + mlc_name<T>. * src/function_loader.hh: Put the SOURCE_DIR in $:. * src/data.erb.hh: Add some mlc_set_name(). * bin/mk_swig_input: Take the dir as argument. @@ -881,4 +883,3 @@ * vcs: New. * vcs/dynamic_static_bridge_vcs.rb: New. - -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * bootstrap: Handle glibtoolize. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4643 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 6 ++++++ dynamic-use-of-static-c++/bootstrap | 13 +++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index e9619f4..41fce8c 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,3 +1,9 @@ +2009-10-13 Roland Levillain <roland@lrde.epita.fr> + + Make bootstrap compatible with Mac OS X. + + * bootstrap: Handle glibtoolize. + 2006-01-15 Nicolas Pouillard <ertai@lrde.epita.fr> Add another version of libiberty. diff --git a/dynamic-use-of-static-c++/bootstrap b/dynamic-use-of-static-c++/bootstrap index 8bd6e9e..e4a288a 100755 --- a/dynamic-use-of-static-c++/bootstrap +++ b/dynamic-use-of-static-c++/bootstrap @@ -1,4 +1,4 @@ -#!/bin/sh +#! /bin/sh # Failures do matter. set -e @@ -8,8 +8,17 @@ set -x mkdir -p _config touch _config/local-config.rb.in +libtoolize=libtoolize +for l in "$LIBTOOLIZE" glibtoolize libtoolize; +do + if ($l --version) >/dev/null 2>&1; then + libtoolize=$l + break + fi +done +export LIBTOOLIZE=$libtoolize # Make the libtool with ltdl -libtoolize --force --copy --automake --ltdl +"$libtoolize" --force --copy --automake --ltdl # Finally, install the GNU Build System. autoreconf -f -v -i -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * configure.ac: Here. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4644 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 6 ++++++ dynamic-use-of-static-c++/configure.ac | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 41fce8c..4cf0c69 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,11 @@ 2009-10-13 Roland Levillain <roland@lrde.epita.fr> + Require more recent versions of Autoconf and Automake. + + * configure.ac: Here. + +2009-10-13 Roland Levillain <roland@lrde.epita.fr> + Make bootstrap compatible with Mac OS X. * bootstrap: Handle glibtoolize. diff --git a/dynamic-use-of-static-c++/configure.ac b/dynamic-use-of-static-c++/configure.ac index 95952e7..3298a22 100644 --- a/dynamic-use-of-static-c++/configure.ac +++ b/dynamic-use-of-static-c++/configure.ac @@ -1,4 +1,4 @@ -AC_PREREQ([2.59]) +AC_PREREQ([2.61]) # Catch some macros that are not expanded. m4_pattern_forbid([^AC_LIBLTDL_]) @@ -18,7 +18,7 @@ AC_INIT([LRDE C++ Static-Dynamic bridge], [0.1], AC_CONFIG_AUX_DIR([_config]) # Automake. -AM_INIT_AUTOMAKE([1.9 foreign check-news dist-bzip2 -Wall nostdinc]) +AM_INIT_AUTOMAKE([1.10 foreign check-news dist-bzip2 -Wall nostdinc]) ## --------------------- ## -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * build-aux/warning.m4 (AC_COMPILE_STDERR_IFELSE, DYN_CXX_WARNINGS): Prevent unwanted concatenations creating dummy tokens with recent versions of Autoconf. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4645 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 9 +++++++++ dynamic-use-of-static-c++/config/warning.m4 | 11 +++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 4cf0c69..9e82e17 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,14 @@ 2009-10-13 Roland Levillain <roland@lrde.epita.fr> + Have DYN_CXX_WARNINGS be compatible with recent versions of Autoconf. + + * build-aux/warning.m4 + (AC_COMPILE_STDERR_IFELSE, DYN_CXX_WARNINGS): Prevent unwanted + concatenations creating dummy tokens with recent versions of + Autoconf. + +2009-10-13 Roland Levillain <roland@lrde.epita.fr> + Require more recent versions of Autoconf and Automake. * configure.ac: Here. diff --git a/dynamic-use-of-static-c++/config/warning.m4 b/dynamic-use-of-static-c++/config/warning.m4 index 2df4649..5719e52 100644 --- a/dynamic-use-of-static-c++/config/warning.m4 +++ b/dynamic-use-of-static-c++/config/warning.m4 @@ -1,6 +1,6 @@ -# Finding valid warning flags for the C Compiler. -*-Autoconf-*- +# Finding valid warning flags for the C and C++ Compilers. -*-Autoconf-*- # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006, 2009 Free Software Foundation, Inc. # # 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 @@ -31,7 +31,7 @@ AS_IF([_AC_EVAL_STDERR($ac_compile) && AC_TRY_COMMAND([test -s conftest.$ac_objext])], [$2], [_AC_MSG_LOG_CONFTEST -m4_ifvaln([$3],[$3])dnl])dnl +m4_ifvaln([$3],[$3])dnl]) rm -f conftest.$ac_objext m4_ifval([$1], [conftest.$ac_ext])[]dnl ])# AC_COMPILE_STDERR_IFELSE @@ -99,7 +99,10 @@ AC_DEFUN([DYN_CXX_WARNINGS], m4_foreach([AC_Option], [$1], [DYN_COMPILER_OPTION_IF(AC_Option, [WARNING_CXXFLAGS="$WARNING_CXXFLAGS AC_Option" - DYN_COMPILER_FLAGS_NAME="$ac_save_compiler_flags $WARNING_FLAGS"])]) + DYN_COMPILER_FLAGS_NAME="$ac_save_compiler_flags $WARNING_FLAGS"]) +dnl Newlines inserted on purpose, to avoid erroneous concatenations. + +]) DYN_COMPILER_FLAGS_NAME=$ac_save_compiler_flags AC_SUBST([WARNING_CXXFLAGS]) ])# DYN_CXX_WARNINGS(OPTIONS) -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * build-aux/warning.m4 (DYN_COMPILER_OPTION_IF): Use AS_VAR_IF instead of AS_IF and AS_VAR_GET. Use AS_VAR_POPDEF instead of AS_VAR_PUSHDEF. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4646 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 8 ++++++++ dynamic-use-of-static-c++/config/warning.m4 | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 9e82e17..ed16651 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,13 @@ 2009-10-13 Roland Levillain <roland@lrde.epita.fr> + Use modern M4sh idioms in warning.m4. + + * build-aux/warning.m4 (DYN_COMPILER_OPTION_IF): + Use AS_VAR_IF instead of AS_IF and AS_VAR_GET. + Use AS_VAR_POPDEF instead of AS_VAR_PUSHDEF. + +2009-10-13 Roland Levillain <roland@lrde.epita.fr> + Have DYN_CXX_WARNINGS be compatible with recent versions of Autoconf. * build-aux/warning.m4 diff --git a/dynamic-use-of-static-c++/config/warning.m4 b/dynamic-use-of-static-c++/config/warning.m4 index 5719e52..677c781 100644 --- a/dynamic-use-of-static-c++/config/warning.m4 +++ b/dynamic-use-of-static-c++/config/warning.m4 @@ -78,8 +78,8 @@ AC_COMPILE_STDERR_IFELSE([AC_LANG_PROGRAM], fi]) DYN_COMPILER_FLAGS_NAME=$ac_save_[]DYN_COMPILER_FLAGS_NAME ]) -AS_IF([test AS_VAR_GET(ac_Option) = yes], [$2], [$3])[]dnl -AS_VAR_PUSHDEF([ac_Option])dnl +AS_VAR_IF([ac_Option], [yes], [$2], [$3])dnl +AS_VAR_POPDEF([ac_Option])dnl ])# DYN_COMPILER_OPTION_IF -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> Careful, everything in lib/ should be removed ultimately (the repository contains compiled libraries in this directory!). `configure' should be used instead, to look for a working (installed) libiberty library. * lib/.libs/libiberty-i686-darwin9.a, * lib/.libs/libiberty-universal-darwin9.0.a: New (absolute) symbolic links. * lib/libiberty-i686-darwin9.la, * lib/libiberty-universal-darwin9.0.la: New Libtool archives. * lib/FIXME: New. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4647 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 17 +++++++++ .../lib/.libs/libiberty-i686-darwin9.a | 1 + .../lib/.libs/libiberty-universal-darwin9.0.a | 1 + dynamic-use-of-static-c++/lib/FIXME | 3 ++ .../lib/libiberty-i686-darwin9.la | 35 ++++++++++++++++++++ .../lib/libiberty-universal-darwin9.0.la | 35 ++++++++++++++++++++ 6 files changed, 92 insertions(+), 0 deletions(-) create mode 120000 dynamic-use-of-static-c++/lib/.libs/libiberty-i686-darwin9.a create mode 120000 dynamic-use-of-static-c++/lib/.libs/libiberty-universal-darwin9.0.a create mode 100644 dynamic-use-of-static-c++/lib/FIXME create mode 100644 dynamic-use-of-static-c++/lib/libiberty-i686-darwin9.la create mode 100644 dynamic-use-of-static-c++/lib/libiberty-universal-darwin9.0.la diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index ed16651..2b6f26c 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,3 +1,20 @@ +2009-09-08 Roland Levillain <roland@lrde.epita.fr> + + Add GNU libiberty for Mac OS X Leopard (10.5). + + Careful, everything in lib/ should be removed ultimately (the + repository contains compiled libraries in this directory!). + `configure' should be used instead, to look for a + working (installed) libiberty library. + + * lib/.libs/libiberty-i686-darwin9.a, + * lib/.libs/libiberty-universal-darwin9.0.a: + New (absolute) symbolic links. + * lib/libiberty-i686-darwin9.la, + * lib/libiberty-universal-darwin9.0.la: + New Libtool archives. + * lib/FIXME: New. + 2009-10-13 Roland Levillain <roland@lrde.epita.fr> Use modern M4sh idioms in warning.m4. diff --git a/dynamic-use-of-static-c++/lib/.libs/libiberty-i686-darwin9.a b/dynamic-use-of-static-c++/lib/.libs/libiberty-i686-darwin9.a new file mode 120000 index 0000000..366583a --- /dev/null +++ b/dynamic-use-of-static-c++/lib/.libs/libiberty-i686-darwin9.a @@ -0,0 +1 @@ +/opt/local/lib/libiberty.a \ No newline at end of file diff --git a/dynamic-use-of-static-c++/lib/.libs/libiberty-universal-darwin9.0.a b/dynamic-use-of-static-c++/lib/.libs/libiberty-universal-darwin9.0.a new file mode 120000 index 0000000..366583a --- /dev/null +++ b/dynamic-use-of-static-c++/lib/.libs/libiberty-universal-darwin9.0.a @@ -0,0 +1 @@ +/opt/local/lib/libiberty.a \ No newline at end of file diff --git a/dynamic-use-of-static-c++/lib/FIXME b/dynamic-use-of-static-c++/lib/FIXME new file mode 100644 index 0000000..342b267 --- /dev/null +++ b/dynamic-use-of-static-c++/lib/FIXME @@ -0,0 +1,3 @@ +FIXME: Binaries should not be hosted on the repository. Remove all +`.a' and `.la' files in lib/ and have configure find a suitable +libiberty instead of providing binary versions of it. diff --git a/dynamic-use-of-static-c++/lib/libiberty-i686-darwin9.la b/dynamic-use-of-static-c++/lib/libiberty-i686-darwin9.la new file mode 100644 index 0000000..7f61ae2 --- /dev/null +++ b/dynamic-use-of-static-c++/lib/libiberty-i686-darwin9.la @@ -0,0 +1,35 @@ +# libiberty.la - a libtool library file +# Generated by ltmain.sh - GNU libtool 1.5.18 (1.1220.2.246 2005/05/16 10:00:18) +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='' + +# Names of this library. +library_names='' + +# The name of the static archive. +old_library='libiberty-i686-darwin9.a' + +# Libraries that this one depends upon. +dependency_libs='' + +# Version information for libiberty. +current= +age= +revision= + +# Is this an already installed library? +installed=no + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='' diff --git a/dynamic-use-of-static-c++/lib/libiberty-universal-darwin9.0.la b/dynamic-use-of-static-c++/lib/libiberty-universal-darwin9.0.la new file mode 100644 index 0000000..a42ed65 --- /dev/null +++ b/dynamic-use-of-static-c++/lib/libiberty-universal-darwin9.0.la @@ -0,0 +1,35 @@ +# libiberty.la - a libtool library file +# Generated by ltmain.sh - GNU libtool 1.5.18 (1.1220.2.246 2005/05/16 10:00:18) +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='' + +# Names of this library. +library_names='' + +# The name of the static archive. +old_library='libiberty-universal-darwin9.0.a' + +# Libraries that this one depends upon. +dependency_libs='' + +# Version information for libiberty. +current= +age= +revision= + +# Is this an already installed library? +installed=no + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='' -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * data/Makefile.am (libdyn_function_la_LDFLAGS, libdyn_function_la_CPPFLAGS): Do not rely on the shell to set these variables. (BUILT_SOURCES, CLEANFILES, SUBDIRS): Remove. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4648 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 9 +++++++++ dynamic-use-of-static-c++/data/Makefile.am | 10 +++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 2b6f26c..4f40700 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,14 @@ 2009-09-08 Roland Levillain <roland@lrde.epita.fr> + Various fixes in data/Makefile.am. + + * data/Makefile.am + (libdyn_function_la_LDFLAGS, libdyn_function_la_CPPFLAGS): + Do not rely on the shell to set these variables. + (BUILT_SOURCES, CLEANFILES, SUBDIRS): Remove. + +2009-09-08 Roland Levillain <roland@lrde.epita.fr> + Add GNU libiberty for Mac OS X Leopard (10.5). Careful, everything in lib/ should be removed ultimately (the diff --git a/dynamic-use-of-static-c++/data/Makefile.am b/dynamic-use-of-static-c++/data/Makefile.am index 61882d7..afdbe34 100644 --- a/dynamic-use-of-static-c++/data/Makefile.am +++ b/dynamic-use-of-static-c++/data/Makefile.am @@ -1,11 +1,11 @@ # Do not install me lib_LTLIBRARIES = libdyn_function.la -libdyn_function_la_LDFLAGS = `dyn-config --libtool-libs` -libdyn_function_la_CXXFLAGS = `dyn-config --cflags` +# FIXME: This is probably not portable! +# libdyn_function_la_LDFLAGS = `dyn-config --libtool-libs` +# libdyn_function_la_CXXFLAGS = `dyn-config --cflags` +libdyn_function_la_LDFLAGS = $(top_builddir)/src/libdyn.la -export-dynamic +libdyn_function_la_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src libdyn_function_la_SOURCES = function.cc -BUILT_SOURCES = function.cc -CLEANFILES = function.cc -SUBDIRS = pkgdata_DATA = Makefile.template Makefile.repository -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * src/function_loader.cc (dyn::function_loader_t::load): Here. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4649 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 6 ++++++ dynamic-use-of-static-c++/src/function_loader.cc | 2 +- 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 4f40700..0d50eca 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,3 +1,9 @@ +2009-10-14 Roland Levillain <roland@lrde.epita.fr> + + Catch up with the current interface of Ruby's MD5 class. + + * src/function_loader.cc (dyn::function_loader_t::load): Here. + 2009-09-08 Roland Levillain <roland@lrde.epita.fr> Various fixes in data/Makefile.am. diff --git a/dynamic-use-of-static-c++/src/function_loader.cc b/dynamic-use-of-static-c++/src/function_loader.cc index cdc0296..84306c4 100644 --- a/dynamic-use-of-static-c++/src/function_loader.cc +++ b/dynamic-use-of-static-c++/src/function_loader.cc @@ -280,7 +280,7 @@ namespace dyn { } std::string prototype = ostr.str(); - ruby << "Digest::MD5.new(%q{" << prototype.c_str() << "}).to_s" << ruby::eval; + ruby << "MD5.new(%q{" << prototype.c_str() << "}).to_s" << ruby::eval; const char* identifier = STR2CSTR(ruby.last_value()); cache_type::iterator ptr_it = cache.find(identifier); -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * src/function_loader.cc (dyn::function_loader_t::load): Here. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4650 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 6 ++++++ dynamic-use-of-static-c++/src/function_loader.cc | 8 ++++++++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 0d50eca..532056e 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,11 @@ 2009-10-14 Roland Levillain <roland@lrde.epita.fr> + Disable colored outputs for now. + + * src/function_loader.cc (dyn::function_loader_t::load): Here. + +2009-10-14 Roland Levillain <roland@lrde.epita.fr> + Catch up with the current interface of Ruby's MD5 class. * src/function_loader.cc (dyn::function_loader_t::load): Here. diff --git a/dynamic-use-of-static-c++/src/function_loader.cc b/dynamic-use-of-static-c++/src/function_loader.cc index 84306c4..ee34f7a 100644 --- a/dynamic-use-of-static-c++/src/function_loader.cc +++ b/dynamic-use-of-static-c++/src/function_loader.cc @@ -287,11 +287,19 @@ namespace dyn { if ( ptr_it != cache.end() ) { + // FIXME: Colors should be used only when the terminal supports them. +#if 0 std::cerr << "\e[36mJIT: \e[32mHIT: \e[0m " << prototype << std::endl; +#endif + std::cerr << "JIT: HIT: " << prototype << std::endl; return ptr_it->second; } + // FIXME: Colors should be used only when the terminal supports them. +#if 0 std::cerr << "\e[36mJIT: \e[31mMISS: compile: \e[0m " << prototype << std::endl; +#endif + std::cerr << "JIT: MISS: compile: " << prototype << std::endl; ruby << "compile %q{"; gen_cxx(identifier, name, arguments_types, kind, paths, ruby); -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * configure.ac (OLENA_PROTO_STL_STYLE): Remove variable. (MILENA_DIR): New variable. * src/config.hh.in (OLENA_PROTO_STL_STYLE): Remove macro. (MILENA_DIR): New macro. * test/test_olena.cc: Convert this test to Milena's interface. Fill the very first image with 0 before printing it. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4651 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 11 +++++++++++ dynamic-use-of-static-c++/configure.ac | 5 +++-- dynamic-use-of-static-c++/src/config.hh.in | 2 +- dynamic-use-of-static-c++/test/test_olena.cc | 21 +++++++++++++-------- 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 532056e..469d2b7 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,16 @@ 2009-10-14 Roland Levillain <roland@lrde.epita.fr> + Convert the test on Olena from proto-stl-style to Milena. + + * configure.ac (OLENA_PROTO_STL_STYLE): Remove variable. + (MILENA_DIR): New variable. + * src/config.hh.in (OLENA_PROTO_STL_STYLE): Remove macro. + (MILENA_DIR): New macro. + * test/test_olena.cc: Convert this test to Milena's interface. + Fill the very first image with 0 before printing it. + +2009-10-14 Roland Levillain <roland@lrde.epita.fr> + Disable colored outputs for now. * src/function_loader.cc (dyn::function_loader_t::load): Here. diff --git a/dynamic-use-of-static-c++/configure.ac b/dynamic-use-of-static-c++/configure.ac index 3298a22..1ecd36c 100644 --- a/dynamic-use-of-static-c++/configure.ac +++ b/dynamic-use-of-static-c++/configure.ac @@ -102,6 +102,7 @@ dnl fi dnl AC_MSG_RESULT([$has_swig]) +# FIXME: Doesn't Autoconf provide something like abs_top_srcdir? my_abs_srcdir=`cd $srcdir && pwd` # FIXME: Remove me when function_loader will be pure C++ @@ -109,8 +110,8 @@ AC_SUBST([DYNDIR], [$my_abs_srcdir/src]) AC_SUBST([DYN_FIXTURES], [$my_abs_srcdir/test/fixtures]) -# Make the proper link to the olena-proto-stl-style in test -AC_SUBST([OLENA_PROTO_STL_STYLE], [$my_abs_srcdir/test/olena/proto-stl-style]) +# Absolute path to Milena. +AC_SUBST([MILENA_DIR], [$my_abs_srcdir/../milena]) AC_SUBST([LIBERTYARG], $my_abs_srcdir/$(ERB([lib/libiberty-<%= RUBY_PLATFORM %>.la]))) diff --git a/dynamic-use-of-static-c++/src/config.hh.in b/dynamic-use-of-static-c++/src/config.hh.in index 9165c7c..7dbbbb0 100644 --- a/dynamic-use-of-static-c++/src/config.hh.in +++ b/dynamic-use-of-static-c++/src/config.hh.in @@ -1,3 +1,3 @@ #define DYNDIR "@DYNDIR@" #define DYN_FIXTURES "@DYN_FIXTURES@" -#define OLENA_PROTO_STL_STYLE "@OLENA_PROTO_STL_STYLE@" +#define MILENA_DIR "@MILENA_DIR@" diff --git a/dynamic-use-of-static-c++/test/test_olena.cc b/dynamic-use-of-static-c++/test/test_olena.cc index d814767..3c5dd74 100644 --- a/dynamic-use-of-static-c++/test/test_olena.cc +++ b/dynamic-use-of-static-c++/test/test_olena.cc @@ -1,21 +1,26 @@ #include "dyn-all.hh" + using namespace dyn::language; int main() { - dyn::include_dir(OLENA_PROTO_STL_STYLE); // FIXME: Move it into fixtures/olean-proto-stl-style - // FIXME: Add - dyn::include("all.hh"); + dyn::include_dir(MILENA_DIR); + dyn::include("mln/core/image/image2d.hh"); + dyn::include("mln/data/fill.hh"); + dyn::include("mln/debug/iota.hh"); + dyn::include("mln/debug/println.hh"); - fun iota("iota"); - fun println_2d("println_2d"); - ctor mk_image2d_int("image2d<int>"); + ctor mk_image2d_int("mln::image2d<int>"); + fun fill("mln::data::fill"); + fun iota("mln::debug::iota"); + fun println("mln::debug::println"); var ima = mk_image2d_int(3, 3); - println_2d(std::cout, "ima_before=", ima); + fill(ima, 0); + println("ima_before=", ima); iota(ima); - println_2d(std::cout, "ima-after=", ima); + println("ima-after=", ima); std::cout << "exiting" << std::endl; } -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * src/name_of.hh: Include typeinfo for typeif. * test/fixtures/my_lib/damien.hh (operator<<) * test/fixtures/my_lib/lib.hh (foo1, foo2, foo2b): Qualify these functions as inline to pacify the compiler. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4652 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 9 +++++++++ dynamic-use-of-static-c++/src/name_of.hh | 2 ++ .../test/fixtures/my_lib/damien.hh | 1 + .../test/fixtures/my_lib/lib.hh | 3 +++ 4 files changed, 15 insertions(+), 0 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 469d2b7..0cb57c3 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,14 @@ 2009-10-14 Roland Levillain <roland@lrde.epita.fr> + Address compilation warnings. + + * src/name_of.hh: Include typeinfo for typeif. + * test/fixtures/my_lib/damien.hh (operator<<) + * test/fixtures/my_lib/lib.hh (foo1, foo2, foo2b): + Qualify these functions as inline to pacify the compiler. + +2009-10-14 Roland Levillain <roland@lrde.epita.fr> + Convert the test on Olena from proto-stl-style to Milena. * configure.ac (OLENA_PROTO_STL_STYLE): Remove variable. diff --git a/dynamic-use-of-static-c++/src/name_of.hh b/dynamic-use-of-static-c++/src/name_of.hh index 04b40ad..67e26a5 100644 --- a/dynamic-use-of-static-c++/src/name_of.hh +++ b/dynamic-use-of-static-c++/src/name_of.hh @@ -1,6 +1,8 @@ #ifndef NAME_OF # define NAME_OF +# include <typeinfo> + # include <string> # include <sstream> diff --git a/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hh b/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hh index a045f1a..369ebe9 100644 --- a/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hh +++ b/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hh @@ -44,6 +44,7 @@ struct down : public up }; +inline std::ostream& operator<<(std::ostream& ostr, const up& obj) { obj.print(ostr); diff --git a/dynamic-use-of-static-c++/test/fixtures/my_lib/lib.hh b/dynamic-use-of-static-c++/test/fixtures/my_lib/lib.hh index 8088724..c861ea5 100644 --- a/dynamic-use-of-static-c++/test/fixtures/my_lib/lib.hh +++ b/dynamic-use-of-static-c++/test/fixtures/my_lib/lib.hh @@ -37,11 +37,13 @@ std::ostream& operator<< (std::ostream& ostr, const t<T, V>& x) return ostr << "t< " << x.x_ << ", " << x.y_ << " >"; } +inline void foo1() { std::cout << "foo1()" << std::endl; } +inline int* foo2() { static int i = 42; @@ -49,6 +51,7 @@ int* foo2() return &i; } +inline int foo2b() { std::cout << "foo2b() => 42" << std::endl; -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * src/Makefile.am: Aesthetic changes. (dyn_light_hh_DEPENDECIES, dyn_all_hh_DEPENDECIES): Rename as... (dyn_light_hh_deps, dyn_all_hh_deps): ...this. (BUILT_SOURCES): List only #include'd header and remove files that will be built anyway. (CLEANFILES): Adjust. (libdyn_la_DEPENDENCIES): s/LIBLTDL/LTDLDEPS/. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4653 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 14 ++++ dynamic-use-of-static-c++/src/Makefile.am | 102 +++++++++++++++-------------- 2 files changed, 66 insertions(+), 50 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 0cb57c3..a8c3708 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,3 +1,17 @@ +2009-10-20 Roland Levillain <roland@lrde.epita.fr> + + Various fixes in src/Makefile.am. + + * src/Makefile.am: Aesthetic changes. + (dyn_light_hh_DEPENDECIES, dyn_all_hh_DEPENDECIES): + Rename as... + (dyn_light_hh_deps, dyn_all_hh_deps): + ...this. + (BUILT_SOURCES): List only #include'd header and remove files that + will be built anyway. + (CLEANFILES): Adjust. + (libdyn_la_DEPENDENCIES): s/LIBLTDL/LTDLDEPS/. + 2009-10-14 Roland Levillain <roland@lrde.epita.fr> Address compilation warnings. diff --git a/dynamic-use-of-static-c++/src/Makefile.am b/dynamic-use-of-static-c++/src/Makefile.am index d64c2ea..0bb8cea 100644 --- a/dynamic-use-of-static-c++/src/Makefile.am +++ b/dynamic-use-of-static-c++/src/Makefile.am @@ -3,55 +3,57 @@ lib_LTLIBRARIES = libdyn.la ERB = ruby $(top_srcdir)/config/erbx -dyn_light_hh_DEPENDECIES = \ - $(srcdir)/name_of.hh \ - function.hh \ - all_methods.hh \ - data.hh \ - $(srcdir)/policy.hh - -dyn_all_hh_DEPENDECIES = \ - config.hh \ - $(srcdir)/name_of.hh \ - function.hh \ - all_methods.hh \ - data.hh \ - $(srcdir)/data.hxx \ - $(srcdir)/function_loader.hh \ - $(srcdir)/dyn.hh - -BUILT_SOURCES = \ - dyn-all.hh dyn-light.hh \ - all_methods.hh all_methods.cc \ - function.hh function.cc \ - data.hh config.hh - -libdyn_la_SOURCES = \ - dyn.hh \ - data.hh data.hxx data.cc \ - all_methods.hh all_methods.cc \ - function.hh function.cc \ - function_loader.hh function_loader.cc \ - name_of.hh name_of.cc \ - policy.hh policy.cc \ - ruby_stream.hh ruby_stream.cc \ - ansidecl.h demangle.h config.hh - -libdyn_la_LIBADD = @LIBERTYARG@ @RUBY_LIBRUBYARG_SHARED@ \ - $(LIBLTDL) - -libdyn_la_DEPENDENCIES = $(LIBLTDL) - -libdyn_la_CPPFLAGS = $(LTDLINCL) \ - -I$(top_builddir) \ - -I$(srcdir) -I. -I@RUBY_topdir@ - +dyn_light_hh_deps = \ + $(srcdir)/name_of.hh \ + function.hh \ + all_methods.hh \ + data.hh \ + $(srcdir)/policy.hh + +dyn_all_hh_deps = \ + config.hh \ + $(srcdir)/name_of.hh \ + function.hh \ + all_methods.hh \ + data.hh \ + $(srcdir)/data.hxx \ + $(srcdir)/function_loader.hh \ + $(srcdir)/dyn.hh + +# Ask Make to build these first since they are #include'd. +BUILT_SOURCES = \ + all_methods.hh \ + function.hh \ + data.hh \ + config.hh + +# Clean generated files. +CLEANFILES = \ + $(BUILT_SOURCES) \ + dyn-all.hh \ + dyn-light.hh \ + all_methods.cc \ + function.cc + +libdyn_la_SOURCES = \ + dyn.hh \ + data.hh data.hxx data.cc \ + all_methods.hh all_methods.cc \ + function.hh function.cc \ + function_loader.hh function_loader.cc \ + name_of.hh name_of.cc \ + policy.hh policy.cc \ + ruby_stream.hh ruby_stream.cc \ + ansidecl.h demangle.h config.hh + +libdyn_la_LIBADD = @LIBERTYARG@ @RUBY_LIBRUBYARG_SHARED@ $(LIBLTDL) +libdyn_la_DEPENDENCIES = $(LTDLDEPS) + +libdyn_la_CPPFLAGS = \ + $(LTDLINCL) -I$(top_builddir) -I$(srcdir) -I. -I@RUBY_topdir@ libdyn_la_CXXFLAGS = $(WARNING_CXXFLAGS) - libdyn_la_LDFLAGS = -version-info 0:1:0 -CLEANFILES = $(BUILT_SOURCES) - ############# ### RULES ### @@ -59,17 +61,17 @@ CLEANFILES = $(BUILT_SOURCES) cut_local_includes = grep -v '^.[\t ]*include[\t ]*".*"' -dyn-all.hh: $(dyn_all_hh_DEPENDECIES) +dyn-all.hh: $(dyn_all_hh_deps) rm -f $@ echo "// Generated: do not edit by hand!" > $@ echo "#define DYN_FULL_IMPLEMENTATION" >> $@ - cat $(dyn_all_hh_DEPENDECIES) | $(cut_local_includes) >> $@ + cat $(dyn_all_hh_deps) | $(cut_local_includes) >> $@ chmod -w $@ -dyn-light.hh: $(dyn_light_hh_DEPENDECIES) +dyn-light.hh: $(dyn_light_hh_deps) rm -f $@ echo "// Generated: do not edit by hand!" > $@ - cat $(dyn_light_hh_DEPENDECIES) | $(cut_local_includes) >> $@ + cat $(dyn_light_hh_deps) | $(cut_local_includes) >> $@ chmod -w $@ %.hh: %.erb.hh -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * src/data.erb.hh: Rename as... * src/data.hh: ...this. * src/Makefile.am (dyn_light_hh_deps, dyn_all_hh_deps): s|data.hh|$(srcdir)/data.hh|. (BUILT_SOURCES): Remove data.hh. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4654 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 10 + dynamic-use-of-static-c++/src/Makefile.am | 5 +- dynamic-use-of-static-c++/src/data.erb.hh | 418 ----------------------------- dynamic-use-of-static-c++/src/data.hh | 416 ++++++++++++++++++++++++++++ 4 files changed, 428 insertions(+), 421 deletions(-) delete mode 100644 dynamic-use-of-static-c++/src/data.erb.hh create mode 100644 dynamic-use-of-static-c++/src/data.hh diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index a8c3708..fc90b57 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,15 @@ 2009-10-20 Roland Levillain <roland@lrde.epita.fr> + Rename src/data.erb.hh as src/data.hh and stop generating the latter. + + * src/data.erb.hh: Rename as... + * src/data.hh: ...this. + * src/Makefile.am (dyn_light_hh_deps, dyn_all_hh_deps): + s|data.hh|$(srcdir)/data.hh|. + (BUILT_SOURCES): Remove data.hh. + +2009-10-20 Roland Levillain <roland@lrde.epita.fr> + Various fixes in src/Makefile.am. * src/Makefile.am: Aesthetic changes. diff --git a/dynamic-use-of-static-c++/src/Makefile.am b/dynamic-use-of-static-c++/src/Makefile.am index 0bb8cea..7d62edf 100644 --- a/dynamic-use-of-static-c++/src/Makefile.am +++ b/dynamic-use-of-static-c++/src/Makefile.am @@ -7,7 +7,7 @@ dyn_light_hh_deps = \ $(srcdir)/name_of.hh \ function.hh \ all_methods.hh \ - data.hh \ + $(srcdir)/data.hh \ $(srcdir)/policy.hh dyn_all_hh_deps = \ @@ -15,7 +15,7 @@ dyn_all_hh_deps = \ $(srcdir)/name_of.hh \ function.hh \ all_methods.hh \ - data.hh \ + $(srcdir)/data.hh \ $(srcdir)/data.hxx \ $(srcdir)/function_loader.hh \ $(srcdir)/dyn.hh @@ -24,7 +24,6 @@ dyn_all_hh_deps = \ BUILT_SOURCES = \ all_methods.hh \ function.hh \ - data.hh \ config.hh # Clean generated files. diff --git a/dynamic-use-of-static-c++/src/data.erb.hh b/dynamic-use-of-static-c++/src/data.erb.hh deleted file mode 100644 index b4c14e1..0000000 --- a/dynamic-use-of-static-c++/src/data.erb.hh +++ /dev/null @@ -1,418 +0,0 @@ -#ifndef DYN_DATA_HH -# define DYN_DATA_HH - -// FIXME: rename me without the .erb - -# include <string> -# include <cassert> -# include "function.hh" -# include "name_of.hh" -# include "all_methods.hh" - -namespace dyn { - - extern std::ostream& logger; - - namespace language - { - struct val; - struct var; - } - - namespace policy - { - enum type - { - none = 0, - is_const = 1, - is_ref = 2, - is_ptr = 4, - is_pod = 8, - is_void = 16 - }; - } - struct proxy_tag; - - // data --> abstract_data - // ^ - // | - // data_proxy<T> --> T - - - // abstract_data - - struct abstract_data - { - virtual abstract_data* clone() const = 0; - virtual abstract_data* const_clone() const { return clone(); } - virtual std::string proxy_type() const = 0; - virtual std::string type() const = 0; - virtual ~abstract_data() {} - }; - - // data_proxy<T> - - template <class T> - struct data_proxy : public abstract_data - { -# define gen_ctor \ - data_proxy() \ - { \ - logger << "ctor: " << proxy_type() << std::endl; \ - } - -# define gen_proxy_type \ - virtual std::string proxy_type() const \ - { \ - return mlc_name_of(*this); \ - } - - gen_proxy_type - - template <typename V> - operator V() const - { - V ret(const_ref()); - return ret; - } - - virtual std::string type() const - { - return mlc_name_of(const_ref()); - } - - virtual const T& const_ref() const = 0; - }; - - - // FIXME Perhaps we can use smart pointers here. - template <class T> - struct data_proxy_by_ptr : public data_proxy<T> - { - data_proxy_by_ptr(T* obj) : p_obj_(obj) { logger << "ctor: " << proxy_type() << std::endl; } - - virtual data_proxy_by_ptr<T>* clone() const - { - return new data_proxy_by_ptr<T>(p_obj_); - } - - virtual data_proxy_by_ptr<const T>* const_clone() const - { - return new data_proxy_by_ptr<const T>(p_obj_); - } - - gen_proxy_type - - T& obj() - { - assert(p_obj_); - return *p_obj_; - } - - const T& obj() const - { - assert(p_obj_); - return *p_obj_; - } - - virtual const T& const_ref() const { return obj(); } - - protected: - T* p_obj_; - }; - - - template <class T> - struct data_proxy_by_ref : public data_proxy<T> - { - data_proxy_by_ref(T& obj) : obj_(obj) { logger << "ctor: " << proxy_type() << std::endl; } - - virtual data_proxy_by_ref<T>* clone() const - { - return new data_proxy_by_ref<T>(obj_); - } - - virtual data_proxy_by_ref<const T>* const_clone() const - { - return new data_proxy_by_ref<const T>(obj_); - } - - virtual const T& const_ref() const { return obj_; } - const T& obj() const { return obj_; } - T& obj() { return obj_; } - - gen_proxy_type - - protected: - T& obj_; - }; - - - template <class T> - struct data_proxy_by_cpy : public data_proxy<T> - { - data_proxy_by_cpy(const T obj) : obj_(T(obj)) { logger << "ctor: " << proxy_type() << std::endl; } - - virtual data_proxy_by_cpy<T>* clone() const - { - return new data_proxy_by_cpy<T>(obj_); - } - - virtual data_proxy_by_cpy<const T>* const_clone() const - { - return new data_proxy_by_cpy<const T>(obj_); - } - - virtual const T& const_ref() const { return obj_; } - const T& obj() const { return obj_; } - T& obj() { return obj_; } - - gen_proxy_type - - protected: - T obj_; - }; - - - struct NilClass - { - NilClass(int) {} - }; - - struct data_nil : public data_proxy<NilClass> - { - data_nil() : nil_object_(NilClass(0)) { logger << "ctor: " << proxy_type() << std::endl; } - data_nil(const NilClass& nil_object) : nil_object_(nil_object) {} - const NilClass& const_ref() const { return nil_object_; } - const NilClass& obj() const { return nil_object_; } - virtual data_nil* clone() const { return new data_nil; } - gen_proxy_type - const NilClass nil_object_; - }; - - extern const NilClass nil_object; - extern data_nil* nil_proxy; - - template <typename T1, typename T2> - T2 - data_cast(const T1& src) - { - T2 tmp(src); - return tmp; - } - - template <typename T1, typename T2> - void - data_assign(T1& lhs, const T2& rhs) - { - lhs = rhs; - } - - // data - - struct data : public all_methods - { - - virtual const data& self() const - { - return *this; - } - - virtual data& self() - { - return *this; - } - - data& assign(const data& rhs) - { - if (&rhs == this) return *this; - if (rhs.proxy_ == 0) - { - logger << "assign(const data& rhs) [ rhs.proxy_ == 0 ]" << std::endl; - proxy_ = nil_proxy; - } - else - { - assert(rhs.proxy_ != proxy_); - // if (proxy_ != 0) - // delete proxy_; - proxy_ = rhs.proxy_->clone(); - } - return *this; - } - - data& const_assign(const data& rhs) - { - if (&rhs == this) return *this; - if (rhs.proxy_ == 0) - { - logger << "const_assign(const data& rhs) [ rhs.proxy_ == 0 ]" << std::endl; - proxy_ = nil_proxy; - } - else - { - assert(rhs.proxy_ != proxy_); - // if (proxy_ != 0) - // delete proxy_; - proxy_ = rhs.proxy_->const_clone(); - } - return *this; - } - - data& operator=(const data& rhs) { return assign(rhs); } - - data& operator=(data& rhs) { return assign(rhs); } - - - template <typename T> - data& operator=(const T& rhs); - - - template <typename T> - T convert_to() const; - - - template <typename T> - T& get_ref_on(); - - template <typename T> - const T& get_ref_on() const; - - std::string& const_stripping(std::string& str) const - { - size_t pos; - while ((pos = str.find("const ")) != std::string::npos) - str.erase(pos, 6); - while ((pos = str.find(" const")) != std::string::npos) - str.erase(pos, 6); - return str; - } - - template <typename T> - operator T() const - { - std::string src_type(proxy()->type()); - std::string dest_type(mlc_name<T>::of()); - if (const_stripping(src_type) == const_stripping(dest_type)) - return get_ref_on<T>(); - else - return convert_to<T>(); - } - - - ~data() - { - if (proxy_ != nil_proxy) - { - logger << "~data [ type() = " << type() << " ]" << std::endl; - delete proxy_; - proxy_ = nil_proxy; - } - } - - - std::string type() const - { - return proxy()->proxy_type(); - } - - - data operator[](const data&); - const data& operator[](const data&) const; - data operator*(); - const data& operator*() const; - - - abstract_data* proxy() const - { - assert(proxy_); - return proxy_; - } - - bool is_const() - { - std::string type_(type()); - return type_.find("dyn::data_proxy_by_ref<") == 0 - && type_.rfind("const>") == type_.length() - 6; - } - - meth method(const std::string& method_name); - - data() : proxy_(nil_proxy) {} - - data(abstract_data* proxy, proxy_tag*) : all_methods(), proxy_(proxy) {} - - template <class T> - data(T& obj) : all_methods() - { - logger << "data(T& obj) [ T = " << mlc_name<T>::of() << " ]" << std::endl; - proxy_ = new data_proxy_by_ref<T>(obj); - } - - template <class T> - data(const T& obj) : all_methods() - { - logger << "data(const T& obj) [ T = " << mlc_name<T>::of() << " ]" << std::endl; - proxy_ = new data_proxy_by_ref<const T>(obj); - } - - data(language::var& rhs); - data(language::val& rhs); - data(const language::var& rhs); - data(const language::val& rhs); - - data(data& rhs) : all_methods(), proxy_(0) - { - logger << "data(data& rhs) [ rhs.type() = " << rhs.type() << " ]" << std::endl; - assign(rhs); - } - - data(const data& rhs) : all_methods(), proxy_(0) - { - logger << "data(const data& rhs) [ rhs.type() = " << rhs.type() << " ]" << std::endl; - assign(rhs); - } - - protected: - abstract_data* proxy_; - }; - - extern const data nil; - - namespace internal { - extern op operator_push; - extern op operator_pop; - extern op operator_incr; - extern op operator_decr; - extern op operator_plus; - extern op operator_star; - extern op operator_equal; - extern op operator_not_equal; - extern meth operator_square_brackets; - } - -} - -template <typename T, dyn::policy::type policy> -struct dyn_choose_data_proxy -{ - typedef dyn::data_proxy_by_cpy<T> ret; -}; - -template <typename T> -struct dyn_choose_data_proxy<T, dyn::policy::is_ref> -{ - typedef dyn::data_proxy_by_ref<T> ret; -}; - -template <typename T> -struct dyn_choose_data_proxy<T, (dyn::policy::type)(dyn::policy::is_ref + dyn::policy::is_const)> -{ - typedef dyn::data_proxy_by_ref<const T> ret; -}; - -# ifdef DYN_FULL_IMPLEMENTATION -# include "data.hxx" -# endif - -#endif diff --git a/dynamic-use-of-static-c++/src/data.hh b/dynamic-use-of-static-c++/src/data.hh new file mode 100644 index 0000000..f0e1812 --- /dev/null +++ b/dynamic-use-of-static-c++/src/data.hh @@ -0,0 +1,416 @@ +#ifndef DYN_DATA_HH +# define DYN_DATA_HH + +# include <string> +# include <cassert> +# include "function.hh" +# include "name_of.hh" +# include "all_methods.hh" + +namespace dyn { + + extern std::ostream& logger; + + namespace language + { + struct val; + struct var; + } + + namespace policy + { + enum type + { + none = 0, + is_const = 1, + is_ref = 2, + is_ptr = 4, + is_pod = 8, + is_void = 16 + }; + } + struct proxy_tag; + + // data --> abstract_data + // ^ + // | + // data_proxy<T> --> T + + + // abstract_data + + struct abstract_data + { + virtual abstract_data* clone() const = 0; + virtual abstract_data* const_clone() const { return clone(); } + virtual std::string proxy_type() const = 0; + virtual std::string type() const = 0; + virtual ~abstract_data() {} + }; + + // data_proxy<T> + + template <class T> + struct data_proxy : public abstract_data + { +# define gen_ctor \ + data_proxy() \ + { \ + logger << "ctor: " << proxy_type() << std::endl; \ + } + +# define gen_proxy_type \ + virtual std::string proxy_type() const \ + { \ + return mlc_name_of(*this); \ + } + + gen_proxy_type + + template <typename V> + operator V() const + { + V ret(const_ref()); + return ret; + } + + virtual std::string type() const + { + return mlc_name_of(const_ref()); + } + + virtual const T& const_ref() const = 0; + }; + + + // FIXME Perhaps we can use smart pointers here. + template <class T> + struct data_proxy_by_ptr : public data_proxy<T> + { + data_proxy_by_ptr(T* obj) : p_obj_(obj) { logger << "ctor: " << proxy_type() << std::endl; } + + virtual data_proxy_by_ptr<T>* clone() const + { + return new data_proxy_by_ptr<T>(p_obj_); + } + + virtual data_proxy_by_ptr<const T>* const_clone() const + { + return new data_proxy_by_ptr<const T>(p_obj_); + } + + gen_proxy_type + + T& obj() + { + assert(p_obj_); + return *p_obj_; + } + + const T& obj() const + { + assert(p_obj_); + return *p_obj_; + } + + virtual const T& const_ref() const { return obj(); } + + protected: + T* p_obj_; + }; + + + template <class T> + struct data_proxy_by_ref : public data_proxy<T> + { + data_proxy_by_ref(T& obj) : obj_(obj) { logger << "ctor: " << proxy_type() << std::endl; } + + virtual data_proxy_by_ref<T>* clone() const + { + return new data_proxy_by_ref<T>(obj_); + } + + virtual data_proxy_by_ref<const T>* const_clone() const + { + return new data_proxy_by_ref<const T>(obj_); + } + + virtual const T& const_ref() const { return obj_; } + const T& obj() const { return obj_; } + T& obj() { return obj_; } + + gen_proxy_type + + protected: + T& obj_; + }; + + + template <class T> + struct data_proxy_by_cpy : public data_proxy<T> + { + data_proxy_by_cpy(const T obj) : obj_(T(obj)) { logger << "ctor: " << proxy_type() << std::endl; } + + virtual data_proxy_by_cpy<T>* clone() const + { + return new data_proxy_by_cpy<T>(obj_); + } + + virtual data_proxy_by_cpy<const T>* const_clone() const + { + return new data_proxy_by_cpy<const T>(obj_); + } + + virtual const T& const_ref() const { return obj_; } + const T& obj() const { return obj_; } + T& obj() { return obj_; } + + gen_proxy_type + + protected: + T obj_; + }; + + + struct NilClass + { + NilClass(int) {} + }; + + struct data_nil : public data_proxy<NilClass> + { + data_nil() : nil_object_(NilClass(0)) { logger << "ctor: " << proxy_type() << std::endl; } + data_nil(const NilClass& nil_object) : nil_object_(nil_object) {} + const NilClass& const_ref() const { return nil_object_; } + const NilClass& obj() const { return nil_object_; } + virtual data_nil* clone() const { return new data_nil; } + gen_proxy_type + const NilClass nil_object_; + }; + + extern const NilClass nil_object; + extern data_nil* nil_proxy; + + template <typename T1, typename T2> + T2 + data_cast(const T1& src) + { + T2 tmp(src); + return tmp; + } + + template <typename T1, typename T2> + void + data_assign(T1& lhs, const T2& rhs) + { + lhs = rhs; + } + + // data + + struct data : public all_methods + { + + virtual const data& self() const + { + return *this; + } + + virtual data& self() + { + return *this; + } + + data& assign(const data& rhs) + { + if (&rhs == this) return *this; + if (rhs.proxy_ == 0) + { + logger << "assign(const data& rhs) [ rhs.proxy_ == 0 ]" << std::endl; + proxy_ = nil_proxy; + } + else + { + assert(rhs.proxy_ != proxy_); + // if (proxy_ != 0) + // delete proxy_; + proxy_ = rhs.proxy_->clone(); + } + return *this; + } + + data& const_assign(const data& rhs) + { + if (&rhs == this) return *this; + if (rhs.proxy_ == 0) + { + logger << "const_assign(const data& rhs) [ rhs.proxy_ == 0 ]" << std::endl; + proxy_ = nil_proxy; + } + else + { + assert(rhs.proxy_ != proxy_); + // if (proxy_ != 0) + // delete proxy_; + proxy_ = rhs.proxy_->const_clone(); + } + return *this; + } + + data& operator=(const data& rhs) { return assign(rhs); } + + data& operator=(data& rhs) { return assign(rhs); } + + + template <typename T> + data& operator=(const T& rhs); + + + template <typename T> + T convert_to() const; + + + template <typename T> + T& get_ref_on(); + + template <typename T> + const T& get_ref_on() const; + + std::string& const_stripping(std::string& str) const + { + size_t pos; + while ((pos = str.find("const ")) != std::string::npos) + str.erase(pos, 6); + while ((pos = str.find(" const")) != std::string::npos) + str.erase(pos, 6); + return str; + } + + template <typename T> + operator T() const + { + std::string src_type(proxy()->type()); + std::string dest_type(mlc_name<T>::of()); + if (const_stripping(src_type) == const_stripping(dest_type)) + return get_ref_on<T>(); + else + return convert_to<T>(); + } + + + ~data() + { + if (proxy_ != nil_proxy) + { + logger << "~data [ type() = " << type() << " ]" << std::endl; + delete proxy_; + proxy_ = nil_proxy; + } + } + + + std::string type() const + { + return proxy()->proxy_type(); + } + + + data operator[](const data&); + const data& operator[](const data&) const; + data operator*(); + const data& operator*() const; + + + abstract_data* proxy() const + { + assert(proxy_); + return proxy_; + } + + bool is_const() + { + std::string type_(type()); + return type_.find("dyn::data_proxy_by_ref<") == 0 + && type_.rfind("const>") == type_.length() - 6; + } + + meth method(const std::string& method_name); + + data() : proxy_(nil_proxy) {} + + data(abstract_data* proxy, proxy_tag*) : all_methods(), proxy_(proxy) {} + + template <class T> + data(T& obj) : all_methods() + { + logger << "data(T& obj) [ T = " << mlc_name<T>::of() << " ]" << std::endl; + proxy_ = new data_proxy_by_ref<T>(obj); + } + + template <class T> + data(const T& obj) : all_methods() + { + logger << "data(const T& obj) [ T = " << mlc_name<T>::of() << " ]" << std::endl; + proxy_ = new data_proxy_by_ref<const T>(obj); + } + + data(language::var& rhs); + data(language::val& rhs); + data(const language::var& rhs); + data(const language::val& rhs); + + data(data& rhs) : all_methods(), proxy_(0) + { + logger << "data(data& rhs) [ rhs.type() = " << rhs.type() << " ]" << std::endl; + assign(rhs); + } + + data(const data& rhs) : all_methods(), proxy_(0) + { + logger << "data(const data& rhs) [ rhs.type() = " << rhs.type() << " ]" << std::endl; + assign(rhs); + } + + protected: + abstract_data* proxy_; + }; + + extern const data nil; + + namespace internal { + extern op operator_push; + extern op operator_pop; + extern op operator_incr; + extern op operator_decr; + extern op operator_plus; + extern op operator_star; + extern op operator_equal; + extern op operator_not_equal; + extern meth operator_square_brackets; + } + +} + +template <typename T, dyn::policy::type policy> +struct dyn_choose_data_proxy +{ + typedef dyn::data_proxy_by_cpy<T> ret; +}; + +template <typename T> +struct dyn_choose_data_proxy<T, dyn::policy::is_ref> +{ + typedef dyn::data_proxy_by_ref<T> ret; +}; + +template <typename T> +struct dyn_choose_data_proxy<T, (dyn::policy::type)(dyn::policy::is_ref + dyn::policy::is_const)> +{ + typedef dyn::data_proxy_by_ref<const T> ret; +}; + +# ifdef DYN_FULL_IMPLEMENTATION +# include "data.hxx" +# endif + +#endif -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * src/function_loader.cc, * src/ruby_stream.hh (ruby::environment::environment): Here. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4655 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 8 ++++++++ dynamic-use-of-static-c++/src/function_loader.cc | 2 +- dynamic-use-of-static-c++/src/ruby_stream.hh | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index fc90b57..b768669 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,13 @@ 2009-10-20 Roland Levillain <roland@lrde.epita.fr> + Typos. + + * src/function_loader.cc, + * src/ruby_stream.hh (ruby::environment::environment): + Here. + +2009-10-20 Roland Levillain <roland@lrde.epita.fr> + Rename src/data.erb.hh as src/data.hh and stop generating the latter. * src/data.erb.hh: Rename as... diff --git a/dynamic-use-of-static-c++/src/function_loader.cc b/dynamic-use-of-static-c++/src/function_loader.cc index ee34f7a..57b20d1 100644 --- a/dynamic-use-of-static-c++/src/function_loader.cc +++ b/dynamic-use-of-static-c++/src/function_loader.cc @@ -4,7 +4,7 @@ # include <ltdl.h> # include <map> -// FIXME use and improve the logger to avoid use of std::cerr +// FIXME: Use and improve the logger to avoid use of std::cerr. # include <iostream> # include "data.hh" diff --git a/dynamic-use-of-static-c++/src/ruby_stream.hh b/dynamic-use-of-static-c++/src/ruby_stream.hh index af2ee61..4f861fe 100644 --- a/dynamic-use-of-static-c++/src/ruby_stream.hh +++ b/dynamic-use-of-static-c++/src/ruby_stream.hh @@ -36,7 +36,7 @@ namespace ruby environment() { ruby_init(); - ruby_script("embeddeed ruby"); + ruby_script("Embedded Ruby"); ruby_init_loadpath(); } -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * libmd5/: New directory. * libmd5/driver.cc, * libmd5/md5.cc, * libmd5/md5.hh, * libmd5/README, * libmd5/test-suite: New. Imported from http://userpages.umbc.edu/~mabzug1/cs/md5/md5.html. * libmd5/Makefile.am: New. * Makefile.am (SUBDIRS): Add libmd5. * configure.ac: Configure libmd5/Makefile. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4656 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 16 + dynamic-use-of-static-c++/Makefile.am | 2 +- dynamic-use-of-static-c++/configure.ac | 1 + dynamic-use-of-static-c++/libmd5/Makefile.am | 33 ++ dynamic-use-of-static-c++/libmd5/README | 102 +++++ dynamic-use-of-static-c++/libmd5/driver.cc | 200 ++++++++++ dynamic-use-of-static-c++/libmd5/md5.cc | 544 ++++++++++++++++++++++++++ dynamic-use-of-static-c++/libmd5/md5.hh | 109 +++++ dynamic-use-of-static-c++/libmd5/test-suite | 34 ++ 9 files changed, 1040 insertions(+), 1 deletions(-) create mode 100644 dynamic-use-of-static-c++/libmd5/Makefile.am create mode 100644 dynamic-use-of-static-c++/libmd5/README create mode 100644 dynamic-use-of-static-c++/libmd5/driver.cc create mode 100644 dynamic-use-of-static-c++/libmd5/md5.cc create mode 100644 dynamic-use-of-static-c++/libmd5/md5.hh create mode 100644 dynamic-use-of-static-c++/libmd5/test-suite diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index b768669..38756f3 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,21 @@ 2009-10-20 Roland Levillain <roland@lrde.epita.fr> + Import a C++ implementation of the MD5 algorithm. + + * libmd5/: New directory. + * libmd5/driver.cc, + * libmd5/md5.cc, + * libmd5/md5.hh, + * libmd5/README, + * libmd5/test-suite: + New. + Imported from http://userpages.umbc.edu/~mabzug1/cs/md5/md5.html. + * libmd5/Makefile.am: New. + * Makefile.am (SUBDIRS): Add libmd5. + * configure.ac: Configure libmd5/Makefile. + +2009-10-20 Roland Levillain <roland@lrde.epita.fr> + Typos. * src/function_loader.cc, diff --git a/dynamic-use-of-static-c++/Makefile.am b/dynamic-use-of-static-c++/Makefile.am index 61eb925..55d40c3 100644 --- a/dynamic-use-of-static-c++/Makefile.am +++ b/dynamic-use-of-static-c++/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = libltdl bin src config data test +SUBDIRS = libltdl libmd5 bin src config data test ACLOCAL_AMFLAGS = -I config -I libltdl diff --git a/dynamic-use-of-static-c++/configure.ac b/dynamic-use-of-static-c++/configure.ac index 1ecd36c..facd01c 100644 --- a/dynamic-use-of-static-c++/configure.ac +++ b/dynamic-use-of-static-c++/configure.ac @@ -142,6 +142,7 @@ AC_CONFIG_FILES([ Makefile bin/Makefile bin/dyn-config + libmd5/Makefile src/Makefile src/config.hh data/Makefile diff --git a/dynamic-use-of-static-c++/libmd5/Makefile.am b/dynamic-use-of-static-c++/libmd5/Makefile.am new file mode 100644 index 0000000..300b0ba --- /dev/null +++ b/dynamic-use-of-static-c++/libmd5/Makefile.am @@ -0,0 +1,33 @@ +# A C++ implementation of the MD5 algorithm adapted from RSA Data +# Security's implementation. +# +# http://userpages.umbc.edu/~mabzug1/cs/md5/md5.html +# http://userpages.umbc.edu/~mabzug1/cs/md5/md5-cc-102.tar.gz + +# FIXME: Check that types are wide enough. From README: +# +# MD5 assumes that an unsigned char is at least a byte long, that an +# unsigned short int is at least two bytes long, and that an unsigned +# int is at least four bytes long. If your system is different, you +# should modify md5.hh accordingly. +# +# We should have `configure' check this. + +# FIXME: I (Roland) think that there is no legal problem to include +# this code in Olena. Still, we should check this thoroughly. +# +# We might want to depend on Crypto++ (http://www.cryptopp.com/) +# instead, which is both available from Debian GNU/Linux +# (http://packages.debian.org/lenny/libcrypto++-dev) and the MacPorts +# (http://trac.macports.org/browser/trunk/dports/devel/libcryptopp/Portfile). +# Crypto++ should also work on Cygwin (http://www.cryptopp.com/ +# mentions patches to have Crypto++ compile on Cygwin). + +noinst_LTLIBRARIES = libmd5.la +libmd5_la_SOURCES = md5.hh md5.cc + +check_PROGRAMS = md5 +md5_SOURCES = driver.cc +md5_LDADD = libmd5.la + +EXTRA_DIST = README test-suite diff --git a/dynamic-use-of-static-c++/libmd5/README b/dynamic-use-of-static-c++/libmd5/README new file mode 100644 index 0000000..9d92af3 --- /dev/null +++ b/dynamic-use-of-static-c++/libmd5/README @@ -0,0 +1,102 @@ +C++/object oriented translation and modification of MD5. + +Version: 1.00 (28 Aug 95) +Version: 1.02 (22 Sep 97) + + Translation and modification (c) 1995 by Mordechai T. Abzug + Thanks to Martin Cleaver for for making it happy on Windows NT and Solaris. + + This translation/ modification is provided "as is," without express or + implied warranty of any kind. + + The translator/ modifier does not claim (1) that MD5 will do what you think + it does; (2) that this translation/ modification is accurate; or (3) that + this software is "merchantible." (Language for this disclaimer partially + copied from the disclaimer below). + +Based on: + + MD5.H - header file for MD5C.C + MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm + MDDRIVER.C - test driver for MD2, MD4 and MD5 + + Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All +rights reserved. + +License to copy and use this software is granted provided that it +is identified as the "RSA Data Security, Inc. MD5 Message-Digest +Algorithm" in all material mentioning or referencing this software +or this function. + +License is also granted to make and use derivative works provided +that such works are identified as "derived from the RSA Data +Security, Inc. MD5 Message-Digest Algorithm" in all material +mentioning or referencing the derived work. + +RSA Data Security, Inc. makes no representations concerning either +the merchantability of this software or the suitability of this +software for any particular purpose. It is provided "as is" +without express or implied warranty of any kind. + +These notices must be retained in any copies of any part of this +documentation and/or software. + +------------------------------------------------------------------------------- + +A note on compilation: + + MD5 assumes that an unsigned char is at least a byte long, that an + unsigned short int is at least two bytes long, and that an unsigned + int is at least four bytes long. If your system is different, you + should modify md5.hh accordingly. + + +HOW TO USE: + +(1) standalone: + + Driver.cc provides a nice interface for simple uses of md5. The + included makefile will do fine. However, if this is the limit of your + md5 use, you may as well use the original C source, which is somewhat + smaller. + +(2) as an object-oriented module: + + The MD5 objects in this module are MD5 contexts that are initialized, + then updated zero or more times, then finalized, and then have their + digest accessed zero or more times. Note that they *must* be + "finalized" between initialization and the availability of the digest; + this is part of the definition of MD5. + + The updating is done with a message, either with a stdio file opened + for reading (it is the user's responsibility to make sure that the file + is open), with an ifstream (again, the user's responsibility), with an + istream, or with an unsigned char string (typecast if you're using + normal char strings). If you initialized with the default contructor + (see later), you can update a single MD5 object multiple times, even + with different types of objects (say, a file and then a string). Note + that a stdio file is closed after an update, and the streams must no + longer be "good". Example: "context.update(file);". + + Initialization of the object depends on the type of updating you + intend to do (which is why it's here). If you want a general-purpose + MD5 object capable of being updated multiple times, with any object + type, use the default constructor (ie. "MD5 context;"). If you only + want to use the MD5 object for one update, you can initialize with + that object; this does an implicit finalization Example: "MD5 context + (cin);". + + Finalization must be done explicitly on object initialized with the + default constructor (see above); finalization is implicit with all + other contrsuctors. Once finalization has occurred, update is an + error. Example: "context.finalize();" + + After finalizing, you can look at the digest. MD5::raw_digest() + returns an 16-member array of unsigned chars (bytes). + MD5::hex_digest() returns a 33-byte long character string that is a + hex representation of the raw digest. There is also a << operator for + ostreams. Example: "unsigned char *digest=context.hex_digest();". + Example: 'cout << "Digest is: " << context << endl;'. + + See driver.cc for more examples. + diff --git a/dynamic-use-of-static-c++/libmd5/driver.cc b/dynamic-use-of-static-c++/libmd5/driver.cc new file mode 100644 index 0000000..3624a7d --- /dev/null +++ b/dynamic-use-of-static-c++/libmd5/driver.cc @@ -0,0 +1,200 @@ +// DRIVER.CC - test driver for the C++/object oriented translation and +// modification of MD5. + +// Translation and modification (c) 1995 by Mordechai T. Abzug + +// This translation/ modification is provided "as is," without express or +// implied warranty of any kind. + +// The translator/ modifier does not claim (1) that MD5 will do what you think +// it does; (2) that this translation/ modification is accurate; or (3) that +// this software is "merchantible." (Language for this disclaimer partially +// copied from the disclaimer below). + +/* based on: + + MDDRIVER.C - test driver for MD2, MD4 and MD5 + + Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All +rights reserved. + +RSA Data Security, Inc. makes no representations concerning either +the merchantability of this software or the suitability of this +software for any particular purpose. It is provided "as is" +without express or implied warranty of any kind. + +These notices must be retained in any copies of any part of this +documentation and/or software. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <string.h> + +#include "md5.hh" + + +// Length of test block, number of test blocks. + +#define TEST_BLOCK_LEN 1000 +#define TEST_BLOCK_COUNT 1000 + +static void MD5_timeTrial (void); +static void MD5_testSuite (void); +static void MD5_file (char *); +static void MD5_filter (void); +static void MD5_string (unsigned char *string); +static char *MD5_usage (void); + +// Main driver. + +int main (int argc, char *argv[]){ + + int i; + + if (argc > 1) + for (i = 1; i < argc; i++) + if (argv[i][0] == '-' && argv[i][1] == 's') + MD5_string ( (unsigned char *) argv[i] + 2); + else if (strcmp (argv[i], "-t") == 0) + MD5_timeTrial (); + else if (strcmp (argv[i], "-x") == 0) + MD5_testSuite (); + else if (strcmp (argv[i], "-h") == 0) + cout << MD5_usage()<< flush; + else if (strcmp (argv[i], "-help")==0) + cout << MD5_usage()<< flush; + else if (argv[i][0] == '-'){ + cerr << argv[i] << " is an unknown option.\n" << MD5_usage()<< flush; + exit (1); + } + else + MD5_file (argv[i]); + else + MD5_filter (); + + return (0); +} + + +// Measures the time to digest TEST_BLOCK_COUNT TEST_BLOCK_LEN-byte blocks. + +static void MD5_timeTrial () +{ + MD5 context; + time_t endTime, startTime; + unsigned char block[TEST_BLOCK_LEN]; + unsigned int i; + + + cout << "MD5 time trial. Digesting "<< TEST_BLOCK_LEN << " "; + cout << TEST_BLOCK_COUNT << "-byte blocks ..."; + + // Initialize block + for (i = 0; i < TEST_BLOCK_LEN; i++) + block[i] = (unsigned char)(i & 0xff); + + // Start timer + time (&startTime); + + // Digest blocks + for (i = 0; i < TEST_BLOCK_COUNT; i++) + context.update (block, TEST_BLOCK_LEN); + + context.finalize(); + + // Stop timer + time (&endTime); + + cout << " done" << endl; + + cout << "Digest = " << context << endl; + + cout << "Time = "<< (long)(endTime-startTime) << " seconds" << endl; + + cout << "Speed = "; + cout << (long)TEST_BLOCK_LEN * (long)TEST_BLOCK_COUNT/(endTime-startTime); + cout << "bytes/second" <<endl; + +} + +// Digests a reference suite of strings and prints the results. + +static void MD5_testSuite () +{ + cout << "MD5 test suite:" << endl; + + MD5_string ( (unsigned char*) ""); + MD5_string ( (unsigned char*) "a"); + MD5_string ( (unsigned char*) "abc"); + MD5_string ( (unsigned char*) "message digest"); + MD5_string ( (unsigned char*) "abcdefghijklmnopqrstuvwxyz"); + MD5_string + ( (unsigned char*) "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); + MD5_string + ( (unsigned char*) "1234567890123456789012345678901234567890\ +1234567890123456789012345678901234567890"); +} + + +// Digests a file and prints the result. + +static void MD5_file (char *filename){ + + ifstream file(filename); + + if (!file) + cerr << filename <<" can't be opened" << endl; + else { + MD5 context(file); + cout << "MD5 (" << filename << ") = " << context << endl; + } +} + +// Digests the standard input and prints the result. + +static void MD5_filter () +{ + + MD5 context(cin); // ie. run istream version of MD5 on cin. + // Could also run file version of MD5 on stdin. + + cout << context << endl; +} + + + +// Digests a string and prints the result. + +void MD5_string (unsigned char *string){ + + MD5 context; + unsigned int len = strlen ( (char *)string); + + context.update (string, len); + context.finalize (); + + cout << "MD5 (\"" << (char *)string << "\") = " << context <<endl; +} + + + +static char *MD5_usage(){ + + return "\n\ + MD5\n\n\ +USAGE:\n\n\ + MD5 [-sstring] [-t] [-x] [-h] [-help] [filename]\n\n\ +Arguments (may be any combination):\n\ + -sstring - digests string\n\ + -t - runs time trial\n\ + -x - runs test script\n\ + -h - displays this message\n\ + -help - displays this message\n\ + filename - digests file\n\ + (none) - digests standard input\n\n"; +} + + + diff --git a/dynamic-use-of-static-c++/libmd5/md5.cc b/dynamic-use-of-static-c++/libmd5/md5.cc new file mode 100644 index 0000000..8a547bd --- /dev/null +++ b/dynamic-use-of-static-c++/libmd5/md5.cc @@ -0,0 +1,544 @@ +// MD5.CC - source code for the C++/object oriented translation and +// modification of MD5. + +// Translation and modification (c) 1995 by Mordechai T. Abzug + +// This translation/ modification is provided "as is," without express or +// implied warranty of any kind. + +// The translator/ modifier does not claim (1) that MD5 will do what you think +// it does; (2) that this translation/ modification is accurate; or (3) that +// this software is "merchantible." (Language for this disclaimer partially +// copied from the disclaimer below). + +/* based on: + + MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm + MDDRIVER.C - test driver for MD2, MD4 and MD5 + + + Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All +rights reserved. + +License to copy and use this software is granted provided that it +is identified as the "RSA Data Security, Inc. MD5 Message-Digest +Algorithm" in all material mentioning or referencing this software +or this function. + +License is also granted to make and use derivative works provided +that such works are identified as "derived from the RSA Data +Security, Inc. MD5 Message-Digest Algorithm" in all material +mentioning or referencing the derived work. + +RSA Data Security, Inc. makes no representations concerning either +the merchantability of this software or the suitability of this +software for any particular purpose. It is provided "as is" +without express or implied warranty of any kind. + +These notices must be retained in any copies of any part of this +documentation and/or software. + + */ + + + + + + +#include "md5.hh" + +#include <assert.h> +#include <strings.h> +#include <iostream.h> + + + + +// MD5 simple initialization method + +MD5::MD5(){ + + init(); + +} + + + + +// MD5 block update operation. Continues an MD5 message-digest +// operation, processing another message block, and updating the +// context. + +void MD5::update (uint1 *input, uint4 input_length) { + + uint4 input_index, buffer_index; + uint4 buffer_space; // how much space is left in buffer + + if (finalized){ // so we can't update! + cerr << "MD5::update: Can't update a finalized digest!" << endl; + return; + } + + // Compute number of bytes mod 64 + buffer_index = (unsigned int)((count[0] >> 3) & 0x3F); + + // Update number of bits + if ( (count[0] += ((uint4) input_length << 3))<((uint4) input_length << 3) ) + count[1]++; + + count[1] += ((uint4)input_length >> 29); + + + buffer_space = 64 - buffer_index; // how much space is left in buffer + + // Transform as many times as possible. + if (input_length >= buffer_space) { // ie. we have enough to fill the buffer + // fill the rest of the buffer and transform + memcpy (buffer + buffer_index, input, buffer_space); + transform (buffer); + + // now, transform each 64-byte piece of the input, bypassing the buffer + for (input_index = buffer_space; input_index + 63 < input_length; + input_index += 64) + transform (input+input_index); + + buffer_index = 0; // so we can buffer remaining + } + else + input_index=0; // so we can buffer the whole input + + + // and here we do the buffering: + memcpy(buffer+buffer_index, input+input_index, input_length-input_index); +} + + + +// MD5 update for files. +// Like above, except that it works on files (and uses above as a primitive.) + +void MD5::update(FILE *file){ + + unsigned char buffer[1024]; + int len; + + while (len=fread(buffer, 1, 1024, file)) + update(buffer, len); + + fclose (file); + +} + + + + + + +// MD5 update for istreams. +// Like update for files; see above. + +void MD5::update(istream& stream){ + + unsigned char buffer[1024]; + int len; + + while (stream.good()){ + stream.read(buffer, 1024); // note that return value of read is unusable. + len=stream.gcount(); + update(buffer, len); + } + +} + + + + + + +// MD5 update for ifstreams. +// Like update for files; see above. + +void MD5::update(ifstream& stream){ + + unsigned char buffer[1024]; + int len; + + while (stream.good()){ + stream.read(buffer, 1024); // note that return value of read is unusable. + len=stream.gcount(); + update(buffer, len); + } + +} + + + + + + +// MD5 finalization. Ends an MD5 message-digest operation, writing the +// the message digest and zeroizing the context. + + +void MD5::finalize (){ + + unsigned char bits[8]; + unsigned int index, padLen; + static uint1 PADDING[64]={ + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + + if (finalized){ + cerr << "MD5::finalize: Already finalized this digest!" << endl; + return; + } + + // Save number of bits + encode (bits, count, 8); + + // Pad out to 56 mod 64. + index = (uint4) ((count[0] >> 3) & 0x3f); + padLen = (index < 56) ? (56 - index) : (120 - index); + update (PADDING, padLen); + + // Append length (before padding) + update (bits, 8); + + // Store state in digest + encode (digest, state, 16); + + // Zeroize sensitive information + memset (buffer, 0, sizeof(*buffer)); + + finalized=1; + +} + + + + +MD5::MD5(FILE *file){ + + init(); // must be called be all constructors + update(file); + finalize (); +} + + + + +MD5::MD5(istream& stream){ + + init(); // must called by all constructors + update (stream); + finalize(); +} + + + +MD5::MD5(ifstream& stream){ + + init(); // must called by all constructors + update (stream); + finalize(); +} + + + +unsigned char *MD5::raw_digest(){ + + uint1 *s = new uint1[16]; + + if (!finalized){ + cerr << "MD5::raw_digest: Can't get digest if you haven't "<< + "finalized the digest!" <<endl; + return ( (unsigned char*) ""); + } + + memcpy(s, digest, 16); + return s; +} + + + +char *MD5::hex_digest(){ + + int i; + char *s= new char[33]; + + if (!finalized){ + cerr << "MD5::hex_digest: Can't get digest if you haven't "<< + "finalized the digest!" <<endl; + return ""; + } + + for (i=0; i<16; i++) + sprintf(s+i*2, "%02x", digest[i]); + + s[32]='\0'; + + return s; +} + + + + + +ostream& operator<<(ostream &stream, MD5 context){ + + stream << context.hex_digest(); + return stream; +} + + + + +// PRIVATE METHODS: + + + +void MD5::init(){ + finalized=0; // we just started! + + // Nothing counted, so count=0 + count[0] = 0; + count[1] = 0; + + // Load magic initialization constants. + state[0] = 0x67452301; + state[1] = 0xefcdab89; + state[2] = 0x98badcfe; + state[3] = 0x10325476; +} + + + +// Constants for MD5Transform routine. +// Although we could use C++ style constants, defines are actually better, +// since they let us easily evade scope clashes. + +#define S11 7 +#define S12 12 +#define S13 17 +#define S14 22 +#define S21 5 +#define S22 9 +#define S23 14 +#define S24 20 +#define S31 4 +#define S32 11 +#define S33 16 +#define S34 23 +#define S41 6 +#define S42 10 +#define S43 15 +#define S44 21 + + + + +// MD5 basic transformation. Transforms state based on block. +void MD5::transform (uint1 block[64]){ + + uint4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; + + decode (x, block, 64); + + assert(!finalized); // not just a user error, since the method is private + + /* Round 1 */ + FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ + FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ + FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ + FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ + FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ + FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ + FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ + FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ + FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ + FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ + FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ + FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ + FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ + FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ + FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ + FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ + + /* Round 2 */ + GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ + GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ + GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ + GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ + GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ + GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */ + GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ + GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ + GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ + GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ + GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ + GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ + GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ + GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ + GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ + GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ + + /* Round 3 */ + HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ + HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ + HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ + HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ + HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ + HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ + HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ + HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ + HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ + HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ + HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ + HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ + HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ + HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ + HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ + HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ + + /* Round 4 */ + II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ + II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ + II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ + II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ + II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ + II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ + II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ + II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ + II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ + II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ + II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ + II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ + II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ + II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ + II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ + II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ + + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + + // Zeroize sensitive information. + memset ( (uint1 *) x, 0, sizeof(x)); + +} + + + +// Encodes input (UINT4) into output (unsigned char). Assumes len is +// a multiple of 4. +void MD5::encode (uint1 *output, uint4 *input, uint4 len) { + + unsigned int i, j; + + for (i = 0, j = 0; j < len; i++, j += 4) { + output[j] = (uint1) (input[i] & 0xff); + output[j+1] = (uint1) ((input[i] >> 8) & 0xff); + output[j+2] = (uint1) ((input[i] >> 16) & 0xff); + output[j+3] = (uint1) ((input[i] >> 24) & 0xff); + } +} + + + + +// Decodes input (unsigned char) into output (UINT4). Assumes len is +// a multiple of 4. +void MD5::decode (uint4 *output, uint1 *input, uint4 len){ + + unsigned int i, j; + + for (i = 0, j = 0; j < len; i++, j += 4) + output[i] = ((uint4)input[j]) | (((uint4)input[j+1]) << 8) | + (((uint4)input[j+2]) << 16) | (((uint4)input[j+3]) << 24); +} + + + + + +// Note: Replace "for loop" with standard memcpy if possible. +void MD5::memcpy (uint1 *output, uint1 *input, uint4 len){ + + unsigned int i; + + for (i = 0; i < len; i++) + output[i] = input[i]; +} + + + +// Note: Replace "for loop" with standard memset if possible. +void MD5::memset (uint1 *output, uint1 value, uint4 len){ + + unsigned int i; + + for (i = 0; i < len; i++) + output[i] = value; +} + + + +// ROTATE_LEFT rotates x left n bits. + +inline unsigned int MD5::rotate_left (uint4 x, uint4 n){ + return (x << n) | (x >> (32-n)) ; +} + + + + +// F, G, H and I are basic MD5 functions. + +inline unsigned int MD5::F (uint4 x, uint4 y, uint4 z){ + return (x & y) | (~x & z); +} + +inline unsigned int MD5::G (uint4 x, uint4 y, uint4 z){ + return (x & z) | (y & ~z); +} + +inline unsigned int MD5::H (uint4 x, uint4 y, uint4 z){ + return x ^ y ^ z; +} + +inline unsigned int MD5::I (uint4 x, uint4 y, uint4 z){ + return y ^ (x | ~z); +} + + + +// FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. +// Rotation is separate from addition to prevent recomputation. + + +inline void MD5::FF(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, + uint4 s, uint4 ac){ + a += F(b, c, d) + x + ac; + a = rotate_left (a, s) +b; +} + +inline void MD5::GG(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, + uint4 s, uint4 ac){ + a += G(b, c, d) + x + ac; + a = rotate_left (a, s) +b; +} + +inline void MD5::HH(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, + uint4 s, uint4 ac){ + a += H(b, c, d) + x + ac; + a = rotate_left (a, s) +b; +} + +inline void MD5::II(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, + uint4 s, uint4 ac){ + a += I(b, c, d) + x + ac; + a = rotate_left (a, s) +b; +} diff --git a/dynamic-use-of-static-c++/libmd5/md5.hh b/dynamic-use-of-static-c++/libmd5/md5.hh new file mode 100644 index 0000000..b8bc075 --- /dev/null +++ b/dynamic-use-of-static-c++/libmd5/md5.hh @@ -0,0 +1,109 @@ +// MD5.CC - source code for the C++/object oriented translation and +// modification of MD5. + +// Translation and modification (c) 1995 by Mordechai T. Abzug + +// This translation/ modification is provided "as is," without express or +// implied warranty of any kind. + +// The translator/ modifier does not claim (1) that MD5 will do what you think +// it does; (2) that this translation/ modification is accurate; or (3) that +// this software is "merchantible." (Language for this disclaimer partially +// copied from the disclaimer below). + +/* based on: + + MD5.H - header file for MD5C.C + MDDRIVER.C - test driver for MD2, MD4 and MD5 + + Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All +rights reserved. + +License to copy and use this software is granted provided that it +is identified as the "RSA Data Security, Inc. MD5 Message-Digest +Algorithm" in all material mentioning or referencing this software +or this function. + +License is also granted to make and use derivative works provided +that such works are identified as "derived from the RSA Data +Security, Inc. MD5 Message-Digest Algorithm" in all material +mentioning or referencing the derived work. + +RSA Data Security, Inc. makes no representations concerning either +the merchantability of this software or the suitability of this +software for any particular purpose. It is provided "as is" +without express or implied warranty of any kind. + +These notices must be retained in any copies of any part of this +documentation and/or software. + +*/ + +#include <stdio.h> +#include <fstream.h> +#include <iostream.h> + +class MD5 { + +public: +// methods for controlled operation: + MD5 (); // simple initializer + void update (unsigned char *input, unsigned int input_length); + void update (istream& stream); + void update (FILE *file); + void update (ifstream& stream); + void finalize (); + +// constructors for special circumstances. All these constructors finalize +// the MD5 context. + MD5 (unsigned char *string); // digest string, finalize + MD5 (istream& stream); // digest stream, finalize + MD5 (FILE *file); // digest file, close, finalize + MD5 (ifstream& stream); // digest stream, close, finalize + +// methods to acquire finalized result + unsigned char *raw_digest (); // digest as a 16-byte binary array + char * hex_digest (); // digest as a 33-byte ascii-hex string + friend ostream& operator<< (ostream&, MD5 context); + + + +private: + +// first, some types: + typedef unsigned int uint4; // assumes integer is 4 words long + typedef unsigned short int uint2; // assumes short integer is 2 words long + typedef unsigned char uint1; // assumes char is 1 word long + +// next, the private data: + uint4 state[4]; + uint4 count[2]; // number of *bits*, mod 2^64 + uint1 buffer[64]; // input buffer + uint1 digest[16]; + uint1 finalized; + +// last, the private methods, mostly static: + void init (); // called by all constructors + void transform (uint1 *buffer); // does the real update work. Note + // that length is implied to be 64. + + static void encode (uint1 *dest, uint4 *src, uint4 length); + static void decode (uint4 *dest, uint1 *src, uint4 length); + static void memcpy (uint1 *dest, uint1 *src, uint4 length); + static void memset (uint1 *start, uint1 val, uint4 length); + + static inline uint4 rotate_left (uint4 x, uint4 n); + static inline uint4 F (uint4 x, uint4 y, uint4 z); + static inline uint4 G (uint4 x, uint4 y, uint4 z); + static inline uint4 H (uint4 x, uint4 y, uint4 z); + static inline uint4 I (uint4 x, uint4 y, uint4 z); + static inline void FF (uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, + uint4 s, uint4 ac); + static inline void GG (uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, + uint4 s, uint4 ac); + static inline void HH (uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, + uint4 s, uint4 ac); + static inline void II (uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, + uint4 s, uint4 ac); + +}; diff --git a/dynamic-use-of-static-c++/libmd5/test-suite b/dynamic-use-of-static-c++/libmd5/test-suite new file mode 100644 index 0000000..ea034e4 --- /dev/null +++ b/dynamic-use-of-static-c++/libmd5/test-suite @@ -0,0 +1,34 @@ + + The MD5 test suite (driver option "-x") should print the following + results: + +MD5 test suite: +MD5 ("") = d41d8cd98f00b204e9800998ecf8427e +MD5 ("a") = 0cc175b9c0f1b6a831c399e269772661 +MD5 ("abc") = 900150983cd24fb0d6963f7d28e17f72 +MD5 ("message digest") = f96b697d7cb7938d525a2f31aaf161d0 +MD5 ("abcdefghijklmnopqrstuvwxyz") = c3fcd3d76192e4007dfb496cca67e13b +MD5 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") = +d174ab98d277d9f5a5611c2c9f419d9f +MD5 ("123456789012345678901234567890123456789012345678901234567890123456 +78901234567890") = 57edf4a22be3c955ac49da2e2107b67a + +Security Considerations + + The level of security discussed in this memo is considered to be + sufficient for implementing very high security hybrid digital- + signature schemes based on MD5 and a public-key cryptosystem. + +Author's Address + + Ronald L. Rivest + Massachusetts Institute of Technology + Laboratory for Computer Science + NE43-324 + 545 Technology Square + Cambridge, MA 02139-1986 + + Phone: (617) 253-5880 + EMail: rivest@theory.lcs.mit.edu + + -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * libmd5/md5.hh, libmd5/driver.cc: Use modern C++ header names. Add missing `std::' qualifiers. * libmd5/md5.cc: Likewise. (MD5::update(std::ifstream&)): Cast the type of the buffer to make it compatible with std::istream::read. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4657 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 10 ++++++ dynamic-use-of-static-c++/libmd5/driver.cc | 46 ++++++++++++++-------------- dynamic-use-of-static-c++/libmd5/md5.cc | 41 +++++++++++++----------- dynamic-use-of-static-c++/libmd5/md5.hh | 16 +++++----- 4 files changed, 63 insertions(+), 50 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 38756f3..a9dec35 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,15 @@ 2009-10-20 Roland Levillain <roland@lrde.epita.fr> + Have libmd5 compile. + + * libmd5/md5.hh, libmd5/driver.cc: Use modern C++ header names. + Add missing `std::' qualifiers. + * libmd5/md5.cc: Likewise. + (MD5::update(std::ifstream&)): Cast the type of the buffer to make + it compatible with std::istream::read. + +2009-10-20 Roland Levillain <roland@lrde.epita.fr> + Import a C++ implementation of the MD5 algorithm. * libmd5/: New directory. diff --git a/dynamic-use-of-static-c++/libmd5/driver.cc b/dynamic-use-of-static-c++/libmd5/driver.cc index 3624a7d..acaa3f7 100644 --- a/dynamic-use-of-static-c++/libmd5/driver.cc +++ b/dynamic-use-of-static-c++/libmd5/driver.cc @@ -27,10 +27,10 @@ These notices must be retained in any copies of any part of this documentation and/or software. */ -#include <stdio.h> -#include <stdlib.h> -#include <time.h> -#include <string.h> +#include <cstdio> +#include <cstdlib> +#include <ctime> +#include <cstring> #include "md5.hh" @@ -62,11 +62,11 @@ int main (int argc, char *argv[]){ else if (strcmp (argv[i], "-x") == 0) MD5_testSuite (); else if (strcmp (argv[i], "-h") == 0) - cout << MD5_usage()<< flush; + std::cout << MD5_usage() << std::flush; else if (strcmp (argv[i], "-help")==0) - cout << MD5_usage()<< flush; + std::cout << MD5_usage() << std::flush; else if (argv[i][0] == '-'){ - cerr << argv[i] << " is an unknown option.\n" << MD5_usage()<< flush; + std::cerr << argv[i] << " is an unknown option.\n" << MD5_usage() << std::flush; exit (1); } else @@ -88,8 +88,8 @@ static void MD5_timeTrial () unsigned int i; - cout << "MD5 time trial. Digesting "<< TEST_BLOCK_LEN << " "; - cout << TEST_BLOCK_COUNT << "-byte blocks ..."; + std::cout << "MD5 time trial. Digesting "<< TEST_BLOCK_LEN << " "; + std::cout << TEST_BLOCK_COUNT << "-byte blocks ..."; // Initialize block for (i = 0; i < TEST_BLOCK_LEN; i++) @@ -107,15 +107,15 @@ static void MD5_timeTrial () // Stop timer time (&endTime); - cout << " done" << endl; + std::cout << " done" << std::endl; - cout << "Digest = " << context << endl; + std::cout << "Digest = " << context << std::endl; - cout << "Time = "<< (long)(endTime-startTime) << " seconds" << endl; + std::cout << "Time = "<< (long)(endTime-startTime) << " seconds" << std::endl; - cout << "Speed = "; - cout << (long)TEST_BLOCK_LEN * (long)TEST_BLOCK_COUNT/(endTime-startTime); - cout << "bytes/second" <<endl; + std::cout << "Speed = "; + std::cout << (long)TEST_BLOCK_LEN * (long)TEST_BLOCK_COUNT/(endTime-startTime); + std::cout << "bytes/second" << std::endl; } @@ -123,7 +123,7 @@ static void MD5_timeTrial () static void MD5_testSuite () { - cout << "MD5 test suite:" << endl; + std::cout << "MD5 test suite:" << std::endl; MD5_string ( (unsigned char*) ""); MD5_string ( (unsigned char*) "a"); @@ -142,13 +142,13 @@ static void MD5_testSuite () static void MD5_file (char *filename){ - ifstream file(filename); + std::ifstream file(filename); if (!file) - cerr << filename <<" can't be opened" << endl; + std::cerr << filename <<" can't be opened" << std::endl; else { MD5 context(file); - cout << "MD5 (" << filename << ") = " << context << endl; + std::cout << "MD5 (" << filename << ") = " << context << std::endl; } } @@ -157,10 +157,10 @@ static void MD5_file (char *filename){ static void MD5_filter () { - MD5 context(cin); // ie. run istream version of MD5 on cin. - // Could also run file version of MD5 on stdin. + MD5 context(std::cin); // ie. run istream version of MD5 on std::cin. + // Could also run file version of MD5 on stdin. - cout << context << endl; + std::cout << context << std::endl; } @@ -175,7 +175,7 @@ void MD5_string (unsigned char *string){ context.update (string, len); context.finalize (); - cout << "MD5 (\"" << (char *)string << "\") = " << context <<endl; + std::cout << "MD5 (\"" << (char *)string << "\") = " << context << std::endl; } diff --git a/dynamic-use-of-static-c++/libmd5/md5.cc b/dynamic-use-of-static-c++/libmd5/md5.cc index 8a547bd..6d9cab5 100644 --- a/dynamic-use-of-static-c++/libmd5/md5.cc +++ b/dynamic-use-of-static-c++/libmd5/md5.cc @@ -45,11 +45,12 @@ documentation and/or software. -#include "md5.hh" - -#include <assert.h> +#include <cassert> #include <strings.h> -#include <iostream.h> + +#include <iostream> + +#include "md5.hh" @@ -75,7 +76,7 @@ void MD5::update (uint1 *input, uint4 input_length) { uint4 buffer_space; // how much space is left in buffer if (finalized){ // so we can't update! - cerr << "MD5::update: Can't update a finalized digest!" << endl; + std::cerr << "MD5::update: Can't update a finalized digest!" << std::endl; return; } @@ -134,16 +135,17 @@ void MD5::update(FILE *file){ -// MD5 update for istreams. +// MD5 update for std::istreams. // Like update for files; see above. -void MD5::update(istream& stream){ +void MD5::update(std::istream& stream){ unsigned char buffer[1024]; int len; + char* buffer_ = (char*)(buffer); while (stream.good()){ - stream.read(buffer, 1024); // note that return value of read is unusable. + stream.read(buffer_, 1024); // note that return value of read is unusable. len=stream.gcount(); update(buffer, len); } @@ -155,16 +157,17 @@ void MD5::update(istream& stream){ -// MD5 update for ifstreams. +// MD5 update for std::ifstreams. // Like update for files; see above. -void MD5::update(ifstream& stream){ +void MD5::update(std::ifstream& stream){ unsigned char buffer[1024]; int len; while (stream.good()){ - stream.read(buffer, 1024); // note that return value of read is unusable. + // FIXME: Cast BUFFER to char* to be compatible with std::istream::read. + stream.read((char*)buffer, 1024); // note that return value of read is unusable. len=stream.gcount(); update(buffer, len); } @@ -191,7 +194,7 @@ void MD5::finalize (){ }; if (finalized){ - cerr << "MD5::finalize: Already finalized this digest!" << endl; + std::cerr << "MD5::finalize: Already finalized this digest!" << std::endl; return; } @@ -229,7 +232,7 @@ MD5::MD5(FILE *file){ -MD5::MD5(istream& stream){ +MD5::MD5(std::istream& stream){ init(); // must called by all constructors update (stream); @@ -238,7 +241,7 @@ MD5::MD5(istream& stream){ -MD5::MD5(ifstream& stream){ +MD5::MD5(std::ifstream& stream){ init(); // must called by all constructors update (stream); @@ -252,8 +255,8 @@ unsigned char *MD5::raw_digest(){ uint1 *s = new uint1[16]; if (!finalized){ - cerr << "MD5::raw_digest: Can't get digest if you haven't "<< - "finalized the digest!" <<endl; + std::cerr << "MD5::raw_digest: Can't get digest if you haven't "<< + "finalized the digest!" << std::endl; return ( (unsigned char*) ""); } @@ -269,8 +272,8 @@ char *MD5::hex_digest(){ char *s= new char[33]; if (!finalized){ - cerr << "MD5::hex_digest: Can't get digest if you haven't "<< - "finalized the digest!" <<endl; + std::cerr << "MD5::hex_digest: Can't get digest if you haven't "<< + "finalized the digest!" << std::endl; return ""; } @@ -286,7 +289,7 @@ char *MD5::hex_digest(){ -ostream& operator<<(ostream &stream, MD5 context){ +std::ostream& operator<<(std::ostream &stream, MD5 context){ stream << context.hex_digest(); return stream; diff --git a/dynamic-use-of-static-c++/libmd5/md5.hh b/dynamic-use-of-static-c++/libmd5/md5.hh index b8bc075..5c72059 100644 --- a/dynamic-use-of-static-c++/libmd5/md5.hh +++ b/dynamic-use-of-static-c++/libmd5/md5.hh @@ -39,9 +39,9 @@ documentation and/or software. */ -#include <stdio.h> -#include <fstream.h> -#include <iostream.h> +#include <cstdio> +#include <fstream> +#include <iostream> class MD5 { @@ -49,22 +49,22 @@ public: // methods for controlled operation: MD5 (); // simple initializer void update (unsigned char *input, unsigned int input_length); - void update (istream& stream); + void update (std::istream& stream); void update (FILE *file); - void update (ifstream& stream); + void update (std::ifstream& stream); void finalize (); // constructors for special circumstances. All these constructors finalize // the MD5 context. MD5 (unsigned char *string); // digest string, finalize - MD5 (istream& stream); // digest stream, finalize + MD5 (std::istream& stream); // digest stream, finalize MD5 (FILE *file); // digest file, close, finalize - MD5 (ifstream& stream); // digest stream, close, finalize + MD5 (std::ifstream& stream); // digest stream, close, finalize // methods to acquire finalized result unsigned char *raw_digest (); // digest as a 16-byte binary array char * hex_digest (); // digest as a 33-byte ascii-hex string - friend ostream& operator<< (ostream&, MD5 context); + friend std::ostream& operator<< (std::ostream&, MD5 context); -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * libmd5/results: New. * libmd5/Makefile.am (EXTRA_DIST): Add results. (check-local): New target. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4658 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 8 ++++++++ dynamic-use-of-static-c++/libmd5/Makefile.am | 5 +++++ dynamic-use-of-static-c++/libmd5/results | 8 ++++++++ 3 files changed, 21 insertions(+), 0 deletions(-) create mode 100644 dynamic-use-of-static-c++/libmd5/results diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index a9dec35..eeaff70 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,13 @@ 2009-10-20 Roland Levillain <roland@lrde.epita.fr> + Exercise libmd5. + + * libmd5/results: New. + * libmd5/Makefile.am (EXTRA_DIST): Add results. + (check-local): New target. + +2009-10-20 Roland Levillain <roland@lrde.epita.fr> + Have libmd5 compile. * libmd5/md5.hh, libmd5/driver.cc: Use modern C++ header names. diff --git a/dynamic-use-of-static-c++/libmd5/Makefile.am b/dynamic-use-of-static-c++/libmd5/Makefile.am index 300b0ba..a445800 100644 --- a/dynamic-use-of-static-c++/libmd5/Makefile.am +++ b/dynamic-use-of-static-c++/libmd5/Makefile.am @@ -31,3 +31,8 @@ md5_SOURCES = driver.cc md5_LDADD = libmd5.la EXTRA_DIST = README test-suite + +# Test. +EXTRA_DIST += results +check-local: + ./md5$(EXEEXT) -x | cmp $(srcdir)/results - diff --git a/dynamic-use-of-static-c++/libmd5/results b/dynamic-use-of-static-c++/libmd5/results new file mode 100644 index 0000000..971f4cf --- /dev/null +++ b/dynamic-use-of-static-c++/libmd5/results @@ -0,0 +1,8 @@ +MD5 test suite: +MD5 ("") = d41d8cd98f00b204e9800998ecf8427e +MD5 ("a") = 0cc175b9c0f1b6a831c399e269772661 +MD5 ("abc") = 900150983cd24fb0d6963f7d28e17f72 +MD5 ("message digest") = f96b697d7cb7938d525a2f31aaf161d0 +MD5 ("abcdefghijklmnopqrstuvwxyz") = c3fcd3d76192e4007dfb496cca67e13b +MD5 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") = d174ab98d277d9f5a5611c2c9f419d9f +MD5 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") = 57edf4a22be3c955ac49da2e2107b67a -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * libmd5/md5.cc (MD5::MD5(unsigned char *)): New. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4659 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 6 ++++++ dynamic-use-of-static-c++/libmd5/md5.cc | 10 ++++++++++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index eeaff70..3412c9b 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,3 +1,9 @@ +2009-10-22 Roland Levillain <roland@lrde.epita.fr> + + Add a missing constructor to class MD5. + + * libmd5/md5.cc (MD5::MD5(unsigned char *)): New. + 2009-10-20 Roland Levillain <roland@lrde.epita.fr> Exercise libmd5. diff --git a/dynamic-use-of-static-c++/libmd5/md5.cc b/dynamic-use-of-static-c++/libmd5/md5.cc index 6d9cab5..876e887 100644 --- a/dynamic-use-of-static-c++/libmd5/md5.cc +++ b/dynamic-use-of-static-c++/libmd5/md5.cc @@ -222,6 +222,16 @@ void MD5::finalize (){ +MD5::MD5(unsigned char *string){ + + init(); // must be called be all constructors + update(string, strlen((char*)string)); + finalize (); +} + + + + MD5::MD5(FILE *file){ init(); // must be called be all constructors -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * config/boost.m4: New (imported). * configure.ac: Invoke BOOST_FILESYSTEM and BOOST_STRING_ALGO. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4660 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 7 + dynamic-use-of-static-c++/config/boost.m4 | 815 +++++++++++++++++++++++++++++ dynamic-use-of-static-c++/configure.ac | 7 + 3 files changed, 829 insertions(+), 0 deletions(-) create mode 100644 dynamic-use-of-static-c++/config/boost.m4 diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 3412c9b..33c229f 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,12 @@ 2009-10-22 Roland Levillain <roland@lrde.epita.fr> + Add support for the Boost Filesystem and String Algorithms Libraries. + + * config/boost.m4: New (imported). + * configure.ac: Invoke BOOST_FILESYSTEM and BOOST_STRING_ALGO. + +2009-10-22 Roland Levillain <roland@lrde.epita.fr> + Add a missing constructor to class MD5. * libmd5/md5.cc (MD5::MD5(unsigned char *)): New. diff --git a/dynamic-use-of-static-c++/config/boost.m4 b/dynamic-use-of-static-c++/config/boost.m4 new file mode 100644 index 0000000..b396249 --- /dev/null +++ b/dynamic-use-of-static-c++/config/boost.m4 @@ -0,0 +1,815 @@ +# boost.m4: Locate Boost headers and libraries for autoconf-based projects. +# Copyright (C) 2007 Benoit Sigoure <tsuna@lrde.epita.fr> +# +# 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 3 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, see <http://www.gnu.org/licenses/>. + +# serial 6 +# Original sources can be found at http://repo.or.cz/w/boost.m4.git +# You can fetch the latest version of the script by doing: +# wget 'http://repo.or.cz/w/boost.m4.git?a=blob_plain;f=build-aux/boost.m4;hb=HEAD' -O boost.m4 + +# ------ # +# README # +# ------ # + +# This file provides several macros to use the various Boost libraries. +# The first macro is BOOST_REQUIRE. It will simply check if it's possible to +# find the Boost headers of a given (optional) minimum version and it will +# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to +# your configure so that users can specify non standard locations. +# For more README and documentation, go to http://repo.or.cz/w/boost.m4.git +# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry, +# simply read the README, it will show you what to do step by step. + +m4_pattern_forbid([^_?BOOST_]) + +# BOOST_REQUIRE([VERSION]) +# ------------------------ +# Look for Boost. If version is given, it must either be a literal of the form +# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a +# variable "$var". +# Defines the value BOOST_CPPFLAGS. This macro only checks for headers with +# the required version, it does not check for any of the Boost libraries. +# FIXME: Add a 2nd optional argument so that it's not fatal if Boost isn't found +# and add an AC_DEFINE to tell whether HAVE_BOOST. +AC_DEFUN([BOOST_REQUIRE], +[dnl First find out what kind of argument we have. +dnl If we have an empty argument, there is no constraint on the version of +dnl Boost to use. If it's a literal version number, we can split it in M4 (so +dnl the resulting configure script will be smaller/faster). Otherwise we do +dnl the splitting at runtime. +m4_bmatch([$1], + [^ *$], [m4_pushdef([BOOST_VERSION_REQ], [])dnl + boost_version_major=0 + boost_version_minor=0 + boost_version_subminor=0 +], + [^[0-9]+\([-._][0-9]+\)*$], + [m4_pushdef([BOOST_VERSION_REQ], [ version >= $1])dnl + boost_version_major=m4_bregexp([$1], [^\([0-9]+\)], [\1]) + boost_version_minor=m4_bregexp([$1], [^[0-9]+[-._]\([0-9]+\)], [\1]) + boost_version_subminor=m4_bregexp([$1], [^[0-9]+[-._][0-9]+[-._]\([0-9]+\)], [\1]) +], + [^\$[a-zA-Z_]+$], + [m4_pushdef([BOOST_VERSION_REQ], [])dnl + boost_version_major=`expr "X$1" : 'X\([[^-._]]*\)'` + boost_version_minor=`expr "X$1" : 'X[[0-9]]*[[-._]]\([[^-._]]*\)'` + boost_version_subminor=`expr "X$1" : 'X[[0-9]]*[[-._]][[0-9]]*[[-._]]\([[0-9]]*\)'` + case $boost_version_major:$boost_version_minor in #( + *: | :* | *[[^0-9]]*:* | *:*[[^0-9]]*) + AC_MSG_ERROR([[Invalid argument for REQUIRE_BOOST: `$1']]) + ;; + esac +], + [m4_fatal(Invalid argument: `$1')] +)dnl +AC_ARG_WITH([boost], + [AS_HELP_STRING([--with-boost=DIR], + [prefix of Boost]BOOST_VERSION_REQ[ @<:@guess@:>@])])dnl +AC_SUBST([DISTCHECK_CONFIGURE_FLAGS], + ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"]) + AC_CACHE_CHECK([for Boost headers[]BOOST_VERSION_REQ], + [boost_cv_inc_path], + [boost_cv_inc_path=no +AC_LANG_PUSH([C++])dnl + boost_subminor_chk= + test x"$boost_version_subminor" != x \ + && boost_subminor_chk="|| (B_V_MAJ == $boost_version_major \ +&& B_V_MIN == $boost_version_minor \ +&& B_V_SUB < $boost_version_subminor)" + for boost_dir in "$with_boost/include" '' \ + /opt/local/include /usr/local/include /opt/include /usr/include \ + "$with_boost" C:/Boost/include + do + # Without --layout=system, Boost (or at least some versions) installs + # itself in <prefix>/include/boost-<version>. This inner loop helps to + # find headers in such directories. + # I didn't indent this loop on purpose (to avoid over-indented code) + for boost_inc in "$boost_dir" "$boost_dir"/boost-* + do + # $boost_inc can often be a symlink, so keep -e here. + test -e "$boost_inc" || continue + # Ensure that version.hpp exists: we're going to read it. Moreover, + # Boost could be reachable thanks to the default include path so we can + # mistakenly accept a wrong include path without this check. + test -e "$boost_inc/boost/version.hpp" || continue + boost_save_CPPFLAGS=$CPPFLAGS + test x"$boost_inc" != x && CPPFLAGS="$CPPFLAGS -I$boost_inc" +m4_pattern_allow([^BOOST_VERSION$])dnl + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/version.hpp> +#ifndef BOOST_VERSION +# error BOOST_VERSION is not defined +#endif +#define B_V_MAJ (BOOST_VERSION / 100000) +#define B_V_MIN (BOOST_VERSION / 100 % 1000) +#define B_V_SUB (BOOST_VERSION % 100) +#if (B_V_MAJ < $boost_version_major) \ + || (B_V_MAJ == $boost_version_major \ + && B_V_MIN < $boost_version_minor) $boost_subminor_chk +# error Boost headers version < $1 +#endif +]])], [boost_cv_inc_path=yes], [boost_cv_version=no]) + CPPFLAGS=$boost_save_CPPFLAGS + if test x"$boost_cv_inc_path" = xyes; then + if test x"$boost_inc" != x; then + boost_cv_inc_path=$boost_inc + fi + break 2 + fi + done + done +AC_LANG_POP([C++])dnl + ]) + case $boost_cv_inc_path in #( + no) + AC_MSG_ERROR([Could not find Boost headers[]BOOST_VERSION_REQ]) + ;;#( + yes) + BOOST_CPPFLAGS= + ;;#( + *) + BOOST_CPPFLAGS="-I$boost_cv_inc_path" + ;; + esac +AC_SUBST([BOOST_CPPFLAGS])dnl + AC_CACHE_CHECK([for Boost's header version], + [boost_cv_lib_version], + [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl + boost_cv_lib_version=unknown + boost_sed_version='/^.*BOOST_LIB_VERSION.*"\([[^"]]*\)".*$/!d;s//\1/' + boost_version_hpp="$boost_inc/boost/version.hpp" + test -e "$boost_version_hpp" \ + && boost_cv_lib_version=`sed "$boost_sed_version" "$boost_version_hpp"` + ]) +m4_popdef([BOOST_VERSION_REQ])dnl +])# BOOST_REQUIRE + + +# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND]) +# -------------------------------------------------------------------------- +# Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for +# some parts of the Boost library which are only made of headers and don't +# require linking (such as Boost.Foreach). +# +# Default ACTION-IF-NOT-FOUND: Fail with a fatal error. +# +# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_<HEADER-NAME> in +# case of success # (where HEADER-NAME is written LIKE_THIS, e.g., +# HAVE_BOOST_FOREACH_HPP). +AC_DEFUN([BOOST_FIND_HEADER], +[AC_REQUIRE([BOOST_REQUIRE])dnl +AC_LANG_PUSH([C++])dnl +boost_save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +AC_CHECK_HEADER([$1], + [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1], + [Define to 1 if you have <$1>])])], + [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])]) +CPPFLAGS=$boost_save_CPPFLAGS +AC_LANG_POP([C++])dnl +])# BOOST_FIND_HEADER + + +# BOOST_FIND_LIB([LIB-NAME], [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], +# [CXX-PROLOGUE]) +# ------------------------------------------------------------------------- +# Look for the Boost library LIB-NAME (e.g., LIB-NAME = `thread', for +# libboost_thread). Check that HEADER-NAME works and check that +# libboost_LIB-NAME can link with the code CXX-TEST. The optional argument +# CXX-PROLOGUE can be used to include some C++ code before the `main' +# function. +# +# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above). +# +# Boost libraries typically come compiled with several flavors (with different +# runtime options) so PREFERRED-RT-OPT is the preferred suffix. A suffix is one +# or more of the following letters: sgdpn (in that order). s = static +# runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build, +# n = (unsure) STLPort build without iostreams from STLPort (it looks like `n' +# must always be used along with `p'). Additionally, PREFERRED-RT-OPT can +# start with `mt-' to indicate that there is a preference for multi-thread +# builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp +# ... If you want to make sure you have a specific version of Boost +# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro. +AC_DEFUN([BOOST_FIND_LIB], +[AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl +AC_REQUIRE([BOOST_REQUIRE])dnl +AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl +AC_LANG_PUSH([C++])dnl +AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl +AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl +AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl +BOOST_FIND_HEADER([$3]) +boost_save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +# Now let's try to find the library. The algorithm is as follows: first look +# for a given library name according to the user's PREFERRED-RT-OPT. For each +# library name, we prefer to use the ones that carry the tag (toolset name). +# Each library is searched through the various standard paths were Boost is +# usually installed. If we can't find the standard variants, we try to +# enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist +# but there's -obviously- libboost_threads-mt.dylib). +AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib], + [Boost_lib=no + case "$2" in #( + mt | mt-) boost_mt=-mt; boost_rtopt=;; #( + mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$2" : 'Xmt-*\(.*\)'`;; #( + *) boost_mt=; boost_rtopt=$2;; + esac + # If the PREFERRED-RT-OPT are not empty, prepend a `-'. + case $boost_rtopt in #( + *[[a-z0-9A-Z]]*) boost_rtopt="-$boost_rtopt";; + esac + $boost_guess_use_mt && boost_mt=-mt + # Look for the abs path the static archive. + # $libext is computed by Libtool but let's make sure it's non empty. + test -z "$libext" && + AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?]) + boost_save_ac_objext=$ac_objext + # Generate the test file. + AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$3> +$5], [$4])]) +dnl Optimization hacks: compiling C++ is slow, especially with Boost. What +dnl we're trying to do here is guess the right combination of link flags +dnl (LIBS / LDFLAGS) to use a given library. This can take several +dnl iterations before it succeeds and is thus *very* slow. So what we do +dnl instead is that we compile the code first (and thus get an object file, +dnl typically conftest.o). Then we try various combinations of link flags +dnl until we succeed to link conftest.o in an executable. The problem is +dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always +dnl remove all the temporary files including conftest.o. So the trick here +dnl is to temporarily change the value of ac_objext so that conftest.o is +dnl preserved accross tests. This is obviously fragile and I will burn in +dnl hell for not respecting Autoconf's documented interfaces, but in the +dnl mean time, it optimizes the macro by a factor of 5 to 30. +dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left +dnl empty because the test file is generated only once above (before we +dnl start the for loops). + AC_COMPILE_IFELSE([], + [ac_objext=do_not_rm_me_plz], + [AC_MSG_ERROR([Cannot compile a test that uses Boost $1])]) + ac_objext=$boost_save_ac_objext + boost_failed_libs= +# Don't bother to ident the 6 nested for loops, only the 2 innermost ones +# matter. +for boost_tag_ in -$boost_cv_lib_tag ''; do +for boost_ver_ in -$boost_cv_lib_version ''; do +for boost_mt_ in $boost_mt -mt ''; do +for boost_rtopt_ in $boost_rtopt '' -d; do + for boost_lib in \ + boost_$1$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ + boost_$1$boost_tag_$boost_mt_$boost_ver_ \ + boost_$1$boost_tag_$boost_rtopt_$boost_ver_ \ + boost_$1$boost_tag_$boost_mt_ \ + boost_$1$boost_tag_$boost_ver_ + do + # Avoid testing twice the same lib + case $boost_failed_libs in #( + *@$boost_lib@*) continue;; + esac + # If with_boost is empty, we'll search in /lib first, which is not quite + # right so instead we'll try to a location based on where the headers are. + boost_tmp_lib=$with_boost + test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} + for boost_ldpath in "$boost_tmp_lib/lib" '' \ + /opt/local/lib /usr/local/lib /opt/lib /usr/lib \ + "$with_boost" C:/Boost/lib /lib /usr/lib64 /lib64 + do + test -e "$boost_ldpath" || continue + boost_save_LDFLAGS=$LDFLAGS + # Are we looking for a static library? + case $boost_ldpath:$boost_rtopt_ in #( + *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) + Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext" + test -e "$Boost_lib_LIBS" || continue;; #( + *) # No: use -lboost_foo to find the shared library. + Boost_lib_LIBS="-l$boost_lib";; + esac + boost_save_LIBS=$LIBS + LIBS="$Boost_lib_LIBS $LIBS" + test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath" +dnl First argument of AC_LINK_IFELSE left empty because the test file is +dnl generated only once above (before we start the for loops). + _BOOST_AC_LINK_IFELSE([], + [Boost_lib=yes], [Boost_lib=no]) + ac_objext=$boost_save_ac_objext + LDFLAGS=$boost_save_LDFLAGS + LIBS=$boost_save_LIBS + if test x"$Boost_lib" = xyes; then + Boost_lib_LDFLAGS="-L$boost_ldpath -R$boost_ldpath" + break 6 + else + boost_failed_libs="$boost_failed_libs@$boost_lib@" + fi + done + done +done +done +done +done +rm -f conftest.$ac_objext +]) +case $Boost_lib in #( + no) AC_MSG_ERROR([Could not find the flags to link with Boost $1]) + ;; +esac +AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS]) +AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS]) +CPPFLAGS=$boost_save_CPPFLAGS +AS_VAR_POPDEF([Boost_lib])dnl +AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl +AS_VAR_POPDEF([Boost_lib_LIBS])dnl +AC_LANG_POP([C++])dnl +])# BOOST_FIND_LIB + + +# --------------------------------------- # +# Checks for the various Boost libraries. # +# --------------------------------------- # + +# List of boost libraries: http://www.boost.org/libs/libraries.htm +# The page http://beta.boost.org/doc/libs is useful: it gives the first release +# version of each library (among other things). + + +# BOOST_BIND() +# ------------ +# Look for Boost.Bind +AC_DEFUN([BOOST_BIND], +[BOOST_FIND_HEADER([boost/bind.hpp])]) + + +# BOOST_CONVERSION() +# ------------------ +# Look for Boost.Conversion (cast / lexical_cast) +AC_DEFUN([BOOST_CONVERSION], +[BOOST_FIND_HEADER([boost/cast.hpp]) +BOOST_FIND_HEADER([boost/lexical_cast.hpp]) +])# BOOST_CONVERSION + + +# BOOST_DATE_TIME([PREFERRED-RT-OPT]) +# ----------------------------------- +# Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_DATE_TIME], +[BOOST_FIND_LIB([date_time], [$1], + [boost/date_time/posix_time/posix_time.hpp], + [boost::posix_time::ptime t;]) +])# BOOST_DATE_TIME + + +# BOOST_FILESYSTEM([PREFERRED-RT-OPT]) +# ------------------------------------ +# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +# Do not check for boost/filesystem.hpp because this file was introduced in 1.34. +AC_DEFUN([BOOST_FILESYSTEM], +[BOOST_FIND_LIB([filesystem], [$1], + [boost/filesystem/path.hpp], [boost::filesystem::path p;]) +])# BOOST_FILESYSTEM + + +# BOOST_FOREACH() +# --------------- +# Look for Boost.Foreach +AC_DEFUN([BOOST_FOREACH], +[BOOST_FIND_HEADER([boost/foreach.hpp])]) + + +# BOOST_FORMAT() +# -------------- +# Look for Boost.Format +# Note: we can't check for boost/format/format_fwd.hpp because the header isn't +# standalone. It can't be compiled because it triggers the following error: +# boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std' +# does not name a type +AC_DEFUN([BOOST_FORMAT], +[BOOST_FIND_HEADER([boost/format.hpp])]) + + +# BOOST_FUNCTION() +# ---------------- +# Look for Boost.Function +AC_DEFUN([BOOST_FUNCTION], +[BOOST_FIND_HEADER([boost/function.hpp])]) + + +# BOOST_GRAPH([PREFERRED-RT-OPT]) +# ------------------------------- +# Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_GRAPH], +[BOOST_FIND_LIB([graph], [$1], + [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;]) +])# BOOST_GRAPH + + +# BOOST_IOSTREAMS([PREFERRED-RT-OPT]) +# ------------------------------- +# Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_IOSTREAMS], +[BOOST_FIND_LIB([iostreams], [$1], + [boost/iostreams/device/file_descriptor.hpp], + [boost::iostreams::file_descriptor fd(0); fd.close();]) +])# BOOST_IOSTREAMS + + +# BOOST_HASH() +# ------------ +# Look for Boost.Functional/Hash +AC_DEFUN([BOOST_HASH], +[BOOST_FIND_HEADER([boost/functional/hash.hpp])]) + + +# BOOST_LAMBDA() +# -------------- +# Look for Boost.Lambda +AC_DEFUN([BOOST_LAMBDA], +[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])]) + + +# BOOST_PREPROCESSOR() +# -------------------- +# Look for Boost.Preprocessor +AC_DEFUN([BOOST_PREPROCESSOR], +[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])]) + + +# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT]) +# ----------------------------------------- +# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT, see +# the documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_PROGRAM_OPTIONS], +[BOOST_FIND_LIB([program_options], [$1], + [boost/program_options.hpp], + [boost::program_options::options_description d("test");]) +])# BOOST_PROGRAM_OPTIONS + + +# BOOST_REF() +# ----------- +# Look for Boost.Ref +AC_DEFUN([BOOST_REF], +[BOOST_FIND_HEADER([boost/ref.hpp])]) + + +# BOOST_REGEX([PREFERRED-RT-OPT]) +# ------------------------------- +# Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_REGEX], +[BOOST_FIND_LIB([regex], [$1], + [boost/regex.hpp], + [boost::regex exp("*"); boost::regex_match("foo", exp);]) +])# BOOST_REGEX + + +# BOOST_SERIALIZATION([PREFERRED-RT-OPT]) +# --------------------------------------- +# Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see +# the documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_SERIALIZATION], +[BOOST_FIND_LIB([serialization], [$1], + [boost/archive/text_oarchive.hpp], + [std::ostream* o = 0; // Cheap way to get an ostream... + boost::archive::text_oarchive t(*o);]) +])# BOOST_SIGNALS + + +# BOOST_SIGNALS([PREFERRED-RT-OPT]) +# --------------------------------- +# Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_SIGNALS], +[BOOST_FIND_LIB([signals], [$1], + [boost/signal.hpp], + [boost::signal<void ()> s;]) +])# BOOST_SIGNALS + + +# BOOST_SMART_PTR() +# ----------------- +# Look for Boost.SmartPtr +AC_DEFUN([BOOST_SMART_PTR], +[BOOST_FIND_HEADER([boost/scoped_ptr.hpp]) +BOOST_FIND_HEADER([boost/shared_ptr.hpp]) +]) + + +# BOOST_STRING_ALGO() +# ------------------- +# Look for Boost.StringAlgo +AC_DEFUN([BOOST_STRING_ALGO], +[BOOST_FIND_HEADER([boost/algorithm/string.hpp]) +]) + + +# BOOST_TEST([PREFERRED-RT-OPT]) +# ------------------------------ +# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_TEST], +[m4_pattern_allow([^BOOST_CHECK$])dnl +BOOST_FIND_LIB([unit_test_framework], [$1], + [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);], + [using boost::unit_test::test_suite; + test_suite* init_unit_test_suite(int argc, char ** argv) + { return NULL; }]) +])# BOOST_TEST + + +# BOOST_THREADS([PREFERRED-RT-OPT]) +# --------------------------------- +# Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +# FIXME: Provide an alias "BOOST_THREAD". +AC_DEFUN([BOOST_THREADS], +[dnl Having the pthread flag is required at least on GCC3 where +dnl boost/thread.hpp would complain if we try to compile without +dnl -pthread on GNU/Linux. +AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl +boost_threads_save_LIBS=$LIBS +boost_threads_save_CPPFLAGS=$CPPFLAGS +LIBS="$LIBS $boost_cv_pthread_flag" +# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3, +# boost/thread.hpp will trigger a #error if -pthread isn't used: +# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support +# is not turned on. Please set the correct command line options for +# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)" +CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag" +BOOST_FIND_LIB([thread], [$1], + [boost/thread.hpp], [boost::thread t; boost::mutex m;]) +BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $boost_cv_pthread_flag" +BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag" +LIBS=$boost_threads_save_LIBS +CPPFLAGS=$boost_threads_save_CPPFLAGS +])# BOOST_THREADS + + +# BOOST_TOKENIZER() +# ----------------- +# Look for Boost.Tokenizer +AC_DEFUN([BOOST_TOKENIZER], +[BOOST_FIND_HEADER([boost/tokenizer.hpp])]) + + +# BOOST_TRIBOOL() +# --------------- +# Look for Boost.Tribool +AC_DEFUN([BOOST_TRIBOOL], +[BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp]) +BOOST_FIND_HEADER([boost/logic/tribool.hpp]) +]) + + +# BOOST_TUPLE() +# ------------- +# Look for Boost.Tuple +AC_DEFUN([BOOST_TUPLE], +[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])]) + + +# BOOST_UTILITY() +# --------------- +# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom, +# etc.) +AC_DEFUN([BOOST_UTILITY], +[BOOST_FIND_HEADER([boost/utility.hpp])]) + + +# BOOST_VARIANT() +# --------------- +# Look for Boost.Variant. +AC_DEFUN([BOOST_VARIANT], +[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp]) +BOOST_FIND_HEADER([boost/variant.hpp])]) + + +# BOOST_WAVE([PREFERRED-RT-OPT]) +# ------------------------------ +# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +AC_DEFUN([BOOST_WAVE], +[BOOST_FIND_LIB([wave], [$1], + [boost/wave.hpp], + [boost::wave::token_id id; get_token_name(id);])]) + + +# ----------------- # +# Internal helpers. # +# ----------------- # + + +# _BOOST_PTHREAD_FLAG() +# --------------------- +# Internal helper for BOOST_THREADS. Based on ACX_PTHREAD: +# http://autoconf-archive.cryp.to/acx_pthread.html +AC_DEFUN([_BOOST_PTHREAD_FLAG], +[AC_REQUIRE([AC_PROG_CXX])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_LANG_PUSH([C++])dnl +AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag], +[ boost_cv_pthread_flag= + # The ordering *is* (sometimes) important. Some notes on the + # individual items follow: + # (none): in case threads are in libc; should be tried before -Kthread and + # other compiler flags to prevent continual compiler warnings + # -lpthreads: AIX (must check this before -lpthread) + # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) + # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) + # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads) + # -pthreads: Solaris/GCC + # -mthreads: MinGW32/GCC, Lynx/GCC + # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it + # doesn't hurt to check since this sometimes defines pthreads too; + # also defines -D_REENTRANT) + # ... -mt is also the pthreads flag for HP/aCC + # -lpthread: GNU Linux, etc. + # --thread-safe: KAI C++ + case $host_os in #( + *solaris*) + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #( + *) + boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \ + -pthreads -mthreads -lpthread --thread-safe -mt";; + esac + # Generate the test file. + AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <pthread.h>], + [pthread_t th; pthread_join(th, 0); + pthread_attr_init(0); pthread_cleanup_push(0, 0); + pthread_create(0,0,0,0); pthread_cleanup_pop(0);])]) + for boost_pthread_flag in '' $boost_pthread_flags; do + boost_pthread_ok=false +dnl Re-use the test file already generated. + boost_pthreads__save_LIBS=$LIBS + LIBS="$LIBS $boost_pthread_flag" + AC_LINK_IFELSE([], + [if grep ".*$boost_pthread_flag" conftest.err; then + echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD + else + boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag + fi]) + LIBS=$boost_pthreads__save_LIBS + $boost_pthread_ok && break + done +]) +AC_LANG_POP([C++])dnl +])# _BOOST_PTHREAD_FLAG + + +# _BOOST_gcc_test(MAJOR, MINOR) +# ----------------------------- +# Internal helper for _BOOST_FIND_COMPILER_TAG. +m4_define([_BOOST_gcc_test], +["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl + + +# _BOOST_FIND_COMPILER_TAG() +# -------------------------- +# Internal. When Boost is installed without --layout=system, each library +# filename will hold a suffix that encodes the compiler used during the +# build. The Boost build system seems to call this a `tag'. +AC_DEFUN([_BOOST_FIND_COMPILER_TAG], +[AC_REQUIRE([AC_PROG_CXX])dnl +AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag], +[AC_LANG_PUSH([C++])dnl + boost_cv_lib_tag=unknown + # The following tests are mostly inspired by boost/config/auto_link.hpp + # The list is sorted to most recent/common to oldest compiler (in order + # to increase the likelihood of finding the right compiler with the + # least number of compilation attempt). + # Beware that some tests are sensible to the order (for instance, we must + # look for MinGW before looking for GCC3). + # I used one compilation test per compiler with a #error to recognize + # each compiler so that it works even when cross-compiling (let me know + # if you know a better approach). + # Known missing tags (known from Boost's tools/build/v2/tools/common.jam): + # como, edg, kcc, bck, mp, sw, tru, xlc + # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines + # the same defines as GCC's). + # TODO: Move the test on GCC 4.3 up once it's released. + for i in \ + _BOOST_gcc_test(4, 2) \ + _BOOST_gcc_test(4, 1) \ + _BOOST_gcc_test(4, 0) \ + "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \ + && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ + || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \ + _BOOST_gcc_test(3, 4) \ + _BOOST_gcc_test(3, 3) \ + "defined _MSC_VER && _MSC_VER >= 1400 @ vc80" \ + _BOOST_gcc_test(3, 2) \ + "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \ + _BOOST_gcc_test(3, 1) \ + _BOOST_gcc_test(3, 0) \ + "defined __BORLANDC__ @ bcb" \ + "defined __ICC && (defined __unix || defined __unix__) @ il" \ + "defined __ICL @ iw" \ + "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \ + _BOOST_gcc_test(4, 3) \ + _BOOST_gcc_test(2, 95) \ + "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \ + "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \ + "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \ + "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8" + do + boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '` + boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'` + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#if $boost_tag_test +/* OK */ +#else +# error $boost_tag_test +#endif +]])], [boost_cv_lib_tag=$boost_tag; break], []) + done +AC_LANG_POP([C++])dnl +]) + case $boost_cv_lib_tag in #( + # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed + # to "gcc41" for instance. + gcc*) + # We can specify multiple tags in this variable because it's used by + # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ... + boost_cv_lib_tag="$boost_cv_lib_tag -gcc" + ;; #( + unknown) + AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]]) + boost_cv_lib_tag= + ;; + esac +])# _BOOST_FIND_COMPILER_TAG + + +# _BOOST_GUESS_WHETHER_TO_USE_MT() +# -------------------------------- +# Compile a small test to try to guess whether we should favor MT (Multi +# Thread) flavors of Boost. Sets boost_guess_use_mt accordingly. +AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT], +[# Check whether we do better use `mt' even though we weren't ask to. +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#if defined _REENTRANT || defined _MT || defined __MT__ +/* use -mt */ +#else +# error MT not needed +#endif +]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false]) +]) + +# _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# ------------------------------------------------------------------- +# Fork of _AC_LINK_IFELSE that preserves conftest.o across calls. Fragile, +# will break when Autoconf changes its internals. Requires that you manually +# rm -f conftest.$ac_objext in between to really different tests, otherwise +# you will try to link a conftest.o left behind by a previous test. +# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this +# macro) +m4_define([_BOOST_AC_LINK_IFELSE], +[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl +rm -f conftest$ac_exeext +boost_ac_ext_save=$ac_ext +boost_use_source=: +# If we already have a .o, re-use it. We change $ac_ext so that $ac_link +# tries to link the existing object file instead of compiling from source. +test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && + _AS_ECHO_LOG([re-using the existing conftest.$ac_objext]) +AS_IF([_AC_DO_STDERR($ac_link) && { + test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_executable_p conftest$ac_exeext +dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough. + }], + [$2], + [if $boost_use_source; then + _AC_MSG_LOG_CONFTEST + fi + $3]) +dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization) +dnl information created by the PGI compiler (conftest_ipa8_conftest.oo), +dnl as it would interfere with the next link command. +rm -f core conftest.err conftest_ipa8_conftest.oo \ + conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl +])# _BOOST_AC_LINK_IFELSE diff --git a/dynamic-use-of-static-c++/configure.ac b/dynamic-use-of-static-c++/configure.ac index facd01c..9eea7df 100644 --- a/dynamic-use-of-static-c++/configure.ac +++ b/dynamic-use-of-static-c++/configure.ac @@ -73,6 +73,13 @@ AC_PROG_LIBTOOL AC_SUBST(INCLTDL) AC_SUBST(LIBLTDL) +## ------ ## +## Boost. ## +## ------ ## + +BOOST_FILESYSTEM +BOOST_STRING_ALGO + dnl ## ------ ## dnl ## Swig. ## dnl ## ------ ## -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * src/Makefile.am (libdyn_la_LIBADD): Add $(BOOST_FILESYSTEM_LIBS). (libdyn_la_CPPFLAGS): Add $(BOOST_CPPFLAGS). (libdyn_la_LDFLAGS): Add $(BOOST_FILESYSTEM_LDFLAGS). git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4661 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 8 ++++++++ dynamic-use-of-static-c++/src/Makefile.am | 10 ++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 33c229f..b17fe73 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,13 @@ 2009-10-22 Roland Levillain <roland@lrde.epita.fr> + Have libdyn depend on Boost Filesystem and Boost String Algorithms. + + * src/Makefile.am (libdyn_la_LIBADD): Add $(BOOST_FILESYSTEM_LIBS). + (libdyn_la_CPPFLAGS): Add $(BOOST_CPPFLAGS). + (libdyn_la_LDFLAGS): Add $(BOOST_FILESYSTEM_LDFLAGS). + +2009-10-22 Roland Levillain <roland@lrde.epita.fr> + Add support for the Boost Filesystem and String Algorithms Libraries. * config/boost.m4: New (imported). diff --git a/dynamic-use-of-static-c++/src/Makefile.am b/dynamic-use-of-static-c++/src/Makefile.am index 7d62edf..c6f975c 100644 --- a/dynamic-use-of-static-c++/src/Makefile.am +++ b/dynamic-use-of-static-c++/src/Makefile.am @@ -45,13 +45,15 @@ libdyn_la_SOURCES = \ ruby_stream.hh ruby_stream.cc \ ansidecl.h demangle.h config.hh -libdyn_la_LIBADD = @LIBERTYARG@ @RUBY_LIBRUBYARG_SHARED@ $(LIBLTDL) +libdyn_la_LIBADD = @LIBERTYARG@ @RUBY_LIBRUBYARG_SHARED@ $(LIBLTDL) \ + $(BOOST_FILESYSTEM_LIBS) libdyn_la_DEPENDENCIES = $(LTDLDEPS) -libdyn_la_CPPFLAGS = \ - $(LTDLINCL) -I$(top_builddir) -I$(srcdir) -I. -I@RUBY_topdir@ +libdyn_la_CPPFLAGS = \ + $(LTDLINCL) $(BOOST_CPPFLAGS) \ + -I$(top_builddir) -I$(srcdir) -I. -I@RUBY_topdir@ libdyn_la_CXXFLAGS = $(WARNING_CXXFLAGS) -libdyn_la_LDFLAGS = -version-info 0:1:0 +libdyn_la_LDFLAGS = -version-info 0:1:0 $(BOOST_FILESYSTEM_LDFLAGS) ############# -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * src/function_loader.cc (dyn::function_loader_t::cxx_compile): New method. * src/config.hh.in (DYN_DATADIR): New macro. * configure.ac (my_abs_builddir): New variable. (DYN_DATADIR): New (substituted) variable. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4662 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 10 +++ dynamic-use-of-static-c++/configure.ac | 4 + dynamic-use-of-static-c++/src/config.hh.in | 1 + dynamic-use-of-static-c++/src/function_loader.cc | 81 ++++++++++++++++++++++ 4 files changed, 96 insertions(+), 0 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index b17fe73..c5493fb 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,15 @@ 2009-10-22 Roland Levillain <roland@lrde.epita.fr> + Provide a C++ implementation of the compile-at-runtime routine. + + * src/function_loader.cc (dyn::function_loader_t::cxx_compile): + New method. + * src/config.hh.in (DYN_DATADIR): New macro. + * configure.ac (my_abs_builddir): New variable. + (DYN_DATADIR): New (substituted) variable. + +2009-10-22 Roland Levillain <roland@lrde.epita.fr> + Have libdyn depend on Boost Filesystem and Boost String Algorithms. * src/Makefile.am (libdyn_la_LIBADD): Add $(BOOST_FILESYSTEM_LIBS). diff --git a/dynamic-use-of-static-c++/configure.ac b/dynamic-use-of-static-c++/configure.ac index 9eea7df..fbaa31c 100644 --- a/dynamic-use-of-static-c++/configure.ac +++ b/dynamic-use-of-static-c++/configure.ac @@ -111,10 +111,14 @@ dnl AC_MSG_RESULT([$has_swig]) # FIXME: Doesn't Autoconf provide something like abs_top_srcdir? my_abs_srcdir=`cd $srcdir && pwd` +# FIXME: Likewise. +my_abs_builddir=`pwd` # FIXME: Remove me when function_loader will be pure C++ AC_SUBST([DYNDIR], [$my_abs_srcdir/src]) +AC_SUBST([DYN_DATADIR], [$my_abs_builddir/data]) + AC_SUBST([DYN_FIXTURES], [$my_abs_srcdir/test/fixtures]) # Absolute path to Milena. diff --git a/dynamic-use-of-static-c++/src/config.hh.in b/dynamic-use-of-static-c++/src/config.hh.in index 7dbbbb0..1327cf4 100644 --- a/dynamic-use-of-static-c++/src/config.hh.in +++ b/dynamic-use-of-static-c++/src/config.hh.in @@ -1,3 +1,4 @@ #define DYNDIR "@DYNDIR@" +#define DYN_DATADIR "@DYN_DATADIR@" #define DYN_FIXTURES "@DYN_FIXTURES@" #define MILENA_DIR "@MILENA_DIR@" diff --git a/dynamic-use-of-static-c++/src/function_loader.cc b/dynamic-use-of-static-c++/src/function_loader.cc index 57b20d1..863452c 100644 --- a/dynamic-use-of-static-c++/src/function_loader.cc +++ b/dynamic-use-of-static-c++/src/function_loader.cc @@ -1,16 +1,24 @@ #ifndef DYN_FUNCTION_LOADER_CC # define DYN_FUNCTION_LOADER_CC +# include <cstdlib> # include <ltdl.h> # include <map> // FIXME: Use and improve the logger to avoid use of std::cerr. # include <iostream> +# include <boost/filesystem.hpp> +# include <boost/filesystem/fstream.hpp> +# include <boost/algorithm/string/replace.hpp> + # include "data.hh" # include "function_loader.hh" # include "ruby_stream.hh" +namespace bfs = boost::filesystem; +namespace ba = boost::algorithm; + template <typename InputIterator, typename T, typename OStream> OStream& join(const InputIterator& begin, const InputIterator& end, const T& elt, OStream& ostr) @@ -256,6 +264,79 @@ namespace dyn { ldflags_.push_back(elt); } + // A C++ implementation of function_loader.rb's `compile'. + void + cxx_compile(const std::string& cxx, const std::string& identifier, + const std::string& cflags, const std::string& ldflags) + { + bfs::path dyn_datadir(DYN_DATADIR); + + bfs::path repository("repository"); + if (!bfs::exists(repository)) + { + bfs::create_directory(repository); + bfs::create_symlink(dyn_datadir / "Makefile.repository", + repository / "Makefile"); + } + + bfs::path dir = repository / identifier; + if (!bfs::exists(dir)) + { + bfs::create_directory(dir); + + bfs::ifstream makefile_orig_str(dyn_datadir / "Makefile.template"); + std::stringstream makefile_orig; + makefile_orig << makefile_orig_str.rdbuf(); + bfs::ofstream makefile(dir / "Makefile"); + /* FIXME: We might want to use boost::format in several + places here, since + + (boost::format("libdyn_%1%.la") % identifier).str() + + may be more elegant than + + std::string("libdyn_") + identifier + ".la") + */ + /* FIXME: It would be more elegant if we could replace + `libdyn_function.la' on the fly while copying the + Makefile (as we would do with Perl). See what Boost + proposes. */ + makefile << + ba::replace_all_copy(makefile_orig.str(), + "libdyn_function.la", + std::string("libdyn_") + identifier + ".la"); + makefile << "CXXFLAGS += " << cflags << std::endl; + makefile << "LDFLAGS += " << ldflags << std::endl; + + bfs::create_directory(dir / ".deps"); + bfs::ofstream(dir / ".deps" / "libdyn_function_la-function.Plo"); + + bfs::path file = dir / "function.cc"; + bfs::ofstream function(file); + function << cxx; + } + + bfs::path out = dir / "make.out"; + // FIXME: Same remark wrt boost::format. + std::string cmd = + std::string("cd ") + dir.string() + " && make >make.out 2>&1"; + if (system(cmd.c_str()) == 0) + { + if (bfs::exists(out)) + bfs::remove(out); + } + else + { + bfs::ifstream out_log(out); + std::cerr << "JIT: Error when compiling this code" << std::endl + << cxx << std::endl + << cmd << std::endl + << out_log.rdbuf() << std::endl; + // FIXME: Isn't this a bit too violent? + std::exit(1); + } + } + void* load(fun_kind kind, const std::string& name, -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * src/Makefile.am (libdyn_la_LIBADD): Add $(top_builddir)/libmd5/libmd5.la. (libdyn_la_CPPFLAGS): Add -I$(top_srcdir)/libmd5. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4663 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 8 ++++++++ dynamic-use-of-static-c++/src/Makefile.am | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index c5493fb..cd807af 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,13 @@ 2009-10-22 Roland Levillain <roland@lrde.epita.fr> + Have libdyn depend on libmd5. + + * src/Makefile.am (libdyn_la_LIBADD): Add + $(top_builddir)/libmd5/libmd5.la. + (libdyn_la_CPPFLAGS): Add -I$(top_srcdir)/libmd5. + +2009-10-22 Roland Levillain <roland@lrde.epita.fr> + Provide a C++ implementation of the compile-at-runtime routine. * src/function_loader.cc (dyn::function_loader_t::cxx_compile): diff --git a/dynamic-use-of-static-c++/src/Makefile.am b/dynamic-use-of-static-c++/src/Makefile.am index c6f975c..00504b7 100644 --- a/dynamic-use-of-static-c++/src/Makefile.am +++ b/dynamic-use-of-static-c++/src/Makefile.am @@ -46,12 +46,12 @@ libdyn_la_SOURCES = \ ansidecl.h demangle.h config.hh libdyn_la_LIBADD = @LIBERTYARG@ @RUBY_LIBRUBYARG_SHARED@ $(LIBLTDL) \ - $(BOOST_FILESYSTEM_LIBS) + $(top_builddir)/libmd5/libmd5.la $(BOOST_FILESYSTEM_LIBS) libdyn_la_DEPENDENCIES = $(LTDLDEPS) libdyn_la_CPPFLAGS = \ $(LTDLINCL) $(BOOST_CPPFLAGS) \ - -I$(top_builddir) -I$(srcdir) -I. -I@RUBY_topdir@ + -I$(top_builddir) -I$(srcdir) -I. -I$(top_srcdir)/libmd5 -I@RUBY_topdir@ libdyn_la_CXXFLAGS = $(WARNING_CXXFLAGS) libdyn_la_LDFLAGS = -version-info 0:1:0 $(BOOST_FILESYSTEM_LDFLAGS) -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * src/function_loader.cc (dyn::function_loader_t::cxx_load): New method. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4664 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 7 ++ dynamic-use-of-static-c++/src/function_loader.cc | 90 ++++++++++++++++++++++ 2 files changed, 97 insertions(+), 0 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index cd807af..89224a7 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,12 @@ 2009-10-22 Roland Levillain <roland@lrde.epita.fr> + Provide a C++ implementation of the dynamic function loader. + + * src/function_loader.cc (dyn::function_loader_t::cxx_load): + New method. + +2009-10-22 Roland Levillain <roland@lrde.epita.fr> + Have libdyn depend on libmd5. * src/Makefile.am (libdyn_la_LIBADD): Add diff --git a/dynamic-use-of-static-c++/src/function_loader.cc b/dynamic-use-of-static-c++/src/function_loader.cc index 863452c..113213a 100644 --- a/dynamic-use-of-static-c++/src/function_loader.cc +++ b/dynamic-use-of-static-c++/src/function_loader.cc @@ -12,6 +12,8 @@ # include <boost/filesystem/fstream.hpp> # include <boost/algorithm/string/replace.hpp> +# include "md5.hh" + # include "data.hh" # include "function_loader.hh" # include "ruby_stream.hh" @@ -403,6 +405,94 @@ namespace dyn { return ptr; } + // FIXME: This C++ version of load shares a lot with the latter. + void* + cxx_load(fun_kind kind, + const std::string& name, + const arguments_types_t& arguments_types, + const std::string& paths) + { + std::ostringstream ostr; + ostr << name << '('; + arguments_types_t::const_iterator it(arguments_types.begin()); + if (it != arguments_types.end()) + { + ostr << *it; + for (++it; it != arguments_types.end(); ++it) + ostr << ", " << *it; + } + ostr << ')'; + if (paths != "") + { + ostr << ", paths: "; + gen_path<std::ostream> fun(ostr); + foreach_path_in_paths(paths, fun); + } + std::string prototype = ostr.str(); + + // FIXME: Careful, this cast removes a const! We should improve + // the interface of libmd5. + std::string identifier(MD5((unsigned char*)prototype.c_str()).hex_digest()); + + cache_type::iterator ptr_it = cache.find(identifier.c_str()); + + // FIXME: It seems the cache doesn't work at all (we almost + // never hit). See why this is happening. + if (ptr_it != cache.end()) + { + // FIXME: Colors should be used only when the terminal supports them. +#if 0 + std::cerr << "\e[36mJIT: \e[32mHIT: \e[0m " << prototype << std::endl; +#endif + std::cerr << "JIT: HIT: " << prototype << std::endl; + return ptr_it->second; + } + + // FIXME: Colors should be used only when the terminal supports them. +#if 0 + std::cerr << "\e[36mJIT: \e[31mMISS: compile: \e[0m " << prototype << std::endl; +#endif + std::cerr << "JIT: MISS: compile: " << prototype << std::endl; + + std::ostringstream cxx; + gen_cxx(identifier, name, arguments_types, kind, paths, cxx); + // FIXME: Rename cflags_ as cxxflags_. + /* FIXME: The interface of join is not elegant. I'd prefer to write + + std::stringstream cflags_stream; + cflags_stream << join(cflags_.begin(), cflags_.end(), ' '); + + or even + + std::string cflags_string = + join(cflags_.begin(), cflags_.end(), ' '); + + But doesn't Boost propose this? E.g. : + + std::string cflags = ba::string::join(cflags_, ' '); + + ? */ + std::stringstream cflags_stream; + join(cflags_.begin(), cflags_.end(), ' ', cflags_stream); + std::stringstream ldflags_stream; + join(ldflags_.begin(), ldflags_.end(), ' ', ldflags_stream); + + cxx_compile(cxx.str(), identifier, + cflags_stream.str(), ldflags_stream.str()); + + const char* error; + std::string lib_path = std::string("repository/") + identifier + + "/libdyn_" + identifier + ".la"; + std::string symb = std::string("dyn_") + identifier; + + lt_dlhandle lib = lt_dlopen(lib_path.c_str()); + if ((error = lt_dlerror())) std::cerr << error << std::endl; + void* ptr = lt_dlsym(lib, symb.c_str()); + cache[identifier.c_str()] = ptr; + if ((error = lt_dlerror())) std::cerr << error << std::endl; + return ptr; + } + protected: typedef std::map<const char*, void*, ltstr> cache_type; cache_type cache; -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * src/function_loader.cc (HAVE_DYN_RUBY_GENERATOR): New macro, depending on DYN_RUBY_GENERATOR. (dyn::function_loader_t::function_loader_t): Feed the Ruby stream only if HAVE_DYN_RUBY_GENERATOR is true. (dyn::function_loader_t::load): Rename method as... (dyn::function_loader_t::ruby_load): ...this. (dyn::load_function) [HAVE_DYN_RUBY_GENERATOR]: Delegate the call to function_loader.ruby_load. (dyn::load_function) [!HAVE_DYN_RUBY_GENERATOR]: Delegate the call to function_loader.cxx_load. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4665 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 15 +++++++++ dynamic-use-of-static-c++/src/function_loader.cc | 37 ++++++++++++++++------ 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 89224a7..24cf3d1 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,20 @@ 2009-10-22 Roland Levillain <roland@lrde.epita.fr> + Have the dynamic function loader use the C++ framework by default. + + * src/function_loader.cc (HAVE_DYN_RUBY_GENERATOR): New macro, + depending on DYN_RUBY_GENERATOR. + (dyn::function_loader_t::function_loader_t): Feed the Ruby stream + only if HAVE_DYN_RUBY_GENERATOR is true. + (dyn::function_loader_t::load): Rename method as... + (dyn::function_loader_t::ruby_load): ...this. + (dyn::load_function) [HAVE_DYN_RUBY_GENERATOR]: Delegate the call + to function_loader.ruby_load. + (dyn::load_function) [!HAVE_DYN_RUBY_GENERATOR]: Delegate the call + to function_loader.cxx_load. + +2009-10-22 Roland Levillain <roland@lrde.epita.fr> + Provide a C++ implementation of the dynamic function loader. * src/function_loader.cc (dyn::function_loader_t::cxx_load): diff --git a/dynamic-use-of-static-c++/src/function_loader.cc b/dynamic-use-of-static-c++/src/function_loader.cc index 113213a..cc25268 100644 --- a/dynamic-use-of-static-c++/src/function_loader.cc +++ b/dynamic-use-of-static-c++/src/function_loader.cc @@ -18,6 +18,14 @@ # include "function_loader.hh" # include "ruby_stream.hh" +// For more details about this, see +// http://www.gnu.org/prep/standards/html_node/Conditional-Compilation.html +# ifdef DYN_RUBY_GENERATOR +# define HAVE_DYN_RUBY_GENERATOR true +# else +# define HAVE_DYN_RUBY_GENERATOR false +# endif + namespace bfs = boost::filesystem; namespace ba = boost::algorithm; @@ -116,10 +124,13 @@ namespace dyn { function_loader_t() { lt_dlinit(); - ruby << "$: << \"" << DYNDIR << "\"" << ruby::eval; - ruby << "require 'function_loader'" << ruby::eval; - ruby << "require 'md5'" << ruby::eval; - ruby << "Signal.trap(:SEGV, 'IGNORE')" << ruby::eval; + if (HAVE_DYN_RUBY_GENERATOR) + { + ruby << "$: << \"" << DYNDIR << "\"" << ruby::eval; + ruby << "require 'function_loader'" << ruby::eval; + ruby << "require 'md5'" << ruby::eval; + ruby << "Signal.trap(:SEGV, 'IGNORE')" << ruby::eval; + } } ~function_loader_t() @@ -339,11 +350,12 @@ namespace dyn { } } + // Most of the ruby-dependent code generator is in this function. void* - load(fun_kind kind, - const std::string& name, - const arguments_types_t& arguments_types, - const std::string& paths) + ruby_load(fun_kind kind, + const std::string& name, + const arguments_types_t& arguments_types, + const std::string& paths) { std::ostringstream ostr; ostr << name << '('; @@ -405,7 +417,7 @@ namespace dyn { return ptr; } - // FIXME: This C++ version of load shares a lot with the latter. + // FIXME: This C++ version of ruby_load shares a lot with the latter. void* cxx_load(fun_kind kind, const std::string& name, @@ -530,7 +542,12 @@ namespace dyn { const arguments_types_t& arguments_types, const std::string& header_path) { - return function_loader.load(kind, name, arguments_types, header_path); + if (HAVE_DYN_RUBY_GENERATOR) + return function_loader.ruby_load(kind, name, arguments_types, + header_path); + else + return function_loader.cxx_load(kind, name, arguments_types, + header_path); } } // end of namespace dyn -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * config/rbconfig_gen.rb (gen_m4): Generate quoted values to avoid issues with, e.g., commas. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4666 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 7 +++++++ dynamic-use-of-static-c++/config/rbconfig_gen.rb | 2 +- 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 24cf3d1..600c239 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,12 @@ 2009-10-22 Roland Levillain <roland@lrde.epita.fr> + Fix the implementation of the Autoconf macro RBCONFIG. + + * config/rbconfig_gen.rb (gen_m4): Generate quoted values to + avoid issues with, e.g., commas. + +2009-10-22 Roland Levillain <roland@lrde.epita.fr> + Have the dynamic function loader use the C++ framework by default. * src/function_loader.cc (HAVE_DYN_RUBY_GENERATOR): New macro, diff --git a/dynamic-use-of-static-c++/config/rbconfig_gen.rb b/dynamic-use-of-static-c++/config/rbconfig_gen.rb index 837cf2b..24fdf95 100644 --- a/dynamic-use-of-static-c++/config/rbconfig_gen.rb +++ b/dynamic-use-of-static-c++/config/rbconfig_gen.rb @@ -8,7 +8,7 @@ def gen_m4 ( config ) RUBY([ val = Config::CONFIG[%q[#{k}]] val = val.to_s.gsub(%q['], %q['"'"']) - %q['] + val + %q['] + %q{['} + val + %q{']} ])) AC_DEFINE([#{name}], $#{name}, [Contains Config::CONFIG['#{k}'] (generated by rbconfig_gen.rb)]) -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * libmd5/md5.cc: Include cstring. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4667 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 6 ++++++ dynamic-use-of-static-c++/libmd5/md5.cc | 1 + 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 600c239..0dbd74e 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,11 @@ 2009-10-22 Roland Levillain <roland@lrde.epita.fr> + Include a missing system header in libmd5. + + * libmd5/md5.cc: Include cstring. + +2009-10-22 Roland Levillain <roland@lrde.epita.fr> + Fix the implementation of the Autoconf macro RBCONFIG. * config/rbconfig_gen.rb (gen_m4): Generate quoted values to diff --git a/dynamic-use-of-static-c++/libmd5/md5.cc b/dynamic-use-of-static-c++/libmd5/md5.cc index 876e887..9bf7426 100644 --- a/dynamic-use-of-static-c++/libmd5/md5.cc +++ b/dynamic-use-of-static-c++/libmd5/md5.cc @@ -46,6 +46,7 @@ documentation and/or software. #include <cassert> +#include <cstring> #include <strings.h> #include <iostream> -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * test/Makefile.am (repository_clean): Rename target as... (clean-repository): ...this. Make it phony. Do not fail on `rm' errors. No longer depend on clean. (clean-local): New target. Depend on clean-repository. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4668 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 12 ++++++++++++ dynamic-use-of-static-c++/test/Makefile.am | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 0dbd74e..5b9e6e1 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,3 +1,15 @@ +2009-10-26 Roland Levillain <roland@lrde.epita.fr> + + Clean the test repository during general cleaning. + + * test/Makefile.am (repository_clean): Rename target as... + (clean-repository): ...this. + Make it phony. + Do not fail on `rm' errors. + No longer depend on clean. + (clean-local): New target. + Depend on clean-repository. + 2009-10-22 Roland Levillain <roland@lrde.epita.fr> Include a missing system header in libmd5. diff --git a/dynamic-use-of-static-c++/test/Makefile.am b/dynamic-use-of-static-c++/test/Makefile.am index 68f3b34..5a6beea 100644 --- a/dynamic-use-of-static-c++/test/Makefile.am +++ b/dynamic-use-of-static-c++/test/Makefile.am @@ -56,5 +56,7 @@ TESTS = $(check_PROGRAMS) tests: $(check_PROGRAMS) -repository_clean: clean - rm -rf repository +clean-local: clean-repository +.PHONY: clean-repository +clean-repository: + -rm -rf repository -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * src/function_loader.cc (dyn::function_loader_t::cache_type): Use C++ string as keys so as to solve some memory management issues. (dyn::function_loader_t::ruby_load) (dyn::function_loader_t::cxx_load): Adjust. (dyn::ltstr): Remove functor class. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4669 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 11 +++++++++++ dynamic-use-of-static-c++/src/function_loader.cc | 20 +++++++++----------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 5b9e6e1..9a6d4bc 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,16 @@ 2009-10-26 Roland Levillain <roland@lrde.epita.fr> + Fix the caching system. + + * src/function_loader.cc (dyn::function_loader_t::cache_type): Use + C++ string as keys so as to solve some memory management issues. + (dyn::function_loader_t::ruby_load) + (dyn::function_loader_t::cxx_load): + Adjust. + (dyn::ltstr): Remove functor class. + +2009-10-26 Roland Levillain <roland@lrde.epita.fr> + Clean the test repository during general cleaning. * test/Makefile.am (repository_clean): Rename target as... diff --git a/dynamic-use-of-static-c++/src/function_loader.cc b/dynamic-use-of-static-c++/src/function_loader.cc index cc25268..e1b0329 100644 --- a/dynamic-use-of-static-c++/src/function_loader.cc +++ b/dynamic-use-of-static-c++/src/function_loader.cc @@ -49,14 +49,6 @@ namespace dyn { ruby::environment ruby_environment; - struct ltstr - { - bool operator()(const char* s1, const char* s2) const - { - return strcmp(s1, s2) < 0; - } - }; - std::list<std::string> includes_; template <typename Fun> @@ -376,7 +368,7 @@ namespace dyn { std::string prototype = ostr.str(); ruby << "MD5.new(%q{" << prototype.c_str() << "}).to_s" << ruby::eval; - const char* identifier = STR2CSTR(ruby.last_value()); + std::string identifier = STR2CSTR(ruby.last_value()); cache_type::iterator ptr_it = cache.find(identifier); @@ -446,7 +438,7 @@ namespace dyn { // the interface of libmd5. std::string identifier(MD5((unsigned char*)prototype.c_str()).hex_digest()); - cache_type::iterator ptr_it = cache.find(identifier.c_str()); + cache_type::iterator ptr_it = cache.find(identifier); // FIXME: It seems the cache doesn't work at all (we almost // never hit). See why this is happening. @@ -506,7 +498,13 @@ namespace dyn { } protected: - typedef std::map<const char*, void*, ltstr> cache_type; + typedef std::map<std::string, void*> cache_type; + /* FIXME: Introduce a real cache object, with + debugging/pretty-printing methods. */ + /* FIXME: It seems this cache is only valid for a (single) run, + i.e., cached values won't be preserved across several + executions. Of course, this is safer, but it would be great to + benefit from a long-term cache. */ cache_type cache; std::list<std::string> cflags_, ldflags_; ruby::stream ruby; -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> * src/function_loader.cc: Wrap long lines. Clean up whitespace. (dyn::function_loader_t::gen_cxx): Remove a useless Ruby stream. * test/test_containers.cc, * test/test_damien.cc, * test/test_function_loader.cc, * test/test_methods.cc, * test/test_var_and_val.cc: Remove useless `return 0' statements at end of `main'. git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4670 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- dynamic-use-of-static-c++/ChangeLog | 14 + dynamic-use-of-static-c++/src/function_loader.cc | 268 ++++++++++---------- dynamic-use-of-static-c++/test/test_containers.cc | 1 - dynamic-use-of-static-c++/test/test_damien.cc | 1 - .../test/test_function_loader.cc | 1 - dynamic-use-of-static-c++/test/test_methods.cc | 1 - dynamic-use-of-static-c++/test/test_var_and_val.cc | 1 - 7 files changed, 154 insertions(+), 133 deletions(-) diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index 9a6d4bc..35e52ee 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,19 @@ 2009-10-26 Roland Levillain <roland@lrde.epita.fr> + Aesthetic changes. + + * src/function_loader.cc: Wrap long lines. + Clean up whitespace. + (dyn::function_loader_t::gen_cxx): Remove a useless Ruby stream. + * test/test_containers.cc, + * test/test_damien.cc, + * test/test_function_loader.cc, + * test/test_methods.cc, + * test/test_var_and_val.cc: + Remove useless `return 0' statements at end of `main'. + +2009-10-26 Roland Levillain <roland@lrde.epita.fr> + Fix the caching system. * src/function_loader.cc (dyn::function_loader_t::cache_type): Use diff --git a/dynamic-use-of-static-c++/src/function_loader.cc b/dynamic-use-of-static-c++/src/function_loader.cc index e1b0329..62efcbc 100644 --- a/dynamic-use-of-static-c++/src/function_loader.cc +++ b/dynamic-use-of-static-c++/src/function_loader.cc @@ -2,12 +2,13 @@ # define DYN_FUNCTION_LOADER_CC # include <cstdlib> -# include <ltdl.h> -# include <map> +# include <map> // FIXME: Use and improve the logger to avoid use of std::cerr. # include <iostream> +# include <ltdl.h> + # include <boost/filesystem.hpp> # include <boost/filesystem/fstream.hpp> # include <boost/algorithm/string/replace.hpp> @@ -31,7 +32,8 @@ namespace ba = boost::algorithm; template <typename InputIterator, typename T, typename OStream> -OStream& join(const InputIterator& begin, const InputIterator& end, const T& elt, OStream& ostr) +OStream& join(const InputIterator& begin, const InputIterator& end, + const T& elt, OStream& ostr) { InputIterator it = begin; @@ -57,17 +59,17 @@ namespace dyn { { std::list<std::string>::const_iterator it; unsigned last = 0, pos; - while (42) + while (true) { pos = header_paths.find(":", last); std::string sub = header_paths.substr(last, pos - last); if (sub == "*") { - for (it = includes_.begin(); it != includes_.end(); ++it) - fun(*it); + for (it = includes_.begin(); it != includes_.end(); ++it) + fun(*it); } else if (sub != "") - fun(sub); + fun(sub); if (pos >= std::string::npos) break; last = pos + 1; } @@ -80,13 +82,14 @@ namespace dyn { void operator() (const std::string& path) { ostr << "#include "; - if (path.find("<") == std::string::npos || path.find("\"") == std::string::npos) - if (path.find(".hh") == path.length() - 3) - ostr << "\"" << path << "\""; - else - ostr << "<" << path << ">"; + if (path.find("<") == std::string::npos + || path.find("\"") == std::string::npos) + if (path.find(".hh") == path.length() - 3) + ostr << "\"" << path << "\""; + else + ostr << "<" << path << ">"; else - ostr << path; + ostr << path; ostr << '\n'; } OStream& ostr; @@ -100,11 +103,11 @@ namespace dyn { { if (first) { - first = false; - ostr << path; + first = false; + ostr << path; } else - ostr << ':' << path; + ostr << ':' << path; } bool first; OStream& ostr; @@ -133,15 +136,14 @@ namespace dyn { template <typename OStream> void gen_cxx(const std::string& identifier, - const std::string& name, - const std::list<std::string>& args, - fun_kind kind, - const std::string paths, - OStream& ostr) + const std::string& name, + const std::list<std::string>& args, + fun_kind kind, + const std::string paths, + OStream& ostr) { - ruby::stream r; - typedef std::string str; - typedef std::list<str> str_list; + typedef std::string str; + typedef std::list<str> str_list; str_list call_args; std::ostringstream body, call; str nl("\n "); @@ -154,45 +156,48 @@ namespace dyn { foreach_path_in_paths(paths, fun); ostr << "extern \"C\" {\n" - << " namespace dyn {\n" - << " namespace generated {\n" - << " data\n" - << " dyn_" << identifier << "("; + << " namespace dyn {\n" + << " namespace generated {\n" + << " data\n" + << " dyn_" << identifier << "("; int i = 0; for (it = args.begin(); it != args.end(); ++it, ++i) { - std::ostringstream oarg; - oarg << "arg" << i; - str arg(oarg.str()); - - str type(*it); - // remove references cause they are forbidden on lhs - while (*type.rbegin() == '&') type.erase(--type.end()); - - if ( kind == METH and i == 0 ) - { - // check if the first type is a pointer to choose the good op (. or ->) - str stripped_type(type); - unsigned pos; - while ((pos = stripped_type.find(" ")) != str::npos) stripped_type.erase(pos, 1); - unsigned len = stripped_type.length(); - first_type_is_ptr = ((stripped_type.compare(len - 7, 7, "*const>") == 0) - || (stripped_type.compare(len - 2, 2, "*>") == 0)); - } - - if (it != args.begin()) ostr << ", "; - ostr << "const data& " << arg; - call_args.push_back(arg + "_reinterpret_cast_ptr->obj()"); - body << type << "* " << arg << "_reinterpret_cast_ptr = " - << "reinterpret_cast<" << type << "* >(" << arg << ".proxy());" - << nl << "assert(" << arg << "_reinterpret_cast_ptr);" << nl; + std::ostringstream oarg; + oarg << "arg" << i; + str arg(oarg.str()); + + str type(*it); + // Remove references cause they are forbidden on lhs. + while (*type.rbegin() == '&') type.erase(--type.end()); + + if (kind == METH and i == 0) + { + // Check if the first type is a pointer to choose the good + // operator (`.' or `->'). + str stripped_type(type); + unsigned pos; + while ((pos = stripped_type.find(" ")) != str::npos) + stripped_type.erase(pos, 1); + unsigned len = stripped_type.length(); + first_type_is_ptr = + ((stripped_type.compare(len - 7, 7, "*const>") == 0) + || (stripped_type.compare(len - 2, 2, "*>") == 0)); + } + + if (it != args.begin()) ostr << ", "; + ostr << "const data& " << arg; + call_args.push_back(arg + "_reinterpret_cast_ptr->obj()"); + body << type << "* " << arg << "_reinterpret_cast_ptr = " + << "reinterpret_cast<" << type << "* >(" << arg << ".proxy());" + << nl << "assert(" << arg << "_reinterpret_cast_ptr);" << nl; } - if ( kind == METH) - { - call << call_args.front() << ((first_type_is_ptr)? "->" : "."); - call_args.pop_front(); + if (kind == METH) + { + call << call_args.front() << ((first_type_is_ptr)? "->" : "."); + call_args.pop_front(); } call << name << "("; @@ -203,51 +208,52 @@ namespace dyn { switch (kind) { - case OP: - if ( op.compare(0, 8, "operator") == 0 ) - op.erase(0, 8); - call.str(std::string()); - switch (call_args.size()) - { - case 1: - call << op << "(" << *call_args.begin() << ")"; - break; - case 2: - it = call_args.begin(); - call << "(" << *it++ << ") "; - call << op - << " (" << *it << ")"; - break; - default: assert(0); - } - // no break here - case METH: - case FUN: - body << "policy::receiver<select_dyn_policy((" << call.str() << "))> receiver;" << nl - << "(receiver(), " << call.str() << ");" << nl - << "data ret(receiver.proxy(), (proxy_tag*)0);" << nl - << "return ret;\n"; - break; - case CTOR: - body << "typedef " << name << " T;" << nl - << "T* ptr = new T("; - join(call_args.begin(), call_args.end(), ", ", body); - body << ");" << nl - << "abstract_data* proxy = new data_proxy_by_ptr<T>(ptr);" << nl - << "data ret(proxy, (proxy_tag*)0);" << nl - << "return ret;\n"; - break; - default: - assert(!"Unknown kind"); + case OP: + if (op.compare(0, 8, "operator") == 0) + op.erase(0, 8); + call.str(std::string()); + switch (call_args.size()) + { + case 1: + call << op << "(" << *call_args.begin() << ")"; + break; + case 2: + it = call_args.begin(); + call << "(" << *it++ << ") "; + call << op + << " (" << *it << ")"; + break; + default: assert(0); + } + // no break here + case METH: + case FUN: + body << "policy::receiver<select_dyn_policy((" + << call.str() << "))> receiver;" << nl + << "(receiver(), " << call.str() << ");" << nl + << "data ret(receiver.proxy(), (proxy_tag*)0);" << nl + << "return ret;\n"; + break; + case CTOR: + body << "typedef " << name << " T;" << nl + << "T* ptr = new T("; + join(call_args.begin(), call_args.end(), ", ", body); + body << ");" << nl + << "abstract_data* proxy = new data_proxy_by_ptr<T>(ptr);" << nl + << "data ret(proxy, (proxy_tag*)0);" << nl + << "return ret;\n"; + break; + default: + assert(!"Unknown kind"); } ostr << ")\n" - << " {" << nl - << body.str() - << " }\n" - << " }\n" - << " }\n" - << "};\n"; + << " {" << nl + << body.str() + << " }\n" + << " }\n" + << " }\n" + << "};\n"; } @@ -339,7 +345,7 @@ namespace dyn { << out_log.rdbuf() << std::endl; // FIXME: Isn't this a bit too violent? std::exit(1); - } + } } // Most of the ruby-dependent code generator is in this function. @@ -354,16 +360,16 @@ namespace dyn { arguments_types_t::const_iterator it(arguments_types.begin()); if (it != arguments_types.end()) { - ostr << *it; - for (++it; it != arguments_types.end(); ++it) - ostr << ", " << *it; + ostr << *it; + for (++it; it != arguments_types.end(); ++it) + ostr << ", " << *it; } ostr << ')'; if (paths != "") { - ostr << ", paths: "; - gen_path<std::ostream> fun(ostr); - foreach_path_in_paths(paths, fun); + ostr << ", paths: "; + gen_path<std::ostream> fun(ostr); + foreach_path_in_paths(paths, fun); } std::string prototype = ostr.str(); @@ -372,19 +378,21 @@ namespace dyn { cache_type::iterator ptr_it = cache.find(identifier); - if ( ptr_it != cache.end() ) + if (ptr_it != cache.end()) { + // FIXME: Don't use a hard-coded error stream (std::cerr). // FIXME: Colors should be used only when the terminal supports them. #if 0 - std::cerr << "\e[36mJIT: \e[32mHIT: \e[0m " << prototype << std::endl; + std::cerr << "\e[36mJIT: \e[32mHIT: \e[0m " << prototype << std::endl; #endif - std::cerr << "JIT: HIT: " << prototype << std::endl; - return ptr_it->second; + std::cerr << "JIT: HIT: " << prototype << std::endl; + return ptr_it->second; } // FIXME: Colors should be used only when the terminal supports them. #if 0 - std::cerr << "\e[36mJIT: \e[31mMISS: compile: \e[0m " << prototype << std::endl; + std::cerr + << "\e[36mJIT: \e[31mMISS: compile: \e[0m " << prototype << std::endl; #endif std::cerr << "JIT: MISS: compile: " << prototype << std::endl; @@ -398,7 +406,7 @@ namespace dyn { const char* error; std::string lib_path = std::string("repository/") + identifier - + "/libdyn_" + identifier + ".la"; + + "/libdyn_" + identifier + ".la"; std::string symb = std::string("dyn_") + identifier; lt_dlhandle lib = lt_dlopen(lib_path.c_str()); @@ -421,22 +429,23 @@ namespace dyn { arguments_types_t::const_iterator it(arguments_types.begin()); if (it != arguments_types.end()) { - ostr << *it; - for (++it; it != arguments_types.end(); ++it) - ostr << ", " << *it; + ostr << *it; + for (++it; it != arguments_types.end(); ++it) + ostr << ", " << *it; } ostr << ')'; if (paths != "") { - ostr << ", paths: "; - gen_path<std::ostream> fun(ostr); - foreach_path_in_paths(paths, fun); + ostr << ", paths: "; + gen_path<std::ostream> fun(ostr); + foreach_path_in_paths(paths, fun); } std::string prototype = ostr.str(); // FIXME: Careful, this cast removes a const! We should improve // the interface of libmd5. - std::string identifier(MD5((unsigned char*)prototype.c_str()).hex_digest()); + std::string identifier = + MD5((unsigned char*)prototype.c_str()).hex_digest(); cache_type::iterator ptr_it = cache.find(identifier); @@ -444,17 +453,19 @@ namespace dyn { // never hit). See why this is happening. if (ptr_it != cache.end()) { + // FIXME: Don't use a hard-coded error stream (std::cerr). // FIXME: Colors should be used only when the terminal supports them. #if 0 - std::cerr << "\e[36mJIT: \e[32mHIT: \e[0m " << prototype << std::endl; + std::cerr << "\e[36mJIT: \e[32mHIT: \e[0m " << prototype << std::endl; #endif - std::cerr << "JIT: HIT: " << prototype << std::endl; - return ptr_it->second; + std::cerr << "JIT: HIT: " << prototype << std::endl; + return ptr_it->second; } // FIXME: Colors should be used only when the terminal supports them. #if 0 - std::cerr << "\e[36mJIT: \e[31mMISS: compile: \e[0m " << prototype << std::endl; + std::cerr + << "\e[36mJIT: \e[31mMISS: compile: \e[0m " << prototype << std::endl; #endif std::cerr << "JIT: MISS: compile: " << prototype << std::endl; @@ -486,7 +497,7 @@ namespace dyn { const char* error; std::string lib_path = std::string("repository/") + identifier - + "/libdyn_" + identifier + ".la"; + + "/libdyn_" + identifier + ".la"; std::string symb = std::string("dyn_") + identifier; lt_dlhandle lib = lt_dlopen(lib_path.c_str()); @@ -497,7 +508,7 @@ namespace dyn { return ptr; } - protected: + protected: typedef std::map<std::string, void*> cache_type; /* FIXME: Introduce a real cache object, with debugging/pretty-printing methods. */ @@ -506,6 +517,7 @@ namespace dyn { executions. Of course, this is safer, but it would be great to benefit from a long-term cache. */ cache_type cache; + // FIXME: Rename cflags as cxxflags. std::list<std::string> cflags_, ldflags_; ruby::stream ruby; }; @@ -536,9 +548,9 @@ namespace dyn { void* load_function(fun_kind kind, - const std::string& name, - const arguments_types_t& arguments_types, - const std::string& header_path) + const std::string& name, + const arguments_types_t& arguments_types, + const std::string& header_path) { if (HAVE_DYN_RUBY_GENERATOR) return function_loader.ruby_load(kind, name, arguments_types, diff --git a/dynamic-use-of-static-c++/test/test_containers.cc b/dynamic-use-of-static-c++/test/test_containers.cc index 2413b30..6a79e02 100644 --- a/dynamic-use-of-static-c++/test/test_containers.cc +++ b/dynamic-use-of-static-c++/test/test_containers.cc @@ -85,5 +85,4 @@ int main() assert(i == 4); echo("exiting"); - return 0; } diff --git a/dynamic-use-of-static-c++/test/test_damien.cc b/dynamic-use-of-static-c++/test/test_damien.cc index 4b30fbd..1b55fd1 100644 --- a/dynamic-use-of-static-c++/test/test_damien.cc +++ b/dynamic-use-of-static-c++/test/test_damien.cc @@ -92,5 +92,4 @@ int main() } std::cout << "exiting" << std::endl; - return 0; } diff --git a/dynamic-use-of-static-c++/test/test_function_loader.cc b/dynamic-use-of-static-c++/test/test_function_loader.cc index 50ee9d4..fc8984a 100644 --- a/dynamic-use-of-static-c++/test/test_function_loader.cc +++ b/dynamic-use-of-static-c++/test/test_function_loader.cc @@ -71,5 +71,4 @@ int main() assert(count == 1); echo("exiting"); - return 0; } diff --git a/dynamic-use-of-static-c++/test/test_methods.cc b/dynamic-use-of-static-c++/test/test_methods.cc index 079e49e..1ea7f0b 100644 --- a/dynamic-use-of-static-c++/test/test_methods.cc +++ b/dynamic-use-of-static-c++/test/test_methods.cc @@ -22,5 +22,4 @@ int main() print(v2, 2, "21"); std::cout << "exiting" << std::endl; - return 0; } diff --git a/dynamic-use-of-static-c++/test/test_var_and_val.cc b/dynamic-use-of-static-c++/test/test_var_and_val.cc index e890e18..b5da732 100644 --- a/dynamic-use-of-static-c++/test/test_var_and_val.cc +++ b/dynamic-use-of-static-c++/test/test_var_and_val.cc @@ -91,5 +91,4 @@ int main() assert(str == "b youhou"); echo("exiting"); - return 0; } -- 1.6.5

From: levill_r <levill_r@4aad255d-cdde-0310-9447-f3009e2ae8c0> git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4671 4aad255d-cdde-0310-9447-f3009e2ae8c0 --- AUTHORS | 5 +++-- ChangeLog | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 3ad07b2..8d66f48 100644 --- a/AUTHORS +++ b/AUTHORS @@ -29,6 +29,7 @@ Active LRDE Staff. - G++ 4.0 and 4.1 compatibility (Olena 0.10a). - Integration of GNU Libtool (Olena 0.10a). - SCOOP 2 and Static (Olena pre-1.0). + - Revive the dynamic-static bridge prototype from Olena proto-1.0. ================================ @@ -129,7 +130,7 @@ Students from Class 2006. - SCOOP 2 (Olena proto-1.0). * Nicolas Pouillard - - Dynamic? (Dyn) (Olena proto-1.0). + - Dynamic-static bridge prototype (Dyn) (Olena proto-1.0). * Damien Thivolle - Contributions to document the code. @@ -139,7 +140,7 @@ Students from Class 2006. - G++ 4.0 compatibility (Olena 0.10a). - Canvas for algorithms (Olena proto-1.0). - SCOOP 2 (Olena proto-1.0). - - Dynamic (Dyn) (Olena proto-1.0). + - Dynamic-static bridge prototype (Dyn) (Olena proto-1.0). ========================= Students from Class 2005. diff --git a/ChangeLog b/ChangeLog index bc82322..35ffb31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-10-26 Roland Levillain <roland@lrde.epita.fr> + + * AUTHORS: Update. + 2009-06-08 Roland Levillain <roland@lrde.epita.fr> Import dynamic-use-of-static-c++. -- 1.6.5
participants (1)
-
Roland Levillain