X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fglsl%2Fdebug.h;h=a5dae0905c3dec3b5d0b01f644a4da8a18eac4fc;hb=d684e9f3007a0113c65c016ceb694eeac56a128c;hp=b377b84488a5cd897645f63ad728d80337262858;hpb=4c805f55d89919d6971d600102ab4d6d65d56dc3;p=libs%2Fgl.git diff --git a/source/glsl/debug.h b/source/glsl/debug.h index b377b844..a5dae090 100644 --- a/source/glsl/debug.h +++ b/source/glsl/debug.h @@ -22,6 +22,16 @@ private: REACH = 0x2574 // ╴ }; + struct Branch + { + std::string text; + Node *node; + + Branch(const char *t, Node *n = 0): text(t), node(n) { } + Branch(const std::string &t, Node *n = 0): text(t), node(n) { } + Branch(Node *n): node(n) { } + }; + std::map node_labels; std::string formatted; std::vector tree; @@ -31,11 +41,13 @@ public: private: void append(const std::string &); + void append_subtree(const std::vector &); void begin_sub(); void last_branch(); void end_sub(); void annotated_branch(const std::string &, Node &); unsigned get_label(const Node &); + std::string format_type(TypeDeclaration *); template typename T::const_iterator increment(typename T::const_iterator &, const T &); @@ -46,9 +58,11 @@ private: virtual void visit(VariableReference &); virtual void visit(InterfaceBlockReference &); virtual void visit(MemberAccess &); + virtual void visit(Swizzle &); virtual void visit(UnaryExpression &); virtual void visit(BinaryExpression &); virtual void visit(Assignment &); + virtual void visit(TernaryExpression &); virtual void visit(FunctionCall &); virtual void visit(ExpressionStatement &); virtual void visit(Import &);