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

updated Wed Mar 27 2024 by Robert van Engelen
 
Public Member Functions | Protected Member Functions | List of all members
reflex::FlexLexer< M >::Matcher Class Reference

Extends reflex::AbstractLexer<M>::Matcher for Flex-compatibility. More...

#include <flexlexer.h>

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

Public Member Functions

 Matcher (const typename M::Pattern &pattern, const Input &input, FlexLexer *lexer, const char *opt=NULL)
 Construct a FlexLexer matcher from a matcher's pattern type. More...
 
 Matcher (const char *pattern, const Input &input, FlexLexer *lexer, const char *opt=NULL)
 Construct a FlexLexer matcher from a string pattern. More...
 
virtual size_t get (char *s, size_t n)
 Read character sequences via a Flex-compatible virtual FlexLexer::LexerInput method. More...
 
- Public Member Functions inherited from reflex::AbstractLexer< M >::Matcher
 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 ()
 Check the Flex-compatible FlexLexer::yywrap method to determine if matcher should wrap input after EOF (lexer yywrap() should return 0 to wrap input after EOF). More...
 

Additional Inherited Members

- Protected Attributes inherited from reflex::AbstractLexer< M >::Matcher
AbstractLexerlexer_
 Points to the lexer class that instantiated this Matcher. More...
 

Detailed Description

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

Extends reflex::AbstractLexer<M>::Matcher for Flex-compatibility.

Constructor & Destructor Documentation

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

Construct a FlexLexer 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::FlexLexer< M >::Matcher::Matcher ( const char *  pattern,
const Input input,
FlexLexer lexer,
const char *  opt = NULL 
)
inline

Construct a FlexLexer 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 size_t reflex::FlexLexer< M >::Matcher::get ( char *  s,
size_t  n 
)
inlinevirtual

Read character sequences via a Flex-compatible virtual FlexLexer::LexerInput method.

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

Check the Flex-compatible FlexLexer::yywrap method to determine if matcher should wrap input after EOF (lexer yywrap() should return 0 to wrap input after EOF).

Returns
true if FlexLexer::yywrap() == 0 indicating that input is wrapped after EOF

Reimplemented from reflex::AbstractLexer< M >::Matcher.


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