NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
LexOthers.cxx File Reference
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
#include <ctype.h>
#include <string>
#include <map>
#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 "OptionSet.h"
Include dependency graph for LexOthers.cxx:

Go to the source code of this file.

Classes

struct  OptionsNSCR
 
struct  OptionSetNSCR
 
class  LexerNSCR
 
struct  OptionsNPRC
 
struct  OptionSetNPRC
 
class  LexerNPRC
 
class  LexerTXTADV
 

Macros

#define DIFF_BUFFER_START_SIZE   16
 
#define SCE_TXTADV_POSSIB_URL   20
 

Functions

static bool strstart (const char *haystack, const char *needle)
 
static bool Is0To9 (char ch)
 
static bool Is1To9 (char ch)
 
static bool IsAlphabetic (int ch)
 
static bool AtEOL (Accessor &styler, unsigned int i)
 
static bool IsBOperator (char ch)
 
static bool IsBSeparator (char ch)
 
static void ColouriseBatchLine (char *lineBuffer, unsigned int lengthLine, unsigned int startLine, unsigned int endPos, WordList *keywordlists[], Accessor &styler)
 
static void ColouriseBatchDoc (unsigned int startPos, int length, int, WordList *keywordlists[], Accessor &styler)
 
static void ColouriseDiffLine (char *lineBuffer, int endLine, Accessor &styler)
 
static void ColouriseDiffDoc (unsigned int startPos, int length, int, WordList *[], Accessor &styler)
 
static void FoldDiffDoc (unsigned int startPos, int length, int, WordList *[], Accessor &styler)
 
static void ColourisePoLine (char *lineBuffer, unsigned int lengthLine, unsigned int startLine, unsigned int endPos, Accessor &styler)
 
static void ColourisePoDoc (unsigned int startPos, int length, int, WordList *[], Accessor &styler)
 
static bool isassignchar (unsigned char ch)
 
static void ColourisePropsLine (char *lineBuffer, unsigned int lengthLine, unsigned int startLine, unsigned int endPos, Accessor &styler, bool allowInitialSpaces)
 
static void ColourisePropsDoc (unsigned int startPos, int length, int, WordList *[], Accessor &styler)
 
static void FoldPropsDoc (unsigned int startPos, int length, int, WordList *[], Accessor &styler)
 
static void ColouriseMakeLine (char *lineBuffer, unsigned int lengthLine, unsigned int startLine, unsigned int endPos, Accessor &styler)
 
static void ColouriseMakeDoc (unsigned int startPos, int length, int, WordList *[], Accessor &styler)
 
static int RecogniseErrorListLine (const char *lineBuffer, unsigned int lengthLine, int &startValue)
 
static void ColouriseErrorListLine (char *lineBuffer, unsigned int lengthLine, unsigned int endPos, Accessor &styler, bool valueSeparate)
 
static void ColouriseErrorListDoc (unsigned int startPos, int length, int, WordList *[], Accessor &styler)
 
static bool latexIsSpecial (int ch)
 
static bool latexIsBlank (int ch)
 
static bool latexIsBlankAndNL (int ch)
 
static bool latexIsLetter (int ch)
 
static bool latexIsTagValid (int &i, int l, Accessor &styler)
 
static bool latexNextNotBlankIs (int i, int l, Accessor &styler, char needle)
 
static bool latexLastWordIs (int start, Accessor &styler, const char *needle)
 
static void ColouriseLatexDoc (unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler)
 
static void ColouriseNullDoc (unsigned int startPos, int length, int, WordList *[], Accessor &styler)
 
static bool IsWordStart (int ch)
 
static bool IsWord (int ch)
 
static bool IsOperator (int ch)
 
static bool IsStringSuffix (int ch)
 
static bool IsStreamCommentStyle (int style)
 
LexerModule lmNSCR (SCLEX_NSCR, LexerNSCR::LexerFactoryNSCR, "NSCR", NSCRWordLists)
 
LexerModule lmNPRC (SCLEX_NPRC, LexerNPRC::LexerFactoryNPRC, "NPRC", NPRCWordLists)
 
LexerModule lmTXTADV (SCLEX_TXTADV, LexerTXTADV::LexerFactoryTXTADV, "TXTADV", emptyWordListDesc)
 
LexerModule lmBatch (SCLEX_BATCH, ColouriseBatchDoc, "batch", 0, batchWordListDesc)
 
LexerModule lmDiff (SCLEX_DIFF, ColouriseDiffDoc, "diff", FoldDiffDoc, emptyWordListDesc)
 
LexerModule lmPo (SCLEX_PO, ColourisePoDoc, "po", 0, emptyWordListDesc)
 
LexerModule lmProps (SCLEX_PROPERTIES, ColourisePropsDoc, "props", FoldPropsDoc, emptyWordListDesc)
 
LexerModule lmMake (SCLEX_MAKEFILE, ColouriseMakeDoc, "makefile", 0, emptyWordListDesc)
 
LexerModule lmErrorList (SCLEX_ERRORLIST, ColouriseErrorListDoc, "errorlist", 0, emptyWordListDesc)
 
LexerModule lmLatex (SCLEX_LATEX, ColouriseLatexDoc, "latex", 0, emptyWordListDesc)
 
LexerModule lmNull (SCLEX_NULL, ColouriseNullDoc, "null")
 

Variables

static const char *const batchWordListDesc []
 
static const char *const emptyWordListDesc []
 
static const char *const NSCRWordLists []
 
static const char *const NPRCWordLists []
 

Detailed Description

Lexers for batch files, diff results, properties files, make files and error lists. Also lexer for LaTeX documents.

Definition in file LexOthers.cxx.

Macro Definition Documentation

◆ DIFF_BUFFER_START_SIZE

#define DIFF_BUFFER_START_SIZE   16

Definition at line 507 of file LexOthers.cxx.

◆ SCE_TXTADV_POSSIB_URL

#define SCE_TXTADV_POSSIB_URL   20

Definition at line 3031 of file LexOthers.cxx.

Function Documentation

◆ AtEOL()

static bool AtEOL ( Accessor &  styler,
unsigned int  i 
)
inlinestatic

◆ ColouriseBatchDoc()

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

Definition at line 477 of file LexOthers.cxx.

References AtEOL(), and ColouriseBatchLine().

Here is the call graph for this function:

◆ ColouriseBatchLine()

static void ColouriseBatchLine ( char *  lineBuffer,
unsigned int  lengthLine,
unsigned int  startLine,
unsigned int  endPos,
WordList *  keywordlists[],
Accessor &  styler 
)
static

Definition at line 68 of file LexOthers.cxx.

References Is0To9(), IsAlphabetic(), IsBOperator(), IsBSeparator(), SCE_BAT_COMMAND, SCE_BAT_COMMENT, SCE_BAT_DEFAULT, SCE_BAT_HIDE, SCE_BAT_IDENTIFIER, SCE_BAT_LABEL, SCE_BAT_OPERATOR, and SCE_BAT_WORD.

Referenced by ColouriseBatchDoc().

Here is the call graph for this function:

◆ ColouriseDiffDoc()

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

Definition at line 566 of file LexOthers.cxx.

References AtEOL(), ColouriseDiffLine(), and DIFF_BUFFER_START_SIZE.

Here is the call graph for this function:

◆ ColouriseDiffLine()

static void ColouriseDiffLine ( char *  lineBuffer,
int  endLine,
Accessor &  styler 
)
static

◆ ColouriseErrorListDoc()

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

Definition at line 1160 of file LexOthers.cxx.

References AtEOL(), and ColouriseErrorListLine().

Here is the call graph for this function:

◆ ColouriseErrorListLine()

static void ColouriseErrorListLine ( char *  lineBuffer,
unsigned int  lengthLine,
unsigned int  endPos,
Accessor &  styler,
bool  valueSeparate 
)
static

Definition at line 1144 of file LexOthers.cxx.

References RecogniseErrorListLine(), and SCE_ERR_VALUE.

Referenced by ColouriseErrorListDoc().

Here is the call graph for this function:

◆ ColouriseLatexDoc()

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

Definition at line 1253 of file LexOthers.cxx.

References latexIsLetter(), latexIsSpecial(), latexIsTagValid(), latexLastWordIs(), latexNextNotBlankIs(), SCE_L_CMDOPT, SCE_L_COMMAND, SCE_L_COMMENT, SCE_L_COMMENT2, SCE_L_DEFAULT, SCE_L_ERROR, SCE_L_MATH, SCE_L_MATH2, SCE_L_SHORTCMD, SCE_L_SPECIAL, SCE_L_TAG, SCE_L_TAG2, and SCE_L_VERBATIM.

Here is the call graph for this function:

◆ ColouriseMakeDoc()

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

Definition at line 925 of file LexOthers.cxx.

References AtEOL(), and ColouriseMakeLine().

Here is the call graph for this function:

◆ ColouriseMakeLine()

static void ColouriseMakeLine ( char *  lineBuffer,
unsigned int  lengthLine,
unsigned int  startLine,
unsigned int  endPos,
Accessor &  styler 
)
static

◆ ColouriseNullDoc()

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

Definition at line 1491 of file LexOthers.cxx.

◆ ColourisePoDoc()

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

Definition at line 672 of file LexOthers.cxx.

References AtEOL(), and ColourisePoLine().

Here is the call graph for this function:

◆ ColourisePoLine()

static void ColourisePoLine ( char *  lineBuffer,
unsigned int  lengthLine,
unsigned int  startLine,
unsigned int  endPos,
Accessor &  styler 
)
static

Definition at line 621 of file LexOthers.cxx.

References SCE_PO_COMMENT, SCE_PO_DEFAULT, SCE_PO_FUZZY, SCE_PO_MSGCTXT, SCE_PO_MSGCTXT_TEXT, SCE_PO_MSGID, SCE_PO_MSGID_TEXT, SCE_PO_MSGSTR, SCE_PO_MSGSTR_TEXT, and strstart().

Referenced by ColourisePoDoc().

Here is the call graph for this function:

◆ ColourisePropsDoc()

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

Definition at line 741 of file LexOthers.cxx.

References AtEOL(), and ColourisePropsLine().

Here is the call graph for this function:

◆ ColourisePropsLine()

static void ColourisePropsLine ( char *  lineBuffer,
unsigned int  lengthLine,
unsigned int  startLine,
unsigned int  endPos,
Accessor &  styler,
bool  allowInitialSpaces 
)
static

Definition at line 697 of file LexOthers.cxx.

References isassignchar(), SCE_PROPS_ASSIGNMENT, SCE_PROPS_COMMENT, SCE_PROPS_DEFAULT, SCE_PROPS_DEFVAL, SCE_PROPS_KEY, and SCE_PROPS_SECTION.

Referenced by ColourisePropsDoc().

Here is the call graph for this function:

◆ FoldDiffDoc()

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

Definition at line 592 of file LexOthers.cxx.

References SCE_DIFF_COMMAND, SCE_DIFF_HEADER, and SCE_DIFF_POSITION.

◆ FoldPropsDoc()

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

Definition at line 771 of file LexOthers.cxx.

References SCE_PROPS_SECTION.

◆ Is0To9()

static bool Is0To9 ( char  ch)
static

Definition at line 39 of file LexOthers.cxx.

Referenced by ColouriseBatchLine(), and RecogniseErrorListLine().

◆ Is1To9()

static bool Is1To9 ( char  ch)
static

Definition at line 43 of file LexOthers.cxx.

Referenced by RecogniseErrorListLine().

◆ IsAlphabetic()

static bool IsAlphabetic ( int  ch)
static

Definition at line 47 of file LexOthers.cxx.

Referenced by ColouriseBatchLine(), and RecogniseErrorListLine().

◆ isassignchar()

static bool isassignchar ( unsigned char  ch)
inlinestatic

Definition at line 693 of file LexOthers.cxx.

Referenced by ColourisePropsLine().

◆ IsBOperator()

static bool IsBOperator ( char  ch)
static

Definition at line 57 of file LexOthers.cxx.

Referenced by ColouriseBatchLine().

◆ IsBSeparator()

static bool IsBSeparator ( char  ch)
static

Definition at line 63 of file LexOthers.cxx.

Referenced by ColouriseBatchLine().

◆ IsOperator()

static bool IsOperator ( int  ch)
static

Definition at line 1584 of file LexOthers.cxx.

Referenced by LexerNSCR::Lex(), and LexerNPRC::Lex().

◆ IsStreamCommentStyle()

static bool IsStreamCommentStyle ( int  style)
static

◆ IsStringSuffix()

static bool IsStringSuffix ( int  ch)
static

Definition at line 1608 of file LexOthers.cxx.

◆ IsWord()

static bool IsWord ( int  ch)
static

Definition at line 1580 of file LexOthers.cxx.

Referenced by LexerNSCR::Lex(), and LexerNPRC::Lex().

◆ IsWordStart()

static bool IsWordStart ( int  ch)
static

Definition at line 1576 of file LexOthers.cxx.

Referenced by LexerNSCR::Lex(), and LexerNPRC::Lex().

◆ latexIsBlank()

static bool latexIsBlank ( int  ch)
static

Definition at line 1191 of file LexOthers.cxx.

Referenced by latexIsTagValid().

◆ latexIsBlankAndNL()

static bool latexIsBlankAndNL ( int  ch)
static

Definition at line 1195 of file LexOthers.cxx.

Referenced by latexNextNotBlankIs().

◆ latexIsLetter()

static bool latexIsLetter ( int  ch)
static

Definition at line 1199 of file LexOthers.cxx.

Referenced by ColouriseLatexDoc(), and latexIsTagValid().

◆ latexIsSpecial()

static bool latexIsSpecial ( int  ch)
static

Definition at line 1186 of file LexOthers.cxx.

Referenced by ColouriseLatexDoc().

◆ latexIsTagValid()

static bool latexIsTagValid ( int &  i,
int  l,
Accessor &  styler 
)
static

Definition at line 1203 of file LexOthers.cxx.

References latexIsBlank(), and latexIsLetter().

Referenced by ColouriseLatexDoc().

Here is the call graph for this function:

◆ latexLastWordIs()

static bool latexLastWordIs ( int  start,
Accessor &  styler,
const char *  needle 
)
static

Definition at line 1238 of file LexOthers.cxx.

Referenced by ColouriseLatexDoc().

◆ latexNextNotBlankIs()

static bool latexNextNotBlankIs ( int  i,
int  l,
Accessor &  styler,
char  needle 
)
static

Definition at line 1223 of file LexOthers.cxx.

References latexIsBlankAndNL().

Referenced by ColouriseLatexDoc().

Here is the call graph for this function:

◆ lmBatch()

LexerModule lmBatch ( SCLEX_BATCH  ,
ColouriseBatchDoc  ,
"batch"  ,
,
batchWordListDesc   
)

Referenced by Scintilla_LinkLexers().

◆ lmDiff()

LexerModule lmDiff ( SCLEX_DIFF  ,
ColouriseDiffDoc  ,
"diff"  ,
FoldDiffDoc  ,
emptyWordListDesc   
)

Referenced by Scintilla_LinkLexers().

◆ lmErrorList()

LexerModule lmErrorList ( SCLEX_ERRORLIST  ,
ColouriseErrorListDoc  ,
"errorlist"  ,
,
emptyWordListDesc   
)

Referenced by Scintilla_LinkLexers().

◆ lmLatex()

LexerModule lmLatex ( SCLEX_LATEX  ,
ColouriseLatexDoc  ,
"latex"  ,
,
emptyWordListDesc   
)

Referenced by Scintilla_LinkLexers().

◆ lmMake()

LexerModule lmMake ( SCLEX_MAKEFILE  ,
ColouriseMakeDoc  ,
"makefile"  ,
,
emptyWordListDesc   
)

Referenced by Scintilla_LinkLexers().

◆ lmNPRC()

LexerModule lmNPRC ( SCLEX_NPRC  ,
LexerNPRC::LexerFactoryNPRC  ,
"NPRC"  ,
NPRCWordLists   
)

Referenced by Scintilla_LinkLexers().

◆ lmNSCR()

LexerModule lmNSCR ( SCLEX_NSCR  ,
LexerNSCR::LexerFactoryNSCR  ,
"NSCR"  ,
NSCRWordLists   
)

Referenced by Scintilla_LinkLexers().

◆ lmNull()

LexerModule lmNull ( SCLEX_NULL  ,
ColouriseNullDoc  ,
"null"   
)

Referenced by Scintilla_LinkLexers().

◆ lmPo()

LexerModule lmPo ( SCLEX_PO  ,
ColourisePoDoc  ,
"po"  ,
,
emptyWordListDesc   
)

Referenced by Scintilla_LinkLexers().

◆ lmProps()

LexerModule lmProps ( SCLEX_PROPERTIES  ,
ColourisePropsDoc  ,
"props"  ,
FoldPropsDoc  ,
emptyWordListDesc   
)

Referenced by Scintilla_LinkLexers().

◆ lmTXTADV()

LexerModule lmTXTADV ( SCLEX_TXTADV  ,
LexerTXTADV::LexerFactoryTXTADV  ,
"TXTADV"  ,
emptyWordListDesc   
)

Referenced by Scintilla_LinkLexers().

◆ RecogniseErrorListLine()

static int RecogniseErrorListLine ( const char *  lineBuffer,
unsigned int  lengthLine,
int &  startValue 
)
static

Definition at line 946 of file LexOthers.cxx.

References Is0To9(), Is1To9(), IsAlphabetic(), SCE_ERR_ABSF, SCE_ERR_BORLAND, SCE_ERR_CMD, SCE_ERR_CTAG, SCE_ERR_DEFAULT, SCE_ERR_DIFF_ADDITION, SCE_ERR_DIFF_CHANGED, SCE_ERR_DIFF_DELETION, SCE_ERR_DIFF_MESSAGE, SCE_ERR_ELF, SCE_ERR_GCC, SCE_ERR_IFC, SCE_ERR_IFORT, SCE_ERR_JAVA_STACK, SCE_ERR_LUA, SCE_ERR_MS, SCE_ERR_NET, SCE_ERR_PERL, SCE_ERR_PHP, SCE_ERR_PYTHON, SCE_ERR_TIDY, and strstart().

Referenced by ColouriseErrorListLine().

Here is the call graph for this function:

◆ strstart()

static bool strstart ( const char *  haystack,
const char *  needle 
)
static

Definition at line 35 of file LexOthers.cxx.

Referenced by ColourisePoLine(), and RecogniseErrorListLine().

Variable Documentation

◆ batchWordListDesc

const char* const batchWordListDesc[]
static
Initial value:
= {
"Internal Commands",
"External Commands",
0
}

Definition at line 1481 of file LexOthers.cxx.

◆ emptyWordListDesc

const char* const emptyWordListDesc[]
static
Initial value:
= {
0
}

Definition at line 1487 of file LexOthers.cxx.

◆ NPRCWordLists

const char* const NPRCWordLists[]
static
Initial value:
= {
"Commands",
"Options",
"Functions",
"Methods",
"Predefined variables",
"Constants",
"Special predefs",
"Operator keywords",
"Documentation keywords",
0
}

Definition at line 2324 of file LexOthers.cxx.

Referenced by OptionSetNPRC::OptionSetNPRC().

◆ NSCRWordLists

const char* const NSCRWordLists[]
static
Initial value:
= {
"Commands",
"Options",
"Functions",
"Methods",
"Predefined variables",
"Constants",
"Special predefs",
"Operator keywords",
"Documentation keywords",
"Procedure commands",
0
}

Definition at line 1647 of file LexOthers.cxx.

Referenced by OptionSetNSCR::OptionSetNSCR().