NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
LexMatlab.cxx File Reference
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
#include <ctype.h>
#include "ILexer.h"
#include "Scintilla.h"
#include "SciLexer.h"
#include "WordList.h"
#include "LexAccessor.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "CharacterSet.h"
#include "LexerModule.h"
Include dependency graph for LexMatlab.cxx:

Go to the source code of this file.

Functions

static bool IsMatlabCommentChar (int c)
 
static bool IsOctaveCommentChar (int c)
 
static bool IsMatlabComment (Accessor &styler, int pos, int len)
 
static bool IsOctaveComment (Accessor &styler, int pos, int len)
 
static bool IsAWordChar (const int ch)
 
static bool IsAWordStart (const int ch)
 
static int GetParenthesesCount (unsigned int startPos, Accessor &styler)
 
static void ColouriseMatlabOctaveDoc (unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler, bool(*IsCommentChar)(int))
 
static void ColouriseMatlabDoc (unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler)
 
static void ColouriseOctaveDoc (unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler)
 
static void FoldMatlabOctaveDoc (unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler, bool(*IsComment)(Accessor &, int, int))
 
static void FoldMatlabDoc (unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler)
 
static void FoldOctaveDoc (unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler)
 
LexerModule lmMatlab (SCLEX_MATLAB, ColouriseMatlabDoc, "matlab", FoldMatlabDoc, matlabWordListDesc)
 
LexerModule lmOctave (SCLEX_OCTAVE, ColouriseOctaveDoc, "octave", FoldOctaveDoc, octaveWordListDesc)
 

Variables

static const char *const matlabWordListDesc []
 
static const char *const octaveWordListDesc []
 

Detailed Description

Lexer for Matlab. Written by José Fonseca

Changes by Christoph Dalitz 2003/12/04:

  • added support for Octave
  • Strings can now be included both in single or double quotes

Definition in file LexMatlab.cxx.

Function Documentation

◆ ColouriseMatlabDoc()

static void ColouriseMatlabDoc ( unsigned int  startPos,
int  length,
int  initStyle,
WordList *  keywordlists[],
Accessor &  styler 
)
static

Definition at line 201 of file LexMatlab.cxx.

References ColouriseMatlabOctaveDoc(), and IsMatlabCommentChar().

Here is the call graph for this function:

◆ ColouriseMatlabOctaveDoc()

static void ColouriseMatlabOctaveDoc ( unsigned int  startPos,
int  length,
int  initStyle,
WordList *  keywordlists[],
Accessor &  styler,
bool(*)(int)  IsCommentChar 
)
static

Definition at line 79 of file LexMatlab.cxx.

References GetParenthesesCount(), SCE_MATLAB_COMMAND, SCE_MATLAB_COMMENT, SCE_MATLAB_DEFAULT, SCE_MATLAB_DOUBLEQUOTESTRING, SCE_MATLAB_FUNCTIONS, SCE_MATLAB_IDENTIFIER, SCE_MATLAB_KEYWORD, SCE_MATLAB_NUMBER, SCE_MATLAB_OPERATOR, and SCE_MATLAB_STRING.

Referenced by ColouriseMatlabDoc(), and ColouriseOctaveDoc().

Here is the call graph for this function:

◆ ColouriseOctaveDoc()

static void ColouriseOctaveDoc ( unsigned int  startPos,
int  length,
int  initStyle,
WordList *  keywordlists[],
Accessor &  styler 
)
static

Definition at line 206 of file LexMatlab.cxx.

References ColouriseMatlabOctaveDoc(), and IsOctaveCommentChar().

Here is the call graph for this function:

◆ FoldMatlabDoc()

static void FoldMatlabDoc ( unsigned int  startPos,
int  length,
int  initStyle,
WordList *  keywordlists[],
Accessor &  styler 
)
static

Definition at line 367 of file LexMatlab.cxx.

References FoldMatlabOctaveDoc(), and IsMatlabComment().

Here is the call graph for this function:

◆ FoldMatlabOctaveDoc()

static void FoldMatlabOctaveDoc ( unsigned int  startPos,
int  length,
int  initStyle,
WordList *  [],
Accessor &  styler,
bool(*)(Accessor &, int, int)  IsComment 
)
static

Definition at line 211 of file LexMatlab.cxx.

References SCE_MATLAB_KEYWORD, and SCE_MATLAB_OPERATOR.

Referenced by FoldMatlabDoc(), and FoldOctaveDoc().

◆ FoldOctaveDoc()

static void FoldOctaveDoc ( unsigned int  startPos,
int  length,
int  initStyle,
WordList *  keywordlists[],
Accessor &  styler 
)
static

Definition at line 372 of file LexMatlab.cxx.

References FoldMatlabOctaveDoc(), and IsOctaveComment().

Here is the call graph for this function:

◆ GetParenthesesCount()

static int GetParenthesesCount ( unsigned int  startPos,
Accessor &  styler 
)
static

Definition at line 62 of file LexMatlab.cxx.

References SCE_MATLAB_DEFAULT, and SCE_MATLAB_OPERATOR.

Referenced by ColouriseMatlabOctaveDoc().

◆ IsAWordChar()

static bool IsAWordChar ( const int  ch)
inlinestatic

Definition at line 51 of file LexMatlab.cxx.

◆ IsAWordStart()

static bool IsAWordStart ( const int  ch)
inlinestatic

Definition at line 55 of file LexMatlab.cxx.

◆ IsMatlabComment()

static bool IsMatlabComment ( Accessor &  styler,
int  pos,
int  len 
)
static

Definition at line 43 of file LexMatlab.cxx.

References IsMatlabCommentChar().

Referenced by FoldMatlabDoc().

Here is the call graph for this function:

◆ IsMatlabCommentChar()

static bool IsMatlabCommentChar ( int  c)
static

Definition at line 35 of file LexMatlab.cxx.

Referenced by ColouriseMatlabDoc(), and IsMatlabComment().

◆ IsOctaveComment()

static bool IsOctaveComment ( Accessor &  styler,
int  pos,
int  len 
)
static

Definition at line 47 of file LexMatlab.cxx.

References IsOctaveCommentChar().

Referenced by FoldOctaveDoc().

Here is the call graph for this function:

◆ IsOctaveCommentChar()

static bool IsOctaveCommentChar ( int  c)
static

Definition at line 39 of file LexMatlab.cxx.

Referenced by ColouriseOctaveDoc(), and IsOctaveComment().

◆ lmMatlab()

LexerModule lmMatlab ( SCLEX_MATLAB  ,
ColouriseMatlabDoc  ,
"matlab"  ,
FoldMatlabDoc  ,
matlabWordListDesc   
)

Referenced by Scintilla_LinkLexers().

◆ lmOctave()

LexerModule lmOctave ( SCLEX_OCTAVE  ,
ColouriseOctaveDoc  ,
"octave"  ,
FoldOctaveDoc  ,
octaveWordListDesc   
)

Referenced by Scintilla_LinkLexers().

Variable Documentation

◆ matlabWordListDesc

const char* const matlabWordListDesc[]
static
Initial value:
= {
"Keywords",
0
}

Definition at line 378 of file LexMatlab.cxx.

◆ octaveWordListDesc

const char* const octaveWordListDesc[]
static
Initial value:
= {
"Keywords",
0
}

Definition at line 383 of file LexMatlab.cxx.