Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

esp.h

Go to the documentation of this file.
00001 /* SCEI CONFIDENTIAL

00002  */
00003 /*
00004  *
00005  *      Copyright (C) 1999 Sony Computer Entertainment Inc.

00006  *                        All Rights Reserved.

00007  *
00008  */
00009 
00010 #ifndef __ESP_H__
00011 #define __ESP_H__
00012 #ifdef __cplusplus
00013 extern "C" {
00014 #endif
00015 
00016 #ifndef NULL
00017 #define NULL    (0)
00018 #endif
00019 
00020 #ifndef FALSE
00021 #define FALSE   (0)
00022 #endif
00023 
00024 #ifndef TRUE
00025 #define TRUE    (1)
00026 #endif
00027 
00028 enum _type{
00029   ENUM_t = 0,   /* enum type */
00030   STR_t,        /* string type */
00031   BOOL_t,       /* boolean type */
00032   INT_t,        /* integer type */
00033   FLT_t         /* floating type */
00034 };
00035 
00036 typedef unsigned char   Bool;           /* maybe risky */
00037 
00038 /****************************************/
00039 /*      declarations                    */
00040 /****************************************/
00041 typedef struct _Enumerator{
00042   int           nvalue;
00043   unsigned long *value;
00044   char          **literal;
00045 }Enumerator;
00046 
00047 typedef union _Initializer{
00048   Enumerator    enumerator;
00049   char          *string;
00050   Bool          bool;                   /* bool is risky */
00051   long          integer;
00052   double        floating;
00053 }Initializer;
00054 
00055 typedef struct _Typedecl{
00056         char    *identifier;            /* type identifier */
00057         int     specifier;              /* which enum _type */
00058         int     sign;                   /* sign bits */
00059         int     exp;                    /* exponent bits */
00060         int     flt;                    /* floating bits */
00061 }Typedecl;
00062 
00063 typedef struct _Structdecl{
00064   char  *identifier;                    /* struct identifier */
00065 
00066   char  **typename;                     /* type name */
00067   int   *typeid;                        /* id of typedecl */
00068   int   ntype;                          /* num of types */
00069 
00070   char  **classname;                    /* class declaration */
00071   int   *classid;                       /* id of classdecl */
00072   int   nclass;                         /* num of classes */
00073 
00074   Initializer   *initializer;           /* initailizer , array is same ntype */
00075 }Structdecl;
00076 
00077 typedef struct _Classdecl {
00078   char          *identifier;            /* class identifier */
00079   Structdecl    *structdecl;            /* structdecl array in a class */
00080   int           nstructdecl;            /* num of structdecl in a class */
00081 }Classdecl;
00082 
00083 typedef struct _Namesdecl {
00084   char          *identifier;            /* namespace identifier */
00085   Classdecl     *classdecl;             /* classdecl array in a namespace */
00086   int           nclassdecl;             /* num of classdecl in a namespace */
00087 }Namesdecl;
00088 
00089 typedef struct _Declare {
00090   Typedecl      *typedecl;              /* typedecl array */
00091   Namesdecl     *namesdecl;             /* namesdecl array */
00092   int           ntypedecl;              /* num of typedecl array */
00093   int           nnamesdecl;             /* num of namesdecl array */
00094 }Declare;
00095 
00096 
00097 /****************************************/
00098 /*      implementations                 */
00099 /****************************************/
00100 typedef union _Value{
00101   unsigned long enumerator;                     /* enumerator value (single) */
00102   char          *string;                        /* string value (single) */
00103   Bool          bool;                           /* using bool is risky */
00104   long          *integer;                       /* integer value array */
00105   double        *floating;                      /* floating value array */
00106 }Value;
00107 
00108 typedef struct _Construct{
00109   int   namesid;                                /* namespace id (same defnamesid for temporary) */
00110   int   classid;                                /* class id */
00111   int   structid;                               /* struct id */
00112 
00113   char  *name;                                  /* construction name */
00114 
00115   struct _Construct     **construct;            /* child construction array */
00116   int                   nconstruct;             /* num of child construction */
00117 
00118   int                   *nvalue;                /* num of value array */
00119   Value                 **value;                /* any type value array */
00120 }Construct;
00121 
00122 typedef struct _Implement{
00123   int                   defnamesid;             /* default namespace id (temporary) */
00124   int                   nconstruct;             /* num of construction array */
00125   Construct             **construct;            /* construction array */
00126 }Implement;
00127 
00128 
00129 
00130 
00131 /***    es.l    ***/
00132 extern void openfile(char *string);
00133 extern int yywrap(void);
00134 extern void yyerror(char *errmsg);
00135 
00136 /***    decl.c  ***/
00137 extern Declare *init_declare(void);
00138 extern int      type_identifier(char *ident);
00139 extern void     type_declarator(int sp, char *bitfield, int id);
00140 extern int      struct_identifier(char *ident);
00141 extern void     type_declaration(int id, char *name);
00142 extern void     class_declaration(int id, char *name);
00143 extern void     struct_declarator(void);
00144 extern int      class_identifier(char *ident);
00145 extern void     class_declarator(void);
00146 extern int      names_identifier(char *ident);
00147 extern void     names_declarator(void);
00148 
00149 extern void integer_initializer(long val);
00150 extern void floating_initializer(double val);
00151 extern void string_initializer(char *val);
00152 extern void enum_initializer(char *val);
00153 extern void bool_initializer(Bool val);
00154 extern Bool true_or_false(char *words);
00155 
00156 
00157 
00158 /***    impl.c  ***/
00159 extern Implement *init_implement(Declare *declare);
00160 extern void namespace_definition(int id);               
00161 extern void default_namespace(int id);
00162 extern int declared_namesid(char *ident);
00163 extern int declared_classid(char *ident);
00164 extern int class_definition(int id, char *name);
00165 extern int declared_typename(char *name);
00166 extern int declared_classname(char *name);
00167 extern int referred_classname(char *name);
00168 extern void type_operator(char *name);
00169 extern void class_operator(char *name);
00170 extern void nest_operator(char *name);
00171 extern void bool_literal(Bool val);
00172 extern void string_literal(char *literal);
00173 extern void enumerator_literal(char *literal);
00174 extern void integer_literal(long lval);
00175 extern void floating_literal(double dval);
00176 extern void separator(void);
00177 extern void reference(int id);
00178 extern void subclassname(char *name);
00179 extern void nest_operator(char *name);
00180 extern void nest_implementation(void);
00181 extern void type_implementation(void);
00182 extern void class_implementation(void);
00183 extern void definition(int classid);
00184 
00185 
00186 /***    print.c ***/
00187 extern void print_typedecl(Declare *declare);
00188 extern void print_namesdecl(Declare *declare);
00189 extern void print_declare(Declare *declare);
00190 extern void print_construct(Declare *declare, Construct *construct);
00191 extern void print_implement(Declare *declare,Implement *implement);
00192 
00193 
00194 
00195 #ifdef __cplusplus
00196 }
00197 #endif
00198 #endif /* !__ESP_H__ */

Generated at Thu Feb 1 13:03:02 2001 for Ketsji Game Engine by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000