*** empty log message ***

This commit is contained in:
hyung-hwan 2005-02-14 14:37:50 +00:00
parent 100f06ff4b
commit 290885a4d1
8 changed files with 36 additions and 26 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: memory.c,v 1.8 2005-02-07 15:10:41 bacon Exp $
* $Id: memory.c,v 1.9 2005-02-14 14:37:50 bacon Exp $
*/
#include <xp/lisp/memory.h>
@ -383,7 +383,7 @@ xp_lisp_obj_t* xp_lisp_make_true (xp_lisp_mem_t* mem)
return mem->t;
}
xp_lisp_obj_t* xp_lisp_make_int (xp_lisp_mem_t* mem, xp_lisp_int value)
xp_lisp_obj_t* xp_lisp_make_int (xp_lisp_mem_t* mem, xp_lisp_int_t value)
{
xp_lisp_obj_t* obj;
@ -395,7 +395,7 @@ xp_lisp_obj_t* xp_lisp_make_int (xp_lisp_mem_t* mem, xp_lisp_int value)
return obj;
}
xp_lisp_obj_t* xp_lisp_make_float (xp_lisp_mem_t* mem, xp_lisp_float value)
xp_lisp_obj_t* xp_lisp_make_float (xp_lisp_mem_t* mem, xp_lisp_real_t value)
{
xp_lisp_obj_t* obj;

View File

@ -1,5 +1,5 @@
/*
* $Id: memory.h,v 1.3 2005-02-07 15:10:41 bacon Exp $
* $Id: memory.h,v 1.4 2005-02-14 14:37:50 bacon Exp $
*/
#ifndef _XP_LISP_MEM_H_
@ -68,8 +68,8 @@ void xp_lisp_unlock_all (xp_lisp_obj_t* obj);
// object creation of standard types
xp_lisp_obj_t* xp_lisp_make_nil (xp_lisp_mem_t* mem);
xp_lisp_obj_t* xp_lisp_make_true (xp_lisp_mem_t* mem);
xp_lisp_obj_t* xp_lisp_make_int (xp_lisp_mem_t* mem, xp_lisp_int value);
xp_lisp_obj_t* xp_lisp_make_float (xp_lisp_mem_t* mem, xp_lisp_float value);
xp_lisp_obj_t* xp_lisp_make_int (xp_lisp_mem_t* mem, xp_lisp_int_t value);
xp_lisp_obj_t* xp_lisp_make_float (xp_lisp_mem_t* mem, xp_lisp_real_t value);
xp_lisp_obj_t* xp_lisp_make_symbol (xp_lisp_mem_t* mem, const xp_char_t* str, xp_size_t len);
xp_lisp_obj_t* xp_lisp_make_string (xp_lisp_mem_t* mem, const xp_char_t* str, xp_size_t len);
xp_lisp_obj_t* xp_lisp_make_cons (xp_lisp_mem_t* mem, xp_lisp_obj_t* car, xp_lisp_obj_t* cdr);

View File

@ -1,5 +1,5 @@
/*
* $Id: object.h,v 1.3 2005-02-07 15:10:41 bacon Exp $
* $Id: object.h,v 1.4 2005-02-14 14:37:50 bacon Exp $
*/
#ifndef _XP_LISP_OBJECT_H_
@ -49,13 +49,13 @@ struct xp_lisp_obj_true_t
struct xp_lisp_obj_int_t
{
XP_LISP_OBJ_HEADER;
xp_lisp_int value;
xp_lisp_int_t value;
};
struct xp_lisp_obj_float_t
{
XP_LISP_OBJ_HEADER;
xp_lisp_float value;
xp_lisp_real_t value;
};
struct xp_lisp_obj_symbol_t

View File

@ -1,5 +1,5 @@
/*
* $Id: primitive.c,v 1.4 2005-02-05 05:30:25 bacon Exp $
* $Id: primitive.c,v 1.5 2005-02-14 14:37:50 bacon Exp $
*/
#include <xp/lisp/lisp.h>
@ -523,7 +523,7 @@ xp_lisp_obj_t* xp_lisp_prim_letx (xp_lisp_t* lsp, xp_lisp_obj_t* args)
xp_lisp_obj_t* xp_lisp_prim_plus (xp_lisp_t* lsp, xp_lisp_obj_t* args)
{
xp_lisp_obj_t* body, * tmp;
xp_lisp_int value = 0;
xp_lisp_int_t value = 0;
XP_LISP_PRIM_CHECK_ARG_COUNT (lsp, args, 1, XP_LISP_PRIM_MAX_ARG_COUNT);
xp_assert (XP_LISP_TYPE(args) == XP_LISP_OBJ_CONS);

View File

@ -1,5 +1,5 @@
/*
* $Id: print.c,v 1.3 2005-02-04 16:23:34 bacon Exp $
* $Id: print.c,v 1.4 2005-02-14 14:37:50 bacon Exp $
*/
#include <xp/lisp/lisp.h>
@ -67,7 +67,15 @@ void xp_lisp_print (xp_lisp_t* lsp, xp_lisp_obj_t* obj)
xp_fprintf (lsp->outstream,XP_TEXT("t"));
break;
case XP_LISP_OBJ_INT:
xp_fprintf (lsp->outstream,XP_TEXT("%d"), XP_LISP_IVALUE(obj));
if (xp_sizeof(xp_lisp_int_t) == xp_sizeof(int)) {
xp_fprintf (lsp->outstream,XP_TEXT("%d"), XP_LISP_IVALUE(obj));
}
else if (xp_sizeof(xp_lisp_int_t) == xp_sizeof(long)) {
xp_fprintf (lsp->outstream,XP_TEXT("%ld"), XP_LISP_IVALUE(obj));
}
else if (xp_sizeof(xp_lisp_int_t) == xp_sizeof(long long)) {
xp_fprintf (lsp->outstream,XP_TEXT("%lld"), XP_LISP_IVALUE(obj));
}
break;
case XP_LISP_OBJ_FLOAT:
xp_fprintf (lsp->outstream,XP_TEXT("%f"), XP_LISP_FVALUE(obj));

View File

@ -1,5 +1,5 @@
/*
* $Id: read.c,v 1.6 2005-02-05 05:43:55 bacon Exp $
* $Id: read.c,v 1.7 2005-02-14 14:37:50 bacon Exp $
*/
#include <xp/lisp/lisp.h>
@ -326,17 +326,20 @@ static int read_token (xp_lisp_t* lsp)
static int read_number (xp_lisp_t* lsp, int negative)
{
xp_lisp_int_t ivalue = 0;
do {
TOKEN_IVALUE(lsp) =
TOKEN_IVALUE(lsp) * 10 + lsp->curc - XP_CHAR('0');
ivalue = ivalue * 10 + (lsp->curc - XP_CHAR('0'));
TOKEN_ADD_CHAR (lsp, lsp->curc);
NEXT_CHAR (lsp);
} while (IS_DIGIT(lsp->curc));
if (negative) TOKEN_IVALUE(lsp) *= -1;
if (negative) ivalue *= -1;
TOKEN_IVALUE(lsp) = ivalue;
TOKEN_TYPE(lsp) = TOKEN_INT;
// TODO: read floating point numbers
/* TODO: read floating point numbers */
return 0;
}
@ -354,7 +357,7 @@ static int read_ident (xp_lisp_t* lsp)
static int read_string (xp_lisp_t* lsp)
{
int escaped = 0;
xp_lisp_cint code = 0;
xp_cint_t code = 0;
do {
if (lsp->curc == XP_EOF) {

View File

@ -1,5 +1,5 @@
/*
* $Id: token.h,v 1.4 2005-02-07 15:10:41 bacon Exp $
* $Id: token.h,v 1.5 2005-02-14 14:37:50 bacon Exp $
*/
#ifndef _XP_LISP_TOKEN_H_
@ -11,8 +11,8 @@ struct xp_lisp_token_t
{
int type;
xp_lisp_int ivalue;
xp_lisp_float fvalue;
xp_lisp_int_t ivalue;
xp_lisp_real_t fvalue;
xp_size_t capacity;
xp_size_t size;

View File

@ -1,5 +1,5 @@
/*
* $Id: types.h,v 1.4 2005-02-07 15:10:41 bacon Exp $
* $Id: types.h,v 1.5 2005-02-14 14:37:50 bacon Exp $
*/
#ifndef _XP_LISP_TYPES_H_
@ -8,8 +8,7 @@
#include <xp/types.h>
#include <xp/macros.h>
typedef xp_cint_t xp_lisp_cint;
typedef xp_long_t xp_lisp_int;
typedef xp_real_t xp_lisp_float;
typedef xp_long_t xp_lisp_int_t;
typedef xp_real_t xp_lisp_real_t;
#endif