virtual typeNode * type();
This method returns NULL and can be overridden by a subclass to return the ``type'' of that node. Note: there are two senses in which we speak of the ``type'' of a node. One is the C++ sense: given a pointer to an object of an abstract class, what is the actual type of the object? The other is the parsed C sense: given a node representing an expression, what is the type of that expression (e.g., pointer, integer, etc.)? This method returns the type in the latter sense; the typ() field of Node returns the type in the former sense.
virtual typeNode * base_type(bool TdefIndir);
This method returns the ``base type'' of a node; how this differs from the ``type'' of the node seems to depend on the context. The TdefIndir flag, if true, causes any typedef base types to be dereferenced; i.e., instead of returning a tdefNode *, base_type() will return the type referred to by the typedef.
virtual void visit(Visitor *);
This method can be overriden to provide a Visitor with something to do at that node.
virtual void walk(Walker &);
This method can be overriden to provide a Walker with something to do at that node.
virtual Node * change(Changer & , bool redispatch = false);
This method can be overriden to provide a Changer with something to do at that node.
virtual void dataflow(FlowVal * v, FlowProblem & fp) =0;
This method can be overridden by subclasses of Node to provide something to do for dataflow analysis. The subclass must handle what to do with flow values when nodes of that type are reached. For instance, ifNode::dataflow calls the dataflow method of the if expression, then calls the dataflow method of the statement to be executed if the condition were true, then sets the resulting flow value to be the ``meet'' of those two flow values.
virtual Node * clone() const =0;
This method returns a pointer to a newly allocated copy of the current node. Each subclass of Node simply overrides this method to return the result of calling the default copy constructor on itself.
virtual void output(output_context & ct, Node * par) =0;
Each subclass of Node overrides this method to send readable C code representing itself to the given output context. In certain contexts, the node must know who its parent is, so the parent node of that node is also supplied as a parameter. For instance, when a blockNode's output method is called, it needs to know whether its parent is a procNode (e.g., a function definition) so that it can follow a wacky indentation style in which the curly brace in this case is placed on a separate line from the function declarator.