removed unneeded text

This commit is contained in:
hyunghwan.chung 2016-05-07 01:37:44 +00:00
parent f9ad51b5c5
commit 4bbd5b52bb
14 changed files with 81 additions and 159 deletions

22
stix/configure vendored
View File

@ -19835,28 +19835,6 @@ cat >>confdefs.h <<_ACEOF
_ACEOF _ACEOF
cat >>confdefs.h <<_ACEOF
#define STIX_SIZEOF_STRUCT_SOCKADDR_IN ${ac_cv_sizeof_struct_sockaddr_in}
_ACEOF
cat >>confdefs.h <<_ACEOF
#define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 ${ac_cv_sizeof_struct_sockaddr_in6}
_ACEOF
cat >>confdefs.h <<_ACEOF
#define STIX_SIZEOF_STRUCT_SOCKADDR_UN ${ac_cv_sizeof_struct_sockaddr_un}
_ACEOF
cat >>confdefs.h <<_ACEOF
#define STIX_SIZEOF_SOCKLEN_T ${ac_cv_sizeof_socklen_t}
_ACEOF
stix_package_version_major="`echo ${PACKAGE_VERSION} | cut -d. -f1`" stix_package_version_major="`echo ${PACKAGE_VERSION} | cut -d. -f1`"
stix_package_version_minor="`echo ${PACKAGE_VERSION} | cut -d. -f2`" stix_package_version_minor="`echo ${PACKAGE_VERSION} | cut -d. -f2`"
stix_package_version_patch="`echo ${PACKAGE_VERSION} | cut -d. -f3`" stix_package_version_patch="`echo ${PACKAGE_VERSION} | cut -d. -f3`"

View File

@ -1,9 +1,5 @@
dnl AC_PREREQ([2.67]) dnl AC_PREREQ([2.67])
dnl Make sure you change the version information
dnl in include/stix/conf_*.h whenever you change the version
dnl here. Those files don't depend on autoconf, thus requiring
dnl manual change.
AC_INIT([stix],[0.6.0],[Chung, Hyung-Hwan (hyunghwan.chung@gmail.com)],[],[http://code.abiyo.net/@stix]) AC_INIT([stix],[0.6.0],[Chung, Hyung-Hwan (hyunghwan.chung@gmail.com)],[],[http://code.abiyo.net/@stix])
AC_CONFIG_HEADER([lib/stix-cfg.h]) AC_CONFIG_HEADER([lib/stix-cfg.h])
@ -361,12 +357,6 @@ AC_DEFINE_UNQUOTED(STIX_SIZEOF_OFF64_T, ${ac_cv_sizeof_off64_t}, [sizeof(off64_t
AC_DEFINE_UNQUOTED(STIX_SIZEOF_MBSTATE_T, ${ac_cv_sizeof_mbstate_t}, [sizeof(mbstate_t)]) AC_DEFINE_UNQUOTED(STIX_SIZEOF_MBSTATE_T, ${ac_cv_sizeof_mbstate_t}, [sizeof(mbstate_t)])
AC_DEFINE_UNQUOTED(STIX_MBLEN_MAX, ${ax_cv_numvalof_MB_LEN_MAX}, [MB_LEN_MAX]) AC_DEFINE_UNQUOTED(STIX_MBLEN_MAX, ${ax_cv_numvalof_MB_LEN_MAX}, [MB_LEN_MAX])
AC_DEFINE_UNQUOTED(STIX_SIZEOF_STRUCT_SOCKADDR_IN, ${ac_cv_sizeof_struct_sockaddr_in}, [sizeof(struct sockaddr_in)])
AC_DEFINE_UNQUOTED(STIX_SIZEOF_STRUCT_SOCKADDR_IN6, ${ac_cv_sizeof_struct_sockaddr_in6}, [sizeof(struct sockaddr_in6)])
AC_DEFINE_UNQUOTED(STIX_SIZEOF_STRUCT_SOCKADDR_UN, ${ac_cv_sizeof_struct_sockaddr_un}, [sizeof(struct sockaddr_un)])
AC_DEFINE_UNQUOTED(STIX_SIZEOF_SOCKLEN_T, ${ac_cv_sizeof_socklen_t}, [sizeof(socklen_t)])
stix_package_version_major="`echo ${PACKAGE_VERSION} | cut -d. -f1`" stix_package_version_major="`echo ${PACKAGE_VERSION} | cut -d. -f1`"
stix_package_version_minor="`echo ${PACKAGE_VERSION} | cut -d. -f2`" stix_package_version_minor="`echo ${PACKAGE_VERSION} | cut -d. -f2`"
stix_package_version_patch="`echo ${PACKAGE_VERSION} | cut -d. -f3`" stix_package_version_patch="`echo ${PACKAGE_VERSION} | cut -d. -f3`"

View File

@ -201,6 +201,44 @@
^true. ^true.
} }
## -------------------------------------------------------
## -------------------------------------------------------
#method(#class) inheritsFrom: aClass
{
| c |
c := self superclass.
[c notNil] whileTrue: [
[ c == aClass ] ifTrue: [^true].
c := c superclass.
].
^false
}
#method(#class) isMemberOf: aClass
{
## a class object is an instance of Class
## but Class inherits from Apex. On the other hand,
## most of ordinary classes are under Object again under Apex.
## special consideration is required here.
^aClass == Class
}
#method(#class) isKindOf: aClass
{
^(self isMemberOf: aClass) or: [self inheritsFrom: aClass].
}
#method isMemberOf: aClass
{
^self class == aClass
}
#method isKindOf: aClass
{
^(self isMemberOf: aClass) or: [self class inheritsFrom: aClass].
}
## ------------------------------------------------------- ## -------------------------------------------------------
## ------------------------------------------------------- ## -------------------------------------------------------

View File

@ -14,6 +14,11 @@
^self. ^self.
} }
## ########################################################################
## most of the following methods can actuall become class methods of Apex.
## ########################################################################
#method name #method name
{ {
^self.name ^self.name
@ -31,7 +36,7 @@
^self.spec bitShift: -7 ^self.spec bitShift: -7
} }
#method inheritsFrom: aSuperclass "#method inheritsFrom: aSuperclass
{ {
| c | | c |
c := self superclass. c := self superclass.
@ -40,5 +45,5 @@
c := c superclass. c := c superclass.
]. ].
^false ^false
} }"
} }

View File

@ -56,7 +56,7 @@
^self.method preambleCode == 10. ^self.method preambleCode == 10.
} }
#method findExceptionHandlerBlock: anException #method findExceptionHandlerBlock: anExceptionClass
{ {
## for this to work, self must be an exception handler context. ## for this to work, self must be an exception handler context.
## For a single on:do: call, ## For a single on:do: call,
@ -70,7 +70,7 @@
bound := self basicSize - 1. bound := self basicSize - 1.
8 to: bound by: 2 do: [ :i | 8 to: bound by: 2 do: [ :i |
exc := self basicAt: i. exc := self basicAt: i.
((anException == exc) or: [anException inheritsFrom: exc]) ifTrue: [^self basicAt: (i + 1)]. ((anExceptionClass == exc) or: [anExceptionClass inheritsFrom: exc]) ifTrue: [^self basicAt: (i + 1)].
] ]
]. ].
^nil. ^nil.
@ -415,7 +415,7 @@ thisContext isExceptionHandlerContext dump.
ctx := thisContext. ctx := thisContext.
[ctx notNil] whileTrue: [ [ctx notNil] whileTrue: [
(ctx class == MethodContext) (ctx class == MethodContext)
ifTrue: [ (ctx method owner name, ' - ', ctx method name) dump ]. ifTrue: [ (ctx method owner name, '>>', ctx method name) dump ].
## TODO: include blockcontext??? ## TODO: include blockcontext???
ctx := ctx sender. ctx := ctx sender.
]. ].

View File

@ -5,6 +5,8 @@
#include 'Boolean.st'. #include 'Boolean.st'.
#########################################################################################
#class Error(Object) #class Error(Object)
{ {
#method(#class) signal: aString #method(#class) signal: aString
@ -350,3 +352,7 @@ f isNil ifTrue: [ self error: 'No such function' ].
} }
#########################################################################################
## #include 'Console.st'

View File

@ -171,13 +171,28 @@
## self test4. ## self test4.
## self test5. ## self test5.
## self test11. self test11.
## self test12. ## self test12.
##100 timesRepeat: ['>>>>> END OF MAIN' dump]. ##100 timesRepeat: ['>>>>> END OF MAIN' dump].
"(Exception isKindOf: Apex) dump.
(Exception isMemberOf: Apex) dump.
(Exception isMemberOf: Class) dump.
(1 isMemberOf: SmallInteger) dump.
(1 isKindOf: Integer) dump.
(1 isKindOf: Class) dump.
(1 isKindOf: Apex) dump.
(Exception isKindOf: Class) dump.
(Exception isKindOf: Apex) dump.
(Exception isKindOf: Object) dump.
(Exception isKindOf: (Apex new)) dump.
(Exception isKindOf: (Object new)) dump."
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@' dump. '@@@@@@@@@@@@@@@@@@@@@@@@@@@@' dump.
## the following line(return:to:) must cause primitive failure... ## the following line(return:to:) must cause primitive failure...
[ Processor return: 10 to: 20. ] on: Exception do: [:ex | ex messageText dump]. ##[ Processor return: 10 to: 20. ] on: Exception do: [:ex | ex messageText dump].
##[ Processor return: 10 to: 20. ] ##[ Processor return: 10 to: 20. ]
## on: PrimitiveFailureException do: [:ex | 'PRIMITIVE FAILURE CAUGHT HERE HERE HERE' dump] ## on: PrimitiveFailureException do: [:ex | 'PRIMITIVE FAILURE CAUGHT HERE HERE HERE' dump]

View File

@ -3717,6 +3717,7 @@ static int compile_keyword_message (stix_t* stix, int to_super)
saved_kwsel_loc = stix->c->tok.loc; saved_kwsel_loc = stix->c->tok.loc;
saved_kwsel_len = stix->c->mth.kwsels.len; saved_kwsel_len = stix->c->mth.kwsels.len;
/* TODO: optimization for ifTrue: ifFalse: whileTrue: whileFalse .. */
do do
{ {
kw = stix->c->tok.name; kw = stix->c->tok.name;

View File

@ -1653,51 +1653,6 @@ printf ("PRIMITVE VALUE RECEIVER IS NOT A BLOCK CONTEXT\n");
return 1; return 1;
} }
static int prim_block_on_do (stix_t* stix, stix_ooi_t nargs)
{
int x;
stix_oop_oop_t exarr;
stix_oop_context_t blkctx;
stix_ooi_t i, j;
STIX_ASSERT (nargs >= 2);
if ((stix_oow_t)nargs & 1) return 0; /* it expects even number of arguments */
//for (i = 0; i < nargs; i += 2)
//{
// exblk = ACTIVE_STACK_GET(stix, stix->sp);
// excls = ACTIVE_STACK_GET(stix, stix->sp - 1);
//}
x = __block_value (stix, nargs, 0, 0, &blkctx);
if (x <= 0) return x; /* hard failure and soft failure */
/* TOOD: implement zero-cost exception handling.
* this implementation requires allocation of a new array
* every time on:do: is executed */
stix_pushtmp (stix, (stix_oop_t*)&blkctx);
exarr = (stix_oop_oop_t)stix_instantiate (stix, stix->_array, STIX_NULL, nargs);
stix_poptmp (stix);
if (!exarr) return -1; /* hard failure */ /* TOOD: can't this be treated as a soft failure? */
for (i = nargs, j = 0; i > 0;)
{
--i;
exarr->slot[j++] = ACTIVE_STACK_GET(stix, stix->sp - i);
--i;
exarr->slot[j++] = ACTIVE_STACK_GET(stix, stix->sp - i);
}
#if defined(STIX_DEBUG_EXEC_001)
printf ("<<ENTERING BLOCK BY ON:DO:>> SP=%ld\n", (long int)stix->sp);
#endif
SWITCH_ACTIVE_CONTEXT (stix, (stix_oop_context_t)blkctx);
return 1;
}
static int prim_process_resume (stix_t* stix, stix_ooi_t nargs) static int prim_process_resume (stix_t* stix, stix_ooi_t nargs)
{ {
stix_oop_t rcv; stix_oop_t rcv;
@ -2595,15 +2550,14 @@ static prim_t primitives[] =
{ 2, 2, prim_basic_at_put, "_basic_at_put" }, { 2, 2, prim_basic_at_put, "_basic_at_put" },
{ 0, MAX_NARGS, prim_block_value, "_block_value" }, { 0, MAX_NARGS, prim_block_value, "_block_value" },
{ 0, MAX_NARGS, prim_block_new_process, "_block_new_process" }, { 0, MAX_NARGS, prim_block_new_process, "_block_new_process" },
{ 2, MAX_NARGS, prim_block_on_do, "_block_on_do" },
{ 0, 0, prim_process_resume, "_process_resume" }, { 0, 0, prim_process_resume, "_process_resume" },
{ 0, 0, prim_process_terminate, "_process_terminate" }, { 0, 0, prim_process_terminate, "_process_terminate" },
{ 0, 0, prim_process_yield, "_process_yield" }, { 0, 0, prim_process_yield, "_process_yield" },
{ 0, 0, prim_semaphore_signal, "_semaphore_signal" }, { 0, 0, prim_semaphore_signal, "_semaphore_signal" },
{ 0, 0, prim_semaphore_wait, "_semaphore_wait" }, { 0, 0, prim_semaphore_wait, "_semaphore_wait" },
{ 1, 1, prim_processor_schedule, "_processor_schedule" }, { 1, 1, prim_processor_schedule, "_processor_schedule" },
{ 2, 3, prim_processor_add_timed_semaphore, "_processor_add_timed_semaphore" }, { 2, 3, prim_processor_add_timed_semaphore, "_processor_add_timed_semaphore" },

View File

@ -480,18 +480,6 @@
/* sizeof(short) */ /* sizeof(short) */
#undef STIX_SIZEOF_SHORT #undef STIX_SIZEOF_SHORT
/* sizeof(socklen_t) */
#undef STIX_SIZEOF_SOCKLEN_T
/* sizeof(struct sockaddr_in) */
#undef STIX_SIZEOF_STRUCT_SOCKADDR_IN
/* sizeof(struct sockaddr_in6) */
#undef STIX_SIZEOF_STRUCT_SOCKADDR_IN6
/* sizeof(struct sockaddr_un) */
#undef STIX_SIZEOF_STRUCT_SOCKADDR_UN
/* sizeof(void*) */ /* sizeof(void*) */
#undef STIX_SIZEOF_VOID_P #undef STIX_SIZEOF_VOID_P

View File

@ -56,11 +56,6 @@
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG # define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
# define STIX_MBLEN_MAX 8 # define STIX_MBLEN_MAX 8
/* these two have only to be large enough */
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
# define STIX_SIZEOF_SOCKLEN_T 4
#elif defined(__WATCOMC__) && !defined(__386__) #elif defined(__WATCOMC__) && !defined(__386__)
# define STIX_SIZEOF_CHAR 1 # define STIX_SIZEOF_CHAR 1
# define STIX_SIZEOF_SHORT 2 # define STIX_SIZEOF_SHORT 2
@ -86,11 +81,6 @@
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG # define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
# define STIX_MBLEN_MAX 8 # define STIX_MBLEN_MAX 8
/* these two have only to be large enough */
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
# define STIX_SIZEOF_SOCKLEN_T 4
#elif defined(__TURBOC__) #elif defined(__TURBOC__)
/* TODO: be more version specific wchar_t may be available in newer BCC */ /* TODO: be more version specific wchar_t may be available in newer BCC */
# define STIX_SIZEOF_CHAR 1 # define STIX_SIZEOF_CHAR 1
@ -117,11 +107,6 @@
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG # define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
# define STIX_MBLEN_MAX 8 # define STIX_MBLEN_MAX 8
/* these two have only to be large enough */
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
# define STIX_SIZEOF_SOCKLEN_T 4
#elif defined(__ZTC__) && defined(DOS386) #elif defined(__ZTC__) && defined(DOS386)
/* Zortech in DOSX 386 mode (ztc -mx) */ /* Zortech in DOSX 386 mode (ztc -mx) */
@ -149,11 +134,6 @@
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG # define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
# define STIX_MBLEN_MAX 8 # define STIX_MBLEN_MAX 8
/* these two have only to be large enough */
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
# define STIX_SIZEOF_SOCKLEN_T 4
#else #else
# error Define the size of various data types. # error Define the size of various data types.
#endif #endif

View File

@ -52,11 +52,6 @@
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG # define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
# define STIX_MBLEN_MAX 16 # define STIX_MBLEN_MAX 16
/* these two have only to be large enough */
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
# define STIX_SIZEOF_SOCKLEN_T 4
#else #else
# error Define the size of various data types. # error Define the size of various data types.
#endif #endif

View File

@ -76,11 +76,6 @@ _M_X64 x64 platform
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG # define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
# define STIX_MBLEN_MAX 16 # define STIX_MBLEN_MAX 16
/* these two have only to be large enough */
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
# define STIX_SIZEOF_SOCKLEN_T 4
#elif defined(__GNUC__) || defined(__DMC__) || defined(__POCC__) #elif defined(__GNUC__) || defined(__DMC__) || defined(__POCC__)
# define STIX_SIZEOF_CHAR 1 # define STIX_SIZEOF_CHAR 1
# define STIX_SIZEOF_SHORT 2 # define STIX_SIZEOF_SHORT 2
@ -110,10 +105,6 @@ _M_X64 x64 platform
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG # define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
# define STIX_MBLEN_MAX 16 # define STIX_MBLEN_MAX 16
/* these two have only to be large enough */
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
# define STIX_SIZEOF_CHAR 1 # define STIX_SIZEOF_CHAR 1
# define STIX_SIZEOF_SHORT 2 # define STIX_SIZEOF_SHORT 2
@ -147,11 +138,6 @@ _M_X64 x64 platform
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG # define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
# define STIX_MBLEN_MAX 8 # define STIX_MBLEN_MAX 8
/* these two have only to be large enough */
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
# define STIX_SIZEOF_SOCKLEN_T 4
#elif defined(__BORLANDC__) #elif defined(__BORLANDC__)
# define STIX_SIZEOF_CHAR 1 # define STIX_SIZEOF_CHAR 1
@ -182,11 +168,6 @@ _M_X64 x64 platform
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG # define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
# define STIX_MBLEN_MAX 8 # define STIX_MBLEN_MAX 8
/* these two have only to be large enough */
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
# define STIX_SIZEOF_SOCKLEN_T 4
#else #else
# error Define the size of various data types. # error Define the size of various data types.
#endif #endif

View File

@ -59,11 +59,6 @@
/* TODO: check the exact value */ /* TODO: check the exact value */
# define STIX_MBLEN_MAX 8 # define STIX_MBLEN_MAX 8
/* these two have only to be large enough */
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
# define STIX_SIZEOF_SOCKLEN_T 4
#elif defined(__BORLANDC__) #elif defined(__BORLANDC__)
# define STIX_SIZEOF_CHAR 1 # define STIX_SIZEOF_CHAR 1
# define STIX_SIZEOF_SHORT 2 # define STIX_SIZEOF_SHORT 2
@ -88,10 +83,6 @@
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG # define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
# define STIX_MBLEN_MAX 8 # define STIX_MBLEN_MAX 8
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
# define STIX_SIZEOF_SOCKLEN_T 4
#else #else
# error Define the size of various data types. # error Define the size of various data types.
#endif #endif