OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
regexp.cpp File Reference
#include <owl/pch.h>
#include <owl/defs.h>
#include <algorithm>
#include <owl/private/regexp.h>

Go to the source code of this file.

Namespaces

namespace  owl
 Object Windows Library (OWLNext Core)
 

Macros

#define BOL   _T('^') /* start-of-line anchor */
 
#define EOL   _T('$') /* end-of-line anchor */
 
#define ANY   _T('.') /* matches any character */
 
#define CCL   _T('[') /* start a character class */
 
#define CCLEND   _T(']') /* end a character class */
 
#define NCCL   _T('^') /* negates character class if 1st char. */
 
#define CLOSURE   _T('*') /* Kleene closure (matches 0 or more) */
 
#define PCLOSE   _T('+') /* Positive closure (1 or more) */
 
#define OPT   _T('?') /* Optional closure (0 or 1) */
 
#define IS_ACTION(x)   ((x)&0x80) /* true => element of pat. string is an */
 
#define MAPSIZE   16 /* need this many bytes for character class bit map */
 
#define ADVANCE(pat)   (pat += (*pat == (pattern)M_CCL) ? (MAPSIZE+1) : 1)
 
#define SETBIT(b, map)   ((map)[((b) & 0x7f) >>3] |= pattern(1 << ((b) & 0x07)) )
 
#define TSTBIT(b, map)   ((map)[((b) & 0x7f) >>3] & (1<< ((b) & 0x07)) )
 
#define E_NONE   0 /* Possible return values from pat_err. */
 
#define E_ILLEGAL   1 /* Set in makepat() to indicate prob- */
 
#define E_NOMEM   2 /* lems that came up while making the */
 
#define E_PAT   3 /* pattern template. */
 
#define ISHEXDIGIT(x)
 
#define ISOCTDIGIT(x)   (_T('0')<=(x) && (x)<=_T('7'))
 

Typedefs

typedef utchar owl::PatternType
 
typedef _TUCHAR owl::pattern
 

Enumerations

enum  owl::action { owl::M_BOL = (0x80 | _T('^')) , owl::M_EOL = (0x80 | _T('$')) , owl::M_ANY = (0x80 | _T('.')) , owl::M_CCL = (0x80 | _T('[')) , owl::M_OPT = (0x80 | _T('?')) , owl::M_CLOSE = (0x80 | _T('*')) , owl::M_PCLOSE = (0x80 | _T('+')) }
 

Functions

int owl::makepat (const tchar *exp, PatternType *pat, size_t maxpattern)
 
const tcharowl::matchs (const tchar *str, const PatternType *pat, tchar **startpat)
 
const tcharowl::patcmp (const tchar *, const pattern *, const tchar *)
 
int owl::esc (const tchar **)
 

Macro Definition Documentation

◆ ADVANCE

#define ADVANCE ( pat)    (pat += (*pat == (pattern)M_CCL) ? (MAPSIZE+1) : 1)

Definition at line 161 of file regexp.cpp.

◆ ANY

#define ANY   _T('.') /* matches any character */

Definition at line 123 of file regexp.cpp.

◆ BOL

#define BOL   _T('^') /* start-of-line anchor */

Definition at line 121 of file regexp.cpp.

◆ CCL

#define CCL   _T('[') /* start a character class */

Definition at line 124 of file regexp.cpp.

◆ CCLEND

#define CCLEND   _T(']') /* end a character class */

Definition at line 125 of file regexp.cpp.

◆ CLOSURE

#define CLOSURE   _T('*') /* Kleene closure (matches 0 or more) */

Definition at line 127 of file regexp.cpp.

◆ E_ILLEGAL

#define E_ILLEGAL   1 /* Set in makepat() to indicate prob- */

Definition at line 172 of file regexp.cpp.

◆ E_NOMEM

#define E_NOMEM   2 /* lems that came up while making the */

Definition at line 173 of file regexp.cpp.

◆ E_NONE

#define E_NONE   0 /* Possible return values from pat_err. */

Definition at line 171 of file regexp.cpp.

◆ E_PAT

#define E_PAT   3 /* pattern template. */

Definition at line 174 of file regexp.cpp.

◆ EOL

#define EOL   _T('$') /* end-of-line anchor */

Definition at line 122 of file regexp.cpp.

◆ IS_ACTION

#define IS_ACTION ( x)    ((x)&0x80) /* true => element of pat. string is an */

Definition at line 147 of file regexp.cpp.

◆ ISHEXDIGIT

#define ISHEXDIGIT ( x)
Value:
(_istdigit(x) \
|| (_T('a')<=(x) && (x)<=_T('f')) \
|| (_T('A')<=(x) && (x)<=_T('F')) )
#define _istdigit
Definition cygwin.h:70
#define _T(x)
Definition cygwin.h:51

Definition at line 525 of file regexp.cpp.

◆ ISOCTDIGIT

#define ISOCTDIGIT ( x)    (_T('0')<=(x) && (x)<=_T('7'))

Definition at line 529 of file regexp.cpp.

◆ MAPSIZE

#define MAPSIZE   16 /* need this many bytes for character class bit map */

Definition at line 151 of file regexp.cpp.

◆ NCCL

#define NCCL   _T('^') /* negates character class if 1st char. */

Definition at line 126 of file regexp.cpp.

◆ OPT

#define OPT   _T('?') /* Optional closure (0 or 1) */

Definition at line 129 of file regexp.cpp.

◆ PCLOSE

#define PCLOSE   _T('+') /* Positive closure (1 or more) */

Definition at line 128 of file regexp.cpp.

◆ SETBIT

#define SETBIT ( b,
map )   ((map)[((b) & 0x7f) >>3] |= pattern(1 << ((b) & 0x07)) )

Definition at line 168 of file regexp.cpp.

◆ TSTBIT

#define TSTBIT ( b,
map )   ((map)[((b) & 0x7f) >>3] & (1<< ((b) & 0x07)) )

Definition at line 169 of file regexp.cpp.