reflex::regex_error Class Reference

updated Wed Mar 27 2024 by Robert van Engelen
 
Public Member Functions | Static Public Attributes | Static Private Member Functions | Private Attributes | List of all members
reflex::regex_error Class Reference

Regex syntax error exceptions. More...

#include <error.h>

Inheritance diagram for reflex::regex_error:
Inheritance graph
[legend]
Collaboration diagram for reflex::regex_error:
Collaboration graph
[legend]

Public Member Functions

 regex_error (regex_error_type code, const std::string &pattern, size_t pos=0)
 Construct regex error info. More...
 
 regex_error (regex_error_type code, const char *pattern, size_t pos=0)
 Construct regex error info. More...
 
 regex_error (const char *message, const std::string &pattern, size_t pos=0)
 Construct regex error info. More...
 
 regex_error (const char *message, const char *pattern, size_t pos=0)
 Construct regex error info. More...
 
regex_error_type code () const
 Returns error code, a reflex::regex_error_type constant. More...
 
size_t pos () const
 Returns position of the error in the regex. More...
 

Static Public Attributes

static const regex_error_type mismatched_parens = 0
 mismatched ( ) More...
 
static const regex_error_type mismatched_braces = 1
 mismatched { } More...
 
static const regex_error_type mismatched_brackets = 2
 mismatched [ ] More...
 
static const regex_error_type mismatched_quotation = 3
 mismatched \Q...\E or "..." quotation More...
 
static const regex_error_type empty_expression = 4
 regex (sub)expression should not be empty More...
 
static const regex_error_type empty_class = 5
 class [...] is empty, e.g. [a&&[b]] More...
 
static const regex_error_type invalid_class = 6
 invalid character class name or code point More...
 
static const regex_error_type invalid_class_range = 7
 invalid character class range, e.g. [Z-A] More...
 
static const regex_error_type invalid_escape = 8
 invalid escape character More...
 
static const regex_error_type invalid_anchor = 9
 invalid anchor More...
 
static const regex_error_type invalid_repeat = 10
 invalid repeat range, e.g. {10,1} More...
 
static const regex_error_type invalid_quantifier = 11
 invalid lazy/possessive quantifier More...
 
static const regex_error_type invalid_modifier = 12
 invalid (?ismx:) modifier More...
 
static const regex_error_type invalid_collating = 13
 invalid collating element [[.name.]] More...
 
static const regex_error_type invalid_backreference = 14
 invalid backreference More...
 
static const regex_error_type invalid_syntax = 15
 invalid regex syntax More...
 
static const regex_error_type exceeds_length = 16
 regex exceeds length limit (reflex::Pattern class only) More...
 
static const regex_error_type exceeds_limits = 17
 regex exceeds complexity limits (reflex::Pattern class only) More...
 
static const regex_error_type undefined_name = 18
 undefined macro name (reflex tool only) More...
 
static const regex_error_type cannot_save_tables = 19
 

Static Private Member Functions

static std::string regex_error_message_code (regex_error_type code, const char *pattern, size_t pos)
 
static std::string regex_error_message (const char *message, const char *pattern, size_t pos)
 
static size_t displen (const char *s, size_t k)
 
static const char * disppos (const char *s, size_t k)
 

Private Attributes

regex_error_type code_
 
size_t pos_
 

Detailed Description

Regex syntax error exceptions.

Constructor & Destructor Documentation

reflex::regex_error::regex_error ( regex_error_type  code,
const std::string &  pattern,
size_t  pos = 0 
)
inline

Construct regex error info.

reflex::regex_error::regex_error ( regex_error_type  code,
const char *  pattern,
size_t  pos = 0 
)
inline

Construct regex error info.

reflex::regex_error::regex_error ( const char *  message,
const std::string &  pattern,
size_t  pos = 0 
)
inline

Construct regex error info.

reflex::regex_error::regex_error ( const char *  message,
const char *  pattern,
size_t  pos = 0 
)
inline

Construct regex error info.

Member Function Documentation

regex_error_type reflex::regex_error::code ( ) const
inline

Returns error code, a reflex::regex_error_type constant.

static size_t reflex::regex_error::displen ( const char *  s,
size_t  k 
)
staticprivate
static const char* reflex::regex_error::disppos ( const char *  s,
size_t  k 
)
staticprivate
size_t reflex::regex_error::pos ( ) const
inline

Returns position of the error in the regex.

static std::string reflex::regex_error::regex_error_message ( const char *  message,
const char *  pattern,
size_t  pos 
)
staticprivate
static std::string reflex::regex_error::regex_error_message_code ( regex_error_type  code,
const char *  pattern,
size_t  pos 
)
staticprivate

Member Data Documentation

const regex_error_type reflex::regex_error::cannot_save_tables = 19
static

cannot save tables file (reflex tool only)

regex_error_type reflex::regex_error::code_
private
const regex_error_type reflex::regex_error::empty_class = 5
static

class [...] is empty, e.g. [a&&[b]]

const regex_error_type reflex::regex_error::empty_expression = 4
static

regex (sub)expression should not be empty

const regex_error_type reflex::regex_error::exceeds_length = 16
static

regex exceeds length limit (reflex::Pattern class only)

const regex_error_type reflex::regex_error::exceeds_limits = 17
static

regex exceeds complexity limits (reflex::Pattern class only)

const regex_error_type reflex::regex_error::invalid_anchor = 9
static

invalid anchor

const regex_error_type reflex::regex_error::invalid_backreference = 14
static

invalid backreference

const regex_error_type reflex::regex_error::invalid_class = 6
static

invalid character class name or code point

const regex_error_type reflex::regex_error::invalid_class_range = 7
static

invalid character class range, e.g. [Z-A]

const regex_error_type reflex::regex_error::invalid_collating = 13
static

invalid collating element [[.name.]]

const regex_error_type reflex::regex_error::invalid_escape = 8
static

invalid escape character

const regex_error_type reflex::regex_error::invalid_modifier = 12
static

invalid (?ismx:) modifier

const regex_error_type reflex::regex_error::invalid_quantifier = 11
static

invalid lazy/possessive quantifier

const regex_error_type reflex::regex_error::invalid_repeat = 10
static

invalid repeat range, e.g. {10,1}

const regex_error_type reflex::regex_error::invalid_syntax = 15
static

invalid regex syntax

const regex_error_type reflex::regex_error::mismatched_braces = 1
static

mismatched { }

const regex_error_type reflex::regex_error::mismatched_brackets = 2
static

mismatched [ ]

const regex_error_type reflex::regex_error::mismatched_parens = 0
static

mismatched ( )

const regex_error_type reflex::regex_error::mismatched_quotation = 3
static

mismatched \Q...\E or "..." quotation

size_t reflex::regex_error::pos_
private
const regex_error_type reflex::regex_error::undefined_name = 18
static

undefined macro name (reflex tool only)


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