edbee - Qt Editor Library v0.11.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
edbee::GrammarTextLexer Class Reference

A simple lexer matches texts with simple regular expressions. More...

#include <grammartextlexer.h>

+ Inheritance diagram for edbee::GrammarTextLexer:
+ Collaboration diagram for edbee::GrammarTextLexer:

Public Member Functions

 GrammarTextLexer (TextDocumentScopes *scopes)
 Constructs the grammar textlexer.
 
virtual ~GrammarTextLexer ()
 The destructor.
 
virtual void textChanged (const TextBufferChange &change)
 This method is called to notify the lexer some data has been changed.
 
virtual void lexLines (int line, int lineCount)
 This method lexes a range of line.
 
virtual void lexRange (int beginOffset, int endOffset)
 This method is called when the given range needs to be lexed.
 
- Public Member Functions inherited from edbee::TextLexer
 TextLexer (TextDocumentScopes *scopes)
 
virtual ~TextLexer ()
 
void setGrammar (TextGrammar *grammar)
 This method is called to notify the lexer the grammar has been changed.
 
TextGrammargrammar ()
 
TextDocumentScopestextScopes ()
 
TextDocumenttextDocument ()
 This method returns the text document.
 

Detailed Description

A simple lexer matches texts with simple regular expressions.

Constructor & Destructor Documentation

◆ GrammarTextLexer()

edbee::GrammarTextLexer::GrammarTextLexer ( TextDocumentScopes * scopes)

Constructs the grammar textlexer.

Parameters
scopesa reference to the scopes model

◆ ~GrammarTextLexer()

edbee::GrammarTextLexer::~GrammarTextLexer ( )
virtual

The destructor.

Member Function Documentation

◆ lexLines()

void edbee::GrammarTextLexer::lexLines ( int lineStart,
int lineCount )
virtual

This method lexes a range of line.

Returns
the last indexed offset

◆ lexRange()

void edbee::GrammarTextLexer::lexRange ( int beginOffset,
int endOffset )
virtual

This method is called when the given range needs to be lexed.

WARNING, this method must be VERY optimized and should 'remember' the lexing states between calls. To invalidate the scopes/lexing state the textReplaced method can be used

Parameters
beginOffsetthe first offset
endOffsetthe last offset to

Implements edbee::TextLexer.

◆ textChanged()

void edbee::GrammarTextLexer::textChanged ( const TextBufferChange & change)
virtual

This method is called to notify the lexer some data has been changed.

Todo
: rebuild an optimized scope-rebuilding algorithm

Implements edbee::TextLexer.


The documentation for this class was generated from the following files: