From 9d8deaedabc345ec7792f97bd8ac01e71e92a71d Mon Sep 17 00:00:00 2001 From: myun2 Date: Mon, 11 Jun 2012 15:32:17 +0900 Subject: [PATCH] =?utf8?q?lexical2/lexical2=5Futil.hpp=20=E5=AE=9F?= =?utf8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- roast/include/roast/lexical2/lexical.hpp | 1 + roast/include/roast/lexical2/lexical2_util.hpp | 35 +++++--------------------- 2 files changed, 7 insertions(+), 29 deletions(-) diff --git a/roast/include/roast/lexical2/lexical.hpp b/roast/include/roast/lexical2/lexical.hpp index 6afe8ea5..9ab66db6 100644 --- a/roast/include/roast/lexical2/lexical.hpp +++ b/roast/include/roast/lexical2/lexical.hpp @@ -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__ diff --git a/roast/include/roast/lexical2/lexical2_util.hpp b/roast/include/roast/lexical2/lexical2_util.hpp index 6fe8045c..953672d1 100644 --- a/roast/include/roast/lexical2/lexical2_util.hpp +++ b/roast/include/roast/lexical2/lexical2_util.hpp @@ -10,42 +10,19 @@ namespace roast { ////////////////////////////////////////////////////////////////////////////////// - // Null Document Class (for Not Used Document Only!!) - - template - class null_document_ - { - public: - template - bool operator << (T){ return true; } - }; - /*static*/ null_document_ null_document; - - ////////////////////////////////////////////////////////////////////////////////// - - // Analyze Utility Functions. - - template - bool analyze(const _It& it, _Param& param) + template + 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 - bool parse(const _It& it, _Param& param){ return analyze<_Rule>(it, param); } - ////////////////////////////////////////////////////////////////////////////////// - // Generate Utility Functions. - - template - bool generate(_Strm& strm, _Document& doc = null_document) + template + void generate(const Lexer &lexer, OutputStream& os, Param& param = EmptyType()) { - _Rule r; - return r.generate(strm,doc); + lexer.generate(os, param); } - ///// ////////////////////////////////////////////////////////////////////////////////// } -- 2.11.0