]> git.draconx.ca Git - gob-dx.git/blobdiff - src/treefuncs.h
Release 0.93.2
[gob-dx.git] / src / treefuncs.h
diff --git a/src/treefuncs.h b/src/treefuncs.h
new file mode 100644 (file)
index 0000000..d2e9430
--- /dev/null
@@ -0,0 +1,201 @@
+/* Generated by generate_treefuncs.pl from treefuncs.def!
+ * Do not edit by hand! */
+
+
+#ifndef _TREEFUNCS_H_
+
+#define _TREEFUNCS_H_
+
+/* for ccode type */
+enum {
+       A_CCODE,
+       AT_CCODE,
+       C_CCODE,
+       H_CCODE,
+       HT_CCODE,
+       PH_CCODE
+};
+
+/* check type */
+enum {
+       NULL_CHECK,
+       TYPE_CHECK,
+       LT_CHECK,
+       GT_CHECK,
+       LE_CHECK,
+       GE_CHECK,
+       EQ_CHECK,
+       NE_CHECK
+};
+
+/* scope type */
+enum {
+       NO_SCOPE,
+       PUBLIC_SCOPE,
+       PRIVATE_SCOPE,
+       PROTECTED_SCOPE
+};
+
+/* method type */
+enum {
+       REGULAR_METHOD,
+       INIT_METHOD,
+       CLASS_INIT_METHOD,
+       VIRTUAL_METHOD,
+       SIGNAL_LAST_METHOD,
+       SIGNAL_FIRST_METHOD,
+       OVERRIDE_METHOD
+};
+
+
+enum {
+       CLASS_NODE,
+       TYPE_NODE,
+       CCODE_NODE,
+       CHECK_NODE,
+       FUNCARG_NODE,
+       ARGUMENT_NODE,
+       METHOD_NODE,
+       VARIABLE_NODE,
+       LAST_NODE_TYPE
+};
+
+typedef union _Node Node;
+typedef struct _Class Class;
+typedef struct _Type Type;
+typedef struct _CCode CCode;
+typedef struct _Check Check;
+typedef struct _FuncArg FuncArg;
+typedef struct _Argument Argument;
+typedef struct _Method Method;
+typedef struct _Variable Variable;
+
+
+struct _Argument {
+       int type;
+       char * gtktype;
+       Type * atype;
+       GList * flags;
+       char * name;
+       char * get;
+       int get_line;
+       char * set;
+       int set_line;
+       int line_no;
+};
+
+struct _CCode {
+       int type;
+       int cctype;
+       char * cbuf;
+       int line_no;
+};
+
+struct _Check {
+       int type;
+       int chtype;
+       char * number;
+};
+
+struct _Class {
+       int type;
+       char * otype;
+       char * ptype;
+       GList * nodes;
+};
+
+struct _FuncArg {
+       int type;
+       Type * atype;
+       char * name;
+       GList * checks;
+};
+
+struct _Method {
+       int type;
+       int scope;
+       int method;
+       Type * mtype;
+       char * otype;
+       GList * gtktypes;
+       GList * flags;
+       char * id;
+       GList * args;
+       char * onerror;
+       char * defreturn;
+       char * cbuf;
+       int line_no;
+       int ccode_line;
+       gboolean vararg;
+};
+
+struct _Type {
+       int type;
+       int stars;
+       char * name;
+       char * postfix;
+};
+
+struct _Variable {
+       int type;
+       int scope;
+       Type * vtype;
+       char * id;
+       int line_no;
+       char * destructor;
+       int destructor_line;
+       gboolean destructor_simple;
+       char * initializer;
+       int initializer_line;
+};
+
+union _Node {
+       int type;
+       Argument argument;
+       CCode ccode;
+       Check check;
+       Class class;
+       FuncArg funcarg;
+       Method method;
+       Type _type;
+       Variable variable;
+};
+
+/* New functions */
+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_ccode (int cctype, char * cbuf, int line_no);
+Node * new_check (int chtype, char * number);
+Node * new_class (char * otype, char * ptype, GList * nodes);
+Node * new_funcarg (Type * atype, char * name, GList * checks);
+Node * new_method (int scope, int method, Type * mtype, char * otype, GList * gtktypes, GList * flags, char * id, GList * args, char * onerror, char * defreturn, char * cbuf, int line_no, int ccode_line, gboolean vararg);
+Node * new_type (int stars, char * name, char * postfix);
+Node * new_variable (int scope, Type * vtype, char * id, int line_no, char * destructor, int destructor_line, gboolean destructor_simple, char * initializer, int initializer_line);
+
+/* General copy/free functions */
+Node * copy_node(Node *node);
+void free_node(Node *node);
+
+GList * copy_node_list(GList *nodes);
+void free_node_list(GList *nodes);
+
+/* Copy functions */
+Argument * copy_argument (Argument * self);
+CCode * copy_ccode (CCode * self);
+Check * copy_check (Check * self);
+Class * copy_class (Class * self);
+FuncArg * copy_funcarg (FuncArg * self);
+Method * copy_method (Method * self);
+Type * copy_type (Type * self);
+Variable * copy_variable (Variable * self);
+
+/* Free functions */
+void free_argument (Argument * self);
+void free_ccode (CCode * self);
+void free_check (Check * self);
+void free_class (Class * self);
+void free_funcarg (FuncArg * self);
+void free_method (Method * self);
+void free_type (Type * self);
+void free_variable (Variable * self);
+
+#endif /*_TREEFUNCS_H_*/