initial commit
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: array.c,v 1.2 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: array.c,v 1.1 2007/03/28 14:05:25 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <ase/stx/array.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: array.h,v 1.4 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: array.h,v 1.1 2007/03/28 14:05:25 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_STX_ARRAY_H_
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: bootstrp.c,v 1.34 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: bootstrp.c,v 1.1 2007/03/28 14:05:25 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <ase/stx/bootstrp.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: bootstrp.h,v 1.9 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: bootstrp.h,v 1.1 2007/03/28 14:05:25 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_STX_BOOTSTRP_H_
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: bytecode.c,v 1.17 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: bytecode.c,v 1.1 2007/03/28 14:05:25 bacon Exp $
|
||||
*/
|
||||
#include <ase/stx/bytecode.h>
|
||||
#include <ase/stx/class.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: bytecode.h,v 1.13 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: bytecode.h,v 1.1 2007/03/28 14:05:25 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_STX_BYTECODE_H_
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: class.c,v 1.28 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: class.c,v 1.1 2007/03/28 14:05:25 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <ase/stx/class.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: class.h,v 1.16 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: class.h,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_STX_CLASS_H_
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: context.c,v 1.12 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: context.c,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <ase/stx/context.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: context.h,v 1.6 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: context.h,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_STX_CONTEXT_H_
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dict.c,v 1.11 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: dict.c,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <ase/stx/dict.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dict.h,v 1.5 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: dict.h,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_STX_DICT_H_
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: interp.c,v 1.20 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: interp.c,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <ase/stx/interp.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: interp.h,v 1.7 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: interp.h,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_STX_INTERP_H_
|
||||
|
@ -6,7 +6,7 @@ OBJS = $(SRCS:.c=.obj)
|
||||
OUT = xpstx.lib
|
||||
|
||||
CC = cl
|
||||
CFLAGS = /nologo /MT /GX /W3 /GR- -I../..
|
||||
CFLAGS = /nologo /MT /GX /W3 /GR- /D_WIN32_WINNT=0x0400 -I../..
|
||||
|
||||
all: $(OBJS)
|
||||
link -lib @<<
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: memory.c,v 1.14 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: memory.c,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <ase/stx/memory.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: memory.h,v 1.9 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: memory.h,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_STX_MEMORY_H_
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: method.h,v 1.9 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: method.h,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_STX_METHOD_H_
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: misc.c,v 1.8 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: misc.c,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <ase/stx/misc.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: misc.h,v 1.16 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: misc.h,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_STX_MISC_H_
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: name.c,v 1.4 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: name.c,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <ase/stx/name.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: name.h,v 1.5 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: name.h,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_STX_NAME_H_
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: object.c,v 1.41 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: object.c,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <ase/stx/object.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: object.h,v 1.31 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: object.h,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_STX_OBJECT_H_
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: parser.c,v 1.81 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: parser.c,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <ase/stx/parser.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: parser.h,v 1.37 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: parser.h,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_STX_PARSER_H_
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stx.c,v 1.41 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: stx.c,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <ase/stx/stx.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stx.h,v 1.47 2007-03-22 11:21:59 bacon Exp $
|
||||
* $Id: stx.h,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_STX_STX_H_
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: symbol.c,v 1.23 2007-04-22 13:55:18 bacon Exp $
|
||||
* $Id: symbol.c,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <ase/stx/symbol.h>
|
||||
@ -15,23 +15,19 @@ static void __grow_symtab (ase_stx_t* stx)
|
||||
ncapa = capa << 1;
|
||||
|
||||
nspace = (ase_word_t*)ase_malloc(ase_sizeof(ase_word_t) * ncapa);
|
||||
if (nspace == ASE_NULL)
|
||||
{
|
||||
if (nspace == ASE_NULL) {
|
||||
/* TODO: handle memory error */
|
||||
}
|
||||
|
||||
for (i = 0; i < capa; i++)
|
||||
{
|
||||
for (i = 0; i < capa; i++) {
|
||||
ase_word_t x = stx->symtab.datum[i];
|
||||
if (x == stx->nil) continue;
|
||||
|
||||
j = ase_stx_strxhash (
|
||||
ASE_STX_DATA(stx,x), ASE_STX_SIZE(stx,x)) % ncapa;
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (nspace[j] == stx->nil)
|
||||
{
|
||||
while (1) {
|
||||
if (nspace[j] == stx->nil) {
|
||||
nspace[j] = x;
|
||||
break;
|
||||
}
|
||||
@ -57,8 +53,7 @@ ase_word_t ase_stx_new_symbolx (
|
||||
capa = stx->symtab.capacity;
|
||||
size = stx->symtab.size;
|
||||
|
||||
if (capa <= size + 1)
|
||||
{
|
||||
if (capa <= size + 1) {
|
||||
__grow_symtab (stx);
|
||||
capa = stx->symtab.capacity;
|
||||
}
|
||||
@ -66,11 +61,9 @@ ase_word_t ase_stx_new_symbolx (
|
||||
hash = ase_stx_strxhash(name,len);
|
||||
index = hash % stx->symtab.capacity;
|
||||
|
||||
while (1)
|
||||
{
|
||||
while (1) {
|
||||
x = stx->symtab.datum[index];
|
||||
if (x == stx->nil)
|
||||
{
|
||||
if (x == stx->nil) {
|
||||
/* insert a new item into an empty slot */
|
||||
x = ase_stx_alloc_char_objectx (stx, name, len);
|
||||
ASE_STX_CLASS(stx,x) = stx->class_symbol;
|
||||
@ -93,8 +86,7 @@ void ase_stx_traverse_symbol_table (
|
||||
{
|
||||
ase_word_t index, x;
|
||||
|
||||
for (index = 0; index < stx->symtab.capacity; index++)
|
||||
{
|
||||
for (index = 0; index < stx->symtab.capacity; index++) {
|
||||
x = stx->symtab.datum[index];
|
||||
if (x != stx->nil) func (stx, x, data);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: symbol.h,v 1.9 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: symbol.h,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_STX_SYMBOL_H_
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: token.c,v 1.11 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: token.c,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <ase/stx/token.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: token.h,v 1.19 2007-03-22 11:19:28 bacon Exp $
|
||||
* $Id: token.h,v 1.1 2007/03/28 14:05:28 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_STX_TOKEN_H_
|
||||
|
Reference in New Issue
Block a user