OSDN Git Service

lexical2/lexical2_util.hpp 実装
authormyun2 <myun2@nwhite.info>
Mon, 11 Jun 2012 06:32:17 +0000 (15:32 +0900)
committermyun2 <myun2@nwhite.info>
Mon, 11 Jun 2012 06:32:17 +0000 (15:32 +0900)
roast/include/roast/lexical2/lexical.hpp
roast/include/roast/lexical2/lexical2_util.hpp

index 6afe8ea..9ab66db 100644 (file)
@@ -6,5 +6,6 @@
 
 #include "roast/lexical2/length.hpp"
 #include "roast/lexical2/empty_type.hpp"
+#include "roast/lexical2/fixed.hpp"
 
 #endif//__SFJP_ROAST__lexical2__lexical_HPP__
index 6fe8045..953672d 100644 (file)
@@ -10,42 +10,19 @@ namespace roast
        {
                //////////////////////////////////////////////////////////////////////////////////
 
-               //      Null Document Class (for Not Used Document Only!!)
-
-               template <typename>
-               class null_document_
-               {
-               public:
-                       template <typename T>
-                       bool operator << (T){ return true; }
-               };
-               /*static*/ null_document_<int> null_document;
-
-               //////////////////////////////////////////////////////////////////////////////////
-
-               //      Analyze Utility Functions.
-
-               template <typename _Rule, typename _It, typename _Param>
-               bool analyze(const _It& it, _Param& param)
+               template <typename Lexer, typename InputIterator, typename Param>
+               bool analyze(Lexer &lexer, InputIterator& it, Param& param = EmptyType())
                {
-                       ::roast::lexical::rule::work_iterator<_Rule> r;
-                       return r.analyze(it, param);
+                       return lexer.analyze(it, param);
                }
                
-               template <typename _Rule, typename _It, typename _Param>
-               bool parse(const _It& it, _Param& param){ return analyze<_Rule>(it, param); }
-               
                //////////////////////////////////////////////////////////////////////////////////
 
-               //      Generate Utility Functions.
-
-               template <typename _Rule, typename _Strm, typename _Document>
-               bool generate(_Strm& strm, _Document& doc = null_document)
+               template <typename Lexer, typename OutputStream, typename Param>
+               void generate(const Lexer &lexer, OutputStream& os, Param& param = EmptyType())
                {
-                       _Rule r;
-                       return r.generate(strm,doc);
+                       lexer.generate(os, param);
                }
-               /////
                
                //////////////////////////////////////////////////////////////////////////////////
        }