diff options
author | nyamatongwe <unknown> | 2001-04-13 04:55:04 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2001-04-13 04:55:04 +0000 |
commit | 3e36fa6f3ea27bb64ce42bdd1a5b50b52dc6bb04 (patch) | |
tree | 72f9058f86ae76bf8d6131a4e80d87549b4770ad /include/KeyWords.h | |
parent | c9925ce492d3ea61e692769c2733d69eed133993 (diff) | |
download | scintilla-mirror-3e36fa6f3ea27bb64ce42bdd1a5b50b52dc6bb04.tar.gz |
Start of new lexer infrastructure.
Lexers can have a fold function as well as a lexer function.
They can be identified by string name as well as an integer ID and may
ask to be automatically assigned that ID.
Diffstat (limited to 'include/KeyWords.h')
-rw-r--r-- | include/KeyWords.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/include/KeyWords.h b/include/KeyWords.h index d589d1228..43de26fe6 100644 --- a/include/KeyWords.h +++ b/include/KeyWords.h @@ -9,17 +9,30 @@ typedef void (*LexerFunction)(unsigned int startPos, int lengthDoc, int initStyl WordList *keywordlists[], Accessor &styler); /** + * A LexerModule is responsible for lexing and folding a particular language. + * The class maintains a list of LexerModules which can be searched to find a + * module appropriate to a particular language. */ class LexerModule { - static LexerModule *base; LexerModule *next; int language; - LexerFunction fn; + const char *languageName; + LexerFunction fnLexer; + LexerFunction fnFolder; + + static LexerModule *base; + static int nextLanguage; public: - LexerModule(int language_, LexerFunction fn_); - static void Colourise(unsigned int startPos, int lengthDoc, int initStyle, - int language, WordList *keywordlists[], Accessor &styler); + LexerModule(int language_, LexerFunction fnLexer_, + const char *languageName_=0, LexerFunction fnFolder_=0); + int GetLanguage() { return language; } + void Lex(unsigned int startPos, int lengthDoc, int initStyle, + WordList *keywordlists[], Accessor &styler); + void Fold(unsigned int startPos, int lengthDoc, int initStyle, + WordList *keywordlists[], Accessor &styler); + static LexerModule *Find(int language); + static LexerModule *Find(const char *languageName); }; /** |