X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=tools%2Fminiswig%2Ftree.h;h=387012ece01169244b719488a3c4ddc1494e4794;hb=137c4c25840c36661c8b68b8eaba77afccd76199;hp=b6f85546670cbe5538439a13cb8e22d5e85e7f54;hpb=78724e8ddcdb94a7b691464ea9e558d0a6665aa7;p=supertux.git diff --git a/tools/miniswig/tree.h b/tools/miniswig/tree.h index b6f855466..387012ece 100644 --- a/tools/miniswig/tree.h +++ b/tools/miniswig/tree.h @@ -84,6 +84,28 @@ public: int ref; }; +class HSQUIRRELVMType : public AtomicType { +public: + HSQUIRRELVMType() + { + this->name = "HSQUIRRELVM"; + assert(_instance == 0); + _instance = this; + } + virtual ~HSQUIRRELVMType() + { + assert(_instance == this); + _instance = 0; + } + + static HSQUIRRELVMType* instance() + { + return _instance; + } +private: + static HSQUIRRELVMType* _instance; +}; + class StringType : public AtomicType { public: StringType() @@ -181,6 +203,19 @@ public: namespaces.push_back(ns); ns->parent = this; } + AtomicType* _findType(const std::string& name, bool godown = false) { + for(std::vector::iterator i = types.begin(); + i != types.end(); ++i) { + AtomicType* type = *i; + if(type->name == name) + return type; + } + if(godown && parent) + return parent->_findType(name, true); + + return 0; + } + Namespace* _findNamespace(const std::string& name, bool godown = false) { for(std::vector::iterator i = namespaces.begin(); i != namespaces.end(); ++i) {