[Uml-devel] KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser

Ralf Habacker ralf.habacker at gmail.com
Sat Jun 30 07:10:27 UTC 2012


SVN commit 1303621 by habacker:

Added debug printer for class Position and Token, which eases debugging.

 M  +11 -0     lexer.cpp  
 M  +10 -0     position.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/lexer.cpp #1303620:1303621
@@ -245,6 +245,17 @@
     return *this;
 }
 
+QDebug operator<<(QDebug out, const Token &t)
+{
+    out << "Token("
+    << "type:" << t.type()
+    << "text:" << t.text()
+    << "start:" << t.getStartPosition()
+    << "end:" << t.getEndPosition()
+    << ")";
+    return out;
+}
+
 Token Lexer::Source::createToken(int type, CharIterator start,
                                  CharIterator end) const
 {
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/position.h #1303620:1303621
@@ -50,6 +50,16 @@
     return p.data();
 }
 
+inline QDebug operator<<(QDebug out, Position const &p)
+{
+    out << "Position("
+        //<< "file" << p.file
+        << "line:" << p.line
+        << "column:" << p.column
+        << ")";
+    return out;
+}
+
 inline bool operator<( Position const& p1, Position const& p2)
 {
     assert( p1.file == p2.file);




More information about the umbrello-devel mailing list