Mark Slee | 3198572 | 2006-05-24 21:45:31 +0000 | [diff] [blame] | 1 | #ifndef T_MAIN_H |
2 | #define T_MAIN_H | ||||
3 | |||||
Mark Slee | f0712dc | 2006-10-25 19:03:57 +0000 | [diff] [blame] | 4 | #include <string> |
5 | |||||
Mark Slee | f5377b3 | 2006-10-10 01:42:59 +0000 | [diff] [blame] | 6 | /** |
7 | * Defined in the flex library | ||||
8 | */ | ||||
Mark Slee | 3198572 | 2006-05-24 21:45:31 +0000 | [diff] [blame] | 9 | |
Mark Slee | f0712dc | 2006-10-25 19:03:57 +0000 | [diff] [blame] | 10 | int yylex(void); |
11 | |||||
12 | int yyparse(void); | ||||
Mark Slee | 3198572 | 2006-05-24 21:45:31 +0000 | [diff] [blame] | 13 | |
Mark Slee | f5377b3 | 2006-10-10 01:42:59 +0000 | [diff] [blame] | 14 | /** |
15 | * Expected to be defined by Flex/Bison | ||||
16 | */ | ||||
Mark Slee | f0712dc | 2006-10-25 19:03:57 +0000 | [diff] [blame] | 17 | void yyerror(char* fmt, ...); |
Mark Slee | 3198572 | 2006-05-24 21:45:31 +0000 | [diff] [blame] | 18 | |
Mark Slee | f5377b3 | 2006-10-10 01:42:59 +0000 | [diff] [blame] | 19 | /** |
Mark Slee | f0712dc | 2006-10-25 19:03:57 +0000 | [diff] [blame] | 20 | * Parse debugging output, used to print helpful info |
Mark Slee | f5377b3 | 2006-10-10 01:42:59 +0000 | [diff] [blame] | 21 | */ |
Mark Slee | f0712dc | 2006-10-25 19:03:57 +0000 | [diff] [blame] | 22 | void pdebug(char* fmt, ...); |
23 | |||||
24 | /** | ||||
25 | * Parser warning | ||||
26 | */ | ||||
27 | void pwarning(int level, char* fmt, ...); | ||||
28 | |||||
29 | /** | ||||
30 | * Failure! | ||||
31 | */ | ||||
32 | void failure(char* fmt, ...); | ||||
33 | |||||
34 | /** | ||||
35 | * Converts a string filename into a thrift program name | ||||
36 | */ | ||||
37 | std::string program_name(std::string filename); | ||||
38 | |||||
39 | /** | ||||
40 | * Gets the directory path of a filename | ||||
41 | */ | ||||
42 | std::string directory_name(std::string filename); | ||||
43 | |||||
44 | /** | ||||
45 | * Get the absolute path for an include file | ||||
46 | */ | ||||
47 | std::string include_file(std::string filename); | ||||
Mark Slee | f5377b3 | 2006-10-10 01:42:59 +0000 | [diff] [blame] | 48 | |
49 | /** | ||||
50 | * Flex utilities | ||||
51 | */ | ||||
52 | |||||
Mark Slee | 3198572 | 2006-05-24 21:45:31 +0000 | [diff] [blame] | 53 | extern int yylineno; |
54 | extern char yytext[]; | ||||
55 | extern FILE* yyin; | ||||
56 | |||||
57 | #endif |