next up previous
Next: Node Up: Using C-Breeze Previous: Invoking a Changer

Node Types

In C-Breeze, a C program is represented as an abstract syntax tree (AST) whose nodes are all objects of a subclass of type Node. The complete class hierarchy is available in the on-line documentation, and the header file ast.h contains the declarations for all the node types. Nodes follow the C++ convention that all data fields are private, being accessed through member functions with related names.

Note: some fields are not necessarily set when the C program is parsed; you may have to set them yourself, or call another function to set them for you. For example, there are fields for keeping type information for each expression node, but they are only set when you call the semantic checker.

Often, STL lists of different types of nodes will be used in node declarations. These list types are typedefed in ast.h. The naming convention is to append the string _list to the (possibly abbreviated) name of the data type to form the list type name, and append _p to the list type name in another typedef for the iterator of that list. For example, if foo is a node type, foo_list would be a list of nodes of type foo, and foo_list_p would be the iterator type for foo_list.

See ast.h for complete details about the structure of the different node classes. Here is an overview of the some of the node classes; as time becomes available, more will be documented here. Not all fields or member functions are described; some fields are seldom used or are just used for internal C-Breeze bookkeeping, and some are just not terribly interesting:



 
next up previous
Next: Node Up: Using C-Breeze Previous: Invoking a Changer
Calvin Lin
2002-01-31