1 #ifndef MSP_GL_SL_REFLECT_H_
2 #define MSP_GL_SL_REFLECT_H_
10 /** Determines the number of interface locations required by a variable. */
11 class LocationCounter: private NodeVisitor
19 unsigned apply(VariableDeclaration &v) { v.visit(*this); return r_count; }
22 virtual void visit(BasicTypeDeclaration &);
23 virtual void visit(ImageTypeDeclaration &);
24 virtual void visit(StructDeclaration &);
25 virtual void visit(VariableDeclaration &);
28 /** Collects dependencies of a function. This includes global variables,
29 interface blocks, other functions and types. */
30 class DependencyCollector: private TraversingVisitor
33 std::set<Node *> dependencies;
34 std::set<Node *> locals;
37 std::set<Node *> apply(FunctionDeclaration &);
40 virtual void visit(VariableReference &);
41 virtual void visit(InterfaceBlockReference &);
42 virtual void visit(FunctionCall &);
43 virtual void visit(VariableDeclaration &);