next up previous
Next: Members of Nodes Up: ASTs Previous: ASTs

Nodes

In C-Breeze, each node in the AST is represented by an object whose type is a subclass of Node. Section 6 describes the details of each kind of node; for now, we will describe the basic concept and give a few examples.

The various node types are organized in a C++ class hierarchy. For example, the loopNode class has subclasses that represent for, do and while loops. A loopNode is a subclass of a stmtNode, an even more general node type containing any kind of statement. stmtNode is a subclass of Node, the most general node type.

This class hierarchy allows the C-Breeze programmer to operate on various levels of specificity. For instance, if you want to examine all loops, but don't care what kind of loop it is, you can write code concerning only loopNode's.



Calvin Lin
2002-01-31