blob: 9a3a81ea11ce3dc1cbe985c9e009ba4765ad89a7 [file] [log] [blame]
Mark Slee31985722006-05-24 21:45:31 +00001#ifndef T_MAIN_H
2#define T_MAIN_H
3
Mark Sleef0712dc2006-10-25 19:03:57 +00004#include <string>
5
Mark Sleef5377b32006-10-10 01:42:59 +00006/**
7 * Defined in the flex library
8 */
Mark Slee31985722006-05-24 21:45:31 +00009
Mark Sleef0712dc2006-10-25 19:03:57 +000010int yylex(void);
11
12int yyparse(void);
Mark Slee31985722006-05-24 21:45:31 +000013
Mark Sleef5377b32006-10-10 01:42:59 +000014/**
15 * Expected to be defined by Flex/Bison
16 */
Mark Sleef0712dc2006-10-25 19:03:57 +000017void yyerror(char* fmt, ...);
Mark Slee31985722006-05-24 21:45:31 +000018
Mark Sleef5377b32006-10-10 01:42:59 +000019/**
Mark Sleef0712dc2006-10-25 19:03:57 +000020 * Parse debugging output, used to print helpful info
Mark Sleef5377b32006-10-10 01:42:59 +000021 */
Mark Sleef0712dc2006-10-25 19:03:57 +000022void pdebug(char* fmt, ...);
23
24/**
25 * Parser warning
26 */
27void pwarning(int level, char* fmt, ...);
28
29/**
30 * Failure!
31 */
32void failure(char* fmt, ...);
33
34/**
35 * Converts a string filename into a thrift program name
36 */
37std::string program_name(std::string filename);
38
39/**
40 * Gets the directory path of a filename
41 */
42std::string directory_name(std::string filename);
43
44/**
45 * Get the absolute path for an include file
46 */
47std::string include_file(std::string filename);
Mark Sleef5377b32006-10-10 01:42:59 +000048
49/**
50 * Flex utilities
51 */
52
Mark Slee31985722006-05-24 21:45:31 +000053extern int yylineno;
54extern char yytext[];
55extern FILE* yyin;
56
57#endif