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