changed the compiler structure a bit for planned architectural change of the compiler

This commit is contained in:
hyunghwan.chung 2018-09-30 16:06:19 +00:00
parent 024976295e
commit 7b5462ca26
7 changed files with 863 additions and 564 deletions

27
moo/configure vendored
View File

@ -19939,6 +19939,33 @@ _ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking numeric value of NSIG" >&5
$as_echo_n "checking numeric value of NSIG... " >&6; }
if ${ax_cv_numvalof_NSIG+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(NSIG)" "ax_cv_numvalof_NSIG" "#include <signal.h>
"; then :
else
ax_cv_numvalof_NSIG=32
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_numvalof_NSIG" >&5
$as_echo "$ax_cv_numvalof_NSIG" >&6; }
cat >>confdefs.h <<_ACEOF
#define NUMVALOF_NSIG $ax_cv_numvalof_NSIG
_ACEOF
if test "x${platform_win32}" = "xyes"
then
# The cast to long int works around a bug in the HP C Compiler

View File

@ -335,6 +335,7 @@ AC_CHECK_SIZEOF(off64_t)
AC_CHECK_SIZEOF(mbstate_t,,[#include <wchar.h>])
AX_CHECK_NUMVALOF(MB_LEN_MAX,[32],[#include <limits.h>])
AX_CHECK_NUMVALOF(PATH_MAX,[0],[#include <limits.h>])
AX_CHECK_NUMVALOF(NSIG,[32],[#include <signal.h>])
if test "x${platform_win32}" = "xyes"
then

View File

@ -143,13 +143,14 @@ class MyObject(TestObject)
##[ Exception signal: 'simulated error' ] on: Exception do: [:ex | 'CAUGHT...' dump. Exception signal: 'jjjjjjj' ].
"[
[ Exception signal: 'simulated error' ] ensure: ['ensure 1' dump ].
] on: Exception do: [:ex | ('EXCETION - ' & ex messageText) dump. Exception signal: 'qqq'. ]."
##[
## [ Exception signal: 'simulated error' ] ensure: ['ensure 1' dump ].
##] on: Exception do: [:ex | ('EXCETION - ' & ex messageText) dump. Exception signal: 'qqq'. ].
"[1 xxx] ifCurtailed: ['XXXXXXXX CURTAILED XXXXXXXXX' dump. Exception signal: 'jjjj']."
##[1 xxx] ifCurtailed: ['XXXXXXXX CURTAILED XXXXXXXXX' dump. Exception signal: 'jjjj'].
" v1 := [
(*
v1 := [
| k |
k := 99.
[
@ -162,7 +163,7 @@ class MyObject(TestObject)
('EXCETION - ' & ex messageText) dump.
## Exception signal: 'qqq'.
].
"
*)
v1 := self aaa_123.
'--------------------------------' dump.

View File

@ -198,7 +198,8 @@ class MyObject(TestObject)
## 100 timesRepeat: ['>>>>> END OF MAIN' dump].
"(Exception isKindOf: Apex) dump.
(*
(Exception isKindOf: Apex) dump.
(Exception isMemberOf: Apex) dump.
(Exception isMemberOf: Class) dump.
(1 isMemberOf: SmallInteger) dump.
@ -209,7 +210,8 @@ class MyObject(TestObject)
(Exception isKindOf: Apex) dump.
(Exception isKindOf: Object) dump.
(Exception isKindOf: (Apex new)) dump.
(Exception isKindOf: (Object new)) dump."
(Exception isKindOf: (Object new)) dump.
*)
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@' dump.

File diff suppressed because it is too large Load Diff

View File

@ -459,6 +459,9 @@
/* The size of `MB_LEN_MAX', as computed by valueof. */
#undef NUMVALOF_MB_LEN_MAX
/* The size of `NSIG', as computed by valueof. */
#undef NUMVALOF_NSIG
/* The size of `PATH_MAX', as computed by valueof. */
#undef NUMVALOF_PATH_MAX

View File

@ -439,20 +439,7 @@ struct moo_loop_t
moo_loop_t* next;
};
typedef struct moo_pooldic_t moo_pooldic_t;
struct moo_pooldic_t
{
moo_oocs_t name;
moo_oocs_t fqn;
moo_oow_t fqn_capa;
moo_ioloc_t fqn_loc;
moo_oop_dic_t pd_oop;
moo_oop_nsdic_t ns_oop;
moo_oow_t start;
moo_oow_t end;
};
typedef struct moo_oopbuf_t moo_oopbuf_t;
struct moo_oopbuf_t
@ -482,50 +469,48 @@ enum moo_pragma_flag_t
MOO_PRAGMA_QC = (1 << 0)
};
struct moo_compiler_t
enum moo_cunit_type_t
{
int pragma_flags;
MOO_CUNIT_BLANK = 0,
MOO_CUNIT_CLASS,
MOO_CUNIT_POOLDIC,
MOO_CUNIT_METHOD
};
typedef enum moo_cunit_type_t moo_cunit_type_t;
/* input handler */
moo_ioimpl_t impl;
#define MOO_CUNIT_HEADER \
moo_cunit_type_t cunit_type; \
moo_cunit_t* cunit_parent
/* information about the last meaningful character read.
* this is a copy of curinp->lxc if no ungetting is performed.
* if there is something in the unget buffer, this is overwritten
* by a value from the buffer when the request to read a character
* is served */
moo_iolxc_t lxc;
/* unget buffer */
moo_iolxc_t ungot[10];
int nungots;
/* static input data buffer */
moo_ioarg_t arg;
/* pointer to the current input data. initially, it points to &arg */
moo_ioarg_t* curinp;
/* the last token read */
moo_iotok_t tok;
moo_iolink_t* io_names;
/* syntax error information */
moo_synerr_t synerr;
/* temporary space used when dealing with an illegal character */
moo_ooch_t ilchr;
moo_oocs_t ilchr_ucs;
/* workspace to use when reading byte array elements */
moo_oobbuf_t balit;
/* workspace space to use when reading an array */
moo_oopbuf_t arlit;
/* information about a class being compiled */
struct
typedef struct moo_cunit_t moo_cunit_t;
struct moo_cunit_t
{
MOO_CUNIT_HEADER;
};
typedef struct moo_cunit_pooldic_t moo_cunit_pooldic_t;
struct moo_cunit_pooldic_t
{
MOO_CUNIT_HEADER;
moo_oocs_t name;
moo_oocs_t fqn;
moo_oow_t fqn_capa;
moo_ioloc_t fqn_loc;
moo_oop_dic_t pd_oop;
moo_oop_nsdic_t ns_oop;
moo_oow_t start;
moo_oow_t end;
};
typedef struct moo_cunit_class_t moo_cunit_class_t;
struct moo_cunit_class_t
{
MOO_CUNIT_HEADER;
int flags;
int indexed_type;
@ -588,14 +573,14 @@ struct moo_compiler_t
moo_oop_dic_t* oops;
moo_oow_t oops_capa;
} pooldic_imp;
} cls;
};
/* pooldic declaration */
moo_pooldic_t pooldic;
/* information about a method being comipled */
struct
typedef struct moo_cunit_method_t moo_cunit_method_t;
struct moo_cunit_method_t
{
MOO_CUNIT_HEADER;
int active;
moo_method_type_t type;
@ -651,7 +636,63 @@ struct moo_compiler_t
/* byte code */
moo_code_t code;
moo_oow_t code_capa;
} mth;
};
struct moo_compiler_t
{
int pragma_flags;
/* input handler */
moo_ioimpl_t impl;
/* information about the last meaningful character read.
* this is a copy of curinp->lxc if no ungetting is performed.
* if there is something in the unget buffer, this is overwritten
* by a value from the buffer when the request to read a character
* is served */
moo_iolxc_t lxc;
/* unget buffer */
moo_iolxc_t ungot[10];
int nungots;
/* static input data buffer */
moo_ioarg_t arg;
/* pointer to the current input data. initially, it points to &arg */
moo_ioarg_t* curinp;
/* the last token read */
moo_iotok_t tok;
moo_iolink_t* io_names;
/* syntax error information */
moo_synerr_t synerr;
/* temporary space used when dealing with an illegal character */
moo_ooch_t ilchr;
moo_oocs_t ilchr_ucs;
/* workspace to use when reading byte array elements */
moo_oobbuf_t balit;
/* workspace space to use when reading an array */
moo_oopbuf_t arlit;
/* the current compilation unit being processed */
moo_cunit_t* cunit;
/* inner-most class unit. it may be same as 'cunit' or something up
* the 'cunit->cunit_parent' chain */
moo_cunit_class_t* cclass;
moo_cunit_pooldic_t* cpooldic;
/* information about a class being compiled */
//moo_cunit_class_t cls;
/* pooldic declaration */
/*moo_cunit_pooldic_t pooldic;*/
/* information about a method being comipled */
moo_cunit_method_t mth;
};
#endif