next up previous
Next: Access to C-Breeze Structures Up: User Defined Phases Previous: User Defined Phases

A Small Example

Here is a small example of a C-Breeze phase:

#include "c_breeze.h"

class Hello: public Phase {
        public:
        void run (void) {
                cout << "Hello, World!\n";
        }
};

Phases hello_phase ("hello", new Hello());

When linked and invoked with cbz -hello, this phase simply prints Hello, World! to the standard output. Note that it's not necessary for the names of the Phases variable, the subclass of Phase, or the identifying string to be related, but it does contribute to readability of your code.



Calvin Lin
2002-01-31