added a dummy print function to the lexindex class so that
authorSebastian Maneth <seba@sophisto.(none)>
Fri, 2 Nov 2012 14:09:35 +0000 (15:09 +0100)
committerSebastian Maneth <seba@sophisto.(none)>
Fri, 2 Nov 2012 14:09:35 +0000 (15:09 +0100)
program terminates now.. :)

src/lexindex_stub.cpp

index 0a9df0f..2118e2e 100644 (file)
@@ -1,4 +1,4 @@
-a#include <cstring>
+#include <cstring>
 #include <utility>
 #include <algorithm>
 #include <vector>
@@ -18,7 +18,6 @@ struct myclass {
 } myobject;
 
 //define a type for the lexicographic index
-
 class lex_index {
 public:
   //The tag IDs
@@ -29,8 +28,11 @@ public:
   vector<int32_t>::iterator tagVectorIt;
   vector<int32_t> tag2Vector;           
   vector<int32_t>::iterator tag2VectorIt;
+  void print();
 };
 
+void lex_index::print(){printf("Print called\n");}
+
 // class prefix_treeNode {
 // public:
   //  std::map<char, prefix_treeNode> Children;
@@ -134,6 +136,7 @@ ML_BINDING value caml_build_lex_index(value vtree, value vtag, value vtag2)
 
   //Uncomment the following and comment the failwith line
   //LEXINDEX(vindex) = ... return a lex_index* ....  
+  LEXINDEX(vindex)=mylindex;
 }
 
 ML_BINDING value caml_print_lex_index(value vindex)
@@ -142,6 +145,7 @@ ML_BINDING value caml_print_lex_index(value vindex)
   lex_index* index = LEXINDEX(vindex);
 
   //Print the index to the terminal
-  caml_failwith("print_lex_index not implemented");
+  //  caml_failwith("print_lex_index not implemented");
+  index->print();
   CAMLreturn (Val_unit);
 }