*** empty log message ***

This commit is contained in:
hyung-hwan 2006-03-14 16:40:00 +00:00
parent 083e4f4404
commit 87f38b76bc
7 changed files with 24 additions and 13 deletions

View File

@ -1,9 +1,9 @@
SRCS = awk.c parse.c tree.c
SRCS = awk.c err.c tree.c tab.c map.c parse.c run.c sa.c val.c
OBJS = $(SRCS:.c=.obj)
OUT = xpawk.lib
CC = bcc32
CFLAGS = -O2 -WM -w -w-inl -w-sig -w-spa -w-hid -RT- -I../..
CFLAGS = -O2 -WM -w -w-inl -w-sig -w-spa -w-hid -RT- -I../.. -D__STAND_ALONE
all: $(OBJS)
tlib $(OUT) @&&!

View File

@ -1,5 +1,5 @@
/*
* $Id: awk.c,v 1.28 2006-03-07 15:55:14 bacon Exp $
* $Id: awk.c,v 1.29 2006-03-14 16:40:00 bacon Exp $
*/
#include <xp/awk/awk.h>
@ -56,7 +56,8 @@ xp_awk_t* xp_awk_open (xp_awk_t* awk)
}
// TODO: initial map size...
if (xp_awk_map_open(&awk->run.named, 256, xp_awk_freeval) == XP_NULL) {
if (xp_awk_map_open(&awk->run.named,
256, (void(*)(void*))xp_awk_freeval) == XP_NULL) {
xp_str_close (&awk->token.name);
xp_awk_map_close (&awk->tree.funcs);
xp_awk_tab_close (&awk->parse.globals);
@ -101,7 +102,6 @@ int xp_awk_close (xp_awk_t* awk)
if (xp_awk_detsrc(awk) == -1) return -1;
xp_awk_map_close (&awk->run.named);
xp_awk_map_close (&awk->tree.funcs);
xp_awk_tab_close (&awk->parse.globals);
xp_awk_tab_close (&awk->parse.locals);

View File

@ -1,5 +1,5 @@
/*
* $Id: run.c,v 1.10 2006-03-07 16:09:18 bacon Exp $
* $Id: run.c,v 1.11 2006-03-14 16:40:00 bacon Exp $
*/
#include <xp/awk/awk.h>
@ -42,6 +42,7 @@ int xp_awk_run (xp_awk_t* awk)
(xp_awk_nde_blk_t*)awk->tree.end) == -1) return -1;
}
xp_printf (XP_TEXT("---------------------------\n"));
xp_awk_map_walk (&awk->run.named, __printval);
return 0;
}
@ -65,7 +66,7 @@ static int __run_block (xp_awk_t* awk, xp_awk_nde_blk_t* nde)
while (p != XP_NULL)
{
if (__run_statement(awk, p) == -1) return -1;
if (__run_statement(awk,p) == -1) return -1;
p = p->next;
}
@ -81,7 +82,7 @@ static int __run_statement (xp_awk_t* awk, xp_awk_nde_t* nde)
break;
case XP_AWK_NDE_BLK:
if (__run_block(awk, (xp_awk_nde_blk_t*)nde) == -1) return -1;
if (__run_block(awk,(xp_awk_nde_blk_t*)nde) == -1) return -1;
break;
case XP_AWK_NDE_IF:
@ -274,7 +275,7 @@ static xp_awk_val_t* __eval_binary (xp_awk_t* awk, xp_awk_nde_exp_t* nde)
right = __eval_expression (awk, nde->right);
if (right == XP_NULL)
{
xp_awk_freeval(left);
xp_awk_freeval (left);
return XP_NULL;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: tree.c,v 1.23 2006-03-05 17:07:33 bacon Exp $
* $Id: tree.c,v 1.24 2006-03-14 16:40:00 bacon Exp $
*/
#include <xp/awk/awk.h>
@ -68,6 +68,8 @@ static int __print_expression (xp_awk_nde_t* nde)
case XP_AWK_NDE_INT:
#if defined(vax) || defined(__vax)
xp_printf (XP_TEXT("%ld"), (long)((xp_awk_nde_int_t*)nde)->val);
#elif defined(_WIN32)
xp_printf (XP_TEXT("%I64d"), (__int64)((xp_awk_nde_int_t*)nde)->val);
#else
xp_printf (XP_TEXT("%lld"), (long long)((xp_awk_nde_int_t*)nde)->val);
#endif

View File

@ -1,5 +1,5 @@
/*
* $Id: val.c,v 1.4 2006-03-07 16:09:18 bacon Exp $
* $Id: val.c,v 1.5 2006-03-14 16:40:00 bacon Exp $
*/
#include <xp/awk/awk.h>
@ -98,8 +98,16 @@ void xp_awk_printval (xp_awk_val_t* val)
break;
case XP_AWK_VAL_INT:
#if defined(vax) || defined(__vax)
xp_printf (XP_TEXT("%ld"),
(long)((xp_awk_val_int_t*)val)->val);
#elif defined(_WIN32)
xp_printf (XP_TEXT("%I64d"),
(__int64)((xp_awk_nde_int_t*)val)->val);
#else
xp_printf (XP_TEXT("%lld"),
(long long)((xp_awk_val_int_t*)val)->val);
#endif
break;
case XP_AWK_VAL_REAL:

View File

@ -1,6 +1,6 @@
CC = bcc32
CFLAGS = -I..\..\..
LDFLAGS = -L..\..\..\xp\bas -L..\..\..\xp\awk
LDFLAGS = -L..\..\..\xp\bas -L..\..\..\xp\awk
LIBS = import32.lib cw32mt.lib xpbas.lib xpawk.lib
STARTUP = c0x32w.obj

View File

@ -4,7 +4,7 @@ CFLAGS = -I../../.. -A -ansic -libcdll -D__STAND_ALONE
#LIBS = -lxpawk -lxpbas
#LDFLAGS = -subsystem console -dynamic -s
LDFLAGS = -subsystem console -s
LIBS = ..\..\..\xp\awk\xpawk.lib
LIBS = ../../../xp/awk/xpawk.lib
all: awk