X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/c190a2ae41238682c1430b8482683b6a7c15c66b..b17287deb56775a49030d738d8c8c0e9cd15f9fe:/src/tree.h diff --git a/src/tree.h b/src/tree.h index d3617a9..9d3638f 100644 --- a/src/tree.h +++ b/src/tree.h @@ -35,13 +35,24 @@ enum { VARIABLE_NODE }; +/* for ccode type */ +enum { + A_CCODE, + AT_CCODE, + C_CCODE, + H_CCODE, + HT_CCODE, + PH_CCODE +}; + typedef union _Node Node; typedef struct _CCode CCode; struct _CCode { int type; - int header; - GString *cbuf; + int cctype; + char *cbuf; + int line_no; }; typedef struct _Class Class; @@ -57,6 +68,7 @@ struct _Type { int type; int stars; char *name; + char *postfix; }; enum { @@ -89,16 +101,27 @@ typedef struct _Argument Argument; struct _Argument { int type; char *gtktype; + Type *atype; GList *flags; char *name; - GString *get; - GString *set; + char *get; + int get_line; + char *set; + int set_line; + int line_no; }; /*scope type*/ enum { + NO_SCOPE, PUBLIC_SCOPE, PRIVATE_SCOPE, + PROTECTED_SCOPE, +}; + +/* method type */ +enum { + REGULAR_METHOD, INIT_METHOD, CLASS_INIT_METHOD, VIRTUAL_METHOD, @@ -110,15 +133,19 @@ enum { typedef struct _Method Method; struct _Method { int type; - int scope; + int scope; /* scope type */ + int method; /* method type */ Type *mtype; char *otype; /*for override methods*/ GList *gtktypes; /*GTK types for a signal*/ + GList *flags; /* GTK_RUN_* flags for a signal */ char *id; GList *args; char *onerror; - GString *cbuf; + char *cbuf; int line_no; + int ccode_line; + gboolean vararg; }; typedef struct _Variable Variable; @@ -127,6 +154,7 @@ struct _Variable { int scope; Type *vtype; char *id; + int line_no; }; union _Node { @@ -140,13 +168,18 @@ union _Node { Variable variable; }; -Node *new_ccode(int header, GString *cbuf); +Node *new_ccode(int cctype, char *cbuf, int line_no); Node *new_class(char *otype, char *ptype, GList *nodes); -Node *new_type(int stars, char *name); +Node *new_type(int stars, char *name, char *postfix); Node *new_check(int chtype, char *number); Node *new_funcarg(Type *atype, char *name, GList *checks); -Node *new_method(int scope, Type *mtype, char *otype, GList *gtktypes, char *id, GList *args, char *onerror, GString *cbuf,int line_no); -Node *new_argument(char *gtktype, GList *flags, char *name, GString *get, GString *set); -Node *new_variable(int scope, Type *vtype, char *id); +Node *new_method(int scope, int method, Type *mtype, char *otype, + GList *gtktypes, GList *flags, char *id, GList *args, + char *onerror, char *cbuf, int line_no, int ccode_line, + gboolean vararg); +Node *new_argument(char *gtktype, Type *atype, GList *flags, char *name, + char *get, int get_line, char *set, int set_line, + int line_no); +Node *new_variable(int scope, Type *vtype, char *id,int line_no); #endif