/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2012 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* posix regex implementation
*
* based on Doug McIlroy's C++ implementation
* Knuth-Morris-Pratt adapted from Corman-Leiserson-Rivest
* Boyer-Moore from conversations with David Korn, Phong Vo, Andrew Hume
*/
#ifndef _REGLIB_H
#define _REGLIB_H
typedef struct regsubop_s
{
} regsubop_t;
#define _REG_SUB_PRIVATE_ \
char* re_cur; /* re_buf cursor */ \
char* re_end; /* re_buf end */ \
#include <ast.h>
#include <cdt.h>
#include <stk.h>
#include "regex.h"
#include <ctype.h>
#include <errno.h>
#if _BLD_DEBUG && !defined(_AST_REGEX_DEBUG)
#endif
#define BRE 0
#include <wchar.h>
#if _hdr_wctype
#include <wctype.h>
#endif
#if !defined(iswblank) && !_lib_iswblank
extern int _reg_iswblank(wint_t);
#endif
#if !defined(towupper) && !_lib_towupper
#endif
#if !defined(towlower) && !_lib_towlower
#endif
#else
#ifndef iswalnum
#endif
#ifndef iswalpha
#endif
#ifndef iswcntrl
#endif
#ifndef iswdigit
#endif
#ifndef iswgraph
#endif
#ifndef iswlower
#endif
#ifndef iswprint
#endif
#ifndef iswpunct
#endif
#ifndef iswspace
#endif
#ifndef iswupper
#endif
#ifndef iswxdigit
#endif
#ifndef towlower
#endif
#ifndef towupper
#endif
#endif
#ifndef iswblank
#endif
#ifndef iswgraph
#endif
/*
* collation element support
*/
#if COLL_KEY_MAX < MB_LEN_MAX
#endif
#define COLL_end 0
typedef struct Celt_s
{
short typ;
short min;
short max;
} Celt_t;
/*
* private stuff hanging off regex_t
*/
typedef struct Stk_pos_s
{
char* base;
} Stk_pos_t;
typedef struct Vector_s
{
} Vector_t;
/*
* Rex_t subtypes
*/
typedef struct Cond_s
{
} Cond_t;
typedef struct Conj_left_s
{
} Conj_left_t;
typedef struct Conj_right_s
{
} Conj_right_t;
typedef unsigned int Bm_mask_t;
typedef struct Bm_s
{
} Bm_t;
typedef struct String_s
{
int* fail;
unsigned char* base;
} String_t;
typedef struct Set_s
{
} Set_t;
typedef struct Collate_s
{
int invert;
} Collate_t;
typedef struct Binary_s
{
int serial;
} Binary_t;
typedef struct Group_s
{
union
{
} expr;
} Group_t;
typedef struct Exec_s
{
void* data;
const char* text;
} Exec_t;
typedef struct Nest_s
{
int primary;
} Nest_t;
/*
* REX_ALT catcher, solely to get control at the end of an
* alternative to keep records for comparing matches.
*/
typedef struct Alt_catch_s
{
} Alt_catch_t;
typedef struct Group_catch_s
{
typedef struct Behind_catch_s
{
unsigned char* beg;
unsigned char* end;
/*
* REX_NEG catcher determines what string lengths can be matched,
* then Neg investigates continuations of other lengths.
* This is inefficient. For !POSITIONS expressions, we can do better:
* since matches to rex will be enumerated in decreasing order,
* we can investigate continuations whenever a length is skipped.
*/
typedef struct Neg_catch_s
{
unsigned char* beg;
unsigned char* index;
} Neg_catch_t;
/*
* REX_REP catcher. One is created on the stack for
* each iteration of a complex repetition.
*/
typedef struct Rep_catch_s
{
unsigned char* beg;
int n;
} Rep_catch_t;
/*
* data structure for an alternation of pure strings
* son points to a subtree of all strings with a common
* prefix ending in character c. sib links alternate
* letters in the same position of a word. end=1 if
* some word ends with c. the order of strings is
* irrelevant, except long words must be investigated
* before short ones.
*/
typedef struct Trie_node_s
{
unsigned char c;
unsigned char end;
} Trie_node_t;
typedef struct Trie_s
{
int min;
int max;
} Trie_t;
/*
* Rex_t is a node in a regular expression
*/
typedef struct Rex_s
{
int explicit; /* scoped explicit match*/
union
{
} re;
} Rex_t;
{
int explicit; /* explicit match on this char */
} Env_t;
{
{
struct
{
unsigned char key;
int fatal;
int initialized;
} State_t;
extern regclass_t classfun(int);
#endif