*** empty log message ***

This commit is contained in:
hyung-hwan 2005-08-18 15:16:39 +00:00
parent b221b702d0
commit 99788ea850
18 changed files with 89 additions and 87 deletions

View File

@ -1,11 +1,11 @@
/*
* $Id: array.h,v 1.1 2005-08-15 16:03:57 bacon Exp $
* $Id: array.h,v 1.2 2005-08-18 15:16:39 bacon Exp $
*/
#ifndef _XP_STX_ARRAY_H_
#define _XP_STX_ARRAY_H_
#include <xp/stx/stx.h>
#include <xp/stx/stxi.h>
#ifdef __cplusplus
extern "C" {

View File

@ -1,11 +1,11 @@
/*
* $Id: bootstrp.h,v 1.6 2005-07-11 13:41:59 bacon Exp $
* $Id: bootstrp.h,v 1.7 2005-08-18 15:16:39 bacon Exp $
*/
#ifndef _XP_STX_BOOTSTRP_H_
#define _XP_STX_BOOTSTRP_H_
#include <xp/stx/stx.h>
#include <xp/stx/stxi.h>
#ifdef __cplusplus
extern "C" {

View File

@ -1,9 +0,0 @@
/*
* $Id: builtin.h,v 1.1 2005-07-16 04:50:19 bacon Exp $
*/
#ifndef _XP_STX_BUILTIN_H_
#define _XP_STX_BUILTIN_H_
#endif

View File

@ -1,11 +1,11 @@
/*
* $Id: bytecode.h,v 1.8 2005-08-11 16:16:04 bacon Exp $
* $Id: bytecode.h,v 1.9 2005-08-18 15:16:39 bacon Exp $
*/
#ifndef _XP_STX_BYTECODE_H_
#define _XP_STX_BYTECODE_H_
#include <xp/stx/stx.h>
#include <xp/stx/stxi.h>
#define PUSH_RECEIVER_VARIABLE 0x00
#define PUSH_TEMPORARY_LOCATION 0x10

View File

@ -1,11 +1,11 @@
/*
* $Id: class.h,v 1.11 2005-07-05 04:29:31 bacon Exp $
* $Id: class.h,v 1.12 2005-08-18 15:16:39 bacon Exp $
*/
#ifndef _XP_STX_CLASS_H_
#define _XP_STX_CLASS_H_
#include <xp/stx/stx.h>
#include <xp/stx/stxi.h>
/* definitions for common objects */
#define XP_STX_CLASS_SIZE 8

View File

@ -1,11 +1,11 @@
/*
* $Id: context.h,v 1.3 2005-06-08 16:00:51 bacon Exp $
* $Id: context.h,v 1.4 2005-08-18 15:16:39 bacon Exp $
*/
#ifndef _XP_STX_CONTEXT_H_
#define _XP_STX_CONTEXT_H_
#include <xp/stx/stx.h>
#include <xp/stx/stxi.h>
#define PUSH_OBJECT 0xA0
#define SEND_UNARY_MESSAGE 0xB0

View File

@ -1,11 +1,11 @@
/*
* $Id: dict.h,v 1.2 2005-07-19 12:08:04 bacon Exp $
* $Id: dict.h,v 1.3 2005-08-18 15:16:39 bacon Exp $
*/
#ifndef _XP_STX_DICT_H_
#define _XP_STX_DICT_H_
#include <xp/stx/stx.h>
#include <xp/stx/stxi.h>
#define XP_STX_ASSOCIATION_SIZE 2
#define XP_STX_ASSOCIATION_KEY 0

View File

@ -1,11 +1,11 @@
/*
* $Id: interp.h,v 1.2 2005-07-07 07:45:05 bacon Exp $
* $Id: interp.h,v 1.3 2005-08-18 15:16:39 bacon Exp $
*/
#ifndef _XP_STX_INTERP_H_
#define _XP_STX_INTERP_H_
#include <xp/stx/stx.h>
#include <xp/stx/stxi.h>
#ifdef __cplusplus
extern "C" {

View File

@ -1,6 +1,6 @@
SRCS = \
stx.c memory.c object.c symbol.c class.c array.c \
dict.c misc.c context.c name.c token.c parser.c bootstrp.c \
dict.c misc.c name.c token.c parser.c bootstrp.c \
bytecode.c interp.c
OBJS = $(SRCS:.c=.obj)
OUT = xpstx.lib

View File

@ -1,11 +1,11 @@
/*
* $Id: memory.h,v 1.6 2005-06-08 16:00:51 bacon Exp $
* $Id: memory.h,v 1.7 2005-08-18 15:16:39 bacon Exp $
*/
#ifndef _XP_STX_MEMORY_H_
#define _XP_STX_MEMORY_H_
#include <xp/stx/stx.h>
#include <xp/stx/stxi.h>
#ifdef __cplusplus
extern "C" {

View File

@ -1,11 +1,11 @@
/*
* $Id: method.h,v 1.3 2005-08-16 15:49:04 bacon Exp $
* $Id: method.h,v 1.4 2005-08-18 15:16:39 bacon Exp $
*/
#ifndef _XP_STX_METHOD_H_
#define _XP_STX_METHOD_H_
#include <xp/stx/stx.h>
#include <xp/stx/stxi.h>
#define XP_STX_METHOD_SIZE 3
#define XP_STX_METHOD_TEXT 0

View File

@ -1,11 +1,11 @@
/*
* $Id: misc.h,v 1.13 2005-07-07 16:32:37 bacon Exp $
* $Id: misc.h,v 1.14 2005-08-18 15:16:39 bacon Exp $
*/
#ifndef _XP_STX_MISC_H_
#define _XP_STX_MISC_H_
#include <xp/stx/stx.h>
#include <xp/stx/stxi.h>
/* TODO: remove this header later */
#include <xp/bas/stdio.h>

View File

@ -1,11 +1,11 @@
/*
* $Id: name.h,v 1.1 2005-06-12 16:22:03 bacon Exp $
* $Id: name.h,v 1.2 2005-08-18 15:16:39 bacon Exp $
*/
#ifndef _XP_STX_NAME_H_
#define _XP_STX_NAME_H_
#include <xp/stx/stx.h>
#include <xp/stx/stxi.h>
struct xp_stx_name_t
{

View File

@ -1,11 +1,11 @@
/*
* $Id: object.h,v 1.28 2005-07-19 15:52:19 bacon Exp $
* $Id: object.h,v 1.29 2005-08-18 15:16:39 bacon Exp $
*/
#ifndef _XP_STX_OBJECT_H_
#define _XP_STX_OBJECT_H_
#include <xp/stx/stx.h>
#include <xp/stx/stxi.h>
#ifdef __cplusplus
extern "C" {

View File

@ -1,11 +1,11 @@
/*
* $Id: parser.h,v 1.32 2005-07-11 13:41:59 bacon Exp $
* $Id: parser.h,v 1.33 2005-08-18 15:16:39 bacon Exp $
*/
#ifndef _XP_STX_PARSER_H_
#define _XP_STX_PARSER_H_
#include <xp/stx/stx.h>
#include <xp/stx/stxi.h>
#include <xp/stx/name.h>
#include <xp/stx/token.h>
#include <xp/bas/array.h>

View File

@ -1,8 +1,8 @@
/*
* $Id: stx.c,v 1.37 2005-08-15 16:03:57 bacon Exp $
* $Id: stx.c,v 1.38 2005-08-18 15:16:39 bacon Exp $
*/
#include <xp/stx/stx.h>
#include <xp/stx/stxi.h>
#include <xp/stx/memory.h>
#include <xp/stx/misc.h>

View File

@ -1,5 +1,5 @@
/*
* $Id: stx.h,v 1.41 2005-08-15 16:03:57 bacon Exp $
* $Id: stx.h,v 1.42 2005-08-18 15:16:39 bacon Exp $
*/
#ifndef _XP_STX_STX_H_
@ -13,7 +13,6 @@ typedef struct xp_stx_object_t xp_stx_object_t;
typedef struct xp_stx_word_object_t xp_stx_word_object_t;
typedef struct xp_stx_byte_object_t xp_stx_byte_object_t;
typedef struct xp_stx_char_object_t xp_stx_char_object_t;
typedef struct xp_stx_memory_t xp_stx_memory_t;
typedef struct xp_stx_t xp_stx_t;
/* common object structure */
@ -49,53 +48,6 @@ struct xp_stx_char_object_t
xp_char_t data[1];
};
struct xp_stx_memory_t
{
xp_word_t capacity;
xp_stx_object_t** slots;
xp_stx_object_t** free;
xp_bool_t __malloced;
};
struct xp_stx_symtab_t
{
xp_word_t* datum;
xp_word_t size;
xp_word_t capacity;
};
typedef struct xp_stx_symtab_t xp_stx_symtab_t;
struct xp_stx_t
{
xp_stx_memory_t memory;
xp_stx_symtab_t symtab;
xp_word_t nil;
xp_word_t true;
xp_word_t false;
xp_word_t smalltalk;
xp_word_t class_symbol;
xp_word_t class_metaclass;
xp_word_t class_association;
xp_word_t class_object;
xp_word_t class_class;
xp_word_t class_array;
xp_word_t class_bytearray;
xp_word_t class_string;
xp_word_t class_character;
xp_word_t class_context;
xp_word_t class_system_dictionary;
xp_word_t class_method;
xp_word_t class_smallinteger;
xp_bool_t __malloced;
xp_bool_t __wantabort; /* TODO: make it a function pointer */
};
#define XP_STX_IS_SMALLINT(x) (((x) & 0x01) == 0x01)
#define XP_STX_TO_SMALLINT(x) (((x) << 1) | 0x01)
#define XP_STX_FROM_SMALLINT(x) ((x) >> 1)

59
ase/stx/stxi.h Normal file
View File

@ -0,0 +1,59 @@
/*
* $Id: stxi.h,v 1.1 2005-08-18 15:16:39 bacon Exp $
*/
#ifndef _XP_STX_STXI_H_
#define _XP_STX_STXI_H_
#include <xp/stx/stx.h>
typedef struct xp_stx_memory_t xp_stx_memory_t;
typedef struct xp_stx_symtab_t xp_stx_symtab_t;
struct xp_stx_memory_t
{
xp_word_t capacity;
xp_stx_object_t** slots;
xp_stx_object_t** free;
xp_bool_t __malloced;
};
struct xp_stx_symtab_t
{
xp_word_t* datum;
xp_word_t size;
xp_word_t capacity;
};
struct xp_stx_t
{
xp_stx_memory_t memory;
xp_stx_symtab_t symtab;
xp_word_t nil;
xp_word_t true;
xp_word_t false;
xp_word_t smalltalk;
xp_word_t class_symbol;
xp_word_t class_metaclass;
xp_word_t class_association;
xp_word_t class_object;
xp_word_t class_class;
xp_word_t class_array;
xp_word_t class_bytearray;
xp_word_t class_string;
xp_word_t class_character;
xp_word_t class_context;
xp_word_t class_system_dictionary;
xp_word_t class_method;
xp_word_t class_smallinteger;
xp_bool_t __malloced;
xp_bool_t __wantabort; /* TODO: make it a function pointer */
};
#endif