diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2009-05-14 09:50:46 (GMT) |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-05-14 09:50:46 (GMT) |
commit | 3bf4db673c3e74ab9a4c3319fd7a1df15ff52ea9 (patch) | |
tree | be3a3f9b90f3cbeab3cb968febe0f87c2afa43a2 /src/declarative/qml/parser | |
parent | 699e4ebfca621d4a009221b4304c3773cb783f7b (diff) | |
download | Qt-3bf4db673c3e74ab9a4c3319fd7a1df15ff52ea9.zip Qt-3bf4db673c3e74ab9a4c3319fd7a1df15ff52ea9.tar.gz Qt-3bf4db673c3e74ab9a4c3319fd7a1df15ff52ea9.tar.bz2 |
Moved Parser::DiagnosticMessage and AST::SourceLocation
Diffstat (limited to 'src/declarative/qml/parser')
-rw-r--r-- | src/declarative/qml/parser/javascript.g | 22 | ||||
-rw-r--r-- | src/declarative/qml/parser/javascriptast_p.h | 26 | ||||
-rw-r--r-- | src/declarative/qml/parser/javascriptastfwd_p.h | 21 | ||||
-rw-r--r-- | src/declarative/qml/parser/javascriptengine_p.h | 29 | ||||
-rw-r--r-- | src/declarative/qml/parser/javascriptparser_p.h | 22 |
5 files changed, 49 insertions, 71 deletions
diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index 53d10b6..53db3d9 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -207,6 +207,8 @@ #include "javascriptgrammar_p.h" #include "javascriptast_p.h" +#include "javascriptengine_p.h" + #include <QtCore/QList> QT_BEGIN_NAMESPACE @@ -263,26 +265,6 @@ public: AST::UiQualifiedId *UiQualifiedId; }; - struct DiagnosticMessage { - enum Kind { Warning, Error }; - - DiagnosticMessage() - : kind(Error) {} - - DiagnosticMessage(Kind kind, const AST::SourceLocation &loc, const QString &message) - : kind(kind), loc(loc), message(message) {} - - bool isWarning() const - { return kind == Warning; } - - bool isError() const - { return kind == Error; } - - Kind kind; - AST::SourceLocation loc; - QString message; - }; - public: Parser(); ~Parser(); diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h index 816835e..571fdff 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -53,11 +53,8 @@ // We mean it. // -#include <QtCore/QString> - - - #include "javascriptastvisitor_p.h" +#include <QtCore/QString> QT_BEGIN_NAMESPACE @@ -120,27 +117,6 @@ _T1 cast(_T2 *ast) return 0; } -class SourceLocation -{ -public: - SourceLocation(quint32 offset = 0, quint32 length = 0) - : offset(offset), length(length), - startLine(0), startColumn(0) - { } - - bool isValid() const { return length != 0; } - - quint32 begin() const { return offset; } - quint32 end() const { return offset + length; } - -// attributes - // ### encode - quint32 offset; - quint32 length; - quint32 startLine; - quint32 startColumn; -}; - class Node { public: diff --git a/src/declarative/qml/parser/javascriptastfwd_p.h b/src/declarative/qml/parser/javascriptastfwd_p.h index 858e393..822a2d7 100644 --- a/src/declarative/qml/parser/javascriptastfwd_p.h +++ b/src/declarative/qml/parser/javascriptastfwd_p.h @@ -59,7 +59,26 @@ QT_BEGIN_NAMESPACE namespace JavaScript { namespace AST { -class SourceLocation; +class SourceLocation +{ +public: + SourceLocation(quint32 offset = 0, quint32 length = 0) + : offset(offset), length(length), + startLine(0), startColumn(0) + { } + + bool isValid() const { return length != 0; } + + quint32 begin() const { return offset; } + quint32 end() const { return offset + length; } + +// attributes + // ### encode + quint32 offset; + quint32 length; + quint32 startLine; + quint32 startColumn; +}; class Visitor; class Node; diff --git a/src/declarative/qml/parser/javascriptengine_p.h b/src/declarative/qml/parser/javascriptengine_p.h index 6aa4a76..966349b 100644 --- a/src/declarative/qml/parser/javascriptengine_p.h +++ b/src/declarative/qml/parser/javascriptengine_p.h @@ -33,6 +33,8 @@ #include <QString> #include <QSet> +#include "javascriptastfwd_p.h" + QT_BEGIN_NAMESPACE namespace JavaScript { @@ -43,14 +45,9 @@ uint qHash(const JavaScript::NameId &id); namespace JavaScript { -class Node; class Lexer; class NodePool; -namespace AST { -class Node; -} // end of namespace AST - namespace Ecma { class RegExp @@ -92,6 +89,28 @@ public: { return _text < other._text; } }; +class DiagnosticMessage +{ +public: + enum Kind { Warning, Error }; + + DiagnosticMessage() + : kind(Error) {} + + DiagnosticMessage(Kind kind, const AST::SourceLocation &loc, const QString &message) + : kind(kind), loc(loc), message(message) {} + + bool isWarning() const + { return kind == Warning; } + + bool isError() const + { return kind == Error; } + + Kind kind; + AST::SourceLocation loc; + QString message; +}; + class Engine { Lexer *_lexer; diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index deb6176..6980cc8 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -62,6 +62,8 @@ #include "javascriptgrammar_p.h" #include "javascriptast_p.h" +#include "javascriptengine_p.h" + #include <QtCore/QList> QT_BEGIN_NAMESPACE @@ -118,26 +120,6 @@ public: AST::UiQualifiedId *UiQualifiedId; }; - struct DiagnosticMessage { - enum Kind { Warning, Error }; - - DiagnosticMessage() - : kind(Error) {} - - DiagnosticMessage(Kind kind, const AST::SourceLocation &loc, const QString &message) - : kind(kind), loc(loc), message(message) {} - - bool isWarning() const - { return kind == Warning; } - - bool isError() const - { return kind == Error; } - - Kind kind; - AST::SourceLocation loc; - QString message; - }; - public: Parser(); ~Parser(); |