*** empty log message ***

This commit is contained in:
hyung-hwan 2005-08-18 15:28:18 +00:00
parent 99788ea850
commit 5d3ab97c38
16 changed files with 77 additions and 88 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,11 +1,11 @@
/*
* $Id: parser.h,v 1.33 2005-08-18 15:16:39 bacon Exp $
* $Id: parser.h,v 1.34 2005-08-18 15:28:18 bacon Exp $
*/
#ifndef _XP_STX_PARSER_H_
#define _XP_STX_PARSER_H_
#include <xp/stx/stxi.h>
#include <xp/stx/stx.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.38 2005-08-18 15:16:39 bacon Exp $
* $Id: stx.c,v 1.39 2005-08-18 15:28:18 bacon Exp $
*/
#include <xp/stx/stxi.h>
#include <xp/stx/stx.h>
#include <xp/stx/memory.h>
#include <xp/stx/misc.h>

View File

@ -1,5 +1,5 @@
/*
* $Id: stx.h,v 1.42 2005-08-18 15:16:39 bacon Exp $
* $Id: stx.h,v 1.43 2005-08-18 15:28:18 bacon Exp $
*/
#ifndef _XP_STX_STX_H_
@ -13,6 +13,8 @@ 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_symtab_t xp_stx_symtab_t;
typedef struct xp_stx_t xp_stx_t;
/* common object structure */
@ -48,6 +50,52 @@ 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;
};
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)

View File

@ -1,59 +0,0 @@
/*
* $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