1 // Scintilla source code edit control
\r
3 ** Interface to the regular expression search library.
\r
5 // Written by Neil Hodgson <neilh@scintilla.org>
\r
6 // Based on the work of Ozan S. Yigit.
\r
7 // This file is in the public domain.
\r
12 #ifdef SCI_NAMESPACE
\r
13 namespace Scintilla {
\r
17 * The following defines are not meant to be changeable.
\r
18 * They are for readability only.
\r
22 #define BITBLK MAXCHR/CHRBIT
\r
24 class CharacterIndexer {
\r
26 virtual char CharAt(int index)=0;
\r
27 virtual ~CharacterIndexer() {
\r
34 RESearch(CharClassify *charClassTable);
\r
36 bool GrabMatches(CharacterIndexer &ci);
\r
37 const char *Compile(const char *pattern, int length, bool caseSensitive, bool posix);
\r
38 int Execute(CharacterIndexer &ci, int lp, int endp);
\r
39 int Substitute(CharacterIndexer &ci, char *src, char *dst);
\r
42 enum { MAXNFA=2048 };
\r
43 enum { NOTFOUND=-1 };
\r
52 void ChSet(unsigned char c);
\r
53 void ChSetWithCase(unsigned char c, bool caseSensitive);
\r
54 int GetBackslashExpression(const char *pattern, int &incr);
\r
56 int PMatch(CharacterIndexer &ci, int lp, int endp, char *ap);
\r
59 int tagstk[MAXTAG]; /* subpat tag stack */
\r
60 char nfa[MAXNFA]; /* automaton */
\r
62 unsigned char bittab[BITBLK]; /* bit table for CCL pre-set bits */
\r
64 CharClassify *charClass;
\r
65 bool iswordc(unsigned char x) {
\r
66 return charClass->IsWord(x);
\r
70 #ifdef SCI_NAMESPACE
\r