edbee - Qt Editor Library
|
defines a single grammar rule More...
#include <textgrammar.h>
Classes | |
class | Iterator |
Public Types | |
enum | Instruction { MainRule, RuleList, SingleLineRegExp, MultiLineRegExp, IncludeCall, Parser } |
the instructions More... | |
Public Member Functions | |
TextGrammarRule (TextGrammar *grammar, Instruction instruction) | |
The text grammar rule constructor. More... | |
~TextGrammarRule () | |
The tex text grammar rule. More... | |
bool | isMainRule () |
bool | isRuleList () |
bool | isMultiLineRegExp () |
bool | isSingleLineRegExp () |
bool | isIncludeCall () |
int | ruleCount () const |
TextGrammarRule * | rule (int idx) const |
returns the child rule at the given index More... | |
void | giveRule (TextGrammarRule *rule) |
Gives the rulle to the rule-list of the grammar rule. More... | |
void | giveMatchRegExp (RegExp *regExp) |
Gives the main regular expression. More... | |
void | setEndRegExpString (const QString &str) |
Sets the ends regular expression(only for multi-line regexp rules. More... | |
Instruction | instruction () const |
void | setInstruction (Instruction ins) |
QString | scopeName () const |
void | setScopeName (const QString &scopeName) |
RegExp * | matchRegExp () const |
QString | endRegExpString () const |
const QMap< int, QString > & | matchCaptures () |
const QMap< int, QString > & | endCaptures () |
QString | contentScopeName () const |
void | setContentScopeName (const QString &name) |
QString | includeName () |
the include name is stored in the content-scopename More... | |
void | setIncludeName (const QString &name) |
void | setCapture (int idx, const QString &name) |
void | setEndCapture (int idx, const QString &name) |
QString | toString (bool includePatterns=true) |
convers the curent object toString (for debugging purposes) More... | |
Iterator * | createIterator () |
TextGrammar * | grammar () |
Static Public Member Functions | |
static TextGrammarRule * | createMainRule (TextGrammar *grammar, const QString &scopeName) |
Creates a main grammar rule. More... | |
static TextGrammarRule * | createRuleList (TextGrammar *grammar) |
Creates a grammar rule list. More... | |
static TextGrammarRule * | createSingleLineRegExp (TextGrammar *grammar, const QString &scopeName, const QString ®Exp) |
Creates an single line regexp. More... | |
static TextGrammarRule * | createMultiLineRegExp (TextGrammar *grammar, const QString &scopeName, const QString &contentScopeName, const QString &beginRegExp, const QString &endRegExp) |
Creates a multiline regexp. More... | |
static TextGrammarRule * | createIncludeRule (TextGrammar *grammar, const QString &includeName) |
Creates an include rule. More... | |
defines a single grammar rule
the instructions
edbee::TextGrammarRule::TextGrammarRule | ( | TextGrammar * | grammar, |
Instruction | instruction | ||
) |
The text grammar rule constructor.
grammar | the grammar this rule belongs to |
instruction | the type of instruction this is |
edbee::TextGrammarRule::~TextGrammarRule | ( | ) |
The tex text grammar rule.
|
inline |
|
static |
Creates an include rule.
grammar | the grammar this rules belongs to |
includeName | the name to include |
|
inline |
|
static |
Creates a main grammar rule.
grammar | the grammar this main rule belongs to |
scopeName | the name of the scope |
|
static |
Creates a multiline regexp.
scopeName | the name of the scope |
contentScopeName | the scope name of the content |
beginRegExp | the start regexp to use |
endRegExp | the end regular expression to use |
|
static |
Creates a grammar rule list.
grammar | the grammar this rule list belongs to |
|
static |
Creates an single line regexp.
grammar | the grammar this rule belongs to |
scopeName | the scopename of this rule |
regExp | the regular expression used for this rule |
|
inline |
|
inline |
void edbee::TextGrammarRule::giveMatchRegExp | ( | RegExp * | regExp | ) |
Gives the main regular expression.
regExp | the regular expression to give |
void edbee::TextGrammarRule::giveRule | ( | TextGrammarRule * | rule | ) |
Gives the rulle to the rule-list of the grammar rule.
the | rule to give (ownership is transfered to this object) |
|
inline |
|
inline |
the include name is stored in the content-scopename
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
TextGrammarRule * edbee::TextGrammarRule::rule | ( | int | idx | ) | const |
returns the child rule at the given index
idx | the index of the grammar rule |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void edbee::TextGrammarRule::setEndRegExpString | ( | const QString & | str | ) |
Sets the ends regular expression(only for multi-line regexp rules.
str | the end regular expression |
|
inline |
|
inline |
|
inline |
QString edbee::TextGrammarRule::toString | ( | bool | includePatterns = true | ) |
convers the curent object toString (for debugging purposes)
includePatters | should the patterns be included |