{
public:
template <typename _It, typename _Param>
- bool analyze(_It& it, _Param& param)
+ bool parse(_It& it, _Param& param)
{
T t;
_It it_work = it;
for(;;)
{
- if ( t.analyze(it_work, param) == false )
+ if ( t.parse(it_work, param) == false )
break;
else
it = it_work;
//----
template <typename _Strm, typename _Document>
- bool generate(_Strm& strm, _Document& doc)
+ bool generate(_Strm& strm, _Document& doc) const
{
T t;
for(;;)
{
public:
template <typename _Strm, typename _Document>
- bool generate(_Strm& strm, _Document& doc)
+ bool generate(_Strm& strm, _Document& doc) const
{
return true;
}
////////////////////
- template <typename T, int N>
+ template <typename T, unsigned int N>
class fixed_repeat// : public lengthable
{
public:
- const static int length = length_of<T>::value * N;
+ const T t;
+
+ //const static int length = length_of<T>::value * N;
/////////////////////////////////////////////////////////////
template <typename _It, typename _Param>
- bool analyze(_It& it, _Param& param)
+ bool parse(_It& it, _Param& param)
{
- T t;
_It it_work = it;
- for(int i=0; i<N; i++)
+ for(unsigned int i=0; i<N; i++)
{
- if ( t.analyze(it_work, param) == false )
+ if ( t.parse(it_work, param) == false )
return false;
else
it = it_work;
template <typename _Strm, typename _Document>
bool generate(_Strm& strm, _Document& doc)
{
- T t;
- for(int i=0; i<N; i++)
+ for(unsigned int i=0; i<N; i++)
{
if ( t.generate(strm, doc) == false )
return false;
return true;
}
};
- template <typename T, int N>
+ template <typename T, unsigned int N>
class fixed_loop : public fixed_repeat<T,N>{};
- template <typename T, int N>
- class n_loop : public fixed_loop<T,N>{};
+ /*template <typename T, unsigned int N>
+ class n_loop : public fixed_loop<T,N>{};*/
////////////////////
- template <typename T, int N>
+ template <typename T, unsigned int N>
class hard_repeat// : public lengthable
{
public:
- const static int length = length_of<T>::value * N;
+ const T t;
+
+ //const static int length = length_of<T>::value * N;
template <typename _It, typename _Param>
- bool analyze(_It& it, _Param& param)
+ bool parse(_It& it, _Param& param)
{
- T t;
+ //T t;
_It it_work = it;
- if ( t.analyze(it_work, param) == false )
+ if ( t.parse(it_work, param) == false )
return false;
else
{
hard_repeat<T,N-1> fr2;
- return fr2.analyze(it_work,param);
+ return fr2.parse(it_work,param);
}
}
//----
template <typename _Strm, typename _Document>
- bool generate(_Strm& strm, _Document& doc)
+ bool generate(_Strm& strm, _Document& doc) const
{
- T t;
+ //T t;
if ( t.generate(strm, doc) == false )
return false;
else
{
public:
template <typename _It, typename _Param>
- bool analyze(_It& it, _Param& param)
+ bool parse(_It& it, _Param& param)
{
T t;
_It it_work = it;
- if ( t.analyze(it_work, param) == false )
+ if ( t.parse(it_work, param) == false )
return false;
else
it = it_work;
//----
template <typename _Strm, typename _Document>
- bool generate(_Strm& strm, _Document& doc)
+ bool generate(_Strm& strm, _Document& doc) const
{
T t;
if ( t.generate(strm, doc) == false )
}
};
+ //
+
+ template <typename T, unsigned int N>
+ class repeat : public fixed_repeat<T,N>{};
+
////////////////////////////////////////////////////////
}
}