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
|
|
|
|
2018-02-12 02:53:46 +01:00
|
|
|
(c) 2000-2017 Benoît Minisini <g4mba5@gmail.com>
|
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;
|
2019-07-15 15:38:52 +02:00
|
|
|
unsigned byref : 1;
|
2012-02-25 02:35:55 +01:00
|
|
|
}
|
2018-05-18 02:19:28 +02:00
|
|
|
TRANS_PARAM;
|
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 {
|
2015-01-16 01:31:59 +01: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
|
|
|
|
unsigned is_embedded : 1; // if it is an embedded array
|
|
|
|
unsigned no_warning : 1; // The symbol name is between braces
|
2012-02-25 02:35:55 +01:00
|
|
|
}
|
|
|
|
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;
|
2019-12-22 20:48:58 +01:00
|
|
|
unsigned no_warning : 1; // The symbol name is between braces
|
|
|
|
unsigned fast : 1;
|
|
|
|
unsigned unsafe : 1;
|
|
|
|
unsigned _reserved : 12;
|
2012-02-25 02:35:55 +01:00
|
|
|
TRANS_PARAM param[MAX_PARAM_FUNC];
|
|
|
|
PATTERN *start;
|
|
|
|
int line;
|
|
|
|
uint64_t byref;
|
|
|
|
}
|
|
|
|
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];
|
|
|
|
}
|
|
|
|
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;
|
2019-12-22 20:48:58 +01:00
|
|
|
unsigned no_warning : 1; // The symbol name is between braces
|
|
|
|
unsigned _reserved : 14;
|
2012-06-01 02:18:38 +02:00
|
|
|
TRANS_PARAM param[MAX_PARAM_FUNC];
|
|
|
|
int library;
|
|
|
|
int alias;
|
2012-02-25 02:35:55 +01:00
|
|
|
}
|
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];
|
2019-08-22 03:13:58 +02:00
|
|
|
int use;
|
2019-12-22 20:48:58 +01:00
|
|
|
unsigned nsynonymous : 3;
|
|
|
|
unsigned read : 1;
|
2012-02-25 02:35:55 +01:00
|
|
|
}
|
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;
|
2013-09-28 22:14:06 +02:00
|
|
|
short loop_var;
|
|
|
|
short _reserved[3];
|
2013-04-29 23:27:11 +02:00
|
|
|
ushort *pos;
|
|
|
|
ushort *pos_break;
|
|
|
|
ushort *pos_continue;
|
2012-02-25 02:35:55 +01:00
|
|
|
}
|
|
|
|
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
|
|
|
}
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
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
|
|
|
|
|