OSDN Git Service

lexical/rule.hpp: nop Add.
authormyun2 <myun2@nwhite.info>
Wed, 18 Apr 2012 02:47:53 +0000 (11:47 +0900)
committermyun2 <myun2@nwhite.info>
Wed, 18 Apr 2012 02:47:53 +0000 (11:47 +0900)
roast/include/roast/lexical/rule.hpp

index 6f8159c..ddea985 100644 (file)
@@ -25,6 +25,24 @@ namespace roast
                        class and
                        {
                        };
+                       
+                       class empty : public lengthable
+                       {
+                       public:
+                               static const int length = 0;
+
+                               template <typename _It, typename _Param>
+                               bool analyze(_It& it, _Param& param)
+                               {
+                                       return true;
+                               }
+                               template <typename _It, typename _Param>
+                               bool generate(const _It&, const _Param&)
+                               {
+                                       return true;
+                               }
+                       };
+                       typedef empty non, nop;
                }
        }
 }