A base class for recognizing a language syntax.
More...
#include <LanguageSyntax.h++>
|
| LanguageSyntax (const QString &language) |
| Constructs a LanguageSyntax for the specified language. More...
|
|
void | addHighlightingRule (const QString &element, const QString &pattern, bool caseInsensitive=false) |
| Adds a highlighting rule to the language for syntax elements that do not span multiple lines of text. More...
|
|
void | addMultilineHighlightingRule (const QString &element, const QString &startPattern, const QString &endPattern, bool caseInsensitive=false) |
| Adds a highlighting rule to the language for syntax elements that can span multiple lines of text, such as multi-line comments. More...
|
|
|
static const char * | SINGLE_QUOTED_STRING_PATTERN |
| A pattern for matching a single-quoted string in which embedded single-quotes are escaped using a backslash character. More...
|
|
static const char * | DOUBLE_QUOTED_STRING_PATTERN |
| A pattern for matching a double-quoted string in which embedded double-quotes are escaped using a backslash character. More...
|
|
A base class for recognizing a language syntax.
Used in conjunction with a SyntaxHighlighter to perform syntax highlighting of a document.
- Author
- Mark Lindner
◆ ~LanguageSyntax()
◆ LanguageSyntax()
Constructs a LanguageSyntax for the specified language.
- Parameters
-
language | The name of the language. |
◆ addHighlightingRule()
void addHighlightingRule |
( |
const QString & |
element, |
|
|
const QString & |
pattern, |
|
|
bool |
caseInsensitive = false |
|
) |
| |
|
protected |
Adds a highlighting rule to the language for syntax elements that do not span multiple lines of text.
- Parameters
-
element | The name of the syntax element. |
pattern | The regular expression pattern for matching the element. |
caseInsensitive | Whether the match should be case-insensitive. |
◆ addMultilineHighlightingRule()
void addMultilineHighlightingRule |
( |
const QString & |
element, |
|
|
const QString & |
startPattern, |
|
|
const QString & |
endPattern, |
|
|
bool |
caseInsensitive = false |
|
) |
| |
|
protected |
Adds a highlighting rule to the language for syntax elements that can span multiple lines of text, such as multi-line comments.
- Parameters
-
element | The name of the syntax element. |
startPattern | The regular expression pattern for matching the beginning of the element. |
endPattern | The regular expression pattern for matching the end of the element. |
caseInsensitive | Whether the match should be case-insensitive. |
◆ language()
QString language |
( |
| ) |
const |
|
inline |
Returns the name of the language.
◆ DOUBLE_QUOTED_STRING_PATTERN
const char* DOUBLE_QUOTED_STRING_PATTERN |
|
staticprotected |
A pattern for matching a double-quoted string in which embedded double-quotes are escaped using a backslash character.
◆ SINGLE_QUOTED_STRING_PATTERN
const char* SINGLE_QUOTED_STRING_PATTERN |
|
staticprotected |
A pattern for matching a single-quoted string in which embedded single-quotes are escaped using a backslash character.
The documentation for this class was generated from the following file: