blob: a7c1d3d39927fe8a7f83bf19da3004a41e1723b2 [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>
Mark Slee30152872006-11-28 01:24:07 +00005#include "parse/t_const.h"
Mark Sleef0712dc2006-10-25 19:03:57 +00006
Mark Sleef5377b32006-10-10 01:42:59 +00007/**
8 * Defined in the flex library
9 */
Mark Slee31985722006-05-24 21:45:31 +000010
Mark Sleef0712dc2006-10-25 19:03:57 +000011int yylex(void);
12
13int yyparse(void);
Mark Slee31985722006-05-24 21:45:31 +000014
Mark Sleef5377b32006-10-10 01:42:59 +000015/**
16 * Expected to be defined by Flex/Bison
17 */
Mark Sleef0712dc2006-10-25 19:03:57 +000018void yyerror(char* fmt, ...);
Mark Slee31985722006-05-24 21:45:31 +000019
Mark Sleef5377b32006-10-10 01:42:59 +000020/**
Mark Sleef0712dc2006-10-25 19:03:57 +000021 * Parse debugging output, used to print helpful info
Mark Sleef5377b32006-10-10 01:42:59 +000022 */
Mark Sleef0712dc2006-10-25 19:03:57 +000023void pdebug(char* fmt, ...);
24
25/**
26 * Parser warning
27 */
28void pwarning(int level, char* fmt, ...);
29
30/**
31 * Failure!
32 */
Mark Slee30152872006-11-28 01:24:07 +000033void failure(const char* fmt, ...);
34
35/**
36 * Check constant types
37 */
38void validate_const_type(t_const* c);
Mark Sleef0712dc2006-10-25 19:03:57 +000039
40/**
41 * Converts a string filename into a thrift program name
42 */
43std::string program_name(std::string filename);
44
45/**
46 * Gets the directory path of a filename
47 */
48std::string directory_name(std::string filename);
49
50/**
51 * Get the absolute path for an include file
52 */
53std::string include_file(std::string filename);
Mark Sleef5377b32006-10-10 01:42:59 +000054
55/**
56 * Flex utilities
57 */
58
Mark Slee31985722006-05-24 21:45:31 +000059extern int yylineno;
60extern char yytext[];
61extern FILE* yyin;
62
63#endif