From 87f38b76bc3f8171a8f9beb3fbdd1a48d044274f Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 14 Mar 2006 16:40:00 +0000 Subject: [PATCH] *** empty log message *** --- ase/awk/Makefile.bcc | 4 ++-- ase/awk/awk.c | 6 +++--- ase/awk/run.c | 9 +++++---- ase/awk/tree.c | 4 +++- ase/awk/val.c | 10 +++++++++- ase/test/awk/Makefile.bcc | 2 +- ase/test/awk/Makefile.lcc | 2 +- 7 files changed, 24 insertions(+), 13 deletions(-) diff --git a/ase/awk/Makefile.bcc b/ase/awk/Makefile.bcc index 8c7a803d..29eeb86e 100644 --- a/ase/awk/Makefile.bcc +++ b/ase/awk/Makefile.bcc @@ -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) @&&! diff --git a/ase/awk/awk.c b/ase/awk/awk.c index 7c16c7e4..19eaf745 100644 --- a/ase/awk/awk.c +++ b/ase/awk/awk.c @@ -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 @@ -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); diff --git a/ase/awk/run.c b/ase/awk/run.c index bb815c61..16bfb957 100644 --- a/ase/awk/run.c +++ b/ase/awk/run.c @@ -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 @@ -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; } diff --git a/ase/awk/tree.c b/ase/awk/tree.c index 1d518a68..7c100633 100644 --- a/ase/awk/tree.c +++ b/ase/awk/tree.c @@ -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 @@ -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 diff --git a/ase/awk/val.c b/ase/awk/val.c index c20764ec..1f499075 100644 --- a/ase/awk/val.c +++ b/ase/awk/val.c @@ -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 @@ -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: diff --git a/ase/test/awk/Makefile.bcc b/ase/test/awk/Makefile.bcc index 80c24962..82087af3 100644 --- a/ase/test/awk/Makefile.bcc +++ b/ase/test/awk/Makefile.bcc @@ -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 diff --git a/ase/test/awk/Makefile.lcc b/ase/test/awk/Makefile.lcc index 9bd7377f..e6c1829c 100644 --- a/ase/test/awk/Makefile.lcc +++ b/ase/test/awk/Makefile.lcc @@ -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