⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 research.h

📁 非常好用的可移植的多平台C/C++源代码编辑器
💻 H
字号:
// Scintilla source code edit control
/** @file RESearch.h
 ** Interface to the regular expression search library.
 **/
// Written by Neil Hodgson <neilh@scintilla.org>
// Based on the work of Ozan S. Yigit.
// This file is in the public domain.

#ifndef RESEARCH_H
#define RESEARCH_H

/*
 * The following defines are not meant to be changeable.
 * They are for readability only.
 */
#define MAXCHR	256
#define CHRBIT	8
#define BITBLK	MAXCHR/CHRBIT

class CharacterIndexer {
public: 
	virtual char CharAt(int index)=0;
};

class RESearch {

public:
	RESearch();
	~RESearch();
	void Init();
	void Clear();
	bool GrabMatches(CharacterIndexer &ci);
	void ChSet(char c);
	void ChSetWithCase(char c, bool caseSensitive);
	const char *Compile(const char *pat, int length, bool caseSensitive, bool posix);
	int Execute(CharacterIndexer &ci, int lp, int endp);
	void ModifyWord(char *s);
	int Substitute(CharacterIndexer &ci, char *src, char *dst);

	enum {MAXTAG=10};
	enum {MAXNFA=2048};
	enum {NOTFOUND=-1};

	int bopat[MAXTAG];
	int eopat[MAXTAG];
	char *pat[MAXTAG];

private:
	int PMatch(CharacterIndexer &ci, int lp, int endp, char *ap);

	int bol;
	int  tagstk[MAXTAG];             /* subpat tag stack..*/
	char nfa[MAXNFA];		/* automaton..       */
	int sta;
	char bittab[BITBLK];		/* bit table for CCL */
						/* pre-set bits...   */
	int failure;
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -