quakeforge/tools/qfcc/include/method.h

84 lines
2.1 KiB
C
Raw Normal View History

2002-05-08 21:24:24 +00:00
/*
#FILENAME#
#DESCRIPTION#
Copyright (C) 2001 #AUTHOR#
Author: #AUTHOR#
Date: #DATE#
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:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA
$Id$
*/
#ifndef __method_h
#define __method_h
#include "function.h"
typedef struct method_s {
struct method_s *next;
int instance;
param_t *selector;
param_t *params;
type_t *type;
def_t *def;
char *name;
char *types;
2002-05-08 21:24:24 +00:00
} method_t;
2002-05-10 00:00:23 +00:00
typedef struct methodlist_s {
2002-05-08 21:24:24 +00:00
method_t *head;
method_t **tail;
} methodlist_t;
2002-05-08 23:12:49 +00:00
typedef struct keywordarg_s {
2002-05-09 20:12:28 +00:00
// the first two fields match the first two fiels of param_t in
// functionl.h
2002-05-08 23:12:49 +00:00
struct keywordarg_s *next;
const char *selector;
expr_t *expr;
} keywordarg_t;
2002-05-08 21:24:24 +00:00
struct class_s;
2002-05-08 23:12:49 +00:00
struct expr_s;
2002-05-09 20:12:28 +00:00
struct dstring_s;
2002-05-08 21:24:24 +00:00
method_t *new_method (type_t *ret_type, param_t *selector, param_t *opt_parms);
void add_method (methodlist_t *methodlist, method_t *method);
2002-05-15 19:10:23 +00:00
def_t *method_def (struct class_s *class, method_t *method);
2002-05-08 21:24:24 +00:00
2002-05-10 00:00:23 +00:00
methodlist_t *new_methodlist (void);
void copy_methods (methodlist_t *dst, methodlist_t *src);
int method_compare (method_t *m1, method_t *m2);
2002-05-10 00:00:23 +00:00
2002-05-08 23:12:49 +00:00
keywordarg_t *new_keywordarg (const char *selector, struct expr_s *expr);
struct expr_s *send_message (int super);
2002-05-08 23:12:49 +00:00
2002-05-09 20:12:28 +00:00
void selector_name (struct dstring_s *sel_id, keywordarg_t *selector);
void selector_types (struct dstring_s *sel_types, keywordarg_t *selector);
struct def_s *selector_def (const char *sel_id, const char *sel_types);
int emit_methods (methodlist_t *methods, const char *name, int instance);
2002-05-08 21:24:24 +00:00
#endif//__method_h