edbee - Qt Editor Library
tmlanguageparser.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <QList>
9 #include <QMap>
10 #include <QStack>
11 #include <QVariant>
12 
13 #include "baseplistparser.h"
14 
15 class QFile;
16 class QIODevice;
17 class QXmlStreamReader;
18 
19 namespace edbee {
20 
21 class TextGrammar;
22 class TextGrammarManager;
23 class TextGrammarRule;
24 
27 {
28 public:
30  TextGrammar* parse( QIODevice* device );
31  TextGrammar* parse(const QFile& file );
32  TextGrammar* parse( const QString& fileName );
33 
34 protected:
35 
36  void addCapturesToGrammarRule( TextGrammarRule* rule, QHash<QString,QVariant> captures, bool endCapture=false );
37  void addPatternsToGrammarRule( TextGrammarRule* rule, QList<QVariant> patterns );
38 
39  TextGrammarRule* createGrammarRule(TextGrammar *grammar, const QVariant &data );
40  TextGrammar* createLanguage(QVariant& data );
41 
42 
43 };
44 
45 } // edbee
TmLanguageParser()
Parses a textmate language.
Definition: tmlanguageparser.cpp:22
TextGrammarRule * createGrammarRule(TextGrammar *grammar, const QVariant &data)
creates a grammar rue
Definition: tmlanguageparser.cpp:96
void addPatternsToGrammarRule(TextGrammarRule *rule, QList< QVariant > patterns)
Adds all patterns to the grammar rules.
Definition: tmlanguageparser.cpp:86
void addCapturesToGrammarRule(TextGrammarRule *rule, QHash< QString, QVariant > captures, bool endCapture=false)
sets the captures
Definition: tmlanguageparser.cpp:67
defines a single grammar rule
Definition: textgrammar.h:24
Copyright 2011-2013 - Reliable Bits Software by Blommers IT.
Definition: commentcommand.cpp:22
This class defines a single language grammar.
Definition: textgrammar.h:125
TextGrammar * createLanguage(QVariant &data)
Definition: tmlanguageparser.cpp:176
TextGrammar * parse(QIODevice *device)
reads the content of a single file
Definition: tmlanguageparser.cpp:30
A general plist xml-file parser.
Definition: baseplistparser.h:19
For parsing a Textmate Language.
Definition: tmlanguageparser.h:26