+ const std::map<std::string, int> *values;
+
+public:
+ ConstantSpecializer();
+
+ void apply(Stage &, const std::map<std::string, int> *);
+
+private:
+ virtual void visit(VariableDeclaration &);
+};
+
+/** Forms links between nested blocks in the syntax tree. */
+class BlockHierarchyResolver: private TraversingVisitor
+{
+public:
+ void apply(Stage &s) { s.content.visit(*this); }
+
+private:
+ virtual void enter(Block &);
+};
+
+/** Resolves variable references. Variable references which match the name
+of an interface block are turned into interface block references. */
+class VariableResolver: private TraversingVisitor
+{
+private:
+ Stage *stage;
+ std::map<std::string, VariableDeclaration *> *r_members;
+ RefPtr<InterfaceBlockReference> r_iface_ref;