// ***************************************************************************** // file name : cmd.h // author : Hung Ngo // description: 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