*** empty log message ***
This commit is contained in:
parent
9f3773ad95
commit
111b108ec0
@ -1,4 +1,4 @@
|
||||
SRCS = awk.c parse.c tree.c sa.c
|
||||
SRCS = awk.c tree.c parse.c run.c sa.c
|
||||
OBJS = $(SRCS:.c=.obj)
|
||||
OUT = xpawk.lib
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
SRCS = awk.c parse.c tree.c
|
||||
OBJS = awk.obj parse.obj tree.obj
|
||||
SRCS = awk.c tree.c parse.c run.c sa.c
|
||||
OBJS = awk.obj tree.obj parse.obj run.obj tree.obj
|
||||
OUT = xpawk.lib
|
||||
|
||||
CC = lcc
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: awk.h,v 1.19 2006-01-25 16:11:43 bacon Exp $
|
||||
* $Id: awk.h,v 1.20 2006-01-26 15:35:20 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _XP_AWK_AWK_H_
|
||||
@ -155,6 +155,7 @@ int xp_awk_attout (xp_awk_t* awk, xp_awk_io_t out, void* arg);
|
||||
int xp_awk_detout (xp_awk_t* awk);
|
||||
|
||||
int xp_awk_parse (xp_awk_t* awk);
|
||||
int xp_awk_run (xp_awk_t* awk);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
SRCS = awk.c parse.c tree.c sa.c
|
||||
SRCS = awk.c tree.c parse.c run.c sa.c
|
||||
OBJS = $(SRCS:.c=.o)
|
||||
OUT = libxpawk.a
|
||||
|
||||
|
45
ase/awk/run.c
Normal file
45
ase/awk/run.c
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* $Id: run.c,v 1.1 2006-01-26 15:35:20 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <xp/awk/awk.h>
|
||||
#ifndef __STAND_ALONE
|
||||
#include <xp/bas/assert.h>
|
||||
#endif
|
||||
|
||||
static int __run_block (xp_awk_t* awk, xp_awk_node_t* node);
|
||||
static int __run_statement (xp_awk_t* awk, xp_awk_node_t* node);
|
||||
|
||||
int xp_awk_run (xp_awk_t* awk)
|
||||
{
|
||||
if (awk->tree.begin != XP_NULL) {
|
||||
if (__run_block(awk, awk->tree.begin) == -1) return -1;
|
||||
}
|
||||
|
||||
if (awk->tree.end != XP_NULL) {
|
||||
if (__run_block(awk, awk->tree.end) == -1) return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __run_block (xp_awk_t* awk, xp_awk_node_t* node)
|
||||
{
|
||||
xp_assert (node->type == XP_AWK_NODE_BLOCK);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int __run_statement (xp_awk_t* awk, xp_awk_node_t* node)
|
||||
{
|
||||
switch (node->type) {
|
||||
case XP_AWK_NODE_BLOCK:
|
||||
if (__run_block(awk, node) == -1) return -1;
|
||||
break;
|
||||
case XP_AWK_NODE_BREAK:
|
||||
break;
|
||||
case XP_AWK_NODE_CONTINUE:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user