aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/KeyWords.h
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2001-04-13 04:55:04 +0000
committernyamatongwe <devnull@localhost>2001-04-13 04:55:04 +0000
commita1008c54ed13feeb5d1a0dc3ebf3f8c908d541ba (patch)
tree72f9058f86ae76bf8d6131a4e80d87549b4770ad /include/KeyWords.h
parent917e46a21acff859faffb292b28f9c063caf2b92 (diff)
downloadscintilla-mirror-a1008c54ed13feeb5d1a0dc3ebf3f8c908d541ba.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.h23
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);
};
/**