*** empty log message ***
[anjuta-git-plugin.git] / scintilla / RESearch.h
blob8ca9cd0b825608ebd24729430cdde3dbd3f471dc
1 // Scintilla source code edit control
2 /** @file RESearch.h
3 ** Interface to the regular expression search library.
4 **/
5 // Written by Neil Hodgson <neilh@scintilla.org>
6 // Based on the work of Ozan S. Yigit.
7 // This file is in the public domain.
9 #ifndef RESEARCH_H
10 #define RESEARCH_H
13 * The following defines are not meant to be changeable.
14 * They are for readability only.
16 #define MAXCHR 256
17 #define CHRBIT 8
18 #define BITBLK MAXCHR/CHRBIT
20 class CharacterIndexer {
21 public:
22 virtual char CharAt(int index)=0;
25 class RESearch {
27 public:
28 RESearch();
29 ~RESearch();
30 void Init();
31 void Clear();
32 bool GrabMatches(CharacterIndexer &ci);
33 void ChSet(char c);
34 void ChSetWithCase(char c, bool caseSensitive);
35 const char *Compile(const char *pat, int length, bool caseSensitive, bool posix);
36 int Execute(CharacterIndexer &ci, int lp, int endp);
37 void ModifyWord(char *s);
38 int Substitute(CharacterIndexer &ci, char *src, char *dst);
40 enum {MAXTAG=10};
41 enum {MAXNFA=2048};
42 enum {NOTFOUND=-1};
44 int bopat[MAXTAG];
45 int eopat[MAXTAG];
46 char *pat[MAXTAG];
48 private:
49 int PMatch(CharacterIndexer &ci, int lp, int endp, char *ap);
51 int bol;
52 int tagstk[MAXTAG]; /* subpat tag stack..*/
53 char nfa[MAXNFA]; /* automaton.. */
54 int sta;
55 char bittab[BITBLK]; /* bit table for CCL */
56 /* pre-set bits... */
57 int failure;
60 #endif