// ***************************************************************************** // cmd.h // ~~~~~ // author : Hung Ngo // - codes to implement user's commands illustrates the user of function // pointers for late binding // ***************************************************************************** #ifndef CMD_H_ #define CMD_H_ #include #include "Lexer.h" /** * cmd_handler_t is a function pointer type, pointing to a function which takes * a Lexer as an argument */ typedef void (*cmd_handler_t)(Lexer); /* * ----------------------------------------------------------------------------- * print_color() prints a string token (if any) from the Lexer in color * bye() just quits * ----------------------------------------------------------------------------- */ void print_color(Lexer); void bye(Lexer); #endif