|  | reflex::AbstractLexer< M >::Matcher Class Reference updated Fri May 16 2025 by Robert van Engelen |

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

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:
[legend]
Collaboration diagram for reflex::AbstractLexer< M >::Matcher:
[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...
virtual Matcher & | operator= (const Matcher &matcher)
| Assign a matcher, the underlying pattern object is shared (not deep copied). 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

AbstractLexer * | lexer_
| 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

  pattern | regex pattern to instantiate matcher class M(pattern, input)
  input | the reflex::Input to instantiate matcher class M(pattern, input)
  lexer | points to the instantiating lexer class
  opt | option 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

  pattern | regex pattern to instantiate matcher class M(pattern, input)
  input | the reflex::Input to instantiate matcher class M(pattern, input)
  lexer | points to the instantiating lexer class
  opt | option string of the form `(A|N|T(=[[:digit:]])?|;)*`

## Member Function Documentation

template<typename M >

virtual Matcher& reflex::AbstractLexer< M >::Matcher::operator= | ( | const Matcher & | matcher | ) |

inlinevirtual

Assign a matcher, the underlying pattern object is shared (not deep copied).

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:

- abslexer.h