X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/2255b3d84eeb947d4c065332f16e410ae4704c63..5b42e9400440d86723a27747b2191ab8cd59c2ee:/src/tree.c diff --git a/src/tree.c b/src/tree.c index 22c6a2e..6382d05 100644 --- a/src/tree.c +++ b/src/tree.c @@ -24,11 +24,11 @@ #include "tree.h" Node * -new_ccode(int header, char *cbuf, int line_no) +new_ccode(int cctype, char *cbuf, int line_no) { CCode *node = (CCode *)g_new(Node,1); node->type = CCODE_NODE; - node->header = header; + node->cctype = cctype; node->cbuf = cbuf; node->line_no = line_no; return (Node *)node; @@ -78,7 +78,10 @@ new_funcarg(Type *atype, char *name, GList *checks) } Node * -new_method(int scope, int method, Type *mtype, char *otype, GList *gtktypes, char *id, GList *args, char *onerror, char *cbuf, int line_no,int ccode_line, int vararg) +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) { Method *node = (Method *)g_new(Node,1); node->type = METHOD_NODE; @@ -87,6 +90,7 @@ new_method(int scope, int method, Type *mtype, char *otype, GList *gtktypes, cha node->mtype = mtype; node->otype = otype; node->gtktypes = gtktypes; + node->flags = flags; node->id = id; node->args = args; node->onerror = onerror; @@ -98,11 +102,12 @@ new_method(int scope, int method, Type *mtype, char *otype, GList *gtktypes, cha } Node * -new_argument(char *gtktype, GList *flags, char *name, char *get, int get_line, char *set, int set_line, int line_no) +new_argument(char *gtktype, Type *atype, GList *flags, char *name, char *get, int get_line, char *set, int set_line, int line_no) { Argument *node = (Argument *)g_new(Node,1); node->type = ARGUMENT_NODE; node->gtktype = gtktype; + node->atype = atype; node->flags = flags; node->name = name; node->get = get; @@ -114,7 +119,10 @@ new_argument(char *gtktype, GList *flags, char *name, char *get, int get_line, c } Node * -new_variable(int scope, Type *vtype, char *id, int line_no) +new_variable(int scope, Type *vtype, char *id, int line_no, + char *destructor, int destructor_line, + gboolean destructor_simple, + char *initializer, int initializer_line) { Variable *node = (Variable *)g_new(Node,1); node->type = VARIABLE_NODE; @@ -122,5 +130,24 @@ new_variable(int scope, Type *vtype, char *id, int line_no) node->vtype = vtype; node->id = id; node->line_no = line_no; + node->destructor = destructor; + node->destructor_line = destructor_line; + node->destructor_simple = destructor_simple; + node->initializer = initializer; + node->initializer_line = initializer_line; return (Node *)node; } + +Type * +copy_type(Type *type) +{ + Node *node; + + if(!type) return NULL; + + node = new_type(type->stars, + g_strdup(type->name), + g_strdup(type->postfix)); + + return (Type *)node; +}