2007-12-30 17:41:49 +01:00
|
|
|
/***************************************************************************
|
|
|
|
|
2012-02-25 02:35:55 +01:00
|
|
|
gbc_trans_common.h
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2012-02-25 02:35:55 +01:00
|
|
|
(c) 2000-2012 Benoît Minisini <gambas@users.sourceforge.net>
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2012-02-25 02:35:55 +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
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2012-02-25 02:35:55 +01:00
|
|
|
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.
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2012-02-25 02:35:55 +01:00
|
|
|
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., 51 Franklin Street, Fifth Floor, Boston,
|
|
|
|
MA 02110-1301, USA.
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __GBC_TRANS_COMMMON_H
|
|
|
|
#define __GBC_TRANS_COMMMON_H
|
|
|
|
|
|
|
|
typedef
|
2012-02-25 02:35:55 +01:00
|
|
|
struct {
|
|
|
|
TYPE type;
|
|
|
|
int index;
|
|
|
|
PATTERN *optional;
|
2012-09-04 09:29:39 +02:00
|
|
|
short value;
|
|
|
|
unsigned ignore : 1;
|
2012-02-25 02:35:55 +01:00
|
|
|
}
|
|
|
|
TRANS_PARAM; /* must be the same as PARAM in class.h */
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
typedef
|
2012-02-25 02:35:55 +01:00
|
|
|
PATTERN TRANS_TREE;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
typedef
|
2012-02-25 02:35:55 +01:00
|
|
|
struct {
|
|
|
|
int type;
|
|
|
|
int ival;
|
|
|
|
int64_t lval;
|
|
|
|
double dval;
|
2012-07-09 01:23:24 +02:00
|
|
|
bool complex;
|
2012-02-25 02:35:55 +01:00
|
|
|
}
|
|
|
|
TRANS_NUMBER;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
typedef
|
2012-02-25 02:35:55 +01:00
|
|
|
struct {
|
|
|
|
TYPE type;
|
|
|
|
int ndim;
|
|
|
|
int dim[MAX_ARRAY_DIM];
|
|
|
|
}
|
|
|
|
TRANS_ARRAY;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
typedef
|
2012-02-25 02:35:55 +01:00
|
|
|
struct {
|
|
|
|
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 */
|
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
TRANS_DECL;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
typedef
|
2012-02-25 02:35:55 +01:00
|
|
|
struct {
|
|
|
|
int index;
|
|
|
|
TYPE type;
|
2012-06-01 02:18:38 +02:00
|
|
|
short nparam;
|
|
|
|
unsigned vararg : 1;
|
|
|
|
unsigned _reserved : 15;
|
2012-02-25 02:35:55 +01:00
|
|
|
TRANS_PARAM param[MAX_PARAM_FUNC];
|
|
|
|
PATTERN *start;
|
|
|
|
int line;
|
|
|
|
uint64_t byref;
|
2012-05-24 14:05:21 +02:00
|
|
|
unsigned fast : 1;
|
2012-02-25 02:35:55 +01:00
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
TRANS_FUNC;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
typedef
|
2012-02-25 02:35:55 +01:00
|
|
|
struct {
|
|
|
|
int index;
|
|
|
|
TYPE type;
|
2012-06-01 02:18:38 +02:00
|
|
|
short nparam;
|
|
|
|
short _reserved;
|
2012-02-25 02:35:55 +01:00
|
|
|
TRANS_PARAM param[MAX_PARAM_FUNC];
|
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
TRANS_EVENT;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
typedef
|
2012-02-25 02:35:55 +01:00
|
|
|
struct {
|
|
|
|
int index;
|
|
|
|
TYPE type;
|
2012-06-01 02:18:38 +02:00
|
|
|
short nparam;
|
|
|
|
unsigned vararg : 1;
|
|
|
|
unsigned _reserved : 15;
|
|
|
|
TRANS_PARAM param[MAX_PARAM_FUNC];
|
|
|
|
int library;
|
|
|
|
int alias;
|
2012-02-25 02:35:55 +01:00
|
|
|
}
|
|
|
|
PACKED
|
2012-06-01 02:18:38 +02:00
|
|
|
TRANS_EXTERN;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
typedef
|
2012-02-25 02:35:55 +01:00
|
|
|
struct {
|
|
|
|
int index;
|
|
|
|
TYPE type;
|
2012-06-01 02:18:38 +02:00
|
|
|
int line;
|
|
|
|
int comment;
|
|
|
|
int synonymous[3];
|
|
|
|
bool read;
|
|
|
|
unsigned char nsynonymous;
|
|
|
|
bool _reserved[2];
|
2012-02-25 02:35:55 +01:00
|
|
|
}
|
|
|
|
PACKED
|
2012-06-01 02:18:38 +02:00
|
|
|
TRANS_PROPERTY;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
typedef
|
2012-02-25 02:35:55 +01:00
|
|
|
struct {
|
|
|
|
int type;
|
|
|
|
int value;
|
|
|
|
int state;
|
2012-07-25 21:32:57 +02:00
|
|
|
short local;
|
|
|
|
short id;
|
2012-02-25 02:35:55 +01:00
|
|
|
short *pos;
|
|
|
|
short *pos_break;
|
|
|
|
short *pos_continue;
|
|
|
|
short loop_var;
|
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
TRANS_CTRL;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
typedef
|
2012-02-25 02:35:55 +01:00
|
|
|
struct {
|
|
|
|
int index;
|
|
|
|
int line;
|
|
|
|
ushort pos;
|
|
|
|
short ctrl_id;
|
2012-05-21 03:09:35 +02:00
|
|
|
unsigned gosub : 1;
|
|
|
|
unsigned on_goto : 1;
|
|
|
|
unsigned _reserved : 30;
|
2012-02-25 02:35:55 +01:00
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
TRANS_GOTO;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
typedef
|
2012-02-25 02:35:55 +01:00
|
|
|
struct {
|
|
|
|
int index;
|
|
|
|
ushort pos;
|
|
|
|
short ctrl_id;
|
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
TRANS_LABEL;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
typedef
|
2012-02-25 02:35:55 +01:00
|
|
|
struct {
|
|
|
|
RESERVED_ID id;
|
|
|
|
void (*func)();
|
2012-03-02 23:57:57 +01:00
|
|
|
bool no_try;
|
2012-02-25 02:35:55 +01:00
|
|
|
}
|
|
|
|
TRANS_STATEMENT;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|