OSDN Git Service

lex_test.cpp
authortomoaki <tomoaki@edge-vpc-debian6.yahagi>
Thu, 24 May 2012 13:11:46 +0000 (22:11 +0900)
committertomoaki <tomoaki@edge-vpc-debian6.yahagi>
Thu, 24 May 2012 13:11:46 +0000 (22:11 +0900)
roast/test/linux_test2/lex_test.cpp

index a08e541..d64a6c9 100644 (file)
@@ -1,4 +1,4 @@
-//#include "roast/lexical/rule/rule.hpp"
+#include "roast/lexical.hpp"
 #include "roast/lexical/rule/lengthable.hpp"
 #include "roast/tuple.hpp"
 #include <stdio.h>
@@ -6,21 +6,25 @@
 #include "roast/lexical/rule/empty.hpp"
 #include "roast/lexical/rule/or.hpp"
 #include "roast/lexical/rule/seq.hpp"
-//#include "roast/lexical/rule/char.hpp"
+#include "roast/lexical/rule/char.hpp"
+#include "roast/lexical/rule/rule_numeric.hpp"
+#include "roast/lexical/rule/string.hpp"
+#include "roast/lexical/rule/get_string.hpp"
 
-using namespace roast;
-
-template <int N>
-void get(){ }
+#include "roast/net/uri.hpp"
 
-template <typename T>
-void ggg(nest_type<T>& doc)
-{
-       doc.get<0>();
-}
+using namespace roast;
 
 int main()
 {
+       try {
+       uri u("hoge", "hoge2");
+       printf("%s\n", lex_to_string(u).c_str());
+
+       //stream::string_output_stream sos;
+       //lexical::generate(sos, zg);
+       //printf("%s\n", sos.c_str());
+
        _nest_type::get_type<nest_type<int>, 0>::type zz = 33;
        _nest_type::get_type<nest_type<int, nest_type<int> >, 0>::type zz2 = 44;
        _nest_type::get_type<nest_type<int, nest_type<int> >, 1>::type zz3 = 55;
@@ -42,6 +46,11 @@ int main()
        printf("%d\n", ddd.get<1>() );
 
        tuple<int,int> tp1;
+       }
+       catch(const ::std::string& s)
+       {
+               fprintf(stderr, "%s\n", s.c_str());
+       }
 
        return 0;
 }