edbee - Qt Editor Library
textlexer.h
Go to the documentation of this file.
1 
6 #pragma once
7 
9 
10 namespace edbee {
11 
12 class TextGrammar;
13 class TextDocument;
14 class TextDocumentScopes;
15 
17 class TextLexer
18 {
19 public:
20  TextLexer( TextDocumentScopes* scopes );
21  virtual ~TextLexer() {}
22 
24 // virtual void textReplaced( int offset, int length, int newLength ) = 0;
25  virtual void textChanged( const edbee::TextBufferChange& change ) = 0;
26 
27 
30  inline TextGrammar* grammar() { return grammarRef_; }
31 
38  virtual void lexRange( int beginOffset, int endOffset ) = 0;
39 
40 
41  TextDocumentScopes* textScopes() { return textDocumentScopesRef_; }
43 
44 private:
45  TextDocumentScopes* textDocumentScopesRef_;
46  TextGrammar* grammarRef_;
47 };
48 
49 } // edbee
This is the base and abstract class of a text document A TextDocument is the model part of the editor...
Definition: textdocument.h:40
This clas represents a text buffer change and is used to pass around between events This is a sharedd...
Definition: textbuffer.h:45
TextDocumentScopes * textScopes()
Definition: textlexer.h:41
virtual void lexRange(int beginOffset, int endOffset)=0
This method is called when the given range needs to be lexed WARNING, this method must be VERY optimi...
Copyright 2011-2013 - Reliable Bits Software by Blommers IT.
Definition: commentcommand.cpp:22
This class defines a single language grammar.
Definition: textgrammar.h:125
void setGrammar(TextGrammar *grammar)
This method is called to notify the lexer the grammar has been changed.
Definition: textlexer.cpp:21
This class is used to 'contain' all document scope information.
Definition: textdocumentscopes.h:325
virtual void textChanged(const edbee::TextBufferChange &change)=0
This method is called to notify the lexer some data has been changed.
TextGrammar * grammar()
Definition: textlexer.h:30
virtual ~TextLexer()
Definition: textlexer.h:21
This is a single lexer.
Definition: textlexer.h:17
TextDocument * textDocument()
This method returns the text document.
Definition: textlexer.cpp:30
TextLexer(TextDocumentScopes *scopes)
Definition: textlexer.cpp:15