gbc_class.c

来自「Gambas is a graphical development enviro」· C语言 代码 · 共 77 行

C
77
字号
/***************************************************************************  class.c  Class management  (c) 2000-2004 Beno顃 Minisini <gambas@users.sourceforge.net>  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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA.***************************************************************************/#define __GBC_CLASS_C#include <stdlib.h>#include <string.h>#include <stdio.h>#include "gb_common.h"#include "gb_error.h"#include "gb_str.h"#include "gb_file.h"#include "gb_table.h"#include "gbc_compile.h"#include "gb_code.h"PUBLIC void CLASS_create(CLASS **result){  CLASS *class;  TRANS_FUNC func;  ALLOC_ZERO(&class, sizeof(CLASS), "CLASS_create");  ARRAY_create(&class->function);  ARRAY_create(&class->event);  ARRAY_create(&class->prop);  ARRAY_create(&class->ext_func);  ARRAY_create(&class->constant);  ARRAY_create(&class->class);  ARRAY_create(&class->unknown);  ARRAY_create(&class->stat);  ARRAY_create(&class->dyn);  ARRAY_create(&class->array);  ARRAY_create(&class->structure);  TABLE_create(&class->table, sizeof(CLASS_SYMBOL), TF_IGNORE_CASE);  TABLE_create(&class->string, sizeof(SYMBOL), TF_NORMAL);  /* Cr閍tion des fonctions d'initialisation */  TYPE_clear(&func.type);  func.nparam = 0;  func.start = NULL;  func.line = 0;  func.index = CLASS_add_symbol(class, "@init");  CLASS_add_function(class, &func);  func.index = CLASS_add_symbol(class, "@new");  CLASS_add_function(class, &func);  /* Le premier symbole de la table des symboles est vide.     Ainsi, l'index 0 de la table n'est jamais utilis

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?