+++ /dev/null
-/* GOB C Preprocessor
- * Copyright (C) 1999 the Free Software Foundation.
- *
- * Author: George Lebl
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- * USA.
- */
-
-#ifndef _TREE_H_
-#define _TREE_H_
-
-#include <glib.h>
-
-enum {
- CCODE_NODE,
- CLASS_NODE,
- TYPE_NODE,
- CHECK_NODE,
- FUNCARG_NODE,
- METHOD_NODE,
- ARGUMENT_NODE,
- 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 cctype;
- char *cbuf;
- int line_no;
-};
-
-typedef struct _Class Class;
-struct _Class {
- int type;
- char *otype; /*this object class type*/
- char *ptype; /*parent class type*/
- GList *nodes;
-};
-
-typedef struct _Type Type;
-struct _Type {
- int type;
- int stars;
- char *name;
- char *postfix;
-};
-
-enum {
- NULL_CHECK,
- TYPE_CHECK,
- LT_CHECK,
- GT_CHECK,
- LE_CHECK,
- GE_CHECK,
- EQ_CHECK,
- NE_CHECK
-};
-
-typedef struct _Check Check;
-struct _Check {
- int type;
- int chtype;
- char *number;
-};
-
-typedef struct _FuncArg FuncArg;
-struct _FuncArg {
- int type;
- Type *atype;
- char *name;
- GList *checks;
-};
-
-typedef struct _Argument Argument;
-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;
-};
-
-/*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
-};
-
-typedef struct _Method Method;
-struct _Method {
- int type;
- 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;
- char *cbuf;
- int line_no;
- int ccode_line;
- gboolean vararg;
-};
-
-typedef struct _Variable Variable;
-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;
- CCode ccode;
- Class class;
- Type _type;
- Check check;
- Argument argument;
- Method method;
- Variable variable;
-};
-
-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, char *postfix);
-Node *new_check(int chtype, char *number);
-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 *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,
- char *destructor, int destructor_line,
- gboolean destructor_simple,
- char *initializer, int initializer_line);
-
-Type *copy_type(Type *type);
-
-#endif