<<< Lexeme symbol(false) | Table Of Contents | Lexeme begin(false) >>> |
Common Text Transformation Library http://cttl.sourceforge.net/
Category:
Format:
Algorithm:
Space sensitivity:
The space sensitivity of begin(true) lexeme is disabled. The space policy is ignored. Regardless of the space policy, the evaluation of begin(true) starts immediately at the position specified by the upper boundary of the parseable substring.
Searchability:
Search grammar evaluation algorithms
are enabled for begin(true) lexeme, but have no effect: in either case match() grammar evaluation algorithm is executed by the lexer.
Usage example:
The begin(true) lexeme provides access to the upper boundary position of the parseable substring:
#define CTTL_TRACE_EVERYTHING #include "cttl/cttl.h" using namespace cttl; int main() { std::string inp; // empty string const_edge<> substring( inp ); node<> start = substring.first; size_t result = start( begin( true ) ).match( substring ); assert( result == 0 ); assert( start.offset() == 0 ); return 0; }
Trace output format:
The trace output of begin(true) lexeme is digit '1'. The above example generates the following trace:
------------------------@?{n 0-0
:2
------------------------@| 1 0-0
------------------------@| n 0-0
}
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 symbol(false) | Table Of Contents | Lexeme begin(false) >>> |