Use tm_parser_scope_separator() instead of symbols_get_context_separator()
[geany-mirror.git] / scintilla / src / RESearch.h
blob306d1b3d1fffaf3e6314c8d8fc42ee6afc50240e
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
12 namespace Scintilla::Internal {
14 class CharacterIndexer {
15 public:
16 virtual char CharAt(Sci::Position index) const=0;
17 virtual ~CharacterIndexer() {
21 class RESearch {
23 public:
24 explicit RESearch(CharClassify *charClassTable);
25 // No dynamic allocation so default copy constructor and assignment operator are OK.
26 void Clear() noexcept;
27 void GrabMatches(const CharacterIndexer &ci);
28 const char *Compile(const char *pattern, Sci::Position length, bool caseSensitive, bool posix) noexcept;
29 int Execute(const CharacterIndexer &ci, Sci::Position lp, Sci::Position endp);
31 static constexpr int MAXTAG = 10;
32 static constexpr int NOTFOUND = -1;
34 Sci::Position bopat[MAXTAG];
35 Sci::Position eopat[MAXTAG];
36 std::string pat[MAXTAG];
38 private:
40 static constexpr int MAXNFA = 4096;
41 // The following constants are not meant to be changeable.
42 // They are for readability only.
43 static constexpr int MAXCHR = 256;
44 static constexpr int CHRBIT = 8;
45 static constexpr int BITBLK = MAXCHR / CHRBIT;
47 void ChSet(unsigned char c) noexcept;
48 void ChSetWithCase(unsigned char c, bool caseSensitive) noexcept;
49 int GetBackslashExpression(const char *pattern, int &incr) noexcept;
51 Sci::Position PMatch(const CharacterIndexer &ci, Sci::Position lp, Sci::Position endp, char *ap);
53 Sci::Position bol;
54 Sci::Position tagstk[MAXTAG]; /* subpat tag stack */
55 char nfa[MAXNFA]; /* automaton */
56 int sta;
57 unsigned char bittab[BITBLK]; /* bit table for CCL pre-set bits */
58 int failure;
59 CharClassify *charClass;
60 bool iswordc(unsigned char x) const noexcept {
61 return charClass->IsWord(x);
67 #endif