-private:
- struct Visitor: TraversingVisitor
- {
- typedef void ResultType;
-
- Stage *stage;
-
- Visitor();
-
- virtual void apply(Stage &);
- void get_result() const { }
- };
-
- struct BlockModifier: Visitor
- {
- bool remove_node;
- std::vector<RefPtr<Statement> > insert_nodes;
-
- BlockModifier();
-
- void flatten_block(Block &);
- void apply_and_increment(Block &, NodeList<Statement>::iterator &);
- using Visitor::visit;
- virtual void visit(Block &);
- };
-
- struct Formatter: Visitor
- {
- typedef std::string ResultType;
-
- std::string formatted;
- unsigned source_index;
- unsigned source_line;
- unsigned indent;
- bool parameter_list;
- std::string block_interface;
-
- Formatter();
-
- virtual void apply(Stage &);
- const std::string &get_result() const { return formatted; }
- using Visitor::visit;
- void append(const std::string &);
- void append(char);
- void set_source(unsigned, unsigned);
- virtual void visit(Block &);
- virtual void visit(Literal &);
- virtual void visit(ParenthesizedExpression &);
- virtual void visit(VariableReference &);
- virtual void visit(MemberAccess &);
- virtual void visit(UnaryExpression &);
- virtual void visit(BinaryExpression &);
- virtual void visit(Assignment &);
- virtual void visit(FunctionCall &);
- virtual void visit(ExpressionStatement &);
- virtual void visit(Import &);
- virtual void visit(Precision &);
- virtual void visit(Layout &);
- virtual void visit(InterfaceLayout &);
- virtual void visit(StructDeclaration &);
- virtual void visit(VariableDeclaration &);
- virtual void visit(InterfaceBlock &);
- virtual void visit(FunctionDeclaration &);
- virtual void visit(Conditional &);
- virtual void visit(Iteration &);
- virtual void visit(Return &);
- virtual void visit(Jump &);
- };
-
- template<typename T>
- struct NodeGatherer: Visitor