2010-08-21 23:59:56 +00:00
|
|
|
// Scintilla source code edit control
|
|
|
|
/** @file LexerBase.h
|
|
|
|
** A simple lexer with no state.
|
|
|
|
**/
|
|
|
|
// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
|
|
|
|
// The License.txt file describes the conditions under which this software may be distributed.
|
|
|
|
|
|
|
|
#ifndef LEXERBASE_H
|
|
|
|
#define LEXERBASE_H
|
|
|
|
|
|
|
|
namespace Scintilla {
|
|
|
|
|
|
|
|
// A simple lexer with no state
|
2021-02-21 04:53:09 +00:00
|
|
|
class LexerBase : public ILexer5 {
|
2010-08-21 23:59:56 +00:00
|
|
|
protected:
|
2019-05-04 18:14:48 +00:00
|
|
|
const LexicalClass *lexClasses;
|
|
|
|
size_t nClasses;
|
2010-08-21 23:59:56 +00:00
|
|
|
PropSetSimple props;
|
|
|
|
enum {numWordLists=KEYWORDSET_MAX+1};
|
|
|
|
WordList *keyWordLists[numWordLists+1];
|
|
|
|
public:
|
2019-05-04 18:14:48 +00:00
|
|
|
LexerBase(const LexicalClass *lexClasses_=nullptr, size_t nClasses_=0);
|
2011-03-22 00:16:49 +00:00
|
|
|
virtual ~LexerBase();
|
2019-05-04 18:14:48 +00:00
|
|
|
void SCI_METHOD Release() override;
|
|
|
|
int SCI_METHOD Version() const override;
|
|
|
|
const char * SCI_METHOD PropertyNames() override;
|
|
|
|
int SCI_METHOD PropertyType(const char *name) override;
|
|
|
|
const char * SCI_METHOD DescribeProperty(const char *name) override;
|
|
|
|
Sci_Position SCI_METHOD PropertySet(const char *key, const char *val) override;
|
|
|
|
const char * SCI_METHOD DescribeWordListSets() override;
|
|
|
|
Sci_Position SCI_METHOD WordListSet(int n, const char *wl) override;
|
|
|
|
void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) override = 0;
|
|
|
|
void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) override = 0;
|
|
|
|
void * SCI_METHOD PrivateCall(int operation, void *pointer) override;
|
|
|
|
int SCI_METHOD LineEndTypesSupported() override;
|
|
|
|
int SCI_METHOD AllocateSubStyles(int styleBase, int numberStyles) override;
|
|
|
|
int SCI_METHOD SubStylesStart(int styleBase) override;
|
|
|
|
int SCI_METHOD SubStylesLength(int styleBase) override;
|
|
|
|
int SCI_METHOD StyleFromSubStyle(int subStyle) override;
|
|
|
|
int SCI_METHOD PrimaryStyleFromStyle(int style) override;
|
|
|
|
void SCI_METHOD FreeSubStyles() override;
|
|
|
|
void SCI_METHOD SetIdentifiers(int style, const char *identifiers) override;
|
|
|
|
int SCI_METHOD DistanceToSecondaryStyles() override;
|
|
|
|
const char * SCI_METHOD GetSubStyleBases() override;
|
|
|
|
int SCI_METHOD NamedStyles() override;
|
|
|
|
const char * SCI_METHOD NameOfStyle(int style) override;
|
|
|
|
const char * SCI_METHOD TagsOfStyle(int style) override;
|
|
|
|
const char * SCI_METHOD DescriptionOfStyle(int style) override;
|
2021-02-21 04:53:09 +00:00
|
|
|
// ILexer5 methods
|
|
|
|
const char * SCI_METHOD GetName() override;
|
|
|
|
int SCI_METHOD GetIdentifier() override;
|
|
|
|
const char *SCI_METHOD PropertyGet(const char *key) override;
|
2010-08-21 23:59:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|