reflex::AbstractLexer< M >::Matcher Class Reference

updated Wed Apr 10 2024 by Robert van Engelen
 
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
reflex::AbstractLexer< M >::Matcher Class Reference

Extend matcher class M with a member pointing to the instantiating lexer class. More...

#include <abslexer.h>

Inheritance diagram for reflex::AbstractLexer< M >::Matcher:
Inheritance graph
[legend]
Collaboration diagram for reflex::AbstractLexer< M >::Matcher:
Collaboration graph
[legend]

Public Member Functions

 Matcher (const typename M::Pattern &pattern, const Input &input, AbstractLexer *lexer, const char *opt=NULL)
 Construct a lexer matcher from a matcher's pattern type. More...
 
 Matcher (const char *pattern, const Input &input, AbstractLexer *lexer, const char *opt=NULL)
 Construct a lexer matcher from a string pattern. More...
 

Protected Member Functions

virtual bool wrap ()
 Returns true if matcher should wrap input after EOF (lexer wrap() should return 0 to wrap input after EOF). More...
 

Protected Attributes

AbstractLexerlexer_
 Points to the lexer class that instantiated this Matcher. More...
 

Detailed Description

template<typename M>
class reflex::AbstractLexer< M >::Matcher

Extend matcher class M with a member pointing to the instantiating lexer class.

Constructor & Destructor Documentation

template<typename M >
reflex::AbstractLexer< M >::Matcher::Matcher ( const typename M::Pattern &  pattern,
const Input input,
AbstractLexer lexer,
const char *  opt = NULL 
)
inline

Construct a lexer matcher from a matcher's pattern type.

Parameters
patternregex pattern to instantiate matcher class M(pattern, input)
inputthe reflex::Input to instantiate matcher class M(pattern, input)
lexerpoints to the instantiating lexer class
optoption string of the form (A|N|T(=[[:digit:]])?|;)*
template<typename M >
reflex::AbstractLexer< M >::Matcher::Matcher ( const char *  pattern,
const Input input,
AbstractLexer lexer,
const char *  opt = NULL 
)
inline

Construct a lexer matcher from a string pattern.

Parameters
patternregex pattern to instantiate matcher class M(pattern, input)
inputthe reflex::Input to instantiate matcher class M(pattern, input)
lexerpoints to the instantiating lexer class
optoption string of the form (A|N|T(=[[:digit:]])?|;)*

Member Function Documentation

template<typename M >
virtual bool reflex::AbstractLexer< M >::Matcher::wrap ( )
inlineprotectedvirtual

Returns true if matcher should wrap input after EOF (lexer wrap() should return 0 to wrap input after EOF).

Returns
true if reflex::AbstractLexer::wrap() == 0 indicating that input is wrapped after EOF

Reimplemented in reflex::FlexLexer< M >::Matcher.

Member Data Documentation

template<typename M >
AbstractLexer* reflex::AbstractLexer< M >::Matcher::lexer_
protected

Points to the lexer class that instantiated this Matcher.


The documentation for this class was generated from the following file: