2007-12-30 17:41:49 +01:00
|
|
|
/***************************************************************************
|
|
|
|
|
|
|
|
gbc_trans_common.h
|
|
|
|
|
2009-08-17 12:41:51 +02:00
|
|
|
(c) 2000-2009 Benoît Minisini <gambas@users.sourceforge.net>
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
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
|
2009-08-17 12:41:51 +02:00
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
2007-12-30 17:41:49 +01:00
|
|
|
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.
|
|
|
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __GBC_TRANS_COMMMON_H
|
|
|
|
#define __GBC_TRANS_COMMMON_H
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
TYPE type;
|
|
|
|
int index;
|
|
|
|
PATTERN *optional;
|
|
|
|
int value;
|
|
|
|
}
|
|
|
|
TRANS_PARAM; /* must be the same as PARAM in class.h */
|
|
|
|
|
|
|
|
typedef
|
|
|
|
PATTERN TRANS_TREE;
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
int type;
|
|
|
|
int ival;
|
2008-01-05 15:07:21 +01:00
|
|
|
int64_t lval;
|
2007-12-30 17:41:49 +01:00
|
|
|
double dval;
|
|
|
|
}
|
|
|
|
TRANS_NUMBER;
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
TYPE type;
|
|
|
|
int ndim;
|
|
|
|
int dim[MAX_ARRAY_DIM];
|
|
|
|
}
|
|
|
|
TRANS_ARRAY;
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct {
|
2009-09-20 19:32:12 +02:00
|
|
|
int index; /* index in symbol table */
|
|
|
|
TYPE type; /* data type */
|
|
|
|
int value; /* value */
|
|
|
|
TRANS_ARRAY array; /* array dimensions */
|
|
|
|
PATTERN *init; /* initialization code */
|
|
|
|
int64_t lvalue; /* The value of a LONG constant */
|
|
|
|
unsigned is_new : 1; /* if something must be instanciated */
|
|
|
|
unsigned is_integer : 1; /* if the constant is an integer */
|
2007-12-30 17:41:49 +01:00
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
TRANS_DECL;
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
int index;
|
|
|
|
TYPE type;
|
|
|
|
int nparam;
|
|
|
|
TRANS_PARAM param[MAX_PARAM_FUNC];
|
|
|
|
PATTERN *start;
|
|
|
|
int line;
|
2008-02-24 17:29:02 +01:00
|
|
|
uint64_t byref;
|
2007-12-30 17:41:49 +01:00
|
|
|
unsigned vararg : 1;
|
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
TRANS_FUNC;
|
|
|
|
|
2008-07-19 15:35:36 +02:00
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
int index;
|
|
|
|
int nfield;
|
|
|
|
TRANS_PARAM field[MAX_STRUCT_FIELD];
|
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
TRANS_STRUCTURE;
|
|
|
|
|
2007-12-30 17:41:49 +01:00
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
int index;
|
|
|
|
TYPE type;
|
|
|
|
int nparam;
|
|
|
|
TRANS_PARAM param[MAX_PARAM_FUNC];
|
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
TRANS_EVENT;
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
int index;
|
|
|
|
TYPE type;
|
|
|
|
int line;
|
|
|
|
int comment;
|
|
|
|
bool read;
|
|
|
|
bool _reserved[3];
|
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
TRANS_PROPERTY;
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
int index;
|
|
|
|
TYPE type;
|
|
|
|
int nparam;
|
|
|
|
TRANS_PARAM param[MAX_PARAM_FUNC];
|
|
|
|
int library;
|
|
|
|
int alias;
|
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
TRANS_EXTERN;
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
int type;
|
|
|
|
int value;
|
|
|
|
int state;
|
|
|
|
short *pos;
|
|
|
|
short *pos_break;
|
|
|
|
short *pos_continue;
|
|
|
|
short local;
|
|
|
|
short id;
|
|
|
|
short loop_var;
|
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
TRANS_CTRL;
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
int index;
|
|
|
|
int line;
|
|
|
|
ushort pos;
|
|
|
|
short ctrl_id;
|
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
TRANS_GOTO;
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
int index;
|
|
|
|
ushort pos;
|
|
|
|
short ctrl_id;
|
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
TRANS_LABEL;
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
RESERVED_ID id;
|
|
|
|
void (*func)();
|
|
|
|
}
|
|
|
|
TRANS_STATEMENT;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|