*** empty log message ***

This commit is contained in:
hyung-hwan 2006-12-12 05:16:30 +00:00
parent d46e714d24
commit aad5bcbc24
9 changed files with 30 additions and 23 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: awk.c,v 1.96 2006-12-04 12:58:23 bacon Exp $ * $Id: awk.c,v 1.97 2006-12-12 05:16:29 bacon Exp $
*/ */
#if defined(__BORLANDC__) #if defined(__BORLANDC__)
@ -194,6 +194,7 @@ int ase_awk_clear (ase_awk_t* awk)
awk->parse.depth.cur.expr = 0; awk->parse.depth.cur.expr = 0;
/* clear parse trees */ /* clear parse trees */
awk->tree.ok = 0;
awk->tree.nbglobals = 0; awk->tree.nbglobals = 0;
awk->tree.nglobals = 0; awk->tree.nglobals = 0;
ase_awk_map_clear (&awk->tree.afns); ase_awk_map_clear (&awk->tree.afns);

View File

@ -1,5 +1,5 @@
/* /*
* $Id: awk.h,v 1.162 2006-12-11 14:58:25 bacon Exp $ * $Id: awk.h,v 1.163 2006-12-12 05:16:29 bacon Exp $
*/ */
#ifndef _ASE_AWK_AWK_H_ #ifndef _ASE_AWK_AWK_H_
@ -203,6 +203,7 @@ enum
ASE_AWK_EINVAL, /* invalid parameter */ ASE_AWK_EINVAL, /* invalid parameter */
ASE_AWK_EEXIST, /* existing data found */ ASE_AWK_EEXIST, /* existing data found */
ASE_AWK_ENOENT, /* no such data entry found */ ASE_AWK_ENOENT, /* no such data entry found */
ASE_AWK_EACCES, /* access denied */
ASE_AWK_ERUNTIME, /* run-time error */ ASE_AWK_ERUNTIME, /* run-time error */
ASE_AWK_ERUNNING, /* there are running instances */ ASE_AWK_ERUNNING, /* there are running instances */
ASE_AWK_ETOOMANYRUNS, /* too many running instances */ ASE_AWK_ETOOMANYRUNS, /* too many running instances */

View File

@ -1,5 +1,5 @@
/* /*
* $Id: awk_i.h,v 1.88 2006-12-04 12:58:23 bacon Exp $ * $Id: awk_i.h,v 1.89 2006-12-12 05:16:29 bacon Exp $
*/ */
#ifndef _ASE_AWK_AWKI_H_ #ifndef _ASE_AWK_AWKI_H_
@ -91,6 +91,7 @@ struct ase_awk_tree_t
ase_awk_chain_t* chain; ase_awk_chain_t* chain;
ase_awk_chain_t* chain_tail; ase_awk_chain_t* chain_tail;
ase_size_t chain_size; /* number of nodes in the chain */ ase_size_t chain_size; /* number of nodes in the chain */
int ok;
}; };
struct ase_awk_t struct ase_awk_t
@ -102,7 +103,6 @@ struct ase_awk_t
/* parse tree */ /* parse tree */
ase_awk_tree_t tree; ase_awk_tree_t tree;
int state;
/* temporary information that the parser needs */ /* temporary information that the parser needs */
struct struct

View File

@ -1,5 +1,5 @@
/* /*
* $Id: err.c,v 1.57 2006-12-02 16:26:03 bacon Exp $ * $Id: err.c,v 1.58 2006-12-12 05:16:29 bacon Exp $
*/ */
#include <ase/awk/awk_i.h> #include <ase/awk/awk_i.h>
@ -18,6 +18,7 @@ const ase_char_t* ase_awk_geterrstr (int errnum)
ASE_T("invalid parameter"), ASE_T("invalid parameter"),
ASE_T("existing data found"), ASE_T("existing data found"),
ASE_T("no such data entry found"), ASE_T("no such data entry found"),
ASE_T("permission denied"),
ASE_T("general run-time error"), ASE_T("general run-time error"),
ASE_T("one or more running instances"), ASE_T("one or more running instances"),
ASE_T("too many running instances"), ASE_T("too many running instances"),

View File

@ -2,7 +2,7 @@ OUT = aseawk
C_SRCS = awk.c err.c tree.c str.c tab.c map.c parse.c \ C_SRCS = awk.c err.c tree.c str.c tab.c map.c parse.c \
run.c rec.c val.c func.c misc.c extio.c rex.c run.c rec.c val.c func.c misc.c extio.c rex.c
JNI_SRCS = $(C_SRCS) jni.c JNI_SRCS = jni.c
JAVA_SRCS = Exception.java Extio.java Awk.java StdAwk.java JAVA_SRCS = Exception.java Extio.java Awk.java StdAwk.java
C_OBJS = $(C_SRCS:.c=.obj) C_OBJS = $(C_SRCS:.c=.obj)
@ -29,17 +29,18 @@ JAVACFLAGS = -classpath ../..
LDFLAGS = -Tpd -ap -Gn -c -q $(BDS_LIBPATH) LDFLAGS = -Tpd -ap -Gn -c -q $(BDS_LIBPATH)
STARTUP = c0d32w.obj STARTUP = c0d32w.obj
LIBS = import32.lib cw32mt.lib LIBS = import32.lib cw32mt.lib
JNI_LIBS = $(LIBS) $(OUT).lib
all: lib jni all: lib jni
lib: $(C_OBJS) lib: $(C_OBJS)
$(AR) aseawk.lib @&&! $(AR) $(OUT).lib @&&!
+-$(**: = &^ +-$(**: = &^
+-) +-)
! !
jni: $(JNI_OBJS) $(JAVA_OBJS) jni: lib $(JNI_OBJS) $(JAVA_OBJS)
$(LD) $(LDFLAGS) $(STARTUP) $(JNI_OBJS),$(OUT).dll,,$(LIBS),jni.def, $(LD) $(LDFLAGS) $(STARTUP) $(JNI_OBJS),$(OUT).dll,,$(JNI_LIBS),jni.def,
ada: ada:
gnatmake -I.. ase-awk gnatmake -I.. ase-awk

View File

@ -2,7 +2,7 @@ OUT = aseawk
C_SRCS = awk.c err.c tree.c str.c tab.c map.c parse.c \ C_SRCS = awk.c err.c tree.c str.c tab.c map.c parse.c \
run.c rec.c val.c func.c misc.c extio.c rex.c run.c rec.c val.c func.c misc.c extio.c rex.c
JNI_SRCS = $(C_SRCS) jni.c JNI_SRCS = jni.c
JAVA_SRCS = Awk.java Exception.java Extio.java JAVA_SRCS = Awk.java Exception.java Extio.java
C_OBJS = $(C_SRCS:.c=.obj) C_OBJS = $(C_SRCS:.c=.obj)
@ -28,10 +28,11 @@ lib: $(C_OBJS)
/nologo /out:$(OUT).lib $(C_OBJS) /nologo /out:$(OUT).lib $(C_OBJS)
<< <<
jni: $(JNI_OBJS) $(JAVA_OBJS) jni: lib $(JNI_OBJS) $(JAVA_OBJS)
$(LD) /dll /def:jni.def /subsystem:windows /version:0.1 /release @<< $(LD) /dll /def:jni.def /subsystem:windows /version:0.1 /release @<<
/nologo /out:$(OUT).dll $(JNI_OBJS) user32.lib /nologo /out:$(OUT).dll $(JNI_OBJS) /implib:tmp.lib user32.lib $(OUT).lib
<< <<
del tmp.lib tmp.exp
clean: clean:
del $(OBJS) $(OUT).lib $(OUT).dll *.obj *.class del $(OBJS) $(OUT).lib $(OUT).dll *.obj *.class

View File

@ -1,5 +1,5 @@
/* /*
* $Id: parse.c,v 1.220 2006-12-11 08:44:52 bacon Exp $ * $Id: parse.c,v 1.221 2006-12-12 05:16:30 bacon Exp $
*/ */
#include <ase/awk/awk_i.h> #include <ase/awk/awk_i.h>
@ -360,7 +360,6 @@ int ase_awk_parse (ase_awk_t* awk, ase_awk_srcios_t* srcios)
ASE_AWK_ASSERT (awk, awk->parse.depth.cur.loop == 0); ASE_AWK_ASSERT (awk, awk->parse.depth.cur.loop == 0);
ASE_AWK_ASSERT (awk, awk->parse.depth.cur.expr == 0); ASE_AWK_ASSERT (awk, awk->parse.depth.cur.expr == 0);
if (n == -1) ase_awk_clear (awk);
return n; return n;
} }
@ -444,6 +443,8 @@ exit_parse:
} }
if (n == -1) ase_awk_clear (awk); if (n == -1) ase_awk_clear (awk);
else awk->tree.ok = 1;
return n; return n;
} }
@ -4401,7 +4402,7 @@ static int __deparse (ase_awk_t* awk)
if (awk->tree.nglobals > awk->tree.nbglobals) if (awk->tree.nglobals > awk->tree.nbglobals)
{ {
ase_size_t i, len; ase_size_t i/*, len*/;
ASE_AWK_ASSERT (awk, awk->tree.nglobals > 0); ASE_AWK_ASSERT (awk, awk->tree.nglobals > 0);
if (ase_awk_putsrcstr (awk, ASE_T("global ")) == -1) if (ase_awk_putsrcstr (awk, ASE_T("global ")) == -1)

View File

@ -1,5 +1,5 @@
/* /*
* $Id: run.c,v 1.296 2006-12-11 08:44:52 bacon Exp $ * $Id: run.c,v 1.297 2006-12-12 05:16:30 bacon Exp $
*/ */
#include <ase/awk/awk_i.h> #include <ase/awk/awk_i.h>
@ -568,8 +568,9 @@ int ase_awk_run (ase_awk_t* awk,
awk->tree.chain_size == 0 && awk->tree.chain_size == 0 &&
ase_awk_map_getsize(&awk->tree.afns) == 0) ase_awk_map_getsize(&awk->tree.afns) == 0)
{ {
/* no code to execute */ /* the code has not been parsed. deny the run */
return 0; awk->errnum = ASE_AWK_EACCES;
return -1;
} }
run = (ase_awk_run_t*) ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_run_t)); run = (ase_awk_run_t*) ASE_AWK_MALLOC (awk, ASE_SIZEOF(ase_awk_run_t));

View File

@ -1,5 +1,5 @@
/* /*
* $Id: tree.c,v 1.95 2006-12-11 08:44:52 bacon Exp $ * $Id: tree.c,v 1.96 2006-12-12 05:16:30 bacon Exp $
*/ */
#include <ase/awk/awk_i.h> #include <ase/awk/awk_i.h>
@ -374,8 +374,8 @@ static int __print_expression (ase_awk_t* awk, ase_awk_nde_t* nde)
case ASE_AWK_NDE_GLOBAL: case ASE_AWK_NDE_GLOBAL:
{ {
ase_char_t tmp[ASE_SIZEOF(ase_long_t)*8+2]; /*ase_char_t tmp[ASE_SIZEOF(ase_long_t)*8+2];
ase_size_t n; ase_size_t n;*/
ase_awk_nde_var_t* px = (ase_awk_nde_var_t*)nde; ase_awk_nde_var_t* px = (ase_awk_nde_var_t*)nde;
if (px->id.idxa != (ase_size_t)-1) if (px->id.idxa != (ase_size_t)-1)
@ -399,8 +399,8 @@ static int __print_expression (ase_awk_t* awk, ase_awk_nde_t* nde)
case ASE_AWK_NDE_GLOBALIDX: case ASE_AWK_NDE_GLOBALIDX:
{ {
ase_char_t tmp[ASE_SIZEOF(ase_long_t)*8+2]; /*ase_char_t tmp[ASE_SIZEOF(ase_long_t)*8+2];
ase_size_t n; ase_size_t n;*/
ase_awk_nde_var_t* px = (ase_awk_nde_var_t*)nde; ase_awk_nde_var_t* px = (ase_awk_nde_var_t*)nde;
if (px->id.idxa != (ase_size_t)-1) if (px->id.idxa != (ase_size_t)-1)