/* $Id: h-fun.h,v 1.6 1997/08/02 08:42:02 isis Exp $ */ // $Log: h-fun.h,v $ // Revision 1.6 1997/08/02 08:42:02 isis // Generator now prints "char*" as strings as well // // Revision 1.5 1997/07/30 17:46:01 isis // Some minor new features and bug fixes // // Revision 1.4 1997/06/22 14:48:31 isis // This is the initial version for // the generating functions module // // Revision 1.3 1997/06/01 13:22:55 isis // Parsing of const: // e.g const char const * const a; // Changed the internal represantation of '*' to support const qualifiers // // Revision 1.2 1997/05/25 15:12:19 isis // Bug fixes // mostly with sizeof operator // // Revision 1.1 1997/05/18 16:56:30 isis // Changed the names a bit // to be easier to use // // Revision 1.1 1997/05/18 16:44:30 isis // Break some files to improve re-making // #ifndef __H_SYN_FUN__ #define __H_SYN_FUN__ #include #include #include #include #include #include "Cname.h" #include "symbol.h" #include "gc_stl.h" #define BITFIELD_SIZE 4 #define ALIGNMENT 4 #define ENUM_SIZE 4 int yyparse(void); int yylex(void); int yyerror(char *); extern int lineno; extern int proto_num; extern int simple_num,typedef_num,struct_num,enum_num; //The SymbolTable and ErrorHandler extern SymbolTableClass SymbolTable; extern ErrorHandlerClass ErrorHandler; //For the unnamed structs/unions/enums.... extern int unnamed_num; //Unique number extern char unnamed_scope[80]; //Generated name extern int param_num; //for the unnamed parameters extern char param_name[80]; //Gerenated name //For the enumerations extern int EnumValue; //It keeps the next to assign value extern Ctype *EnumCtype; //It keeps the Ctype of the enum //The built-in types extern TypeEntry *IntType; extern TypeEntry *CharType; extern TypeEntry *FloatType; extern TypeEntry *DoubleType; extern TypeEntry *VoidType; extern TypeEntry *EllipsisType; //Internal functions & typedefs typedef gc_type_id_list type_id_list; //**************************************** type_id_list *create_type_id_list(Ctype*,gc_pCname_list *); //**************************************** void insert_type_id_list_as_var(type_id_list*); //**************************************** void insert_type_id_list_as_type(type_id_list*); //**************************************** void insert_enum_ent(char *,int); //**************************************** Ctype* find_and_check_type(char*,Ctype::DefStyle); //**************************************** void mangle(char*,Ctype::DefStyle,char*); void create_complex_type(char*,Ctype::DefStyle); void forward_create_complex_type(char*,Ctype::DefStyle); bool open_forward_complex_type(char*,Ctype::DefStyle); //**************************************** void make_cname_function(Cname*,gc_type_id_list*); //**************************************** int get_sizeof_id(char *); int get_sizeof_ctype(Ctype *); int get_sizeof_ctype_cname(Ctype *,Cname *); //**************************************** int get_value_of_id(char *); //**************************************** int get_lcm_of_alignments(Scope*); int get_max_sizeof_vars_in_scope(Scope*); int get_sizeof_vars_in_scope(Scope*); void fix_struct_size_alignment(Ctype*,Ctype::DefStyle); int get_alignment_of_ctype(Ctype*); int get_alignment_of_ctype_cname(Ctype*,Cname*); //**************************************** ostream& print_cname(ostream&,Cname*); ostream& print_ctype(ostream&,Ctype*); ostream& print_ctype_cname(ostream&,Ctype*,Cname*); ostream& print_headers(ostream&,Scope *sc); //**************************************** char *create_param_name(); void fix_param_name(Cname *); //**************************************** bool IsVoid(Ctype *,Cname *); bool IsCharPtr(Ctype *,Cname *); #endif