blob: 8f73759f8061e73c43ab9c222a178a6c07f54b78 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
/****************************************************************************
**
** Copyright (c) 2015 Digia Plc
** For any questions to Digia, please use contact form at http://qt.digia.com/
**
** All Rights Reserved.
**
** NOTICE: All information contained herein is, and remains
** the property of Digia Plc and its suppliers,
** if any. The intellectual and technical concepts contained
** herein are proprietary to Digia Plc
** and its suppliers and may be covered by Finnish and Foreign Patents,
** patents in process, and are protected by trade secret or copyright law.
** Dissemination of this information or reproduction of this material
** is strictly forbidden unless prior written permission is obtained
** from Digia Plc.
****************************************************************************/
#ifndef SCXMLPARSER_H
#define SCXMLPARSER_H
#include <QScxml/scxmlstatemachine.h>
#include <QStringList>
#include <QString>
QT_BEGIN_NAMESPACE
class QXmlStreamReader;
namespace Scxml {
class ScxmlParserPrivate;
class SCXML_EXPORT ScxmlParser
{
public:
class SCXML_EXPORT Loader
{
public:
Loader(ScxmlParser *parser);
virtual ~Loader();
virtual QByteArray load(const QString &name, const QString &baseDir, bool *ok) = 0;
protected:
ScxmlParser *parser() const;
private:
ScxmlParser *m_parser;
};
enum State {
StartingParsing,
ParsingScxml,
ParsingError,
FinishedParsing,
};
public:
ScxmlParser(QXmlStreamReader *xmlReader);
~ScxmlParser();
QString fileName() const;
void setFileName(const QString &fileName);
Loader *loader() const;
void setLoader(Loader *newLoader);
void parse();
StateMachine *instantiateStateMachine() const;
void instantiateDataModel(StateMachine *table) const;
State state() const;
QVector<ScxmlError> errors() const;
void addError(const QString &msg);
private:
friend ScxmlParserPrivate;
ScxmlParserPrivate *p;
};
} // namespace Scxml
QT_END_NAMESPACE
#endif // SCXMLPARSER_H
|