edbee - Qt Editor Library
Public Member Functions | List of all members
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. More...
 
virtual ~GrammarTextLexer ()
 The destructor. More...
 
virtual void textChanged (const TextBufferChange &change)
 This method is called to notify the lexer some data has been changed. More...
 
virtual void lexLines (int line, int lineCount)
 This method lexes a range of line. More...
 
virtual void lexRange (int beginOffset, int endOffset)
 This method is called when the given range needs to be lexed. More...
 
- 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. More...
 
TextGrammargrammar ()
 
TextDocumentScopestextScopes ()
 
TextDocumenttextDocument ()
 This method returns the text document. More...
 

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: