diff --git a/ase/awk/Makefile.lcc b/ase/awk/Makefile.lcc index 1590f104..d23fac50 100644 --- a/ase/awk/Makefile.lcc +++ b/ase/awk/Makefile.lcc @@ -1,7 +1,5 @@ -SRCS = stx.c memory.c object.c symbol.c class.c dict.c misc.c array.c \ - context.c name.c token.c parser.c bootstrp.c bytecode.c interp.c -OBJS = stx.obj memory.obj object.obj symbol.obj class.obj dict.obj misc.obj array.obj \ - context.obj name.obj token.obj parser.obj bootstrp.obj bytecode.obj interp.obj +SRCS = awk.c parse.c tree.c +OBJS = awk.obj parse.obj tree.obj OUT = xpawk.lib CC = lcc diff --git a/ase/awk/tree.c b/ase/awk/tree.c index c69f4a72..6bfe4de4 100644 --- a/ase/awk/tree.c +++ b/ase/awk/tree.c @@ -1,5 +1,5 @@ /* - * $Id: tree.c,v 1.2 2006-01-14 16:09:57 bacon Exp $ + * $Id: tree.c,v 1.3 2006-01-15 06:51:35 bacon Exp $ */ #include @@ -108,16 +108,17 @@ static void __print_statements (xp_awk_node_t* tree, int depth) __print_tabs (depth); xp_printf (XP_TEXT("if (")); __print_expr_node (((xp_awk_node_if_t*)p)->test); - xp_printf (XP_TEXT(") ")); + xp_printf (XP_TEXT(")\n")); +// TODO: identation of depth + 1 if then_part or else_part is not a block if (((xp_awk_node_if_t*)p)->then_part == XP_NULL) - xp_printf (XP_TEXT(";\n")); - else __print_statements (((xp_awk_node_if_t*)p)->then_part, 0); + xp_printf (XP_TEXT(";\n")); + else __print_statements (((xp_awk_node_if_t*)p)->then_part, depth); if (((xp_awk_node_if_t*)p)->else_part != XP_NULL) { __print_tabs (depth); - xp_printf (XP_TEXT("else ")); - __print_statements (((xp_awk_node_if_t*)p)->else_part, 0); + xp_printf (XP_TEXT("else\n")); + __print_statements (((xp_awk_node_if_t*)p)->else_part, depth); } break; diff --git a/ase/test/awk/Makefile.lcc b/ase/test/awk/Makefile.lcc new file mode 100644 index 00000000..5dbbb088 --- /dev/null +++ b/ase/test/awk/Makefile.lcc @@ -0,0 +1,20 @@ +CC = lcc +CFLAGS = -I../../.. -A -ansic -libcdll +#LDFLAGS = -L../../../xp/bas -L../../../xp/awk +#LIBS = -lxpawk -lxpbas +#LDFLAGS = -subsystem console -dynamic -s +LDFLAGS = -subsystem console -s +LIBS = ..\..\..\xp\awk\xpawk.lib ..\..\..\xp\bas\xpbas.lib + +all: awk + +awk: awk.obj + lcclnk $(LDFLAGS) -o awk.exe awk.obj $(LIBS) + +clean: + del $(OBJS) *.obj $(OUT) + +.SUFFIXES: .c .obj +.c.obj: + $(CC) $(CFLAGS) -c $< +