<<< Lexeme begin() | Table Of Contents | Lexeme symbol(true) >>> |
Common Text Transformation Library http://cttl.sourceforge.net/
Category:
Format:
Algorithm:
Space sensitivity:
The space sensitivity of end() lexeme is enabled:
#define CTTL_TRACE_EVERYTHING #include "cttl/cttl.h" using namespace cttl; int main() { std::string inp( 5, ' ' ); // string with five spaces const_edge< policy_space<> > substring( inp ); const_edge<> token = substring; size_t result = token( end() ).match( substring ); assert( result == inp.length() ); assert( token.length() == 0 ); assert( substring.length() == 0 ); return 0; }
Searchability:
Search grammar evaluation algorithms
are enabled for end() lexeme. The search moves upper boundary of the parseable substring to its lower boundary position. The substring becomes empty. The following fragment demonstrates terminal symbol search algorithm for end():
#define CTTL_TRACE_EVERYTHING
#include "cttl/cttl.h"
using namespace cttl;
int main()
{
std::string inp = "XYZ";
const_edge< policy_space<> > substring( inp );
const_edge<> token = substring;
size_t result = token( end() ).find( substring );
assert( result == inp.length() );
assert( token.length() == 0 );
assert( substring.length() == 0 );
return 0;
}
Trace output format:
The trace symbol of end() lexeme is uppercase 'Z', annotated by the "EOF" label. The above example generates the following trace:
---------------------@XYZ?{e! 0-3 :3:1 ---------------------XYZ@| Z 3-3 EOF ------------------------@| e 3-3 }
Copyright © 1997-2009 Igor Kholodov mailto:cttl@users.sourceforge.net.
Permission to copy and distribute this document is granted provided this copyright notice appears in all copies. This document is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.
<<< Lexeme begin() | Table Of Contents | Lexeme symbol(true) >>> |