}
template <typename _Strm, typename _Document>
- bool generate(_Strm& strm, _Document& doc) const
+ bool generate(_Strm& strm, _Document& doc)
{
- /*
T0 t0;
if ( t0.generate(strm, doc) == false )
return false;
T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32> t1;
if ( t1.generate(strm, doc) == false )
return false;
-
+
return true;
- */
-
- return _seq_generate(strm, doc, typename _Base::_Next());
}
};
}
template <typename _Strm, typename _Document>
- bool generate(_Strm& strm, _Document& doc) const
+ bool generate(_Strm& strm, _Document& doc)
{
- /*T1 t1;
+ T1 t1;
if ( t1.generate(strm, doc) == false )
return false;
- return true;*/
- return _seq_generate(strm, doc, EmptyType());
+ return true;
}
};
--- /dev/null
+#include <string>
+#include <stdio.h>
+#include "roast/lexical2/lexical.hpp"
+
+using namespace roast;
+using namespace roast::lexical;
+
+int main()
+{
+ try{
+ lexical::println(fixed_char<'U'>());
+ lexical::println(seq<fixed_char<'U'>, fixed_char<'T'> >());
+ //lexical::println(fixed_ptr<char>("aaa",3));
+ lexical::println(fixed_string("aaca",3));
+
+ int a=10;
+ int *p = &a;
+ var_int vi;
+ vi.parse(p, 0);
+ printf("vi = %d\n", vi.get());
+
+ printf("%d\n", lexical::parse(fixed_char<'U'>(), "Z") );
+ printf("%d\n", lexical::parse(fixed_string("aaca",3), "aacaZ") );
+ printf("%d\n", lexical::parse(seq<fixed_char<'U'>, fixed_char<'T'> >(), "Ud") );
+
+ lexical::string str;
+ printf("lexical::string parse: %d\n", lexical::parse(str, "lexical::string parse OK.") );
+ lexical::println(str);
+
+ lexical::string_<fixed_char<'\n'> > str2;
+ printf("lexical::string_ parse: %d\n", lexical::parse(str2, "lexical::string_ parse OK.\n NG!!") );
+ lexical::println(str2);
+
+ }
+ catch(const ::std::string &s)
+ {
+ ::fprintf(stderr, "[ERR] %s\n", s.c_str());
+ }
+ return 0;
+}