]> git.saurik.com Git - cycript.git/blobdiff - Parser.hpp
Move CYNext, CYSetLast, and CYForEach to List.hpp.
[cycript.git] / Parser.hpp
index 0b9099adfa8059009323d8f016a7451e68a40c49..d8539399fb9c13a016ce5cb7c63284a7390741f5 100644 (file)
 #include <cstdlib>
 
 #include "location.hh"
 #include <cstdlib>
 
 #include "location.hh"
+
+#include "List.hpp"
 #include "Pooling.hpp"
 #include "Options.hpp"
 
 class CYContext;
 
 #include "Pooling.hpp"
 #include "Options.hpp"
 
 class CYContext;
 
-template <typename Type_>
-struct CYNext {
-    Type_ *next_;
-
-    CYNext() :
-        next_(NULL)
-    {
-    }
-
-    CYNext(Type_ *next) :
-        next_(next)
-    {
-    }
-
-    void SetNext(Type_ *next) {
-        next_ = next;
-    }
-};
-
-template <typename Type_>
-void CYSetLast(Type_ *&list, Type_ *item) {
-    if (list == NULL)
-        list = item;
-    else {
-        Type_ *next(list);
-        while (next->next_ != NULL)
-            next = next->next_;
-        next->next_ = item;
-    }
-}
-
-#define CYForEach(value, list) \
-    for (__typeof__(*list) *value(list); value != NULL; value = value->next_)
-
 struct CYThing {
     virtual ~CYThing() {
     }
 struct CYThing {
     virtual ~CYThing() {
     }