summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/script/tokens.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-04-22 04:47:24 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-04-22 04:47:24 (GMT)
commit2366667fc97eb6a56203b2dd7dac776ff4164abd (patch)
treeb2acb6cc6bfe475d7e619e4788973b61fff775e0 /src/declarative/qml/script/tokens.cpp
parent2c762f3b8b284a7c6dc0c499b7052013bad5b707 (diff)
downloadQt-2366667fc97eb6a56203b2dd7dac776ff4164abd.zip
Qt-2366667fc97eb6a56203b2dd7dac776ff4164abd.tar.gz
Qt-2366667fc97eb6a56203b2dd7dac776ff4164abd.tar.bz2
Initial import of kinetic-dui branch from the old kinetic
Diffstat (limited to 'src/declarative/qml/script/tokens.cpp')
-rw-r--r--src/declarative/qml/script/tokens.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/declarative/qml/script/tokens.cpp b/src/declarative/qml/script/tokens.cpp
new file mode 100644
index 0000000..51b46f0
--- /dev/null
+++ b/src/declarative/qml/script/tokens.cpp
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** This file is part of the $PACKAGE_NAME$.
+**
+** Copyright (C) $THISYEAR$ $COMPANY_NAME$.
+**
+** $QT_EXTENDED_DUAL_LICENSE$
+**
+****************************************************************************/
+
+#include "tokens.h"
+
+
+/*!
+ \relates <tokens.h>
+ Returns a string representation of token \a tok.
+*/
+const char *tokenToString(Token tok)
+{
+ switch(tok) {
+#define CASE(X) case X: return #X;
+ CASE(NOTOKEN)
+ CASE(INCOMPLETE)
+ CASE(WHITESPACE)
+ CASE(LANGLE)
+ CASE(RANGLE)
+ CASE(PLUS)
+ CASE(MINUS)
+ CASE(STAR)
+ CASE(EQUALS)
+ CASE(DOT)
+ CASE(CHARACTER)
+ CASE(DIGIT)
+ CASE(OTHER)
+ CASE(AND)
+ case TOKEN_TRUE:
+ return "TRUE";
+ case TOKEN_FALSE:
+ return "FALSE";
+#undef CASE
+ }
+ return 0;
+}
+