r1519@opsdev009 (orig r80499): mcslee | 2008-01-30 17:49:16 -0800
[amiethrift.git] / compiler / cpp / src / main.h
blob3ab2744495b04824c52eb356317a90fc2b90fa39
1 // Copyright (c) 2006- Facebook
2 // Distributed under the Thrift Software License
3 //
4 // See accompanying file LICENSE or visit the Thrift site at:
5 // http://developers.facebook.com/thrift/
7 #ifndef T_MAIN_H
8 #define T_MAIN_H
10 #include <string>
11 #include "parse/t_const.h"
12 #include "parse/t_field.h"
14 /**
15 * Defined in the flex library
18 int yylex(void);
20 int yyparse(void);
22 /**
23 * Expected to be defined by Flex/Bison
25 void yyerror(char* fmt, ...);
27 /**
28 * Parse debugging output, used to print helpful info
30 void pdebug(char* fmt, ...);
32 /**
33 * Parser warning
35 void pwarning(int level, char* fmt, ...);
37 /**
38 * Failure!
40 void failure(const char* fmt, ...);
42 /**
43 * Check constant types
45 void validate_const_type(t_const* c);
47 /**
48 * Check constant types
50 void validate_field_value(t_field* field, t_const_value* cv);
52 /**
53 * Check members of a throws block
55 bool validate_throws(t_struct* throws);
57 /**
58 * Converts a string filename into a thrift program name
60 std::string program_name(std::string filename);
62 /**
63 * Gets the directory path of a filename
65 std::string directory_name(std::string filename);
67 /**
68 * Get the absolute path for an include file
70 std::string include_file(std::string filename);
72 /**
73 * Clears any previously stored doctext string.
75 void clear_doctext();
77 /**
78 * Cleans up text commonly found in doxygen-like comments
80 char* clean_up_doctext(char* doctext);
82 /**
83 * Flex utilities
86 extern int yylineno;
87 extern char yytext[];
88 extern FILE* yyin;
90 #endif