scintilla: Update scintilla with changeset 3662:1d1c06df8a2f using gtk+3
[anjuta-extras.git] / plugins / scintilla / scintilla / LexerBase.cxx
blobea5734d2476e0c0ddfa2dedcdc35031500fbe11f
1 // Scintilla source code edit control
2 /** @file LexerSimple.cxx
3 ** A simple lexer with no state.
4 **/
5 // Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
8 #include <stdlib.h>
9 #include <string.h>
10 #include <stdio.h>
11 #include <stdarg.h>
12 #include <assert.h>
13 #include <ctype.h>
15 #include "ILexer.h"
16 #include "Scintilla.h"
17 #include "SciLexer.h"
19 #include "PropSetSimple.h"
20 #include "WordList.h"
21 #include "LexAccessor.h"
22 #include "Accessor.h"
23 #include "LexerModule.h"
24 #include "LexerBase.h"
26 #ifdef SCI_NAMESPACE
27 using namespace Scintilla;
28 #endif
30 LexerBase::LexerBase() {
31 for (int wl = 0; wl < numWordLists; wl++)
32 keyWordLists[wl] = new WordList;
33 keyWordLists[numWordLists] = 0;
36 LexerBase::~LexerBase() {
37 for (int wl = 0; wl < numWordLists; wl++) {
38 delete keyWordLists[wl];
39 keyWordLists[wl] = 0;
41 keyWordLists[numWordLists] = 0;
44 void SCI_METHOD LexerBase::Release() {
45 delete this;
48 int SCI_METHOD LexerBase::Version() const {
49 return lvOriginal;
52 const char * SCI_METHOD LexerBase::PropertyNames() {
53 return "";
56 int SCI_METHOD LexerBase::PropertyType(const char *) {
57 return SC_TYPE_BOOLEAN;
60 const char * SCI_METHOD LexerBase::DescribeProperty(const char *) {
61 return "";
64 int SCI_METHOD LexerBase::PropertySet(const char *key, const char *val) {
65 const char *valOld = props.Get(key);
66 if (strcmp(val, valOld) != 0) {
67 props.Set(key, val);
68 return 0;
69 } else {
70 return -1;
74 const char * SCI_METHOD LexerBase::DescribeWordListSets() {
75 return "";
78 int SCI_METHOD LexerBase::WordListSet(int n, const char *wl) {
79 if (n < numWordLists) {
80 WordList wlNew;
81 wlNew.Set(wl);
82 if (*keyWordLists[n] != wlNew) {
83 keyWordLists[n]->Set(wl);
84 return 0;
87 return -1;
90 void * SCI_METHOD LexerBase::PrivateCall(int, void *) {
91 return 0;