]>
git.saurik.com Git - wxWidgets.git/blob - src/stc/scintilla/lexlib/LexerSimple.cxx
   1 // Scintilla source code edit control 
   2 /** @file LexerSimple.cxx 
   3  ** A simple lexer with no state. 
   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. 
  18 #include "Scintilla.h" 
  21 #include "PropSetSimple.h" 
  23 #include "LexAccessor.h" 
  25 #include "LexerModule.h" 
  26 #include "LexerBase.h" 
  27 #include "LexerSimple.h" 
  30 using namespace Scintilla
; 
  33 LexerSimple::LexerSimple(const LexerModule 
*module_
) : module(module_
) { 
  34         for (int wl 
= 0; wl 
< module->GetNumWordLists(); wl
++) { 
  35                 if (!wordLists
.empty()) 
  37                 wordLists 
+= module->GetWordListDescription(wl
); 
  41 const char * SCI_METHOD 
LexerSimple::DescribeWordListSets() { 
  42         return wordLists
.c_str(); 
  45 void SCI_METHOD 
LexerSimple::Lex(unsigned int startPos
, int lengthDoc
, int initStyle
, IDocument 
*pAccess
) { 
  46         Accessor 
astyler(pAccess
, &props
); 
  47         module->Lex(startPos
, lengthDoc
, initStyle
, keyWordLists
, astyler
); 
  51 void SCI_METHOD 
LexerSimple::Fold(unsigned int startPos
, int lengthDoc
, int initStyle
, IDocument 
*pAccess
) { 
  52         if (props
.GetInt("fold")) { 
  53                 Accessor 
astyler(pAccess
, &props
); 
  54                 module->Fold(startPos
, lengthDoc
, initStyle
, keyWordLists
, astyler
);