From 7adb9d1cbd84e803e939f9e9090a2a552e35039c Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sun, 22 Oct 2006 12:39:30 +0000 Subject: [PATCH] *** empty log message *** --- ase/awk/awk.h | 60 +++---- ase/awk/awk_i.h | 8 +- ase/awk/err.c | 54 +++--- ase/awk/func.c | 4 +- ase/awk/jni.c | 16 +- ase/awk/jni.h | 10 +- ase/awk/misc.c | 152 ++++++++--------- ase/awk/misc.h | 4 +- ase/awk/parse.c | 190 ++++++++++----------- ase/awk/rex.c | 72 ++++---- ase/awk/rex.h | 14 +- ase/awk/run.c | 284 ++++++++++++++++---------------- ase/awk/run.h | 6 +- ase/awk/tree.c | 118 ++++++------- ase/awk/tree.h | 24 +-- ase/awk/val.c | 66 ++++---- ase/configure | 5 +- ase/configure.ac | 4 +- ase/test/awk/awk.c | 348 +++++++++++++++++++-------------------- ase/test/awk/makefile.in | 6 +- 20 files changed, 723 insertions(+), 722 deletions(-) diff --git a/ase/awk/awk.h b/ase/awk/awk.h index 1b9a9dbc..a36c70f0 100644 --- a/ase/awk/awk.h +++ b/ase/awk/awk.h @@ -1,5 +1,5 @@ /* - * $Id: awk.h,v 1.130 2006-10-22 11:34:52 bacon Exp $ + * $Id: awk.h,v 1.131 2006-10-22 12:39:29 bacon Exp $ */ #ifndef _SSE_AWK_AWK_H_ @@ -141,8 +141,8 @@ enum sse_awk_option_t /* allow undeclared variables */ SSE_AWK_IMPLICIT = (1 << 0), - /* variable requires esselicit declaration */ - SSE_AWK_ESSELICIT = (1 << 1), + /* variable requires explicit declaration */ + SSE_AWK_EXPLICIT = (1 << 1), /* a function name should not coincide to be a variable name */ SSE_AWK_UNIQUE = (1 << 2), @@ -162,7 +162,7 @@ enum sse_awk_option_t /* support string concatenation in tokenization. * this option can change the behavior of a certain construct. * getline < "abc" ".def" is treated as if it is getline < "abc.def" - * when this option is on. If this option is off, the same esseression + * when this option is on. If this option is off, the same expression * is treated as if it is (getline < "abc") ".def". */ SSE_AWK_STRCONCAT = (1 << 7), @@ -179,7 +179,7 @@ enum sse_awk_option_t SSE_AWK_STRINDEXONE = (1 << 11), /* strip off leading and trailing spaces when splitting a record - * into fields with a regular esseression. + * into fields with a regular expression. * * Consider the following program. * BEGIN { FS="[:[:space:]]+"; } @@ -229,24 +229,24 @@ enum ant_awk_errnum_t SSE_AWK_ELXCHR, /* lexer came accross an wrong character */ SSE_AWK_ELXUNG, /* lexer failed to unget a character */ - SSE_AWK_EENDSRC, /* unesseected end of source */ - SSE_AWK_EENDCOMMENT, /* unesseected end of a comment */ - SSE_AWK_EENDSTR, /* unesseected end of a string */ - SSE_AWK_EENDREX, /* unesseected end of a regular esseression */ - SSE_AWK_ELBRACE, /* left brace esseected */ - SSE_AWK_ELPAREN, /* left parenthesis esseected */ - SSE_AWK_ERPAREN, /* right parenthesis esseected */ - SSE_AWK_ERBRACK, /* right bracket esseected */ - SSE_AWK_ECOMMA, /* comma esseected */ - SSE_AWK_ESEMICOLON, /* semicolon esseected */ - SSE_AWK_ECOLON, /* colon esseected */ - SSE_AWK_EIN, /* keyword 'in' is esseected */ + SSE_AWK_EENDSRC, /* unexpected end of source */ + SSE_AWK_EENDCOMMENT, /* unexpected end of a comment */ + SSE_AWK_EENDSTR, /* unexpected end of a string */ + SSE_AWK_EENDREX, /* unexpected end of a regular expression */ + SSE_AWK_ELBRACE, /* left brace expected */ + SSE_AWK_ELPAREN, /* left parenthesis expected */ + SSE_AWK_ERPAREN, /* right parenthesis expected */ + SSE_AWK_ERBRACK, /* right bracket expected */ + SSE_AWK_ECOMMA, /* comma expected */ + SSE_AWK_ESEMICOLON, /* semicolon expected */ + SSE_AWK_ECOLON, /* colon expected */ + SSE_AWK_EIN, /* keyword 'in' is expected */ SSE_AWK_ENOTVAR, /* not a variable name after 'in' */ - SSE_AWK_EESSERESSION, /* esseression esseected */ + SSE_AWK_EEXPRESSION, /* expression expected */ - SSE_AWK_EWHILE, /* keyword 'while' is esseected */ - SSE_AWK_EASSIGNMENT, /* assignment statement esseected */ - SSE_AWK_EIDENT, /* identifier esseected */ + SSE_AWK_EWHILE, /* keyword 'while' is expected */ + SSE_AWK_EASSIGNMENT, /* assignment statement expected */ + SSE_AWK_EIDENT, /* identifier expected */ SSE_AWK_EBEGINBLOCK, /* BEGIN requires an action block */ SSE_AWK_EENDBLOCK, /* END requires an action block */ SSE_AWK_EDUPBEGIN, /* duplicate BEGIN */ @@ -266,7 +266,7 @@ enum ant_awk_errnum_t SSE_AWK_ECONTINUE, /* continue outside a loop */ SSE_AWK_ENEXT, /* next illegal in BEGIN or END block */ SSE_AWK_ENEXTFILE, /* nextfile illegal in BEGIN or END block */ - SSE_AWK_EGETLINE, /* getline esseected */ + SSE_AWK_EGETLINE, /* getline expected */ /* run time error */ SSE_AWK_EDIVBYZERO, /* divide by zero */ @@ -291,15 +291,15 @@ enum ant_awk_errnum_t SSE_AWK_EIOHANDLER, /* io handler has returned an error */ SSE_AWK_EINTERNAL, /* internal error */ - /* regular esseression error */ - SSE_AWK_EREXRPAREN, /* a right parenthesis is esseected */ - SSE_AWK_EREXRBRACKET, /* a right bracket is esseected */ - SSE_AWK_EREXRBRACE, /* a right brace is esseected */ - SSE_AWK_EREXCOLON, /* a colon is esseected */ + /* regular expression error */ + SSE_AWK_EREXRPAREN, /* a right parenthesis is expected */ + SSE_AWK_EREXRBRACKET, /* a right bracket is expected */ + SSE_AWK_EREXRBRACE, /* a right brace is expected */ + SSE_AWK_EREXCOLON, /* a colon is expected */ SSE_AWK_EREXCRANGE, /* invalid character range */ SSE_AWK_EREXCCLASS, /* invalid character class */ SSE_AWK_EREXBRANGE, /* invalid boundary range */ - SSE_AWK_EREXEND, /* unesseected end of the pattern */ + SSE_AWK_EREXEND, /* unexpected end of the pattern */ SSE_AWK_EREXGARBAGE /* garbage after the pattern */ }; @@ -371,7 +371,7 @@ void sse_awk_setrunerrnum (sse_awk_run_t* run, int errnum); int sse_awk_clrrec (sse_awk_run_t* run, sse_bool_t skip_inrec_line); int sse_awk_setrec (sse_awk_run_t* run, sse_size_t idx, const sse_char_t* str, sse_size_t len); -/* utility functions esseorted by awk.h */ +/* utility functions exported by awk.h */ sse_long_t sse_awk_strxtolong ( sse_awk_t* awk, const sse_char_t* str, sse_size_t len, int base, const sse_char_t** endptr); @@ -383,7 +383,7 @@ sse_size_t sse_awk_longtostr ( sse_long_t value, int radix, const sse_char_t* prefix, sse_char_t* buf, sse_size_t size); -/* string functions esseorted by awk.h */ +/* string functions exported by awk.h */ sse_char_t* sse_awk_strdup ( sse_awk_t* awk, const sse_char_t* str); sse_char_t* sse_awk_strxdup ( diff --git a/ase/awk/awk_i.h b/ase/awk/awk_i.h index f22aa5e2..d60bfe86 100644 --- a/ase/awk/awk_i.h +++ b/ase/awk/awk_i.h @@ -1,5 +1,5 @@ /* - * $Id: awk_i.h,v 1.69 2006-10-22 11:34:52 bacon Exp $ + * $Id: awk_i.h,v 1.70 2006-10-22 12:39:29 bacon Exp $ */ #ifndef _SSE_AWK_AWKI_H_ @@ -22,10 +22,10 @@ typedef struct sse_awk_tree_t sse_awk_tree_t; #include #ifdef NDEBUG - #define sse_awk_assert(awk,esser) ((void)0) + #define sse_awk_assert(awk,expr) ((void)0) #else - #define sse_awk_assert(awk,esser) (void)((esser) || \ - (sse_awk_abort(awk, SSE_TEXT(#esser), SSE_TEXT(__FILE__), __LINE__), 0)) + #define sse_awk_assert(awk,expr) (void)((expr) || \ + (sse_awk_abort(awk, SSE_TEXT(#expr), SSE_TEXT(__FILE__), __LINE__), 0)) #endif #ifdef _MSC_VER diff --git a/ase/awk/err.c b/ase/awk/err.c index 3fbc1544..47c229cb 100644 --- a/ase/awk/err.c +++ b/ase/awk/err.c @@ -1,5 +1,5 @@ /* - * $Id: err.c,v 1.43 2006-10-22 11:34:53 bacon Exp $ + * $Id: err.c,v 1.44 2006-10-22 12:39:29 bacon Exp $ */ #include @@ -42,24 +42,24 @@ const sse_char_t* sse_awk_geterrstr (int errnum) SSE_T("invalid character"), SSE_T("cannot unget character"), - SSE_T("unesseected end of source"), - SSE_T("unesseected end of a comment"), - SSE_T("unesseected end of a string"), - SSE_T("unesseected end of a regular esseression"), - SSE_T("left brace esseected"), - SSE_T("left parenthesis esseected"), - SSE_T("right parenthesis esseected"), - SSE_T("right bracket esseected"), - SSE_T("comma esseected"), - SSE_T("semicolon esseected"), - SSE_T("colon esseected"), - SSE_T("keyword 'in' esseected"), + SSE_T("unexpected end of source"), + SSE_T("unexpected end of a comment"), + SSE_T("unexpected end of a string"), + SSE_T("unexpected end of a regular expression"), + SSE_T("left brace expected"), + SSE_T("left parenthesis expected"), + SSE_T("right parenthesis expected"), + SSE_T("right bracket expected"), + SSE_T("comma expected"), + SSE_T("semicolon expected"), + SSE_T("colon expected"), + SSE_T("keyword 'in' expected"), SSE_T("not a variable after 'in'"), - SSE_T("esseression esseected"), + SSE_T("expression expected"), - SSE_T("keyword 'while' esseected"), - SSE_T("assignment statement esseected"), - SSE_T("identifier esseected"), + SSE_T("keyword 'while' expected"), + SSE_T("assignment statement expected"), + SSE_T("identifier expected"), SSE_T("BEGIN requires an action block"), SSE_T("END requires an action block"), SSE_T("duplicate BEGIN"), @@ -79,7 +79,7 @@ const sse_char_t* sse_awk_geterrstr (int errnum) SSE_T("continue outside a loop"), SSE_T("next illegal in BEGIN or END block"), SSE_T("nextfile illegal in BEGIN or END block"), - SSE_T("getline esseected"), + SSE_T("getline expected"), SSE_T("divide by zero"), SSE_T("invalid operand"), @@ -103,15 +103,15 @@ const sse_char_t* sse_awk_geterrstr (int errnum) SSE_T("io handler has returned an error"), SSE_T("internal error that should never have happened"), - SSE_T("a right parenthesis is esseected in the regular esseression"), - SSE_T("a right bracket is esseected in the regular esseression"), - SSE_T("a right brace is esseected in the regular esseression"), - SSE_T("a colon is esseected in the regular esseression"), - SSE_T("invalid character range in the regular esseression"), - SSE_T("invalid character class in the regular esseression"), - SSE_T("invalid boundary range in the regular esseression"), - SSE_T("unesseected end of the regular esseression"), - SSE_T("garbage after the regular esseression") + SSE_T("a right parenthesis is expected in the regular expression"), + SSE_T("a right bracket is expected in the regular expression"), + SSE_T("a right brace is expected in the regular expression"), + SSE_T("a colon is expected in the regular expression"), + SSE_T("invalid character range in the regular expression"), + SSE_T("invalid character class in the regular expression"), + SSE_T("invalid boundary range in the regular expression"), + SSE_T("unexpected end of the regular expression"), + SSE_T("garbage after the regular expression") }; if (errnum >= 0 && errnum < sse_countof(__errstr)) diff --git a/ase/awk/func.c b/ase/awk/func.c index a7a666d6..7e11fcb9 100644 --- a/ase/awk/func.c +++ b/ase/awk/func.c @@ -1,5 +1,5 @@ /* - * $Id: func.c,v 1.66 2006-10-22 11:34:53 bacon Exp $ + * $Id: func.c,v 1.67 2006-10-22 12:39:29 bacon Exp $ */ #include @@ -175,7 +175,7 @@ static int __bfn_close (sse_awk_run_t* run) /* getline or print doesn't allow an emptry for the * input or output file name. so close should not allow * it either. - * another reason for this is if close is called esselicitly + * another reason for this is if close is called explicitly * with an empty string, it may close the console that uses * an empty string for its identification because closeextio * closes any extios that match the name given unlike diff --git a/ase/awk/jni.c b/ase/awk/jni.c index 460b5008..eb8233a4 100644 --- a/ase/awk/jni.c +++ b/ase/awk/jni.c @@ -1,5 +1,5 @@ /* - * $Id: jni.c,v 1.13 2006-10-22 11:40:51 bacon Exp $ + * $Id: jni.c,v 1.14 2006-10-22 12:39:29 bacon Exp $ */ #include @@ -60,7 +60,7 @@ static void __awk_free (void* ptr, void* custom_data) free (ptr); } -JNIESSEORT void JNICALL Java_sse_awk_Awk_open (JNIEnv* env, jobject obj) +JNIEXPORT void JNICALL Java_sse_awk_Awk_open (JNIEnv* env, jobject obj) { jclass class; jfieldID fid; @@ -117,7 +117,7 @@ JNIESSEORT void JNICALL Java_sse_awk_Awk_open (JNIEnv* env, jobject obj) (*env)->SetLongField (env, obj, fid, (jlong)awk); - opt = SSE_AWK_ESSELICIT | SSE_AWK_UNIQUE | SSE_AWK_DBLSLASHES | + opt = SSE_AWK_EXPLICIT | SSE_AWK_UNIQUE | SSE_AWK_DBLSLASHES | SSE_AWK_SHADING | SSE_AWK_IMPLICIT | SSE_AWK_SHIFT | SSE_AWK_EXTIO | SSE_AWK_BLOCKLESS; sse_awk_setopt (awk, opt); @@ -125,7 +125,7 @@ JNIESSEORT void JNICALL Java_sse_awk_Awk_open (JNIEnv* env, jobject obj) printf ("__awk(native) done => %u, 0x%X\n", awk, awk); } -JNIESSEORT void JNICALL Java_sse_awk_Awk_close (JNIEnv* env, jobject obj) +JNIEXPORT void JNICALL Java_sse_awk_Awk_close (JNIEnv* env, jobject obj) { jclass class; jfieldID fid; @@ -141,7 +141,7 @@ JNIESSEORT void JNICALL Java_sse_awk_Awk_close (JNIEnv* env, jobject obj) printf ("close (native) done\n"); } -JNIESSEORT void JNICALL Java_sse_awk_Awk_parse (JNIEnv* env, jobject obj) +JNIEXPORT void JNICALL Java_sse_awk_Awk_parse (JNIEnv* env, jobject obj) { jclass class; jfieldID fid; @@ -176,7 +176,7 @@ printf ("parse error -> line [%d] %S\n", sse_awk_getsrcline(awk), sse_awk_geterr } } -JNIESSEORT void JNICALL Java_sse_awk_Awk_run (JNIEnv* env, jobject obj) +JNIEXPORT void JNICALL Java_sse_awk_Awk_run (JNIEnv* env, jobject obj) { jclass class; jfieldID fid; @@ -211,14 +211,14 @@ JNIESSEORT void JNICALL Java_sse_awk_Awk_run (JNIEnv* env, jobject obj) } } -JNIESSEORT void JNICALL Java_sse_awk_Awk_set_1extio ( +JNIEXPORT void JNICALL Java_sse_awk_Awk_set_1extio ( JNIEnv* env, jobject obj, jlong extio, jobject handle) { sse_awk_extio_t* epa = (sse_awk_extio_t*)extio; epa->handle = (void*)handle; } -JNIESSEORT jobject JNICALL Java_sse_awk_Awk_get_1extio ( +JNIEXPORT jobject JNICALL Java_sse_awk_Awk_get_1extio ( JNIEnv* env, jobject obj, jlong extio) { sse_awk_extio_t* epa = (sse_awk_extio_t*)extio; diff --git a/ase/awk/jni.h b/ase/awk/jni.h index 401d8e16..f55ede7b 100644 --- a/ase/awk/jni.h +++ b/ase/awk/jni.h @@ -1,5 +1,5 @@ /* - * $Id: jni.h,v 1.5 2006-10-22 11:40:51 bacon Exp $ + * $Id: jni.h,v 1.6 2006-10-22 12:39:29 bacon Exp $ */ #ifndef _SSE_AWK_JNI_H_ @@ -11,10 +11,10 @@ extern "C" { #endif -JNIESSEORT void JNICALL Java_sse_awk_Awk_open (JNIEnv*, jobject); -JNIESSEORT void JNICALL Java_sse_awk_Awk_close (JNIEnv*, jobject); -JNIESSEORT void JNICALL Java_sse_awk_Awk_parse (JNIEnv*, jobject); -JNIESSEORT void JNICALL Java_sse_awk_Awk_run (JNIEnv*, jobject); +JNIEXPORT void JNICALL Java_sse_awk_Awk_open (JNIEnv*, jobject); +JNIEXPORT void JNICALL Java_sse_awk_Awk_close (JNIEnv*, jobject); +JNIEXPORT void JNICALL Java_sse_awk_Awk_parse (JNIEnv*, jobject); +JNIEXPORT void JNICALL Java_sse_awk_Awk_run (JNIEnv*, jobject); #ifdef __cplusplus } diff --git a/ase/awk/misc.c b/ase/awk/misc.c index 820e3d21..62ed59b9 100644 --- a/ase/awk/misc.c +++ b/ase/awk/misc.c @@ -1,5 +1,5 @@ /* - * $Id: misc.c,v 1.29 2006-10-22 11:34:53 bacon Exp $ + * $Id: misc.c,v 1.30 2006-10-22 12:39:29 bacon Exp $ */ #include @@ -135,16 +135,16 @@ sse_long_t sse_awk_strxtolong ( * notice appear in all copies. The University of California * makes no representations about the suitability of this * software for any purpose. It is provided "as is" without - * esseress or implied warranty. + * express or implied warranty. */ -#define MAX_ESSEONENT 511 +#define MAX_EXPONENT 511 sse_real_t sse_awk_strtoreal (sse_awk_t* awk, const sse_char_t* str) { /* * Table giving binary powers of 10. Entry is 10^2^i. - * Used to convert decimal esseonents into floating-point numbers. + * Used to convert decimal exponents into floating-point numbers. */ static sse_real_t powers_of_10[] = { @@ -152,25 +152,25 @@ sse_real_t sse_awk_strtoreal (sse_awk_t* awk, const sse_char_t* str) 1.0e32, 1.0e64, 1.0e128, 1.0e256 }; - sse_real_t fraction, dbl_esse, * d; + sse_real_t fraction, dbl_exp, * d; const sse_char_t* p; sse_cint_t c; - int esse = 0; /* Esseonent read from "EX" field */ + int exp = 0; /* Esseonent read from "EX" field */ /* * Esseonent that derives from the fractional part. Under normal * circumstatnces, it is the negative of the number of digits in F. * However, if I is very long, the last digits of I get dropped - * (otherwise a long I with a large negative esseonent could cause an - * unnecessary overflow on I alone). In this case, frac_esse is + * (otherwise a long I with a large negative exponent could cause an + * unnecessary overflow on I alone). In this case, frac_exp is * incremented one for each dropped digit. */ - int frac_esse; + int frac_exp; int mant_size; /* Number of digits in mantissa. */ int dec_pt; /* Number of mantissa digits BEFORE decimal point */ - const sse_char_t *pesse; /* Temporarily holds location of esseonent in string */ - int negative = 0, esse_negative = 0; + const sse_char_t *pexp; /* Temporarily holds location of exponent in string */ + int negative = 0, exp_negative = 0; p = str; @@ -209,7 +209,7 @@ sse_real_t sse_awk_strtoreal (sse_awk_t* awk, const sse_char_t* str) * If the mantissa has more than 18 digits, ignore the extras, since * they can't affect the value anyway. */ - pesse = p; + pexp = p; p -= mant_size; if (dec_pt < 0) { @@ -222,19 +222,19 @@ sse_real_t sse_awk_strtoreal (sse_awk_t* awk, const sse_char_t* str) if (mant_size > 18) { - frac_esse = dec_pt - 18; + frac_exp = dec_pt - 18; mant_size = 18; } else { - frac_esse = dec_pt - mant_size; + frac_exp = dec_pt - mant_size; } if (mant_size == 0) { fraction = 0.0; /*p = str;*/ - p = pesse; + p = pexp; goto done; } else @@ -266,62 +266,62 @@ sse_real_t sse_awk_strtoreal (sse_awk_t* awk, const sse_char_t* str) fraction = (1.0e9 * frac1) + frac2; } - /* Skim off the esseonent */ - p = pesse; + /* Skim off the exponent */ + p = pexp; if ((*p == SSE_T('E')) || (*p == SSE_T('e'))) { p++; if (*p == SSE_T('-')) { - esse_negative = 1; + exp_negative = 1; p++; } else { if (*p == SSE_T('+')) p++; - esse_negative = 0; + exp_negative = 0; } if (!SSE_AWK_ISDIGIT (awk, *p)) { - /* p = pesse; */ + /* p = pexp; */ /* goto done; */ - goto no_esse; + goto no_exp; } while (SSE_AWK_ISDIGIT (awk, *p)) { - esse = esse * 10 + (*p - SSE_T('0')); + exp = exp * 10 + (*p - SSE_T('0')); p++; } } -no_esse: - if (esse_negative) esse = frac_esse - esse; - else esse = frac_esse + esse; +no_exp: + if (exp_negative) exp = frac_exp - exp; + else exp = frac_exp + exp; /* - * Generate a floating-point number that represents the esseonent. - * Do this by processing the esseonent one bit at a time to combine - * many powers of 2 of 10. Then combine the esseonent with the + * Generate a floating-point number that represents the exponent. + * Do this by processing the exponent one bit at a time to combine + * many powers of 2 of 10. Then combine the exponent with the * fraction. */ - if (esse < 0) + if (exp < 0) { - esse_negative = 1; - esse = -esse; + exp_negative = 1; + exp = -exp; } - else esse_negative = 0; + else exp_negative = 0; - if (esse > MAX_ESSEONENT) esse = MAX_ESSEONENT; + if (exp > MAX_EXPONENT) exp = MAX_EXPONENT; - dbl_esse = 1.0; + dbl_exp = 1.0; - for (d = powers_of_10; esse != 0; esse >>= 1, d++) + for (d = powers_of_10; exp != 0; exp >>= 1, d++) { - if (esse & 01) dbl_esse *= *d; + if (exp & 01) dbl_exp *= *d; } - if (esse_negative) fraction /= dbl_esse; - else fraction *= dbl_esse; + if (exp_negative) fraction /= dbl_exp; + else fraction *= dbl_exp; done: return (negative)? -fraction: fraction; @@ -333,7 +333,7 @@ sse_real_t sse_awk_strxtoreal ( { /* * Table giving binary powers of 10. Entry is 10^2^i. - * Used to convert decimal esseonents into floating-point numbers. + * Used to convert decimal exponents into floating-point numbers. */ static sse_real_t powers_of_10[] = { @@ -341,25 +341,25 @@ sse_real_t sse_awk_strxtoreal ( 1.0e32, 1.0e64, 1.0e128, 1.0e256 }; - sse_real_t fraction, dbl_esse, * d; + sse_real_t fraction, dbl_exp, * d; const sse_char_t* p, * end; sse_cint_t c; - int esse = 0; /* Esseonent read from "EX" field */ + int exp = 0; /* Esseonent read from "EX" field */ /* * Esseonent that derives from the fractional part. Under normal * circumstatnces, it is the negative of the number of digits in F. * However, if I is very long, the last digits of I get dropped - * (otherwise a long I with a large negative esseonent could cause an - * unnecessary overflow on I alone). In this case, frac_esse is + * (otherwise a long I with a large negative exponent could cause an + * unnecessary overflow on I alone). In this case, frac_exp is * incremented one for each dropped digit. */ - int frac_esse; + int frac_exp; int mant_size; /* Number of digits in mantissa. */ int dec_pt; /* Number of mantissa digits BEFORE decimal point */ - const sse_char_t *pesse; /* Temporarily holds location of esseonent in string */ - int negative = 0, esse_negative = 0; + const sse_char_t *pexp; /* Temporarily holds location of exponent in string */ + int negative = 0, exp_negative = 0; p = str; end = str + len; @@ -400,7 +400,7 @@ sse_real_t sse_awk_strxtoreal ( * If the mantissa has more than 18 digits, ignore the extras, since * they can't affect the value anyway. */ - pesse = p; + pexp = p; p -= mant_size; if (dec_pt < 0) { @@ -413,19 +413,19 @@ sse_real_t sse_awk_strxtoreal ( if (mant_size > 18) /* TODO: is 18 correct for sse_real_t??? */ { - frac_esse = dec_pt - 18; + frac_exp = dec_pt - 18; mant_size = 18; } else { - frac_esse = dec_pt - mant_size; + frac_exp = dec_pt - mant_size; } if (mant_size == 0) { fraction = 0.0; /*p = str;*/ - p = pesse; + p = pexp; goto done; } else @@ -458,8 +458,8 @@ sse_real_t sse_awk_strxtoreal ( fraction = (1.0e9 * frac1) + frac2; } - /* Skim off the esseonent */ - p = pesse; + /* Skim off the exponent */ + p = pexp; if (p < end && (*p == SSE_T('E') || *p == SSE_T('e'))) { p++; @@ -468,59 +468,59 @@ sse_real_t sse_awk_strxtoreal ( { if (*p == SSE_T('-')) { - esse_negative = 1; + exp_negative = 1; p++; } else { if (*p == SSE_T('+')) p++; - esse_negative = 0; + exp_negative = 0; } } - else esse_negative = 0; + else exp_negative = 0; if (!(p < end && SSE_AWK_ISDIGIT (awk, *p))) { - /*p = pesse;*/ + /*p = pexp;*/ /*goto done;*/ - goto no_esse; + goto no_exp; } while (p < end && SSE_AWK_ISDIGIT (awk, *p)) { - esse = esse * 10 + (*p - SSE_T('0')); + exp = exp * 10 + (*p - SSE_T('0')); p++; } } -no_esse: - if (esse_negative) esse = frac_esse - esse; - else esse = frac_esse + esse; +no_exp: + if (exp_negative) exp = frac_exp - exp; + else exp = frac_exp + exp; /* - * Generate a floating-point number that represents the esseonent. - * Do this by processing the esseonent one bit at a time to combine - * many powers of 2 of 10. Then combine the esseonent with the + * Generate a floating-point number that represents the exponent. + * Do this by processing the exponent one bit at a time to combine + * many powers of 2 of 10. Then combine the exponent with the * fraction. */ - if (esse < 0) + if (exp < 0) { - esse_negative = 1; - esse = -esse; + exp_negative = 1; + exp = -exp; } - else esse_negative = 0; + else exp_negative = 0; - if (esse > MAX_ESSEONENT) esse = MAX_ESSEONENT; + if (exp > MAX_EXPONENT) exp = MAX_EXPONENT; - dbl_esse = 1.0; + dbl_exp = 1.0; - for (d = powers_of_10; esse != 0; esse >>= 1, d++) + for (d = powers_of_10; exp != 0; exp >>= 1, d++) { - if (esse & 01) dbl_esse *= *d; + if (exp & 01) dbl_exp *= *d; } - if (esse_negative) fraction /= dbl_esse; - else fraction *= dbl_esse; + if (exp_negative) fraction /= dbl_exp; + else fraction *= dbl_exp; done: if (endptr != SSE_NULL) *endptr = p; @@ -1061,11 +1061,11 @@ exit_loop: } int sse_awk_abort (sse_awk_t* awk, - const sse_char_t* esser, const sse_char_t* file, int line) + const sse_char_t* expr, const sse_char_t* file, int line) { awk->syscas.dprintf ( SSE_T("ASSERTION FAILURE AT FILE %s, LINE %d\n%s\n"), - file, line, esser); + file, line, expr); awk->syscas.abort (); return 0; } diff --git a/ase/awk/misc.h b/ase/awk/misc.h index 9e860138..7ea1fa83 100644 --- a/ase/awk/misc.h +++ b/ase/awk/misc.h @@ -1,5 +1,5 @@ /* - * $Id: misc.h,v 1.4 2006-10-22 11:34:53 bacon Exp $ + * $Id: misc.h,v 1.5 2006-10-22 12:39:29 bacon Exp $ */ #ifndef _SSE_AWK_MISC_H_ @@ -39,7 +39,7 @@ sse_char_t* sse_awk_strxntokbyrex ( void* rex, sse_char_t** tok, sse_size_t* tok_len, int* errnum); int sse_awk_abort (sse_awk_t* awk, - const sse_char_t* esser, const sse_char_t* file, int line); + const sse_char_t* expr, const sse_char_t* file, int line); #ifdef __cplusplus } diff --git a/ase/awk/parse.c b/ase/awk/parse.c index 7d23dcdf..6e8c87b4 100644 --- a/ase/awk/parse.c +++ b/ase/awk/parse.c @@ -1,5 +1,5 @@ /* - * $Id: parse.c,v 1.192 2006-10-22 11:34:53 bacon Exp $ + * $Id: parse.c,v 1.193 2006-10-22 12:39:29 bacon Exp $ */ #include @@ -17,7 +17,7 @@ enum TOKEN_MUL_ASSIGN, TOKEN_DIV_ASSIGN, TOKEN_MOD_ASSIGN, - TOKEN_ESSE_ASSIGN, + TOKEN_EXP_ASSIGN, TOKEN_EQ, TOKEN_NE, @@ -44,7 +44,7 @@ enum TOKEN_RSHIFT, TOKEN_LSHIFT, TOKEN_IN, - TOKEN_ESSE, + TOKEN_EXP, TOKEN_LPAREN, TOKEN_RPAREN, @@ -136,11 +136,11 @@ static sse_awk_chain_t* __parse_pattern_block ( static sse_awk_nde_t* __parse_block (sse_awk_t* awk, sse_bool_t is_top); static sse_awk_nde_t* __parse_statement (sse_awk_t* awk); static sse_awk_nde_t* __parse_statement_nb (sse_awk_t* awk); -static sse_awk_nde_t* __parse_esseression (sse_awk_t* awk); +static sse_awk_nde_t* __parse_expression (sse_awk_t* awk); -static sse_awk_nde_t* __parse_basic_esser (sse_awk_t* awk); +static sse_awk_nde_t* __parse_basic_expr (sse_awk_t* awk); -static sse_awk_nde_t* __parse_binary_esser ( +static sse_awk_nde_t* __parse_binary_expr ( sse_awk_t* awk, const __binmap_t* binmap, sse_awk_nde_t*(*next_level_func)(sse_awk_t*)); @@ -224,10 +224,10 @@ static struct __kwent __kwtab[] = { SSE_T("func"), 4, TOKEN_FUNCTION, 0 }, /* keywords for variable declaration */ - { SSE_T("local"), 5, TOKEN_LOCAL, SSE_AWK_ESSELICIT }, - { SSE_T("global"), 6, TOKEN_GLOBAL, SSE_AWK_ESSELICIT }, + { SSE_T("local"), 5, TOKEN_LOCAL, SSE_AWK_EXPLICIT }, + { SSE_T("global"), 6, TOKEN_GLOBAL, SSE_AWK_EXPLICIT }, - /* keywords that start statements excluding esseression statements */ + /* keywords that start statements excluding expression statements */ { SSE_T("if"), 2, TOKEN_IF, 0 }, { SSE_T("else"), 4, TOKEN_ELSE, 0 }, { SSE_T("while"), 5, TOKEN_WHILE, 0 }, @@ -243,7 +243,7 @@ static struct __kwent __kwtab[] = { SSE_T("print"), 5, TOKEN_PRINT, SSE_AWK_EXTIO }, { SSE_T("printf"), 6, TOKEN_PRINTF, SSE_AWK_EXTIO }, - /* keywords that can start an esseression */ + /* keywords that can start an expression */ { SSE_T("getline"), 7, TOKEN_GETLINE, SSE_AWK_EXTIO }, { SSE_NULL, 0, 0 } @@ -409,7 +409,7 @@ static sse_awk_t* __parse_progunit (sse_awk_t* awk) sse_awk_assert (awk, awk->parse.depth.loop == 0); - if ((awk->option & SSE_AWK_ESSELICIT) && MATCH(awk,TOKEN_GLOBAL)) + if ((awk->option & SSE_AWK_EXPLICIT) && MATCH(awk,TOKEN_GLOBAL)) { sse_size_t nglobals; @@ -477,8 +477,8 @@ static sse_awk_t* __parse_progunit (sse_awk_t* awk) else { /* - esseressions - /regular esseression/ + expressions + /regular expression/ pattern && pattern pattern || pattern !pattern @@ -489,7 +489,7 @@ static sse_awk_t* __parse_progunit (sse_awk_t* awk) awk->parse.id.block = PARSE_PATTERN; - ptn = __parse_esseression (awk); + ptn = __parse_expression (awk); if (ptn == SSE_NULL) return SSE_NULL; sse_awk_assert (awk, ptn->next == SSE_NULL); @@ -502,7 +502,7 @@ static sse_awk_t* __parse_progunit (sse_awk_t* awk) return SSE_NULL; } - ptn->next = __parse_esseression (awk); + ptn->next = __parse_expression (awk); if (ptn->next == SSE_NULL) { sse_awk_clrpt (awk, ptn); @@ -870,7 +870,7 @@ static sse_awk_nde_t* __parse_block (sse_awk_t* awk, sse_bool_t is_top) nlocals_max = awk->parse.nlocals_max; /* local variable declarations */ - if (awk->option & SSE_AWK_ESSELICIT) + if (awk->option & SSE_AWK_EXPLICIT) { while (1) { @@ -1256,7 +1256,7 @@ awk->parse.nl_semicolon = 1; } else { - nde = __parse_esseression(awk); + nde = __parse_expression(awk); } awk->parse.nl_semicolon = 0; @@ -1279,13 +1279,13 @@ awk->parse.nl_semicolon = 0; return nde; } -static sse_awk_nde_t* __parse_esseression (sse_awk_t* awk) +static sse_awk_nde_t* __parse_expression (sse_awk_t* awk) { sse_awk_nde_t* x, * y; sse_awk_nde_ass_t* nde; int opcode; - x = __parse_basic_esser (awk); + x = __parse_basic_expr (awk); if (x == SSE_NULL) return SSE_NULL; opcode = __assign_to_opcode (awk); @@ -1308,7 +1308,7 @@ static sse_awk_nde_t* __parse_esseression (sse_awk_t* awk) return SSE_NULL; } - y = __parse_basic_esser (awk); + y = __parse_basic_expr (awk); if (y == SSE_NULL) { sse_awk_clrpt (awk, x); @@ -1332,7 +1332,7 @@ static sse_awk_nde_t* __parse_esseression (sse_awk_t* awk) return (sse_awk_nde_t*)nde; } -static sse_awk_nde_t* __parse_basic_esser (sse_awk_t* awk) +static sse_awk_nde_t* __parse_basic_expr (sse_awk_t* awk) { sse_awk_nde_t* nde, * n1, * n2; @@ -1345,7 +1345,7 @@ static sse_awk_nde_t* __parse_basic_esser (sse_awk_t* awk) if (__get_token(awk) == -1) return SSE_NULL; - n1 = __parse_basic_esser (awk); + n1 = __parse_basic_expr (awk); if (n1 == SSE_NULL) { sse_awk_clrpt (awk, nde); @@ -1355,7 +1355,7 @@ static sse_awk_nde_t* __parse_basic_esser (sse_awk_t* awk) if (!MATCH(awk,TOKEN_COLON)) PANIC (awk, SSE_AWK_ECOLON); if (__get_token(awk) == -1) return SSE_NULL; - n2 = __parse_basic_esser (awk); + n2 = __parse_basic_expr (awk); if (n2 == SSE_NULL) { sse_awk_clrpt (awk, nde); @@ -1385,11 +1385,11 @@ static sse_awk_nde_t* __parse_basic_esser (sse_awk_t* awk) return nde; } -static sse_awk_nde_t* __parse_binary_esser ( +static sse_awk_nde_t* __parse_binary_expr ( sse_awk_t* awk, const __binmap_t* binmap, sse_awk_nde_t*(*next_level_func)(sse_awk_t*)) { - sse_awk_nde_esse_t* nde; + sse_awk_nde_exp_t* nde; sse_awk_nde_t* left, * right; int opcode; @@ -1488,8 +1488,8 @@ static sse_awk_nde_t* __parse_binary_esser ( skip_constant_folding: #endif - nde = (sse_awk_nde_esse_t*) SSE_AWK_MALLOC ( - awk, sse_sizeof(sse_awk_nde_esse_t)); + nde = (sse_awk_nde_exp_t*) SSE_AWK_MALLOC ( + awk, sse_sizeof(sse_awk_nde_exp_t)); if (nde == SSE_NULL) { sse_awk_clrpt (awk, right); @@ -1497,7 +1497,7 @@ static sse_awk_nde_t* __parse_binary_esser ( PANIC (awk, SSE_AWK_ENOMEM); } - nde->type = SSE_AWK_NDE_ESSE_BIN; + nde->type = SSE_AWK_NDE_EXP_BIN; nde->next = SSE_NULL; nde->opcode = opcode; nde->left = left; @@ -1517,7 +1517,7 @@ static sse_awk_nde_t* __parse_logical_or (sse_awk_t* awk) { TOKEN_EOF, 0 } }; - return __parse_binary_esser (awk, map, __parse_logical_and); + return __parse_binary_expr (awk, map, __parse_logical_and); } static sse_awk_nde_t* __parse_logical_and (sse_awk_t* awk) @@ -1528,7 +1528,7 @@ static sse_awk_nde_t* __parse_logical_and (sse_awk_t* awk) { TOKEN_EOF, 0 } }; - return __parse_binary_esser (awk, map, __parse_in); + return __parse_binary_expr (awk, map, __parse_in); } static sse_awk_nde_t* __parse_in (sse_awk_t* awk) @@ -1540,10 +1540,10 @@ static sse_awk_nde_t* __parse_in (sse_awk_t* awk) { TOKEN_EOF, 0 } }; - return __parse_binary_esser (awk, map, __parse_regex_match); + return __parse_binary_expr (awk, map, __parse_regex_match); */ - sse_awk_nde_esse_t* nde; + sse_awk_nde_exp_t* nde; sse_awk_nde_t* left, * right; left = __parse_regex_match (awk); @@ -1573,8 +1573,8 @@ static sse_awk_nde_t* __parse_in (sse_awk_t* awk) PANIC (awk, SSE_AWK_ENOTVAR); } - nde = (sse_awk_nde_esse_t*) SSE_AWK_MALLOC ( - awk, sse_sizeof(sse_awk_nde_esse_t)); + nde = (sse_awk_nde_exp_t*) SSE_AWK_MALLOC ( + awk, sse_sizeof(sse_awk_nde_exp_t)); if (nde == SSE_NULL) { sse_awk_clrpt (awk, right); @@ -1582,7 +1582,7 @@ static sse_awk_nde_t* __parse_in (sse_awk_t* awk) PANIC (awk, SSE_AWK_ENOMEM); } - nde->type = SSE_AWK_NDE_ESSE_BIN; + nde->type = SSE_AWK_NDE_EXP_BIN; nde->next = SSE_NULL; nde->opcode = SSE_AWK_BINOP_IN; nde->left = left; @@ -1603,7 +1603,7 @@ static sse_awk_nde_t* __parse_regex_match (sse_awk_t* awk) { TOKEN_EOF, 0 }, }; - return __parse_binary_esser (awk, map, __parse_bitwise_or); + return __parse_binary_expr (awk, map, __parse_bitwise_or); } static sse_awk_nde_t* __parse_bitwise_or (sse_awk_t* awk) @@ -1620,7 +1620,7 @@ static sse_awk_nde_t* __parse_bitwise_or (sse_awk_t* awk) { TOKEN_EOF, 0 } }; - return __parse_binary_esser (awk, map, __parse_bitwise_xor); + return __parse_binary_expr (awk, map, __parse_bitwise_xor); } } @@ -1691,7 +1691,7 @@ static sse_awk_nde_t* __parse_bitwise_or_with_extio (sse_awk_t* awk) } else { - sse_awk_nde_esse_t* nde; + sse_awk_nde_exp_t* nde; if (in_type == SSE_AWK_IN_COPROC) { @@ -1708,8 +1708,8 @@ static sse_awk_nde_t* __parse_bitwise_or_with_extio (sse_awk_t* awk) /* TODO: do constant folding */ - nde = (sse_awk_nde_esse_t*) SSE_AWK_MALLOC ( - awk, sse_sizeof(sse_awk_nde_esse_t)); + nde = (sse_awk_nde_exp_t*) SSE_AWK_MALLOC ( + awk, sse_sizeof(sse_awk_nde_exp_t)); if (nde == SSE_NULL) { sse_awk_clrpt (awk, right); @@ -1717,7 +1717,7 @@ static sse_awk_nde_t* __parse_bitwise_or_with_extio (sse_awk_t* awk) PANIC (awk, SSE_AWK_ENOMEM); } - nde->type = SSE_AWK_NDE_ESSE_BIN; + nde->type = SSE_AWK_NDE_EXP_BIN; nde->next = SSE_NULL; nde->opcode = SSE_AWK_BINOP_BOR; nde->left = left; @@ -1738,7 +1738,7 @@ static sse_awk_nde_t* __parse_bitwise_xor (sse_awk_t* awk) { TOKEN_EOF, 0 } }; - return __parse_binary_esser (awk, map, __parse_bitwise_and); + return __parse_binary_expr (awk, map, __parse_bitwise_and); } static sse_awk_nde_t* __parse_bitwise_and (sse_awk_t* awk) @@ -1749,7 +1749,7 @@ static sse_awk_nde_t* __parse_bitwise_and (sse_awk_t* awk) { TOKEN_EOF, 0 } }; - return __parse_binary_esser (awk, map, __parse_equality); + return __parse_binary_expr (awk, map, __parse_equality); } static sse_awk_nde_t* __parse_equality (sse_awk_t* awk) @@ -1761,7 +1761,7 @@ static sse_awk_nde_t* __parse_equality (sse_awk_t* awk) { TOKEN_EOF, 0 } }; - return __parse_binary_esser (awk, map, __parse_relational); + return __parse_binary_expr (awk, map, __parse_relational); } static sse_awk_nde_t* __parse_relational (sse_awk_t* awk) @@ -1775,7 +1775,7 @@ static sse_awk_nde_t* __parse_relational (sse_awk_t* awk) { TOKEN_EOF, 0 } }; - return __parse_binary_esser (awk, map, __parse_shift); + return __parse_binary_expr (awk, map, __parse_shift); } static sse_awk_nde_t* __parse_shift (sse_awk_t* awk) @@ -1787,12 +1787,12 @@ static sse_awk_nde_t* __parse_shift (sse_awk_t* awk) { TOKEN_EOF, 0 } }; - return __parse_binary_esser (awk, map, __parse_concat); + return __parse_binary_expr (awk, map, __parse_concat); } static sse_awk_nde_t* __parse_concat (sse_awk_t* awk) { - sse_awk_nde_esse_t* nde; + sse_awk_nde_exp_t* nde; sse_awk_nde_t* left, * right; left = __parse_additive (awk); @@ -1811,8 +1811,8 @@ static sse_awk_nde_t* __parse_concat (sse_awk_t* awk) return SSE_NULL; } - nde = (sse_awk_nde_esse_t*) SSE_AWK_MALLOC ( - awk, sse_sizeof(sse_awk_nde_esse_t)); + nde = (sse_awk_nde_exp_t*) SSE_AWK_MALLOC ( + awk, sse_sizeof(sse_awk_nde_exp_t)); if (nde == SSE_NULL) { sse_awk_clrpt (awk, left); @@ -1820,7 +1820,7 @@ static sse_awk_nde_t* __parse_concat (sse_awk_t* awk) PANIC (awk, SSE_AWK_ENOMEM); } - nde->type = SSE_AWK_NDE_ESSE_BIN; + nde->type = SSE_AWK_NDE_EXP_BIN; nde->next = SSE_NULL; nde->opcode = SSE_AWK_BINOP_CONCAT; nde->left = left; @@ -1841,7 +1841,7 @@ static sse_awk_nde_t* __parse_additive (sse_awk_t* awk) { TOKEN_EOF, 0 } }; - return __parse_binary_esser (awk, map, __parse_multiplicative); + return __parse_binary_expr (awk, map, __parse_multiplicative); } static sse_awk_nde_t* __parse_multiplicative (sse_awk_t* awk) @@ -1851,16 +1851,16 @@ static sse_awk_nde_t* __parse_multiplicative (sse_awk_t* awk) { TOKEN_MUL, SSE_AWK_BINOP_MUL }, { TOKEN_DIV, SSE_AWK_BINOP_DIV }, { TOKEN_MOD, SSE_AWK_BINOP_MOD }, - { TOKEN_ESSE, SSE_AWK_BINOP_ESSE }, + { TOKEN_EXP, SSE_AWK_BINOP_EXP }, { TOKEN_EOF, 0 } }; - return __parse_binary_esser (awk, map, __parse_unary); + return __parse_binary_expr (awk, map, __parse_unary); } static sse_awk_nde_t* __parse_unary (sse_awk_t* awk) { - sse_awk_nde_esse_t* nde; + sse_awk_nde_exp_t* nde; sse_awk_nde_t* left; int opcode; @@ -1876,14 +1876,14 @@ static sse_awk_nde_t* __parse_unary (sse_awk_t* awk) left = __parse_unary (awk); if (left == SSE_NULL) return SSE_NULL; - nde = (sse_awk_nde_esse_t*) SSE_AWK_MALLOC (awk, sse_sizeof(sse_awk_nde_esse_t)); + nde = (sse_awk_nde_exp_t*) SSE_AWK_MALLOC (awk, sse_sizeof(sse_awk_nde_exp_t)); if (nde == SSE_NULL) { sse_awk_clrpt (awk, left); PANIC (awk, SSE_AWK_ENOMEM); } - nde->type = SSE_AWK_NDE_ESSE_UNR; + nde->type = SSE_AWK_NDE_EXP_UNR; nde->next = SSE_NULL; nde->opcode = opcode; nde->left = left; @@ -1894,7 +1894,7 @@ static sse_awk_nde_t* __parse_unary (sse_awk_t* awk) static sse_awk_nde_t* __parse_increment (sse_awk_t* awk) { - sse_awk_nde_esse_t* nde; + sse_awk_nde_exp_t* nde; sse_awk_nde_t* left; int type, opcode, opcode1, opcode2; @@ -1923,18 +1923,18 @@ static sse_awk_nde_t* __parse_increment (sse_awk_t* awk) } else if (opcode1 != -1) { - type = SSE_AWK_NDE_ESSE_INCPRE; + type = SSE_AWK_NDE_EXP_INCPRE; opcode = opcode1; } else if (opcode2 != -1) { - type = SSE_AWK_NDE_ESSE_INCPST; + type = SSE_AWK_NDE_EXP_INCPST; opcode = opcode2; if (__get_token(awk) == -1) return SSE_NULL; } - nde = (sse_awk_nde_esse_t*) SSE_AWK_MALLOC (awk, sse_sizeof(sse_awk_nde_esse_t)); + nde = (sse_awk_nde_exp_t*) SSE_AWK_MALLOC (awk, sse_sizeof(sse_awk_nde_exp_t)); if (nde == SSE_NULL) { sse_awk_clrpt (awk, left); @@ -2061,7 +2061,7 @@ static sse_awk_nde_t* __parse_primary (sse_awk_t* awk) sse_awk_nde_rex_t* nde; int errnum; - /* the regular esseression is tokenized here because + /* the regular expression is tokenized here because * of the context-sensitivity of the slash symbol */ SET_TOKEN_TYPE (awk, TOKEN_REX); sse_awk_str_clear (&awk->token.name); @@ -2140,11 +2140,11 @@ static sse_awk_nde_t* __parse_primary (sse_awk_t* awk) /* eat up the left parenthesis */ if (__get_token(awk) == -1) return SSE_NULL; - /* parse the sub-esseression inside the parentheses */ - nde = __parse_esseression (awk); + /* parse the sub-expression inside the parentheses */ + nde = __parse_expression (awk); if (nde == SSE_NULL) return SSE_NULL; - /* parse subsequent esseressions separated by a comma, if any */ + /* parse subsequent expressions separated by a comma, if any */ last = nde; sse_awk_assert (awk, last->next == SSE_NULL); @@ -2158,7 +2158,7 @@ static sse_awk_nde_t* __parse_primary (sse_awk_t* awk) return SSE_NULL; } - tmp = __parse_esseression (awk); + tmp = __parse_expression (awk); if (tmp == SSE_NULL) { sse_awk_clrpt (awk, nde); @@ -2187,8 +2187,8 @@ static sse_awk_nde_t* __parse_primary (sse_awk_t* awk) /* check if it is a chained node */ if (nde->next != SSE_NULL) { - /* if so, it is a esseression group */ - /* (esser1, esser2, esser2) */ + /* if so, it is a expression group */ + /* (expr1, expr2, expr2) */ sse_awk_nde_grp_t* tmp; @@ -2242,7 +2242,7 @@ static sse_awk_nde_t* __parse_primary (sse_awk_t* awk) } /* TODO: is this correct? */ - /*in = __parse_esseression (awk);*/ + /*in = __parse_expression (awk);*/ in = __parse_primary (awk); if (in == SSE_NULL) { @@ -2270,8 +2270,8 @@ static sse_awk_nde_t* __parse_primary (sse_awk_t* awk) return (sse_awk_nde_t*)nde; } - /* valid esseression introducer is esseected */ - PANIC (awk, SSE_AWK_EESSERESSION); + /* valid expression introducer is expected */ + PANIC (awk, SSE_AWK_EEXPRESSION); } static sse_awk_nde_t* __parse_primary_ident (sse_awk_t* awk) @@ -2428,7 +2428,7 @@ static sse_awk_nde_t* __parse_hashidx ( return SSE_NULL; } - tmp = __parse_esseression (awk); + tmp = __parse_expression (awk); if (tmp == SSE_NULL) { if (idx != SSE_NULL) sse_awk_clrpt (awk, idx); @@ -2555,7 +2555,7 @@ static sse_awk_nde_t* __parse_fncall ( while (1) { - nde = __parse_esseression (awk); + nde = __parse_expression (awk); if (nde == SSE_NULL) { if (head != SSE_NULL) sse_awk_clrpt (awk, head); @@ -2640,7 +2640,7 @@ static sse_awk_nde_t* __parse_if (sse_awk_t* awk) if (!MATCH(awk,TOKEN_LPAREN)) PANIC (awk, SSE_AWK_ELPAREN); if (__get_token(awk) == -1) return SSE_NULL; - test = __parse_esseression (awk); + test = __parse_expression (awk); if (test == SSE_NULL) return SSE_NULL; if (!MATCH(awk,TOKEN_RPAREN)) @@ -2707,7 +2707,7 @@ static sse_awk_nde_t* __parse_while (sse_awk_t* awk) if (!MATCH(awk,TOKEN_LPAREN)) PANIC (awk, SSE_AWK_ELPAREN); if (__get_token(awk) == -1) return SSE_NULL; - test = __parse_esseression (awk); + test = __parse_expression (awk); if (test == SSE_NULL) return SSE_NULL; if (!MATCH(awk,TOKEN_RPAREN)) @@ -2758,16 +2758,16 @@ static sse_awk_nde_t* __parse_for (sse_awk_t* awk) else { /* this line is very ugly. it checks the entire next - * esseression or the first element in the esseression + * expression or the first element in the expression * is wrapped by a parenthesis */ int no_foreach = MATCH(awk,TOKEN_LPAREN); - init = __parse_esseression (awk); + init = __parse_expression (awk); if (init == SSE_NULL) return SSE_NULL; - if (!no_foreach && init->type == SSE_AWK_NDE_ESSE_BIN && - ((sse_awk_nde_esse_t*)init)->opcode == SSE_AWK_BINOP_IN && - __is_plain_var(((sse_awk_nde_esse_t*)init)->left)) + if (!no_foreach && init->type == SSE_AWK_NDE_EXP_BIN && + ((sse_awk_nde_exp_t*)init)->opcode == SSE_AWK_BINOP_IN && + __is_plain_var(((sse_awk_nde_exp_t*)init)->left)) { /* switch to foreach */ @@ -2824,7 +2824,7 @@ static sse_awk_nde_t* __parse_for (sse_awk_t* awk) if (MATCH(awk,TOKEN_SEMICOLON)) test = SSE_NULL; else { - test = __parse_esseression (awk); + test = __parse_expression (awk); if (test == SSE_NULL) { sse_awk_clrpt (awk, init); @@ -2849,7 +2849,7 @@ static sse_awk_nde_t* __parse_for (sse_awk_t* awk) if (MATCH(awk,TOKEN_RPAREN)) incr = SSE_NULL; else { - incr = __parse_esseression (awk); + incr = __parse_expression (awk); if (incr == SSE_NULL) { sse_awk_clrpt (awk, init); @@ -2935,7 +2935,7 @@ static sse_awk_nde_t* __parse_dowhile (sse_awk_t* awk) return SSE_NULL; } - test = __parse_esseression (awk); + test = __parse_expression (awk); if (test == SSE_NULL) { sse_awk_clrpt (awk, body); @@ -3019,7 +3019,7 @@ static sse_awk_nde_t* __parse_return (sse_awk_t* awk) } else { - val = __parse_esseression (awk); + val = __parse_expression (awk); if (val == SSE_NULL) { SSE_AWK_FREE (awk, nde); @@ -3048,7 +3048,7 @@ static sse_awk_nde_t* __parse_exit (sse_awk_t* awk) } else { - val = __parse_esseression (awk); + val = __parse_expression (awk); if (val == SSE_NULL) { SSE_AWK_FREE (awk, nde); @@ -3072,7 +3072,7 @@ static sse_awk_nde_t* __parse_delete (sse_awk_t* awk) if (!__is_var (var)) { - /* a normal identifier is esseected */ + /* a normal identifier is expected */ sse_awk_clrpt (awk, var); PANIC (awk, SSE_AWK_EIDENT); } @@ -3103,7 +3103,7 @@ static sse_awk_nde_t* __parse_print (sse_awk_t* awk) !MATCH(awk,TOKEN_BOR) && !MATCH(awk,TOKEN_BORAND)) { - args = __parse_esseression (awk); + args = __parse_expression (awk); if (args == SSE_NULL) return SSE_NULL; args_tail = args; @@ -3117,7 +3117,7 @@ static sse_awk_nde_t* __parse_print (sse_awk_t* awk) return SSE_NULL; } - args_tail->next = __parse_esseression (awk); + args_tail->next = __parse_expression (awk); if (args_tail->next == SSE_NULL) { sse_awk_clrpt (awk, args); @@ -3131,9 +3131,9 @@ static sse_awk_nde_t* __parse_print (sse_awk_t* awk) /* print 1 > 2 would print 1 to the file named 2. * print (1 > 2) would print (1 > 2) in the console */ if (awk->token.prev != TOKEN_RPAREN && - args_tail->type == SSE_AWK_NDE_ESSE_BIN) + args_tail->type == SSE_AWK_NDE_EXP_BIN) { - sse_awk_nde_esse_t* ep = (sse_awk_nde_esse_t*)args_tail; + sse_awk_nde_exp_t* ep = (sse_awk_nde_exp_t*)args_tail; if (ep->opcode == SSE_AWK_BINOP_GT) { sse_awk_nde_t* tmp = args_tail; @@ -3192,7 +3192,7 @@ static sse_awk_nde_t* __parse_print (sse_awk_t* awk) return SSE_NULL; } - out = __parse_esseression(awk); + out = __parse_expression(awk); if (out == SSE_NULL) { if (args != SSE_NULL) sse_awk_clrpt (awk, args); @@ -3527,13 +3527,13 @@ static int __get_token (sse_awk_t* awk) GET_CHAR_TO (awk, c); if (c == SSE_T('=')) { - SET_TOKEN_TYPE (awk, TOKEN_ESSE_ASSIGN); + SET_TOKEN_TYPE (awk, TOKEN_EXP_ASSIGN); ADD_TOKEN_CHAR (awk, c); GET_CHAR_TO (awk, c); } else { - SET_TOKEN_TYPE (awk, TOKEN_ESSE); + SET_TOKEN_TYPE (awk, TOKEN_EXP); } } else @@ -3653,7 +3653,7 @@ static int __get_token (sse_awk_t* awk) return -1; } -/*sse_printf (SSE_T("token -> [%s]\n"), SSE_AWK_STR_BUF(&awk->token.name));*/ +/*xp_printf (SSE_T("token -> [%s]\n"), SSE_AWK_STR_BUF(&awk->token.name));*/ return 0; } @@ -4101,11 +4101,11 @@ static int __assign_to_opcode (sse_awk_t* awk) SSE_AWK_ASSOP_MUL, SSE_AWK_ASSOP_DIV, SSE_AWK_ASSOP_MOD, - SSE_AWK_ASSOP_ESSE + SSE_AWK_ASSOP_EXP }; if (awk->token.type >= TOKEN_ASSIGN && - awk->token.type <= TOKEN_ESSE_ASSIGN) + awk->token.type <= TOKEN_EXP_ASSIGN) { return __assop[awk->token.type - TOKEN_ASSIGN]; } diff --git a/ase/awk/rex.c b/ase/awk/rex.c index fae92a5c..0659047d 100644 --- a/ase/awk/rex.c +++ b/ase/awk/rex.c @@ -1,5 +1,5 @@ /* - * $Id: rex.c,v 1.37 2006-10-22 11:34:53 bacon Exp $ + * $Id: rex.c,v 1.38 2006-10-22 12:39:29 bacon Exp $ */ #include @@ -398,8 +398,8 @@ sse_bool_t sse_awk_isemptyrex (sse_awk_t* awk, void* code) nb = *(sse_size_t*)p; p += sse_sizeof(nb); el = *(sse_size_t*)p; p += sse_sizeof(el); - /* an empty regular esseression look like: - * | esseression | + /* an empty regular expression look like: + * | expression | * | header | branch | * | | branch header | * | NB(1) | EL(16) | NA(1) | BL(8) | */ @@ -720,7 +720,7 @@ static int __build_charset (__builder_t* builder, struct __code_t* cmd) { /* invalid range */ #ifdef DEBUG_REX -sse_printf (SSE_T("__build_charset: invalid character set range\n")); +xp_printf (SSE_T("__build_charset: invalid character set range\n")); #endif builder->errnum = SSE_AWK_EREXCRANGE; return -1; @@ -752,7 +752,7 @@ static int __build_cclass (__builder_t* builder, sse_char_t* cc) { /* wrong class name */ #ifdef DEBUG_REX -sse_printf (SSE_T("__build_cclass: wrong class name\n"));*/ +xp_printf (SSE_T("__build_cclass: wrong class name\n"));*/ #endif builder->errnum = SSE_AWK_EREXCCLASS; return -1; @@ -765,7 +765,7 @@ sse_printf (SSE_T("__build_cclass: wrong class name\n"));*/ builder->ptn.curc.value != SSE_T(':')) { #ifdef BUILD_REX -sse_printf (SSE_T("__build_cclass: a colon(:) esseected\n")); +xp_printf (SSE_T("__build_cclass: a colon(:) expected\n")); #endif builder->errnum = SSE_AWK_EREXCOLON; return -1; @@ -778,7 +778,7 @@ sse_printf (SSE_T("__build_cclass: a colon(:) esseected\n")); builder->ptn.curc.value != SSE_T(']')) { #ifdef DEBUG_REX -sse_printf (SSE_T("__build_cclass: ] esseected\n")); +xp_printf (SSE_T("__build_cclass: ] expected\n")); #endif builder->errnum = SSE_AWK_EREXRBRACKET; return -1; @@ -1025,7 +1025,7 @@ static const sse_byte_t* __match_pattern ( el = *(sse_size_t*)p; p += sse_sizeof(el); #ifdef BUILD_REX -sse_printf (SSE_T("__match_pattern: NB = %u, EL = %u\n"), (unsigned)nb, (unsigned)el); +xp_printf (SSE_T("__match_pattern: NB = %u, EL = %u\n"), (unsigned)nb, (unsigned)el); #endif mat->matched = sse_false; mat->match_len = 0; @@ -1211,7 +1211,7 @@ static const sse_byte_t* __match_any_char ( } #ifdef BUILD_REX -sse_printf (SSE_T("__match_any_char: lbound = %u, ubound = %u\n"), +xp_printf (SSE_T("__match_any_char: lbound = %u, ubound = %u\n"), (unsigned int)lbound, (unsigned int)ubound); #endif @@ -1223,7 +1223,7 @@ sse_printf (SSE_T("__match_any_char: lbound = %u, ubound = %u\n"), } #ifdef BUILD_REX -sse_printf (SSE_T("__match_any_char: max si = %d\n"), si); +xp_printf (SSE_T("__match_any_char: max si = %d\n"), si); #endif if (si >= lbound && si <= ubound) { @@ -1281,7 +1281,7 @@ static const sse_byte_t* __match_ord_char ( } #ifdef BUILD_REX -sse_printf (SSE_T("__match_ord_char: lbound = %u, ubound = %u\n"), +xp_printf (SSE_T("__match_ord_char: lbound = %u, ubound = %u\n"), (unsigned int)lbound, (unsigned int)ubound);*/ #endif @@ -1309,7 +1309,7 @@ sse_printf (SSE_T("__match_ord_char: lbound = %u, ubound = %u\n"), } #ifdef DEBUG_REX -sse_printf (SSE_T("__match_ord_char: max si = %d, lbound = %u, ubound = %u\n"), si, lbound, ubound); +xp_printf (SSE_T("__match_ord_char: max si = %d, lbound = %u, ubound = %u\n"), si, lbound, ubound); #endif if (si >= lbound && si <= ubound) @@ -1466,7 +1466,7 @@ static const sse_byte_t* __match_group ( mat2.branch_end = mat->branch_end; #ifdef DEBUG_REX -sse_printf (SSE_T("__match_group: GROUP si = %d [%s]\n"), si, mat->match_ptr); +xp_printf (SSE_T("__match_group: GROUP si = %d [%s]\n"), si, mat->match_ptr); #endif tmp = __match_branch_body (matcher, p, &mat2); if (tmp == SSE_NULL) @@ -1565,7 +1565,7 @@ static const sse_byte_t* __match_occurrences ( mat2.branch_end = mat->branch_end; #ifdef DEBUG_REX -sse_printf (SSE_T("__match occurrences: si = %d [%s]\n"), si, mat->match_ptr); +xp_printf (SSE_T("__match occurrences: si = %d [%s]\n"), si, mat->match_ptr); #endif tmp = __match_branch_body (matcher, p, &mat2); @@ -1699,7 +1699,7 @@ static sse_bool_t __cc_isxdigit (sse_awk_t* awk, sse_char_t c) void sse_awk_printrex (void* rex) { __print_pattern (rex); - sse_printf (SSE_T("\n")); + xp_printf (SSE_T("\n")); } static const sse_byte_t* __print_pattern (const sse_byte_t* p) @@ -1709,12 +1709,12 @@ static const sse_byte_t* __print_pattern (const sse_byte_t* p) nb = *(sse_size_t*)p; p += sse_sizeof(nb); el = *(sse_size_t*)p; p += sse_sizeof(el); #ifdef DEBUG_REX -sse_printf (SSE_T("__print_pattern: NB = %u, EL = %u\n"), (unsigned int)nb, (unsigned int)el); +xp_printf (SSE_T("__print_pattern: NB = %u, EL = %u\n"), (unsigned int)nb, (unsigned int)el); #endif for (i = 0; i < nb; i++) { - if (i != 0) sse_printf (SSE_T("|")); + if (i != 0) xp_printf (SSE_T("|")); p = __print_branch (p); } @@ -1728,7 +1728,7 @@ static const sse_byte_t* __print_branch (const sse_byte_t* p) na = *(sse_size_t*)p; p += sse_sizeof(na); bl = *(sse_size_t*)p; p += sse_sizeof(bl); #ifdef DEBUG_REX -sse_printf (SSE_T("__print_branch: NA = %u, BL = %u\n"), (unsigned int) na, (unsigned int)bl); +xp_printf (SSE_T("__print_branch: NA = %u, BL = %u\n"), (unsigned int) na, (unsigned int)bl); #endif for (i = 0; i < na; i++) @@ -1745,23 +1745,23 @@ static const sse_byte_t* __print_atom (const sse_byte_t* p) if (cp->cmd == CMD_BOL) { - sse_printf (SSE_T("^")); + xp_printf (SSE_T("^")); p += sse_sizeof(*cp); } else if (cp->cmd == CMD_EOL) { - sse_printf (SSE_T("$")); + xp_printf (SSE_T("$")); p += sse_sizeof(*cp); } else if (cp->cmd == CMD_ANY_CHAR) { - sse_printf (SSE_T(".")); + xp_printf (SSE_T(".")); p += sse_sizeof(*cp); } else if (cp->cmd == CMD_ORD_CHAR) { p += sse_sizeof(*cp); - sse_printf (SSE_T("%c"), *(sse_char_t*)p); + xp_printf (SSE_T("%c"), *(sse_char_t*)p); p += sse_sizeof(sse_char_t); } else if (cp->cmd == CMD_CHARSET) @@ -1769,8 +1769,8 @@ static const sse_byte_t* __print_atom (const sse_byte_t* p) sse_size_t csc, csl, i; p += sse_sizeof(*cp); - sse_printf (SSE_T("[")); - if (cp->negate) sse_printf (SSE_T("^")); + xp_printf (SSE_T("[")); + if (cp->negate) xp_printf (SSE_T("^")); csc = *(sse_size_t*)p; p += sse_sizeof(csc); csl = *(sse_size_t*)p; p += sse_sizeof(csl); @@ -1785,51 +1785,51 @@ static const sse_byte_t* __print_atom (const sse_byte_t* p) if (c0 == CHARSET_ONE) { c1 = *(sse_char_t*)p; - sse_printf (SSE_T("%c"), c1); + xp_printf (SSE_T("%c"), c1); } else if (c0 == CHARSET_RANGE) { c1 = *(sse_char_t*)p; p += sse_sizeof(c1); c2 = *(sse_char_t*)p; - sse_printf (SSE_T("%c-%c"), c1, c2); + xp_printf (SSE_T("%c-%c"), c1, c2); } else if (c0 == CHARSET_CLASS) { c1 = *(sse_char_t*)p; - sse_printf (SSE_T("[:%s:]"), __char_class[c1].name); + xp_printf (SSE_T("[:%s:]"), __char_class[c1].name); } else { - sse_printf ("should never happen - invalid charset code\n"); + xp_printf ("should never happen - invalid charset code\n"); } p += sse_sizeof(c1); } - sse_printf (SSE_T("]")); + xp_printf (SSE_T("]")); } else if (cp->cmd == CMD_GROUP) { p += sse_sizeof(*cp); - sse_printf (SSE_T("(")); + xp_printf (SSE_T("(")); p = __print_pattern (p); - sse_printf (SSE_T(")")); + xp_printf (SSE_T(")")); } else { - sse_printf ("should never happen - invalid atom code\n"); + xp_printf ("should never happen - invalid atom code\n"); } if (cp->lbound == 0 && cp->ubound == BOUND_MAX) - sse_printf (SSE_T("*")); + xp_printf (SSE_T("*")); else if (cp->lbound == 1 && cp->ubound == BOUND_MAX) - sse_printf (SSE_T("+")); + xp_printf (SSE_T("+")); else if (cp->lbound == 0 && cp->ubound == 1) - sse_printf (SSE_T("?")); + xp_printf (SSE_T("?")); else if (cp->lbound != 1 || cp->ubound != 1) { - sse_printf (SSE_T("{%lu,%lu}"), + xp_printf (SSE_T("{%lu,%lu}"), (unsigned long)cp->lbound, (unsigned long)cp->ubound); } diff --git a/ase/awk/rex.h b/ase/awk/rex.h index 23e24046..e592b084 100644 --- a/ase/awk/rex.h +++ b/ase/awk/rex.h @@ -1,5 +1,5 @@ /* - * $Id: rex.h,v 1.19 2006-10-22 11:34:53 bacon Exp $ + * $Id: rex.h,v 1.20 2006-10-22 12:39:29 bacon Exp $ **/ #ifndef _SSE_AWK_REX_H_ @@ -11,26 +11,26 @@ /* * Regular Esseression Syntax - * A regular esseression is zero or more branches, separated by '|'. + * A regular expression is zero or more branches, separated by '|'. * ...... * ...... * - * Compiled form of a regular esseression: + * Compiled form of a regular expression: * - * | esseression | + * | expression | * | header | branch | branch | branch | * | nb | el | na | bl | cmd | arg | cmd | arg | na | bl | cmd | arg | na | bl | cmd | * * nb: the number of branches - * el: the length of a esseression including the length of nb and el + * el: the length of a expression including the length of nb and el * na: the number of atoms * bl: the length of a branch including the length of na and bl * cmd: The command and repetition info encoded together. * Some commands require an argument to follow them but some other don't. * It is encoded as follows: * - * Subesseressions can be nested by having the command "GROUP" - * and a subesseression as its argument. + * Subexpressions can be nested by having the command "GROUP" + * and a subexpression as its argument. * * Examples: * a.c -> |1|6|5|ORD_CHAR(no bound)|a|ANY_CHAR(no bound)|ORD_CHAR(no bound)|c| diff --git a/ase/awk/run.c b/ase/awk/run.c index b3df33d2..f22aa277 100644 --- a/ase/awk/run.c +++ b/ase/awk/run.c @@ -1,5 +1,5 @@ /* - * $Id: run.c,v 1.240 2006-10-22 11:34:53 bacon Exp $ + * $Id: run.c,v 1.241 2006-10-22 12:39:29 bacon Exp $ */ #include @@ -84,8 +84,8 @@ static int __run_nextfile (sse_awk_run_t* run, sse_awk_nde_nextfile_t* nde); static int __run_delete (sse_awk_run_t* run, sse_awk_nde_delete_t* nde); static int __run_print (sse_awk_run_t* run, sse_awk_nde_print_t* nde); -static sse_awk_val_t* __eval_esseression (sse_awk_run_t* run, sse_awk_nde_t* nde); -static sse_awk_val_t* __eval_esseression0 (sse_awk_run_t* run, sse_awk_nde_t* nde); +static sse_awk_val_t* __eval_expression (sse_awk_run_t* run, sse_awk_nde_t* nde); +static sse_awk_val_t* __eval_expression0 (sse_awk_run_t* run, sse_awk_nde_t* nde); static sse_awk_val_t* __eval_group (sse_awk_run_t* run, sse_awk_nde_t* nde); @@ -140,7 +140,7 @@ static sse_awk_val_t* __eval_binop_div ( sse_awk_run_t* run, sse_awk_val_t* left, sse_awk_val_t* right); static sse_awk_val_t* __eval_binop_mod ( sse_awk_run_t* run, sse_awk_val_t* left, sse_awk_val_t* right); -static sse_awk_val_t* __eval_binop_esse ( +static sse_awk_val_t* __eval_binop_exp ( sse_awk_run_t* run, sse_awk_val_t* left, sse_awk_val_t* right); static sse_awk_val_t* __eval_binop_concat ( sse_awk_run_t* run, sse_awk_val_t* left, sse_awk_val_t* right); @@ -198,14 +198,14 @@ static sse_char_t* __idxnde_to_str ( typedef sse_awk_val_t* (*binop_func_t) ( sse_awk_run_t* run, sse_awk_val_t* left, sse_awk_val_t* right); -typedef sse_awk_val_t* (*eval_esser_t) (sse_awk_run_t* run, sse_awk_nde_t* nde); +typedef sse_awk_val_t* (*eval_expr_t) (sse_awk_run_t* run, sse_awk_nde_t* nde); /* TODO: remove this function */ static int __printval (sse_awk_pair_t* pair, void* arg) { - sse_printf (SSE_T("%s = "), (const sse_char_t*)pair->key); + xp_printf (SSE_T("%s = "), (const sse_char_t*)pair->key); sse_awk_printval ((sse_awk_val_t*)pair->val); - sse_printf (SSE_T("\n")); + xp_printf (SSE_T("\n")); return 0; } @@ -269,8 +269,8 @@ int sse_awk_setglobal (sse_awk_run_t* run, sse_size_t idx, sse_awk_val_t* val) } else { - /* due to the esseression evaluation rule, the - * regular esseression can not be an assigned value */ + /* due to the expression evaluation rule, the + * regular expression can not be an assigned value */ sse_awk_assert (run->awk, val->type != SSE_AWK_VAL_REX); fs_ptr = sse_awk_valtostr ( @@ -282,7 +282,7 @@ int sse_awk_setglobal (sse_awk_run_t* run, sse_size_t idx, sse_awk_val_t* val) { void* rex; - /* compile the regular esseression */ + /* compile the regular expression */ /* TODO: use safebuild */ rex = sse_awk_buildrex ( run->awk, fs_ptr, fs_len, &run->errnum); @@ -387,8 +387,8 @@ int sse_awk_setglobal (sse_awk_run_t* run, sse_size_t idx, sse_awk_val_t* val) } else { - /* due to the esseression evaluation rule, the - * regular esseression can not be an assigned value */ + /* due to the expression evaluation rule, the + * regular expression can not be an assigned value */ sse_awk_assert (run->awk, val->type != SSE_AWK_VAL_REX); rs_ptr = sse_awk_valtostr ( @@ -400,7 +400,7 @@ int sse_awk_setglobal (sse_awk_run_t* run, sse_size_t idx, sse_awk_val_t* val) { void* rex; - /* compile the regular esseression */ + /* compile the regular expression */ /* TODO: use safebuild */ rex = sse_awk_buildrex ( run->awk, rs_ptr, rs_len, &run->errnum); @@ -1147,9 +1147,9 @@ static int __run_main (sse_awk_run_t* run, sse_awk_runarg_t* runarg) } v = STACK_RETVAL(run); -sse_printf (SSE_T("Return Value - ")); +xp_printf (SSE_T("Return Value - ")); sse_awk_printval (v); -sse_printf (SSE_T("\n")); +xp_printf (SSE_T("\n")); /* the life of the global return value is over here * unlike the return value of each function */ /*sse_awk_refdownval_nofree (awk, v);*/ @@ -1173,9 +1173,9 @@ sse_printf (SSE_T("\n")); /* just reset the exit level */ run->exit_level = EXIT_NONE; -sse_printf (SSE_T("-[VARIABLES]------------------------\n")); +xp_printf (SSE_T("-[VARIABLES]------------------------\n")); sse_awk_map_walk (&run->named, __printval, SSE_NULL); -sse_printf (SSE_T("-[END VARIABLES]--------------------------\n")); +xp_printf (SSE_T("-[END VARIABLES]--------------------------\n")); return n; } @@ -1293,7 +1293,7 @@ static int __run_pattern_block ( /* pattern { ... } */ sse_awk_val_t* v1; - v1 = __eval_esseression (run, ptn); + v1 = __eval_expression (run, ptn); if (v1 == SSE_NULL) return -1; sse_awk_refupval (v1); @@ -1319,7 +1319,7 @@ static int __run_pattern_block ( { sse_awk_val_t* v1; - v1 = __eval_esseression (run, ptn); + v1 = __eval_expression (run, ptn); if (v1 == SSE_NULL) return -1; sse_awk_refupval (v1); @@ -1341,7 +1341,7 @@ static int __run_pattern_block ( { sse_awk_val_t* v2; - v2 = __eval_esseression (run, ptn->next); + v2 = __eval_expression (run, ptn->next); if (v2 == SSE_NULL) return -1; sse_awk_refupval (v2); @@ -1399,7 +1399,7 @@ static int __run_block (sse_awk_run_t* run, sse_awk_nde_blk_t* nde) p = nde->body; nlocals = nde->nlocals; -/*sse_printf (SSE_T("securing space for local variables nlocals = %d\n"), (int)nlocals);*/ +/*xp_printf (SSE_T("securing space for local variables nlocals = %d\n"), (int)nlocals);*/ saved_stack_top = run->stack_top; /* secure space for local variables */ @@ -1416,10 +1416,10 @@ static int __run_block (sse_awk_run_t* run, sse_awk_nde_blk_t* nde) /* refupval is not required for sse_awk_val_nil */ } -/*sse_printf (SSE_T("executing block statements\n"));*/ +/*xp_printf (SSE_T("executing block statements\n"));*/ while (p != SSE_NULL && run->exit_level == EXIT_NONE) { -/*sse_printf (SSE_T("running a statement\n"));*/ +/*xp_printf (SSE_T("running a statement\n"));*/ if (__run_statement(run,p) == -1) { n = -1; @@ -1428,7 +1428,7 @@ static int __run_block (sse_awk_run_t* run, sse_awk_nde_blk_t* nde) p = p->next; } -/*sse_printf (SSE_T("popping off local variables\n"));*/ +/*xp_printf (SSE_T("popping off local variables\n"));*/ /* pop off local variables */ nlocals = nde->nlocals; while (nlocals > 0) @@ -1546,7 +1546,7 @@ static int __run_statement (sse_awk_run_t* run, sse_awk_nde_t* nde) default: { sse_awk_val_t* v; - v = __eval_esseression(run,nde); + v = __eval_expression(run,nde); if (v == SSE_NULL) return -1; sse_awk_refupval (v); @@ -1564,12 +1564,12 @@ static int __run_if (sse_awk_run_t* run, sse_awk_nde_if_t* nde) sse_awk_val_t* test; int n = 0; - /* the test esseression for the if statement cannot have - * chained esseressions. this should not be allowed by the + /* the test expression for the if statement cannot have + * chained expressions. this should not be allowed by the * parser first of all */ sse_awk_assert (run->awk, nde->test->next == SSE_NULL); - test = __eval_esseression (run, nde->test); + test = __eval_expression (run, nde->test); if (test == SSE_NULL) return -1; sse_awk_refupval (test); @@ -1592,14 +1592,14 @@ static int __run_while (sse_awk_run_t* run, sse_awk_nde_while_t* nde) if (nde->type == SSE_AWK_NDE_WHILE) { - /* no chained esseressions are allowed for the test - * esseression of the while statement */ + /* no chained expressions are allowed for the test + * expression of the while statement */ sse_awk_assert (run->awk, nde->test->next == SSE_NULL); /* TODO: handle run-time abortion... */ while (1) { - test = __eval_esseression (run, nde->test); + test = __eval_expression (run, nde->test); if (test == SSE_NULL) return -1; sse_awk_refupval (test); @@ -1634,8 +1634,8 @@ static int __run_while (sse_awk_run_t* run, sse_awk_nde_while_t* nde) } else if (nde->type == SSE_AWK_NDE_DOWHILE) { - /* no chained esseressions are allowed for the test - * esseression of the while statement */ + /* no chained expressions are allowed for the test + * expression of the while statement */ sse_awk_assert (run->awk, nde->test->next == SSE_NULL); /* TODO: handle run-time abortion... */ @@ -1654,7 +1654,7 @@ static int __run_while (sse_awk_run_t* run, sse_awk_nde_while_t* nde) } else if (run->exit_level != EXIT_NONE) break; - test = __eval_esseression (run, nde->test); + test = __eval_expression (run, nde->test); if (test == SSE_NULL) return -1; sse_awk_refupval (test); @@ -1680,7 +1680,7 @@ static int __run_for (sse_awk_run_t* run, sse_awk_nde_for_t* nde) if (nde->init != SSE_NULL) { sse_awk_assert (run->awk, nde->init->next == SSE_NULL); - val = __eval_esseression(run,nde->init); + val = __eval_expression(run,nde->init); if (val == SSE_NULL) return -1; sse_awk_refupval (val); @@ -1693,11 +1693,11 @@ static int __run_for (sse_awk_run_t* run, sse_awk_nde_for_t* nde) { sse_awk_val_t* test; - /* no chained esseressions for the test esseression of + /* no chained expressions for the test expression of * the for statement are allowed */ sse_awk_assert (run->awk, nde->test->next == SSE_NULL); - test = __eval_esseression (run, nde->test); + test = __eval_expression (run, nde->test); if (test == SSE_NULL) return -1; sse_awk_refupval (test); @@ -1739,7 +1739,7 @@ static int __run_for (sse_awk_run_t* run, sse_awk_nde_for_t* nde) if (nde->incr != SSE_NULL) { sse_awk_assert (run->awk, nde->incr->next == SSE_NULL); - val = __eval_esseression(run,nde->incr); + val = __eval_expression(run,nde->incr); if (val == SSE_NULL) return -1; sse_awk_refupval (val); @@ -1786,20 +1786,20 @@ static int __walk_foreach (sse_awk_pair_t* pair, void* arg) static int __run_foreach (sse_awk_run_t* run, sse_awk_nde_foreach_t* nde) { int n; - sse_awk_nde_esse_t* test; + sse_awk_nde_exp_t* test; sse_awk_val_t* rv; sse_awk_map_t* map; struct __foreach_walker_t walker; - test = (sse_awk_nde_esse_t*)nde->test; - sse_awk_assert (run->awk, test->type == SSE_AWK_NDE_ESSE_BIN && + test = (sse_awk_nde_exp_t*)nde->test; + sse_awk_assert (run->awk, test->type == SSE_AWK_NDE_EXP_BIN && test->opcode == SSE_AWK_BINOP_IN); - /* chained esseressions should not be allowed + /* chained expressions should not be allowed * by the parser first of all */ sse_awk_assert (run->awk, test->right->next == SSE_NULL); - rv = __eval_esseression (run, test->right); + rv = __eval_expression (run, test->right); if (rv == SSE_NULL) return -1; sse_awk_refupval (rv); @@ -1837,18 +1837,18 @@ static int __run_return (sse_awk_run_t* run, sse_awk_nde_return_t* nde) { sse_awk_val_t* val; - /* chained esseressions should not be allowed + /* chained expressions should not be allowed * by the parser first of all */ sse_awk_assert (run->awk, nde->val->next == SSE_NULL); -/*sse_printf (SSE_T("returning....\n"));*/ - val = __eval_esseression (run, nde->val); +/*xp_printf (SSE_T("returning....\n"));*/ + val = __eval_expression (run, nde->val); if (val == SSE_NULL) return -1; sse_awk_refdownval (run, STACK_RETVAL(run)); STACK_RETVAL(run) = val; sse_awk_refupval (val); /* see __eval_call for the trick */ -/*sse_printf (SSE_T("set return value....\n"));*/ +/*xp_printf (SSE_T("set return value....\n"));*/ } run->exit_level = EXIT_FUNCTION; @@ -1861,11 +1861,11 @@ static int __run_exit (sse_awk_run_t* run, sse_awk_nde_exit_t* nde) { sse_awk_val_t* val; - /* chained esseressions should not be allowed + /* chained expressions should not be allowed * by the parser first of all */ sse_awk_assert (run->awk, nde->val->next == SSE_NULL); - val = __eval_esseression (run, nde->val); + val = __eval_expression (run, nde->val); if (val == SSE_NULL) return -1; sse_awk_refdownval (run, STACK_RETVAL_GLOBAL(run)); @@ -1882,7 +1882,7 @@ static int __run_next (sse_awk_run_t* run, sse_awk_nde_next_t* nde) { /* the parser checks if next has been called in the begin/end * block or whereever inappropriate. so the runtime doesn't - * check that esselicitly */ + * check that explicitly */ if (run->active_block == (sse_awk_nde_blk_t*)run->awk->tree.begin || run->active_block == (sse_awk_nde_blk_t*)run->awk->tree.end) @@ -1988,7 +1988,7 @@ static int __run_delete (sse_awk_run_t* run, sse_awk_nde_delete_t* nde) sse_awk_assert (run->awk, var->idx != SSE_NULL); - idx = __eval_esseression (run, var->idx); + idx = __eval_expression (run, var->idx); if (idx == SSE_NULL) return -1; sse_awk_refupval (idx); @@ -2079,7 +2079,7 @@ static int __run_delete (sse_awk_run_t* run, sse_awk_nde_delete_t* nde) sse_awk_assert (run->awk, var->idx != SSE_NULL); - idx = __eval_esseression (run, var->idx); + idx = __eval_expression (run, var->idx); if (idx == SSE_NULL) return -1; sse_awk_refupval (idx); @@ -2127,7 +2127,7 @@ static int __run_print (sse_awk_run_t* run, sse_awk_nde_print_t* nde) { sse_size_t len; - v = __eval_esseression (run, p->out); + v = __eval_expression (run, p->out); if (v == SSE_NULL) return -1; sse_awk_refupval (v); @@ -2213,7 +2213,7 @@ static int __run_print (sse_awk_run_t* run, sse_awk_nde_print_t* nde) } } - v = __eval_esseression (run, np); + v = __eval_expression (run, np); if (v == SSE_NULL) { if (out != SSE_NULL) SSE_AWK_FREE (run->awk, out); @@ -2255,12 +2255,12 @@ skip_write: return 0; } -static sse_awk_val_t* __eval_esseression (sse_awk_run_t* run, sse_awk_nde_t* nde) +static sse_awk_val_t* __eval_expression (sse_awk_run_t* run, sse_awk_nde_t* nde) { sse_awk_val_t* v; int n, errnum; - v = __eval_esseression0 (run, nde); + v = __eval_expression0 (run, nde); if (v == SSE_NULL) return SSE_NULL; if (v->type == SSE_AWK_VAL_REX) @@ -2302,9 +2302,9 @@ static sse_awk_val_t* __eval_esseression (sse_awk_run_t* run, sse_awk_nde_t* nde return v; } -static sse_awk_val_t* __eval_esseression0 (sse_awk_run_t* run, sse_awk_nde_t* nde) +static sse_awk_val_t* __eval_expression0 (sse_awk_run_t* run, sse_awk_nde_t* nde) { - static eval_esser_t __eval_func[] = + static eval_expr_t __eval_func[] = { /* the order of functions here should match the order * of node types declared in tree.h */ @@ -2356,7 +2356,7 @@ static sse_awk_val_t* __eval_assignment (sse_awk_run_t* run, sse_awk_nde_t* nde) sse_awk_assert (run->awk, ass->left != SSE_NULL && ass->right != SSE_NULL); sse_awk_assert (run->awk, ass->right->next == SSE_NULL); - val = __eval_esseression (run, ass->right); + val = __eval_expression (run, ass->right); if (val == SSE_NULL) return SSE_NULL; sse_awk_refupval (val); @@ -2366,7 +2366,7 @@ static sse_awk_val_t* __eval_assignment (sse_awk_run_t* run, sse_awk_nde_t* nde) sse_awk_val_t* val2, * tmp; sse_awk_assert (run->awk, ass->left->next == SSE_NULL); - val2 = __eval_esseression (run, ass->left); + val2 = __eval_expression (run, ass->left); if (val2 == SSE_NULL) { sse_awk_refdownval (run, val); @@ -2395,9 +2395,9 @@ static sse_awk_val_t* __eval_assignment (sse_awk_run_t* run, sse_awk_nde_t* nde) { tmp = __eval_binop_mod (run, val2, val); } - else if (ass->opcode == SSE_AWK_ASSOP_ESSE) + else if (ass->opcode == SSE_AWK_ASSOP_EXP) { - tmp = __eval_binop_esse (run, val2, val); + tmp = __eval_binop_exp (run, val2, val); } else { @@ -2620,7 +2620,7 @@ static sse_awk_val_t* __do_assignment_map ( if (str == SSE_NULL) return SSE_NULL; /* -sse_printf (SSE_T("**** index str=>%s, map->ref=%d, map->type=%d\n"), str, (int)map->ref, (int)map->type); +xp_printf (SSE_T("**** index str=>%s, map->ref=%d, map->type=%d\n"), str, (int)map->ref, (int)map->type); */ n = sse_awk_map_putx (map->map, str, len, val, SSE_NULL); if (n < 0) @@ -2644,7 +2644,7 @@ static sse_awk_val_t* __do_assignment_pos ( sse_size_t len; int n; - v = __eval_esseression (run, pos->val); + v = __eval_expression (run, pos->val); if (v == SSE_NULL) return SSE_NULL; sse_awk_refupval (v); @@ -2704,49 +2704,49 @@ static sse_awk_val_t* __eval_binary (sse_awk_run_t* run, sse_awk_nde_t* nde) __eval_binop_mul, __eval_binop_div, __eval_binop_mod, - __eval_binop_esse, + __eval_binop_exp, __eval_binop_concat, SSE_NULL, /* __eval_binop_ma */ SSE_NULL /* __eval_binop_nm */ }; - sse_awk_nde_esse_t* esse = (sse_awk_nde_esse_t*)nde; + sse_awk_nde_exp_t* exp = (sse_awk_nde_exp_t*)nde; sse_awk_val_t* left, * right, * res; - sse_awk_assert (run->awk, esse->type == SSE_AWK_NDE_ESSE_BIN); + sse_awk_assert (run->awk, exp->type == SSE_AWK_NDE_EXP_BIN); - if (esse->opcode == SSE_AWK_BINOP_LAND) + if (exp->opcode == SSE_AWK_BINOP_LAND) { - res = __eval_binop_land (run, esse->left, esse->right); + res = __eval_binop_land (run, exp->left, exp->right); } - else if (esse->opcode == SSE_AWK_BINOP_LOR) + else if (exp->opcode == SSE_AWK_BINOP_LOR) { - res = __eval_binop_lor (run, esse->left, esse->right); + res = __eval_binop_lor (run, exp->left, exp->right); } - else if (esse->opcode == SSE_AWK_BINOP_IN) + else if (exp->opcode == SSE_AWK_BINOP_IN) { /* treat the in operator specially */ - res = __eval_binop_in (run, esse->left, esse->right); + res = __eval_binop_in (run, exp->left, exp->right); } - else if (esse->opcode == SSE_AWK_BINOP_NM) + else if (exp->opcode == SSE_AWK_BINOP_NM) { - res = __eval_binop_nm (run, esse->left, esse->right); + res = __eval_binop_nm (run, exp->left, exp->right); } - else if (esse->opcode == SSE_AWK_BINOP_MA) + else if (exp->opcode == SSE_AWK_BINOP_MA) { - res = __eval_binop_ma (run, esse->left, esse->right); + res = __eval_binop_ma (run, exp->left, exp->right); } else { - sse_awk_assert (run->awk, esse->left->next == SSE_NULL); - left = __eval_esseression (run, esse->left); + sse_awk_assert (run->awk, exp->left->next == SSE_NULL); + left = __eval_expression (run, exp->left); if (left == SSE_NULL) return SSE_NULL; sse_awk_refupval (left); - sse_awk_assert (run->awk, esse->right->next == SSE_NULL); - right = __eval_esseression (run, esse->right); + sse_awk_assert (run->awk, exp->right->next == SSE_NULL); + right = __eval_expression (run, exp->right); if (right == SSE_NULL) { sse_awk_refdownval (run, left); @@ -2755,11 +2755,11 @@ static sse_awk_val_t* __eval_binary (sse_awk_run_t* run, sse_awk_nde_t* nde) sse_awk_refupval (right); - sse_awk_assert (run->awk, esse->opcode >= 0 && - esse->opcode < sse_countof(__binop_func)); - sse_awk_assert (run->awk, __binop_func[esse->opcode] != SSE_NULL); + sse_awk_assert (run->awk, exp->opcode >= 0 && + exp->opcode < sse_countof(__binop_func)); + sse_awk_assert (run->awk, __binop_func[exp->opcode] != SSE_NULL); - res = __binop_func[esse->opcode] (run, left, right); + res = __binop_func[exp->opcode] (run, left, right); sse_awk_refdownval (run, left); sse_awk_refdownval (run, right); @@ -2785,7 +2785,7 @@ static sse_awk_val_t* __eval_binop_lor ( sse_awk_val_t* lv, * rv, * res; sse_awk_assert (run->awk, left->next == SSE_NULL); - lv = __eval_esseression (run, left); + lv = __eval_expression (run, left); if (lv == SSE_NULL) return SSE_NULL; sse_awk_refupval (lv); @@ -2797,7 +2797,7 @@ static sse_awk_val_t* __eval_binop_lor ( else { sse_awk_assert (run->awk, right->next == SSE_NULL); - rv = __eval_esseression (run, right); + rv = __eval_expression (run, right); if (rv == SSE_NULL) { sse_awk_refdownval (run, lv); @@ -2833,7 +2833,7 @@ static sse_awk_val_t* __eval_binop_land ( sse_awk_val_t* lv, * rv, * res; sse_awk_assert (run->awk, left->next == SSE_NULL); - lv = __eval_esseression (run, left); + lv = __eval_expression (run, left); if (lv == SSE_NULL) return SSE_NULL; sse_awk_refupval (lv); @@ -2845,7 +2845,7 @@ static sse_awk_val_t* __eval_binop_land ( else { sse_awk_assert (run->awk, right->next == SSE_NULL); - rv = __eval_esseression (run, right); + rv = __eval_expression (run, right); if (rv == SSE_NULL) { sse_awk_refdownval (run, lv); @@ -2890,7 +2890,7 @@ static sse_awk_val_t* __eval_binop_in ( /* evaluate the right-hand side of the operator */ sse_awk_assert (run->awk, right->next == SSE_NULL); - rv = __eval_esseression (run, right); + rv = __eval_expression (run, right); if (rv == SSE_NULL) { SSE_AWK_FREE (run->awk, str); @@ -3500,7 +3500,7 @@ static sse_awk_val_t* __eval_binop_mod ( return res; } -static sse_awk_val_t* __eval_binop_esse ( +static sse_awk_val_t* __eval_binop_exp ( sse_awk_run_t* run, sse_awk_val_t* left, sse_awk_val_t* right) { int n1, n2, n3; @@ -3585,7 +3585,7 @@ static sse_awk_val_t* __eval_binop_ma ( sse_awk_assert (run->awk, left->next == SSE_NULL); sse_awk_assert (run->awk, right->next == SSE_NULL); - lv = __eval_esseression (run, left); + lv = __eval_expression (run, left); if (lv == SSE_NULL) { return SSE_NULL; @@ -3593,7 +3593,7 @@ static sse_awk_val_t* __eval_binop_ma ( sse_awk_refupval (lv); - rv = __eval_esseression0 (run, right); + rv = __eval_expression0 (run, right); if (rv == SSE_NULL) { sse_awk_refdownval (run, lv); @@ -3618,12 +3618,12 @@ static sse_awk_val_t* __eval_binop_nm ( sse_awk_assert (run->awk, left->next == SSE_NULL); sse_awk_assert (run->awk, right->next == SSE_NULL); - lv = __eval_esseression (run, left); + lv = __eval_expression (run, left); if (lv == SSE_NULL) return SSE_NULL; sse_awk_refupval (lv); - rv = __eval_esseression0 (run, right); + rv = __eval_expression0 (run, right); if (rv == SSE_NULL) { sse_awk_refdownval (run, lv); @@ -3743,18 +3743,18 @@ static sse_awk_val_t* __eval_binop_match0 ( static sse_awk_val_t* __eval_unary (sse_awk_run_t* run, sse_awk_nde_t* nde) { sse_awk_val_t* left, * res = SSE_NULL; - sse_awk_nde_esse_t* esse = (sse_awk_nde_esse_t*)nde; + sse_awk_nde_exp_t* exp = (sse_awk_nde_exp_t*)nde; - sse_awk_assert (run->awk, esse->type == SSE_AWK_NDE_ESSE_UNR); - sse_awk_assert (run->awk, esse->left != SSE_NULL && esse->right == SSE_NULL); + sse_awk_assert (run->awk, exp->type == SSE_AWK_NDE_EXP_UNR); + sse_awk_assert (run->awk, exp->left != SSE_NULL && exp->right == SSE_NULL); - sse_awk_assert (run->awk, esse->left->next == SSE_NULL); - left = __eval_esseression (run, esse->left); + sse_awk_assert (run->awk, exp->left->next == SSE_NULL); + left = __eval_expression (run, exp->left); if (left == SSE_NULL) return SSE_NULL; sse_awk_refupval (left); - if (esse->opcode == SSE_AWK_UNROP_PLUS) + if (exp->opcode == SSE_AWK_UNROP_PLUS) { if (left->type == SSE_AWK_VAL_INT) { @@ -3772,7 +3772,7 @@ static sse_awk_val_t* __eval_unary (sse_awk_run_t* run, sse_awk_nde_t* nde) PANIC (run, SSE_AWK_EOPERAND); } } - else if (esse->opcode == SSE_AWK_UNROP_MINUS) + else if (exp->opcode == SSE_AWK_UNROP_MINUS) { if (left->type == SSE_AWK_VAL_INT) { @@ -3790,7 +3790,7 @@ static sse_awk_val_t* __eval_unary (sse_awk_run_t* run, sse_awk_nde_t* nde) PANIC (run, SSE_AWK_EOPERAND); } } - else if (esse->opcode == SSE_AWK_UNROP_NOT) + else if (exp->opcode == SSE_AWK_UNROP_NOT) { if (left->type == SSE_AWK_VAL_INT) { @@ -3808,7 +3808,7 @@ static sse_awk_val_t* __eval_unary (sse_awk_run_t* run, sse_awk_nde_t* nde) PANIC (run, SSE_AWK_EOPERAND); } } - else if (esse->opcode == SSE_AWK_UNROP_BNOT) + else if (exp->opcode == SSE_AWK_UNROP_BNOT) { if (left->type == SSE_AWK_VAL_INT) { @@ -3835,27 +3835,27 @@ static sse_awk_val_t* __eval_unary (sse_awk_run_t* run, sse_awk_nde_t* nde) static sse_awk_val_t* __eval_incpre (sse_awk_run_t* run, sse_awk_nde_t* nde) { sse_awk_val_t* left, * res; - sse_awk_nde_esse_t* esse = (sse_awk_nde_esse_t*)nde; + sse_awk_nde_exp_t* exp = (sse_awk_nde_exp_t*)nde; - sse_awk_assert (run->awk, esse->type == SSE_AWK_NDE_ESSE_INCPRE); - sse_awk_assert (run->awk, esse->left != SSE_NULL && esse->right == SSE_NULL); + sse_awk_assert (run->awk, exp->type == SSE_AWK_NDE_EXP_INCPRE); + sse_awk_assert (run->awk, exp->left != SSE_NULL && exp->right == SSE_NULL); /* this way of checking if the l-value is assignable is * ugly as it is dependent of the values defined in tree.h. * but let's keep going this way for the time being. */ - if (esse->left->type < SSE_AWK_NDE_NAMED || - esse->left->type > SSE_AWK_NDE_ARGIDX) + if (exp->left->type < SSE_AWK_NDE_NAMED || + exp->left->type > SSE_AWK_NDE_ARGIDX) { PANIC (run, SSE_AWK_EOPERAND); } - sse_awk_assert (run->awk, esse->left->next == SSE_NULL); - left = __eval_esseression (run, esse->left); + sse_awk_assert (run->awk, exp->left->next == SSE_NULL); + left = __eval_expression (run, exp->left); if (left == SSE_NULL) return SSE_NULL; sse_awk_refupval (left); - if (esse->opcode == SSE_AWK_INCOP_PLUS) + if (exp->opcode == SSE_AWK_INCOP_PLUS) { if (left->type == SSE_AWK_VAL_INT) { @@ -3907,7 +3907,7 @@ static sse_awk_val_t* __eval_incpre (sse_awk_run_t* run, sse_awk_nde_t* nde) } } } - else if (esse->opcode == SSE_AWK_INCOP_MINUS) + else if (exp->opcode == SSE_AWK_INCOP_MINUS) { if (left->type == SSE_AWK_VAL_INT) { @@ -3966,7 +3966,7 @@ static sse_awk_val_t* __eval_incpre (sse_awk_run_t* run, sse_awk_nde_t* nde) PANIC (run, SSE_AWK_EINTERNAL); } - if (__do_assignment (run, esse->left, res) == SSE_NULL) + if (__do_assignment (run, exp->left, res) == SSE_NULL) { sse_awk_refdownval (run, left); return SSE_NULL; @@ -3979,27 +3979,27 @@ static sse_awk_val_t* __eval_incpre (sse_awk_run_t* run, sse_awk_nde_t* nde) static sse_awk_val_t* __eval_incpst (sse_awk_run_t* run, sse_awk_nde_t* nde) { sse_awk_val_t* left, * res, * res2; - sse_awk_nde_esse_t* esse = (sse_awk_nde_esse_t*)nde; + sse_awk_nde_exp_t* exp = (sse_awk_nde_exp_t*)nde; - sse_awk_assert (run->awk, esse->type == SSE_AWK_NDE_ESSE_INCPST); - sse_awk_assert (run->awk, esse->left != SSE_NULL && esse->right == SSE_NULL); + sse_awk_assert (run->awk, exp->type == SSE_AWK_NDE_EXP_INCPST); + sse_awk_assert (run->awk, exp->left != SSE_NULL && exp->right == SSE_NULL); /* this way of checking if the l-value is assignable is * ugly as it is dependent of the values defined in tree.h. * but let's keep going this way for the time being. */ - if (esse->left->type < SSE_AWK_NDE_NAMED || - esse->left->type > SSE_AWK_NDE_ARGIDX) + if (exp->left->type < SSE_AWK_NDE_NAMED || + exp->left->type > SSE_AWK_NDE_ARGIDX) { PANIC (run, SSE_AWK_EOPERAND); } - sse_awk_assert (run->awk, esse->left->next == SSE_NULL); - left = __eval_esseression (run, esse->left); + sse_awk_assert (run->awk, exp->left->next == SSE_NULL); + left = __eval_expression (run, exp->left); if (left == SSE_NULL) return SSE_NULL; sse_awk_refupval (left); - if (esse->opcode == SSE_AWK_INCOP_PLUS) + if (exp->opcode == SSE_AWK_INCOP_PLUS) { if (left->type == SSE_AWK_VAL_INT) { @@ -4087,7 +4087,7 @@ static sse_awk_val_t* __eval_incpst (sse_awk_run_t* run, sse_awk_nde_t* nde) } } } - else if (esse->opcode == SSE_AWK_INCOP_MINUS) + else if (exp->opcode == SSE_AWK_INCOP_MINUS) { if (left->type == SSE_AWK_VAL_INT) { @@ -4182,7 +4182,7 @@ static sse_awk_val_t* __eval_incpst (sse_awk_run_t* run, sse_awk_nde_t* nde) PANIC (run, SSE_AWK_EINTERNAL); } - if (__do_assignment (run, esse->left, res2) == SSE_NULL) + if (__do_assignment (run, exp->left, res2) == SSE_NULL) { sse_awk_refdownval (run, left); return SSE_NULL; @@ -4198,7 +4198,7 @@ static sse_awk_val_t* __eval_cnd (sse_awk_run_t* run, sse_awk_nde_t* nde) sse_awk_nde_cnd_t* cnd = (sse_awk_nde_cnd_t*)nde; sse_awk_assert (run->awk, cnd->test->next == SSE_NULL); - tv = __eval_esseression (run, cnd->test); + tv = __eval_expression (run, cnd->test); if (tv == SSE_NULL) return SSE_NULL; sse_awk_refupval (tv); @@ -4206,8 +4206,8 @@ static sse_awk_val_t* __eval_cnd (sse_awk_run_t* run, sse_awk_nde_t* nde) sse_awk_assert (run->awk, cnd->left->next == SSE_NULL && cnd->right->next == SSE_NULL); v = (sse_awk_valtobool (run, tv))? - __eval_esseression (run, cnd->left): - __eval_esseression (run, cnd->right); + __eval_expression (run, cnd->left): + __eval_expression (run, cnd->right); sse_awk_refdownval (run, tv); return v; @@ -4327,7 +4327,7 @@ static sse_awk_val_t* __eval_call ( saved_stack_top = run->stack_top; -/*sse_printf (SSE_T("setting up function stack frame stack_top = %ld stack_base = %ld\n"), run->stack_top, run->stack_base); */ +/*xp_printf (SSE_T("setting up function stack frame stack_top = %ld stack_base = %ld\n"), run->stack_top, run->stack_base); */ if (__raw_push(run,(void*)run->stack_base) == -1) { PANIC (run, SSE_AWK_ENOMEM); @@ -4383,13 +4383,13 @@ static sse_awk_val_t* __eval_call ( else if (bfn_arg_spec != SSE_NULL && bfn_arg_spec[nargs] == SSE_T('x')) { - /* a regular esseression is passed to + /* a regular expression is passed to * the function as it is */ - v = __eval_esseression0 (run, p); + v = __eval_expression0 (run, p); } else { - v = __eval_esseression (run, p); + v = __eval_expression (run, p); } if (v == SSE_NULL) { @@ -4475,7 +4475,7 @@ static sse_awk_val_t* __eval_call ( run->stack_base = saved_stack_top; STACK_NARGS(run) = (void*)nargs; -/*sse_printf (SSE_T("running function body\n")); */ +/*xp_printf (SSE_T("running function body\n")); */ if (afn != SSE_NULL) { @@ -4495,16 +4495,16 @@ static sse_awk_val_t* __eval_call ( n = call->what.bfn.handler (run); } -/*sse_printf (SSE_T("block run complete\n")); */ +/*xp_printf (SSE_T("block run complete\n")); */ /* refdown args in the run.stack */ nargs = (sse_size_t)STACK_NARGS(run); -/*sse_printf (SSE_T("block run complete nargs = %d\n"), (int)nargs); */ +/*xp_printf (SSE_T("block run complete nargs = %d\n"), (int)nargs); */ for (i = 0; i < nargs; i++) { sse_awk_refdownval (run, STACK_ARG(run,i)); } -/*sse_printf (SSE_T("got return value\n")); */ +/*xp_printf (SSE_T("got return value\n")); */ /* this trick has been mentioned in __run_return. * adjust the reference count of the return value. @@ -4519,7 +4519,7 @@ static sse_awk_val_t* __eval_call ( if (run->exit_level == EXIT_FUNCTION) run->exit_level = EXIT_NONE; -/*sse_printf (SSE_T("returning from function stack_top=%ld, stack_base=%ld\n"), run->stack_top, run->stack_base); */ +/*xp_printf (SSE_T("returning from function stack_top=%ld, stack_base=%ld\n"), run->stack_top, run->stack_base); */ return (n == -1)? SSE_NULL: v; } @@ -4623,7 +4623,7 @@ static int __get_reference ( /* the position number is returned for the positional * variable unlike other reference types. */ - v = __eval_esseression (run, ((sse_awk_nde_pos_t*)nde)->val); + v = __eval_expression (run, ((sse_awk_nde_pos_t*)nde)->val); if (v == SSE_NULL) return -1; sse_awk_refupval (v); @@ -4843,7 +4843,7 @@ static sse_awk_val_t* __eval_pos (sse_awk_run_t* run, sse_awk_nde_t* nde) sse_real_t rv; int n; - v = __eval_esseression (run, pos->val); + v = __eval_expression (run, pos->val); if (v == SSE_NULL) return SSE_NULL; sse_awk_refupval (v); @@ -4882,7 +4882,7 @@ static sse_awk_val_t* __eval_getline (sse_awk_run_t* run, sse_awk_nde_t* nde) { sse_size_t len; - v = __eval_esseression (run, p->in); + v = __eval_expression (run, p->in); if (v == SSE_NULL) return SSE_NULL; /* TODO: distinction between v->type == SSE_AWK_VAL_STR @@ -5055,7 +5055,7 @@ static int __read_record (sse_awk_run_t* run) return -1; } /* -sse_printf (SSE_T("len = %d str=[%s]\n"), +xp_printf (SSE_T("len = %d str=[%s]\n"), (int)SSE_AWK_STR_LEN(&run->inrec.line), SSE_AWK_STR_BUF(&run->inrec.line)); */ @@ -5175,7 +5175,7 @@ static sse_char_t* __idxnde_to_str ( if (nde->next == SSE_NULL) { /* single node index */ - idx = __eval_esseression (run, nde); + idx = __eval_expression (run, nde); if (idx == SSE_NULL) return SSE_NULL; sse_awk_refupval (idx); @@ -5203,7 +5203,7 @@ static sse_char_t* __idxnde_to_str ( while (nde != SSE_NULL) { - idx = __eval_esseression (run, nde); + idx = __eval_expression (run, nde); if (idx == SSE_NULL) { sse_awk_str_close (&idxstr); diff --git a/ase/awk/run.h b/ase/awk/run.h index d80e200f..c1c877da 100644 --- a/ase/awk/run.h +++ b/ase/awk/run.h @@ -1,5 +1,5 @@ /* - * $Id: run.h,v 1.19 2006-10-22 11:34:53 bacon Exp $ + * $Id: run.h,v 1.20 2006-10-22 12:39:30 bacon Exp $ */ #ifndef _SSE_AWK_RUN_H_ @@ -18,7 +18,7 @@ enum SSE_AWK_ASSOP_MUL, SSE_AWK_ASSOP_DIV, SSE_AWK_ASSOP_MOD, - SSE_AWK_ASSOP_ESSE + SSE_AWK_ASSOP_EXP }; enum @@ -48,7 +48,7 @@ enum SSE_AWK_BINOP_MUL, SSE_AWK_BINOP_DIV, SSE_AWK_BINOP_MOD, - SSE_AWK_BINOP_ESSE, + SSE_AWK_BINOP_EXP, SSE_AWK_BINOP_CONCAT, SSE_AWK_BINOP_MA, diff --git a/ase/awk/tree.c b/ase/awk/tree.c index 9016bb7b..80aef6d3 100644 --- a/ase/awk/tree.c +++ b/ase/awk/tree.c @@ -1,5 +1,5 @@ /* - * $Id: tree.c,v 1.81 2006-10-22 11:34:53 bacon Exp $ + * $Id: tree.c,v 1.82 2006-10-22 12:39:30 bacon Exp $ */ #include @@ -89,18 +89,18 @@ static const sse_char_t* __print_outop_str[] = #define PRINT_TABS(awk,depth) \ do { if (__print_tabs(awk,depth) == -1) return -1; } while (0) -#define PRINT_ESSERESSION(awk,nde) \ - do { if (__print_esseression(awk,nde) == -1) return -1; } while (0) +#define PRINT_EXPRESSION(awk,nde) \ + do { if (__print_expression(awk,nde) == -1) return -1; } while (0) -#define PRINT_ESSERESSION_LIST(awk,nde) \ - do { if (__print_esseression_list(awk,nde) == -1) return -1; } while (0) +#define PRINT_EXPRESSION_LIST(awk,nde) \ + do { if (__print_expression_list(awk,nde) == -1) return -1; } while (0) #define PRINT_STATEMENTS(awk,nde,depth) \ do { if (__print_statements(awk,nde,depth) == -1) return -1; } while (0) static int __print_tabs (sse_awk_t* awk, int depth); -static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde); -static int __print_esseression_list (sse_awk_t* awk, sse_awk_nde_t* tree); +static int __print_expression (sse_awk_t* awk, sse_awk_nde_t* nde); +static int __print_expression_list (sse_awk_t* awk, sse_awk_nde_t* tree); static int __print_statements (sse_awk_t* awk, sse_awk_nde_t* tree, int depth); static int __print_tabs (sse_awk_t* awk, int depth) @@ -114,7 +114,7 @@ static int __print_tabs (sse_awk_t* awk, int depth) return 0; } -static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde) +static int __print_expression (sse_awk_t* awk, sse_awk_nde_t* nde) { switch (nde->type) { @@ -125,7 +125,7 @@ static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde) PUT_SRCSTR (awk, SSE_T("(")); while (p != SSE_NULL) { - PRINT_ESSERESSION (awk, p); + PRINT_EXPRESSION (awk, p); if (p->next != SSE_NULL) PUT_SRCSTR (awk, SSE_T(",")); p = p->next; @@ -138,22 +138,22 @@ static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde) { sse_awk_nde_ass_t* px = (sse_awk_nde_ass_t*)nde; - PRINT_ESSERESSION (awk, px->left); + PRINT_EXPRESSION (awk, px->left); PUT_SRCSTR (awk, SSE_T(" ")); PUT_SRCSTR (awk, __assop_str[px->opcode]); PUT_SRCSTR (awk, SSE_T(" ")); - PRINT_ESSERESSION (awk, px->right); + PRINT_EXPRESSION (awk, px->right); sse_awk_assert (awk, px->right->next == SSE_NULL); break; } - case SSE_AWK_NDE_ESSE_BIN: + case SSE_AWK_NDE_EXP_BIN: { - sse_awk_nde_esse_t* px = (sse_awk_nde_esse_t*)nde; + sse_awk_nde_exp_t* px = (sse_awk_nde_exp_t*)nde; PUT_SRCSTR (awk, SSE_T("(")); - PRINT_ESSERESSION (awk, px->left); + PRINT_EXPRESSION (awk, px->left); sse_awk_assert (awk, px->left->next == SSE_NULL); PUT_SRCSTR (awk, SSE_T(" ")); @@ -162,7 +162,7 @@ static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde) if (px->right->type == SSE_AWK_NDE_ASS) PUT_SRCSTR (awk, SSE_T("(")); - PRINT_ESSERESSION (awk, px->right); + PRINT_EXPRESSION (awk, px->right); if (px->right->type == SSE_AWK_NDE_ASS) PUT_SRCSTR (awk, SSE_T(")")); sse_awk_assert (awk, px->right->next == SSE_NULL); @@ -170,37 +170,37 @@ static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde) break; } - case SSE_AWK_NDE_ESSE_UNR: + case SSE_AWK_NDE_EXP_UNR: { - sse_awk_nde_esse_t* px = (sse_awk_nde_esse_t*)nde; + sse_awk_nde_exp_t* px = (sse_awk_nde_exp_t*)nde; sse_awk_assert (awk, px->right == SSE_NULL); PUT_SRCSTR (awk, __unrop_str[px->opcode]); PUT_SRCSTR (awk, SSE_T("(")); - PRINT_ESSERESSION (awk, px->left); + PRINT_EXPRESSION (awk, px->left); PUT_SRCSTR (awk, SSE_T(")")); break; } - case SSE_AWK_NDE_ESSE_INCPRE: + case SSE_AWK_NDE_EXP_INCPRE: { - sse_awk_nde_esse_t* px = (sse_awk_nde_esse_t*)nde; + sse_awk_nde_exp_t* px = (sse_awk_nde_exp_t*)nde; sse_awk_assert (awk, px->right == SSE_NULL); PUT_SRCSTR (awk, __incop_str[px->opcode]); PUT_SRCSTR (awk, SSE_T("(")); - PRINT_ESSERESSION (awk, px->left); + PRINT_EXPRESSION (awk, px->left); PUT_SRCSTR (awk, SSE_T(")")); break; } - case SSE_AWK_NDE_ESSE_INCPST: + case SSE_AWK_NDE_EXP_INCPST: { - sse_awk_nde_esse_t* px = (sse_awk_nde_esse_t*)nde; + sse_awk_nde_exp_t* px = (sse_awk_nde_exp_t*)nde; sse_awk_assert (awk, px->right == SSE_NULL); PUT_SRCSTR (awk, SSE_T("(")); - PRINT_ESSERESSION (awk, px->left); + PRINT_EXPRESSION (awk, px->left); PUT_SRCSTR (awk, SSE_T(")")); PUT_SRCSTR (awk, __incop_str[px->opcode]); break; @@ -211,12 +211,12 @@ static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde) sse_awk_nde_cnd_t* px = (sse_awk_nde_cnd_t*)nde; PUT_SRCSTR (awk, SSE_T("(")); - PRINT_ESSERESSION (awk, px->test); + PRINT_EXPRESSION (awk, px->test); PUT_SRCSTR (awk, SSE_T(")?")); - PRINT_ESSERESSION (awk, px->left); + PRINT_EXPRESSION (awk, px->left); PUT_SRCSTR (awk, SSE_T(":")); - PRINT_ESSERESSION (awk, px->right); + PRINT_EXPRESSION (awk, px->right); break; } @@ -321,7 +321,7 @@ static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde) px->id.idxa, 10, SSE_NULL, tmp, sse_countof(tmp)); PUT_SRCSTRX (awk, tmp, n); PUT_SRCSTR (awk, SSE_T("[")); - PRINT_ESSERESSION_LIST (awk, px->idx); + PRINT_EXPRESSION_LIST (awk, px->idx); PUT_SRCSTR (awk, SSE_T("]")); break; } @@ -344,7 +344,7 @@ static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde) PUT_SRCSTRX (awk, px->id.name, px->id.name_len); PUT_SRCSTR (awk, SSE_T("[")); - PRINT_ESSERESSION_LIST (awk, px->idx); + PRINT_EXPRESSION_LIST (awk, px->idx); PUT_SRCSTR (awk, SSE_T("]")); break; } @@ -392,7 +392,7 @@ static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde) PUT_SRCSTR (awk, SSE_T("[")); } sse_awk_assert (awk, px->idx != SSE_NULL); - PRINT_ESSERESSION_LIST (awk, px->idx); + PRINT_EXPRESSION_LIST (awk, px->idx); PUT_SRCSTR (awk, SSE_T("]")); break; } @@ -440,7 +440,7 @@ static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde) PUT_SRCSTR (awk, SSE_T("[")); } sse_awk_assert (awk, px->idx != SSE_NULL); - PRINT_ESSERESSION_LIST (awk, px->idx); + PRINT_EXPRESSION_LIST (awk, px->idx); PUT_SRCSTR (awk, SSE_T("]")); break; } @@ -448,7 +448,7 @@ static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde) case SSE_AWK_NDE_POS: { PUT_SRCSTR (awk, SSE_T("$")); - PRINT_ESSERESSION (awk, ((sse_awk_nde_pos_t*)nde)->val); + PRINT_EXPRESSION (awk, ((sse_awk_nde_pos_t*)nde)->val); break; } @@ -458,7 +458,7 @@ static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde) PUT_SRCSTRX (awk, px->what.bfn.name, px->what.bfn.name_len); PUT_SRCSTR (awk, SSE_T(" (")); - PRINT_ESSERESSION_LIST (awk, px->args); + PRINT_EXPRESSION_LIST (awk, px->args); PUT_SRCSTR (awk, SSE_T(")")); break; } @@ -470,7 +470,7 @@ static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde) PUT_SRCSTRX (awk, px->what.afn.name, px->what.afn.name_len); PUT_SRCSTR (awk, SSE_T(" (")); - PRINT_ESSERESSION_LIST (awk, px->args); + PRINT_EXPRESSION_LIST (awk, px->args); PUT_SRCSTR (awk, SSE_T(")")); break; } @@ -482,7 +482,7 @@ static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde) (px->in_type == SSE_AWK_IN_PIPE || px->in_type == SSE_AWK_IN_COPROC)) { - PRINT_ESSERESSION (awk, px->in); + PRINT_EXPRESSION (awk, px->in); PUT_SRCSTR (awk, SSE_T(" ")); PUT_SRCSTR (awk, __getline_inop_str[px->in_type]); PUT_SRCSTR (awk, SSE_T(" ")); @@ -492,7 +492,7 @@ static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde) if (px->var != SSE_NULL) { PUT_SRCSTR (awk, SSE_T(" ")); - PRINT_ESSERESSION (awk, px->var); + PRINT_EXPRESSION (awk, px->var); } if (px->in != SSE_NULL && @@ -501,7 +501,7 @@ static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde) PUT_SRCSTR (awk, SSE_T(" ")); PUT_SRCSTR (awk, __getline_inop_str[px->in_type]); PUT_SRCSTR (awk, SSE_T(" ")); - PRINT_ESSERESSION (awk, px->in); + PRINT_EXPRESSION (awk, px->in); } break; } @@ -515,13 +515,13 @@ static int __print_esseression (sse_awk_t* awk, sse_awk_nde_t* nde) return 0; } -static int __print_esseression_list (sse_awk_t* awk, sse_awk_nde_t* tree) +static int __print_expression_list (sse_awk_t* awk, sse_awk_nde_t* tree) { sse_awk_nde_t* p = tree; while (p != SSE_NULL) { - PRINT_ESSERESSION (awk, p); + PRINT_EXPRESSION (awk, p); p = p->next; if (p != SSE_NULL) PUT_SRCSTR (awk, SSE_T(",")); } @@ -588,7 +588,7 @@ static int __print_statements (sse_awk_t* awk, sse_awk_nde_t* tree, int depth) PRINT_TABS (awk, depth); PUT_SRCSTR (awk, SSE_T("if (")); - PRINT_ESSERESSION (awk, px->test); + PRINT_EXPRESSION (awk, px->test); PUT_SRCSTR (awk, SSE_T(")\n")); sse_awk_assert (awk, px->then_part != SSE_NULL); @@ -615,7 +615,7 @@ static int __print_statements (sse_awk_t* awk, sse_awk_nde_t* tree, int depth) PRINT_TABS (awk, depth); PUT_SRCSTR (awk, SSE_T("while (")); - PRINT_ESSERESSION (awk, px->test); + PRINT_EXPRESSION (awk, px->test); PUT_SRCSTR (awk, SSE_T(")\n")); if (px->body->type == SSE_AWK_NDE_BLK) { @@ -645,7 +645,7 @@ static int __print_statements (sse_awk_t* awk, sse_awk_nde_t* tree, int depth) PRINT_TABS (awk, depth); PUT_SRCSTR (awk, SSE_T("while (")); - PRINT_ESSERESSION (awk, px->test); + PRINT_EXPRESSION (awk, px->test); PUT_SRCSTR (awk, SSE_T(");\n")); break; } @@ -658,17 +658,17 @@ static int __print_statements (sse_awk_t* awk, sse_awk_nde_t* tree, int depth) PUT_SRCSTR (awk, SSE_T("for (")); if (px->init != SSE_NULL) { - PRINT_ESSERESSION (awk, px->init); + PRINT_EXPRESSION (awk, px->init); } PUT_SRCSTR (awk, SSE_T("; ")); if (px->test != SSE_NULL) { - PRINT_ESSERESSION (awk, px->test); + PRINT_EXPRESSION (awk, px->test); } PUT_SRCSTR (awk, SSE_T("; ")); if (px->incr != SSE_NULL) { - PRINT_ESSERESSION (awk, px->incr); + PRINT_EXPRESSION (awk, px->incr); } PUT_SRCSTR (awk, SSE_T(")\n")); @@ -689,7 +689,7 @@ static int __print_statements (sse_awk_t* awk, sse_awk_nde_t* tree, int depth) PRINT_TABS (awk, depth); PUT_SRCSTR (awk, SSE_T("for ")); - PRINT_ESSERESSION (awk, px->test); + PRINT_EXPRESSION (awk, px->test); PUT_SRCSTR (awk, SSE_T("\n")); if (px->body->type == SSE_AWK_NDE_BLK) { @@ -728,7 +728,7 @@ static int __print_statements (sse_awk_t* awk, sse_awk_nde_t* tree, int depth) PUT_SRCSTR (awk, SSE_T("return ")); sse_awk_assert (awk, ((sse_awk_nde_return_t*)p)->val->next == SSE_NULL); - PRINT_ESSERESSION (awk, ((sse_awk_nde_return_t*)p)->val); + PRINT_EXPRESSION (awk, ((sse_awk_nde_return_t*)p)->val); PUT_SRCSTR (awk, SSE_T(";\n")); } break; @@ -747,7 +747,7 @@ static int __print_statements (sse_awk_t* awk, sse_awk_nde_t* tree, int depth) { PUT_SRCSTR (awk, SSE_T("exit ")); sse_awk_assert (awk, px->val->next == SSE_NULL); - PRINT_ESSERESSION (awk, px->val); + PRINT_EXPRESSION (awk, px->val); PUT_SRCSTR (awk, SSE_T(";\n")); } break; @@ -771,7 +771,7 @@ static int __print_statements (sse_awk_t* awk, sse_awk_nde_t* tree, int depth) { PRINT_TABS (awk, depth); PUT_SRCSTR (awk, SSE_T("delete ")); - /* TODO: can't use __print_esseression??? */ + /* TODO: can't use __print_expression??? */ sse_awk_prnpt (awk, ((sse_awk_nde_delete_t*)p)->var); break; } @@ -786,7 +786,7 @@ static int __print_statements (sse_awk_t* awk, sse_awk_nde_t* tree, int depth) if (px->args != SSE_NULL) { PUT_SRCSTR (awk, SSE_T(" ")); - PRINT_ESSERESSION_LIST (awk, px->args); + PRINT_EXPRESSION_LIST (awk, px->args); } if (px->out != SSE_NULL) @@ -794,7 +794,7 @@ static int __print_statements (sse_awk_t* awk, sse_awk_nde_t* tree, int depth) PUT_SRCSTR (awk, SSE_T(" ")); PUT_SRCSTR (awk, __print_outop_str[px->out_type]); PUT_SRCSTR (awk, SSE_T(" ")); - PRINT_ESSERESSION (awk, px->out); + PRINT_EXPRESSION (awk, px->out); } PUT_SRCSTR (awk, SSE_T(";\n")); @@ -804,7 +804,7 @@ static int __print_statements (sse_awk_t* awk, sse_awk_nde_t* tree, int depth) default: { PRINT_TABS (awk, depth); - PRINT_ESSERESSION (awk, p); + PRINT_EXPRESSION (awk, p); PUT_SRCSTR (awk, SSE_T(";\n")); } } @@ -826,7 +826,7 @@ int sse_awk_prnptnpt (sse_awk_t* awk, sse_awk_nde_t* tree) while (nde != SSE_NULL) { - if (__print_esseression (awk, nde) == -1) return -1; + if (__print_expression (awk, nde) == -1) return -1; if (nde->next == SSE_NULL) break; PUT_SRCSTR (awk, SSE_T(",")); @@ -975,9 +975,9 @@ void sse_awk_clrpt (sse_awk_t* awk, sse_awk_nde_t* tree) break; } - case SSE_AWK_NDE_ESSE_BIN: + case SSE_AWK_NDE_EXP_BIN: { - sse_awk_nde_esse_t* px = (sse_awk_nde_esse_t*)p; + sse_awk_nde_exp_t* px = (sse_awk_nde_exp_t*)p; sse_awk_assert (awk, px->left->next == SSE_NULL); sse_awk_assert (awk, px->right->next == SSE_NULL); @@ -987,11 +987,11 @@ void sse_awk_clrpt (sse_awk_t* awk, sse_awk_nde_t* tree) break; } - case SSE_AWK_NDE_ESSE_UNR: - case SSE_AWK_NDE_ESSE_INCPRE: - case SSE_AWK_NDE_ESSE_INCPST: + case SSE_AWK_NDE_EXP_UNR: + case SSE_AWK_NDE_EXP_INCPRE: + case SSE_AWK_NDE_EXP_INCPST: { - sse_awk_nde_esse_t* px = (sse_awk_nde_esse_t*)p; + sse_awk_nde_exp_t* px = (sse_awk_nde_exp_t*)p; sse_awk_assert (awk, px->right == SSE_NULL); sse_awk_clrpt (awk, px->left); SSE_AWK_FREE (awk, p); diff --git a/ase/awk/tree.h b/ase/awk/tree.h index 5c0816f7..a8b1855f 100644 --- a/ase/awk/tree.h +++ b/ase/awk/tree.h @@ -1,5 +1,5 @@ /* - * $Id: tree.h,v 1.75 2006-10-22 11:34:53 bacon Exp $ + * $Id: tree.h,v 1.76 2006-10-22 12:39:30 bacon Exp $ */ #ifndef _SSE_AWK_TREE_H_ @@ -29,16 +29,16 @@ enum SSE_AWK_NDE_DELETE, SSE_AWK_NDE_PRINT, - /* esseression */ + /* expression */ /* if you change the following values including their order, - * you should change __eval_func of __eval_esseression + * you should change __eval_func of __eval_expression * in run.c accordingly */ SSE_AWK_NDE_GRP, SSE_AWK_NDE_ASS, - SSE_AWK_NDE_ESSE_BIN, - SSE_AWK_NDE_ESSE_UNR, - SSE_AWK_NDE_ESSE_INCPRE, - SSE_AWK_NDE_ESSE_INCPST, + SSE_AWK_NDE_EXP_BIN, + SSE_AWK_NDE_EXP_UNR, + SSE_AWK_NDE_EXP_INCPRE, + SSE_AWK_NDE_EXP_INCPST, SSE_AWK_NDE_CND, SSE_AWK_NDE_BFN, SSE_AWK_NDE_AFN, @@ -95,7 +95,7 @@ typedef struct sse_awk_nde_t sse_awk_nde_t; typedef struct sse_awk_nde_blk_t sse_awk_nde_blk_t; typedef struct sse_awk_nde_grp_t sse_awk_nde_grp_t; typedef struct sse_awk_nde_ass_t sse_awk_nde_ass_t; -typedef struct sse_awk_nde_esse_t sse_awk_nde_esse_t; +typedef struct sse_awk_nde_exp_t sse_awk_nde_exp_t; typedef struct sse_awk_nde_cnd_t sse_awk_nde_cnd_t; typedef struct sse_awk_nde_pos_t sse_awk_nde_pos_t; typedef struct sse_awk_nde_int_t sse_awk_nde_int_t; @@ -144,7 +144,7 @@ struct sse_awk_nde_blk_t sse_awk_nde_t* body; }; -/* SSE_AWK_NDE_GRP - esseression group */ +/* SSE_AWK_NDE_GRP - expression group */ struct sse_awk_nde_grp_t { SSE_AWK_NDE_HDR; @@ -160,9 +160,9 @@ struct sse_awk_nde_ass_t sse_awk_nde_t* right; }; -/* SSE_AWK_NDE_ESSE_BIN, SSE_AWK_NDE_ESSE_UNR, - * SSE_AWK_NDE_ESSE_INCPRE, SSE_AW_NDE_ESSE_INCPST */ -struct sse_awk_nde_esse_t +/* SSE_AWK_NDE_EXP_BIN, SSE_AWK_NDE_EXP_UNR, + * SSE_AWK_NDE_EXP_INCPRE, SSE_AW_NDE_EXP_INCPST */ +struct sse_awk_nde_exp_t { SSE_AWK_NDE_HDR; int opcode; diff --git a/ase/awk/val.c b/ase/awk/val.c index 0b943d70..e6c6abd7 100644 --- a/ase/awk/val.c +++ b/ase/awk/val.c @@ -1,5 +1,5 @@ /* - * $Id: val.c,v 1.74 2006-10-22 11:34:53 bacon Exp $ + * $Id: val.c,v 1.75 2006-10-22 12:39:30 bacon Exp $ */ #include @@ -64,7 +64,7 @@ sse_awk_val_t* sse_awk_makeintval (sse_awk_run_t* run, sse_long_t v) val->val = v; val->nde = SSE_NULL; -/*sse_printf (SSE_T("makeintval => %p\n"), val);*/ +/*xp_printf (SSE_T("makeintval => %p\n"), val);*/ return (sse_awk_val_t*)val; } @@ -88,7 +88,7 @@ sse_awk_val_t* sse_awk_makerealval (sse_awk_run_t* run, sse_real_t v) val->val = v; val->nde = SSE_NULL; -/*sse_printf (SSE_T("makerealval => %p\n"), val);*/ +/*xp_printf (SSE_T("makerealval => %p\n"), val);*/ return (sse_awk_val_t*)val; } @@ -116,7 +116,7 @@ sse_awk_val_t* sse_awk_makestrval ( return SSE_NULL; } -/*sse_printf (SSE_T("makestrval => %p\n"), val);*/ +/*xp_printf (SSE_T("makestrval => %p\n"), val);*/ return (sse_awk_val_t*)val; } @@ -141,7 +141,7 @@ sse_awk_val_t* sse_awk_makestrval2 ( return SSE_NULL; } -/*sse_printf (SSE_T("makestrval2 => %p\n"), val);*/ +/*xp_printf (SSE_T("makestrval2 => %p\n"), val);*/ return (sse_awk_val_t*)val; } @@ -179,9 +179,9 @@ sse_awk_val_t* sse_awk_makerexval ( static void __free_map_val (void* run, void* v) { /* -sse_printf (SSE_T("refdown in map free...")); +xp_printf (SSE_T("refdown in map free...")); sse_awk_printval (v); -sse_printf (SSE_T("\n")); +xp_printf (SSE_T("\n")); */ sse_awk_refdownval (run, v); } @@ -243,9 +243,9 @@ void sse_awk_freeval (sse_awk_run_t* run, sse_awk_val_t* val, sse_bool_t cache) { if (sse_awk_isbuiltinval(val)) return; -/*sse_printf (SSE_T("freeing [cache=%d] ... "), cache); +/*xp_printf (SSE_T("freeing [cache=%d] ... "), cache); sse_awk_printval (val); -sse_printf (SSE_T("\n"));*/ +xp_printf (SSE_T("\n"));*/ if (val->type == SSE_AWK_VAL_NIL) { SSE_AWK_FREE (run->awk, val); @@ -307,9 +307,9 @@ void sse_awk_refupval (sse_awk_val_t* val) { if (sse_awk_isbuiltinval(val)) return; /* -sse_printf (SSE_T("ref up ")); +xp_printf (SSE_T("ref up ")); sse_awk_printval (val); -sse_printf (SSE_T("\n")); +xp_printf (SSE_T("\n")); */ val->ref++; } @@ -319,10 +319,10 @@ void sse_awk_refdownval (sse_awk_run_t* run, sse_awk_val_t* val) if (sse_awk_isbuiltinval(val)) return; /* -sse_printf (SSE_T("%p, %p, %p\n"), sse_awk_val_nil, &__awk_nil, val); -sse_printf (SSE_T("ref down [count=>%d]\n"), (int)val->ref); +xp_printf (SSE_T("%p, %p, %p\n"), sse_awk_val_nil, &__awk_nil, val); +xp_printf (SSE_T("ref down [count=>%d]\n"), (int)val->ref); sse_awk_printval (val); -sse_printf (SSE_T("\n")); +xp_printf (SSE_T("\n")); */ sse_awk_assert (run->awk, val->ref > 0); @@ -330,9 +330,9 @@ sse_printf (SSE_T("\n")); if (val->ref <= 0) { /* -sse_printf (SSE_T("**FREEING [")); +xp_printf (SSE_T("**FREEING [")); sse_awk_printval (val); -sse_printf (SSE_T("]\n")); +xp_printf (SSE_T("]\n")); */ sse_awk_freeval(run, val, sse_true); } @@ -426,7 +426,7 @@ sse_char_t* sse_awk_valtostr ( /* TODO: process more value types */ -sse_printf (SSE_T("*** ERROR: WRONG VALUE TYPE [%d] in sse_awk_valtostr v=> %p***\n"), v->type, v); +xp_printf (SSE_T("*** ERROR: WRONG VALUE TYPE [%d] in sse_awk_valtostr v=> %p***\n"), v->type, v); run->errnum = SSE_AWK_EVALTYPE; return SSE_NULL; } @@ -643,16 +643,16 @@ int sse_awk_valtonum ( return 0; /* long */ } -sse_printf (SSE_T("*** ERROR: WRONG VALUE TYPE [%d] in sse_awk_valtonum v=> %p***\n"), v->type, v); +xp_printf (SSE_T("*** ERROR: WRONG VALUE TYPE [%d] in sse_awk_valtonum v=> %p***\n"), v->type, v); run->errnum = SSE_AWK_EVALTYPE; return -1; /* error */ } static int __print_pair (sse_awk_pair_t* pair, void* arg) { - sse_printf (SSE_T(" %s=>"), pair->key); + xp_printf (SSE_T(" %s=>"), pair->key); sse_awk_printval (pair->val); - sse_printf (SSE_T(" ")); + xp_printf (SSE_T(" ")); return 0; } @@ -662,51 +662,51 @@ void sse_awk_printval (sse_awk_val_t* val) switch (val->type) { case SSE_AWK_VAL_NIL: - sse_printf (SSE_T("nil")); + xp_printf (SSE_T("nil")); break; case SSE_AWK_VAL_INT: #if defined(__LCC__) - sse_printf (SSE_T("%lld"), + xp_printf (SSE_T("%lld"), (long long)((sse_awk_val_int_t*)val)->val); #elif defined(__BORLANDC__) || defined(_MSC_VER) - sse_printf (SSE_T("%I64d"), + xp_printf (SSE_T("%I64d"), (__int64)((sse_awk_nde_int_t*)val)->val); #elif defined(vax) || defined(__vax) || defined(_SCO_DS) - sse_printf (SSE_T("%ld"), + xp_printf (SSE_T("%ld"), (long)((sse_awk_val_int_t*)val)->val); #else - sse_printf (SSE_T("%lld"), + xp_printf (SSE_T("%lld"), (long long)((sse_awk_val_int_t*)val)->val); #endif break; case SSE_AWK_VAL_REAL: - sse_printf (SSE_T("%Lf"), + xp_printf (SSE_T("%Lf"), (long double)((sse_awk_val_real_t*)val)->val); break; case SSE_AWK_VAL_STR: - sse_printf (SSE_T("%s"), ((sse_awk_val_str_t*)val)->buf); + xp_printf (SSE_T("%s"), ((sse_awk_val_str_t*)val)->buf); break; case SSE_AWK_VAL_REX: - sse_printf (SSE_T("REX[%s]"), ((sse_awk_val_rex_t*)val)->buf); + xp_printf (SSE_T("REX[%s]"), ((sse_awk_val_rex_t*)val)->buf); break; case SSE_AWK_VAL_MAP: - sse_printf (SSE_T("MAP[")); + xp_printf (SSE_T("MAP[")); sse_awk_map_walk (((sse_awk_val_map_t*)val)->map, __print_pair, SSE_NULL); - sse_printf (SSE_T("]")); + xp_printf (SSE_T("]")); break; case SSE_AWK_VAL_REF: - sse_printf (SSE_T("REF[id=%d,val="), ((sse_awk_val_ref_t*)val)->id); + xp_printf (SSE_T("REF[id=%d,val="), ((sse_awk_val_ref_t*)val)->id); sse_awk_printval (*((sse_awk_val_ref_t*)val)->adr); - sse_printf (SSE_T("]")); + xp_printf (SSE_T("]")); break; default: - sse_printf (SSE_T("**** INTERNAL ERROR - INVALID VALUE TYPE ****\n")); + xp_printf (SSE_T("**** INTERNAL ERROR - INVALID VALUE TYPE ****\n")); } } diff --git a/ase/configure b/ase/configure index d4756e92..ff99c5d6 100755 --- a/ase/configure +++ b/ase/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 1.66 . +# From configure.ac Revision: 1.67 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for sse deb-0.1.0. # @@ -12938,7 +12938,7 @@ then CFLAGS="$CFLAGS -D_REENTRANT -D_THREAD_SAFE" fi - ac_config_files="$ac_config_files makefile awk/makefile" + ac_config_files="$ac_config_files makefile awk/makefile test/awk/makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -13466,6 +13466,7 @@ do # Handling of arguments. "makefile" ) CONFIG_FILES="$CONFIG_FILES makefile" ;; "awk/makefile" ) CONFIG_FILES="$CONFIG_FILES awk/makefile" ;; + "test/awk/makefile" ) CONFIG_FILES="$CONFIG_FILES test/awk/makefile" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} diff --git a/ase/configure.ac b/ase/configure.ac index 10d44a19..5bc8d20b 100644 --- a/ase/configure.ac +++ b/ase/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ(2.53) AC_INIT([sse], [deb-0.1.0]) -AC_REVISION([$Revision: 1.67 $]) +AC_REVISION([$Revision: 1.68 $]) AC_CONFIG_HEADER([config.h]) # Checks for programs. @@ -123,5 +123,5 @@ then [CFLAGS="$CFLAGS -D_REENTRANT -D_THREAD_SAFE"] fi -AC_CONFIG_FILES([makefile awk/makefile]) +AC_CONFIG_FILES([makefile awk/makefile test/awk/makefile]) AC_OUTPUT diff --git a/ase/test/awk/awk.c b/ase/test/awk/awk.c index 4fb532ab..2740644e 100644 --- a/ase/test/awk/awk.c +++ b/ase/test/awk/awk.c @@ -1,14 +1,14 @@ /* - * $Id: awk.c,v 1.100 2006-10-16 14:39:21 bacon Exp $ + * $Id: awk.c,v 1.101 2006-10-22 12:39:30 bacon Exp $ */ -#include +#include #include #include #include #include -#ifdef XP_CHAR_IS_WCHAR +#ifdef SSE_CHAR_IS_WCHAR #include #include #endif @@ -25,9 +25,9 @@ #include #include #ifndef PATH_MAX - #define XP_PATH_MAX 4096 + #define SSE_PATH_MAX 4096 #else - #define XP_PATH_MAX PATH_MAX + #define SSE_PATH_MAX PATH_MAX #endif #ifdef _WIN32 @@ -66,7 +66,7 @@ static FILE* fopen_t (const xp_char_t* path, const xp_char_t* mode) #ifdef _WIN32 return _tfopen (path, mode); #else - #ifdef XP_CHAR_IS_MCHAR + #ifdef SSE_CHAR_IS_MCHAR const xp_mchar_t* path_mb; const xp_mchar_t* mode_mb; #else @@ -74,14 +74,14 @@ static FILE* fopen_t (const xp_char_t* path, const xp_char_t* mode) xp_mchar_t mode_mb[32]; #endif - #ifdef XP_CHAR_IS_MCHAR + #ifdef SSE_CHAR_IS_MCHAR path_mb = path; mode_mb = mode; #else if (xp_wcstomcs_strict ( - path, path_mb, xp_countof(path_mb)) == -1) return XP_NULL; + path, path_mb, xp_countof(path_mb)) == -1) return SSE_NULL; if (xp_wcstomcs_strict ( - mode, mode_mb, xp_countof(mode_mb)) == -1) return XP_NULL; + mode, mode_mb, xp_countof(mode_mb)) == -1) return SSE_NULL; #endif return fopen (path_mb, mode_mb); @@ -100,9 +100,9 @@ static int __dprintf (const xp_char_t* fmt, ...) #ifdef _WIN32 n = xp_vsprintf (buf, xp_countof(buf), fmt, ap); #if defined(_MSC_VER) && (_MSC_VER>=1400) - MessageBox (NULL, buf, XP_T("\uD655\uC778\uC2E4\uD328 Assertion Failure"), MB_OK | MB_ICONERROR); + MessageBox (NULL, buf, SSE_T("\uD655\uC778\uC2E4\uD328 Assertion Failure"), MB_OK | MB_ICONERROR); #else - MessageBox (NULL, buf, XP_T("Assertion Failure"), MB_OK | MB_ICONERROR); + MessageBox (NULL, buf, SSE_T("Assertion Failure"), MB_OK | MB_ICONERROR); #endif #else @@ -117,7 +117,7 @@ static FILE* popen_t (const xp_char_t* cmd, const xp_char_t* mode) #ifdef _WIN32 return _tpopen (cmd, mode); #else - #ifdef XP_CHAR_IS_MCHAR + #ifdef SSE_CHAR_IS_MCHAR const xp_mchar_t* cmd_mb; const xp_mchar_t* mode_mb; #else @@ -125,14 +125,14 @@ static FILE* popen_t (const xp_char_t* cmd, const xp_char_t* mode) xp_mchar_t mode_mb[32]; #endif - #ifdef XP_CHAR_IS_MCHAR + #ifdef SSE_CHAR_IS_MCHAR cmd_mb = cmd; mode_mb = mode; #else if (xp_wcstomcs_strict ( - cmd, cmd_mb, xp_countof(cmd_mb)) == -1) return XP_NULL; + cmd, cmd_mb, xp_countof(cmd_mb)) == -1) return SSE_NULL; if (xp_wcstomcs_strict ( - mode, mode_mb, xp_countof(mode_mb)) == -1) return XP_NULL; + mode, mode_mb, xp_countof(mode_mb)) == -1) return SSE_NULL; #endif return popen (cmd_mb, mode_mb); @@ -143,7 +143,7 @@ static FILE* popen_t (const xp_char_t* cmd, const xp_char_t* mode) #define fgets_t _fgetts #define fputs_t _fputts #else - #ifdef XP_CHAR_IS_MCHAR + #ifdef SSE_CHAR_IS_MCHAR #define fgets_t fgets #define fputs_t fputs #else @@ -158,28 +158,28 @@ static xp_ssize_t process_source ( struct src_io* src_io = (struct src_io*)arg; xp_char_t c; - if (cmd == XP_AWK_IO_OPEN) + if (cmd == SSE_AWK_IO_OPEN) { - if (src_io->input_file == XP_NULL) return 0; - src_io->input_handle = fopen_t (src_io->input_file, XP_T("r")); + if (src_io->input_file == SSE_NULL) return 0; + src_io->input_handle = fopen_t (src_io->input_file, SSE_T("r")); if (src_io->input_handle == NULL) return -1; return 1; } - else if (cmd == XP_AWK_IO_CLOSE) + else if (cmd == SSE_AWK_IO_CLOSE) { - if (src_io->input_file == XP_NULL) return 0; + if (src_io->input_file == SSE_NULL) return 0; fclose ((FILE*)src_io->input_handle); return 0; } - else if (cmd == XP_AWK_IO_READ) + else if (cmd == SSE_AWK_IO_READ) { if (size <= 0) return -1; - #ifdef XP_CHAR_IS_MCHAR + #ifdef SSE_CHAR_IS_MCHAR c = fgetc ((FILE*)src_io->input_handle); #else c = fgetwc ((FILE*)src_io->input_handle); #endif - if (c == XP_CHAR_EOF) return 0; + if (c == SSE_CHAR_EOF) return 0; *data = c; return 1; } @@ -192,14 +192,14 @@ static xp_ssize_t dump_source ( { /*struct src_io* src_io = (struct src_io*)arg;*/ - if (cmd == XP_AWK_IO_OPEN) return 1; - else if (cmd == XP_AWK_IO_CLOSE) return 0; - else if (cmd == XP_AWK_IO_WRITE) + if (cmd == SSE_AWK_IO_OPEN) return 1; + else if (cmd == SSE_AWK_IO_CLOSE) return 0; + else if (cmd == SSE_AWK_IO_WRITE) { xp_size_t i; for (i = 0; i < size; i++) { - #ifdef XP_CHAR_IS_MCHAR + #ifdef SSE_CHAR_IS_MCHAR fputc (data[i], stdout); #else fputwc (data[i], stdout); @@ -214,56 +214,56 @@ static xp_ssize_t dump_source ( static xp_ssize_t process_extio_pipe ( int cmd, void* arg, xp_char_t* data, xp_size_t size) { - xp_awk_extio_t* epa = (xp_awk_extio_t*)arg; + sse_awk_extio_t* epa = (sse_awk_extio_t*)arg; switch (cmd) { - case XP_AWK_IO_OPEN: + case SSE_AWK_IO_OPEN: { FILE* handle; const xp_char_t* mode; - if (epa->mode == XP_AWK_IO_PIPE_READ) - mode = XP_T("r"); - else if (epa->mode == XP_AWK_IO_PIPE_WRITE) - mode = XP_T("w"); + if (epa->mode == SSE_AWK_IO_PIPE_READ) + mode = SSE_T("r"); + else if (epa->mode == SSE_AWK_IO_PIPE_WRITE) + mode = SSE_T("w"); else return -1; /* TODO: any way to set the error number? */ -xp_printf (XP_TEXT("opending %s of type %d (pipe)\n"), epa->name, epa->type); +xp_printf (SSE_TEXT("opending %s of type %d (pipe)\n"), epa->name, epa->type); handle = popen_t (epa->name, mode); if (handle == NULL) return -1; epa->handle = (void*)handle; return 1; } - case XP_AWK_IO_CLOSE: + case SSE_AWK_IO_CLOSE: { -xp_printf (XP_TEXT("closing %s of type (pipe) %d\n"), epa->name, epa->type); +xp_printf (SSE_TEXT("closing %s of type (pipe) %d\n"), epa->name, epa->type); fclose ((FILE*)epa->handle); epa->handle = NULL; return 0; } - case XP_AWK_IO_READ: + case SSE_AWK_IO_READ: { - if (fgets_t (data, size, (FILE*)epa->handle) == XP_NULL) + if (fgets_t (data, size, (FILE*)epa->handle) == SSE_NULL) return 0; - return xp_awk_strlen(data); + return sse_awk_strlen(data); } - case XP_AWK_IO_WRITE: + case SSE_AWK_IO_WRITE: { /* TODO: size... */ fputs_t (data, (FILE*)epa->handle); return size; } - case XP_AWK_IO_FLUSH: + case SSE_AWK_IO_FLUSH: { - if (epa->mode == XP_AWK_IO_PIPE_READ) return -1; + if (epa->mode == SSE_AWK_IO_PIPE_READ) return -1; else return 0; } - case XP_AWK_IO_NEXT: + case SSE_AWK_IO_NEXT: { return -1; } @@ -275,24 +275,24 @@ xp_printf (XP_TEXT("closing %s of type (pipe) %d\n"), epa->name, epa->type); static xp_ssize_t process_extio_file ( int cmd, void* arg, xp_char_t* data, xp_size_t size) { - xp_awk_extio_t* epa = (xp_awk_extio_t*)arg; + sse_awk_extio_t* epa = (sse_awk_extio_t*)arg; switch (cmd) { - case XP_AWK_IO_OPEN: + case SSE_AWK_IO_OPEN: { FILE* handle; const xp_char_t* mode; - if (epa->mode == XP_AWK_IO_FILE_READ) - mode = XP_T("r"); - else if (epa->mode == XP_AWK_IO_FILE_WRITE) - mode = XP_T("w"); - else if (epa->mode == XP_AWK_IO_FILE_APPEND) - mode = XP_T("a"); + if (epa->mode == SSE_AWK_IO_FILE_READ) + mode = SSE_T("r"); + else if (epa->mode == SSE_AWK_IO_FILE_WRITE) + mode = SSE_T("w"); + else if (epa->mode == SSE_AWK_IO_FILE_APPEND) + mode = SSE_T("a"); else return -1; /* TODO: any way to set the error number? */ -xp_printf (XP_TEXT("opending %s of type %d (file)\n"), epa->name, epa->type); +xp_printf (SSE_TEXT("opending %s of type %d (file)\n"), epa->name, epa->type); handle = fopen_t (epa->name, mode); if (handle == NULL) return -1; @@ -300,35 +300,35 @@ xp_printf (XP_TEXT("opending %s of type %d (file)\n"), epa->name, epa->type); return 1; } - case XP_AWK_IO_CLOSE: + case SSE_AWK_IO_CLOSE: { -xp_printf (XP_TEXT("closing %s of type %d (file)\n"), epa->name, epa->type); +xp_printf (SSE_TEXT("closing %s of type %d (file)\n"), epa->name, epa->type); fclose ((FILE*)epa->handle); epa->handle = NULL; return 0; } - case XP_AWK_IO_READ: + case SSE_AWK_IO_READ: { - if (fgets_t (data, size, (FILE*)epa->handle) == XP_NULL) + if (fgets_t (data, size, (FILE*)epa->handle) == SSE_NULL) return 0; - return xp_awk_strlen(data); + return sse_awk_strlen(data); } - case XP_AWK_IO_WRITE: + case SSE_AWK_IO_WRITE: { /* TODO: how to return error or 0 */ fputs_t (data, /*size,*/ (FILE*)epa->handle); return size; } - case XP_AWK_IO_FLUSH: + case SSE_AWK_IO_FLUSH: { if (fflush ((FILE*)epa->handle) == EOF) return -1; return 0; } - case XP_AWK_IO_NEXT: + case SSE_AWK_IO_NEXT: { return -1; } @@ -338,56 +338,56 @@ xp_printf (XP_TEXT("closing %s of type %d (file)\n"), epa->name, epa->type); return -1; } -static int open_extio_console (xp_awk_extio_t* epa); -static int close_extio_console (xp_awk_extio_t* epa); -static int next_extio_console (xp_awk_extio_t* epa); +static int open_extio_console (sse_awk_extio_t* epa); +static int close_extio_console (sse_awk_extio_t* epa); +static int next_extio_console (sse_awk_extio_t* epa); static xp_size_t infile_no = 0; static const xp_char_t* infiles[10000] = { - XP_T(""), - XP_NULL + SSE_T(""), + SSE_NULL }; static xp_ssize_t process_extio_console ( int cmd, void* arg, xp_char_t* data, xp_size_t size) { - xp_awk_extio_t* epa = (xp_awk_extio_t*)arg; + sse_awk_extio_t* epa = (sse_awk_extio_t*)arg; - if (cmd == XP_AWK_IO_OPEN) + if (cmd == SSE_AWK_IO_OPEN) { return open_extio_console (epa); } - else if (cmd == XP_AWK_IO_CLOSE) + else if (cmd == SSE_AWK_IO_CLOSE) { return close_extio_console (epa); } - else if (cmd == XP_AWK_IO_READ) + else if (cmd == SSE_AWK_IO_READ) { - while (fgets_t (data, size, epa->handle) == XP_NULL) + while (fgets_t (data, size, epa->handle) == SSE_NULL) { /* it has reached the end of the current file. * open the next file if available */ - if (infiles[infile_no] == XP_NULL) + if (infiles[infile_no] == SSE_NULL) { /* no more input console */ /* is this correct??? */ /* - if (epa->handle != XP_NULL && + if (epa->handle != SSE_NULL && epa->handle != stdin && epa->handle != stdout && epa->handle != stderr) fclose (epa->handle); - epa->handle = XP_NULL; + epa->handle = SSE_NULL; */ return 0; } - if (infiles[infile_no][0] == XP_T('\0')) + if (infiles[infile_no][0] == SSE_T('\0')) { - if (epa->handle != XP_NULL && + if (epa->handle != SSE_NULL && epa->handle != stdin && epa->handle != stdout && epa->handle != stderr) fclose (epa->handle); @@ -395,40 +395,40 @@ static xp_ssize_t process_extio_console ( } else { - FILE* fp = fopen_t (infiles[infile_no], XP_T("r")); - if (fp == XP_NULL) + FILE* fp = fopen_t (infiles[infile_no], SSE_T("r")); + if (fp == SSE_NULL) { -xp_printf (XP_TEXT("failed to open the next console of type %x - fopen failure\n"), epa->type); +xp_printf (SSE_TEXT("failed to open the next console of type %x - fopen failure\n"), epa->type); return -1; } - if (epa->handle != XP_NULL && + if (epa->handle != SSE_NULL && epa->handle != stdin && epa->handle != stdout && epa->handle != stderr) fclose (epa->handle); -xp_printf (XP_TEXT("open the next console [%s]\n"), infiles[infile_no]); +xp_printf (SSE_TEXT("open the next console [%s]\n"), infiles[infile_no]); epa->handle = fp; } infile_no++; } - return xp_awk_strlen(data); + return sse_awk_strlen(data); } - else if (cmd == XP_AWK_IO_WRITE) + else if (cmd == SSE_AWK_IO_WRITE) { /* TODO: how to return error or 0 */ fputs_t (data, /*size,*/ (FILE*)epa->handle); /*MessageBox (NULL, data, data, MB_OK);*/ return size; } - else if (cmd == XP_AWK_IO_FLUSH) + else if (cmd == SSE_AWK_IO_FLUSH) { if (fflush ((FILE*)epa->handle) == EOF) return -1; return 0; } - else if (cmd == XP_AWK_IO_NEXT) + else if (cmd == SSE_AWK_IO_NEXT) { return next_extio_console (epa); } @@ -436,44 +436,44 @@ xp_printf (XP_TEXT("open the next console [%s]\n"), infiles[infile_no]); return -1; } -static int open_extio_console (xp_awk_extio_t* epa) +static int open_extio_console (sse_awk_extio_t* epa) { /* TODO: OpenConsole in GUI APPLICATION */ /* epa->name is always empty for console */ - xp_assert (epa->name[0] == XP_T('\0')); + xp_assert (epa->name[0] == SSE_T('\0')); -xp_printf (XP_TEXT("opening console[%s] of type %x\n"), epa->name, epa->type); +xp_printf (SSE_TEXT("opening console[%s] of type %x\n"), epa->name, epa->type); - if (epa->mode == XP_AWK_IO_CONSOLE_READ) + if (epa->mode == SSE_AWK_IO_CONSOLE_READ) { - if (infiles[infile_no] == XP_NULL) + if (infiles[infile_no] == SSE_NULL) { /* no more input file */ -xp_printf (XP_TEXT("console - no more file\n"));; +xp_printf (SSE_TEXT("console - no more file\n"));; return 0; } - if (infiles[infile_no][0] == XP_T('\0')) + if (infiles[infile_no][0] == SSE_T('\0')) { -xp_printf (XP_T(" console(r) - \n")); +xp_printf (SSE_T(" console(r) - \n")); epa->handle = stdin; } else { /* a temporary variable fp is used here not to change * any fields of epa when the open operation fails */ - FILE* fp = fopen_t (infiles[infile_no], XP_T("r")); - if (fp == XP_NULL) + FILE* fp = fopen_t (infiles[infile_no], SSE_T("r")); + if (fp == SSE_NULL) { -xp_printf (XP_TEXT("failed to open console of type %x - fopen failure\n"), epa->type); +xp_printf (SSE_TEXT("failed to open console of type %x - fopen failure\n"), epa->type); return -1; } -xp_printf (XP_T(" console(r) - %s\n"), infiles[infile_no]); - if (xp_awk_setconsolename ( +xp_printf (SSE_T(" console(r) - %s\n"), infiles[infile_no]); + if (sse_awk_setconsolename ( epa->run, infiles[infile_no], - xp_awk_strlen(infiles[infile_no])) == -1) + sse_awk_strlen(infiles[infile_no])) == -1) { fclose (fp); return -1; @@ -485,11 +485,11 @@ xp_printf (XP_T(" console(r) - %s\n"), infiles[infile_no]); infile_no++; return 1; } - else if (epa->mode == XP_AWK_IO_CONSOLE_WRITE) + else if (epa->mode == SSE_AWK_IO_CONSOLE_WRITE) { -xp_printf (XP_T(" console(w) - \n")); +xp_printf (SSE_T(" console(w) - \n")); /* TODO: does output console has a name??? */ - /*xp_awk_setconsolename (XP_T(""));*/ + /*sse_awk_setconsolename (SSE_T(""));*/ epa->handle = stdout; return 1; } @@ -497,11 +497,11 @@ xp_printf (XP_T(" console(w) - \n")); return -1; } -static int close_extio_console (xp_awk_extio_t* epa) +static int close_extio_console (sse_awk_extio_t* epa) { -xp_printf (XP_TEXT("closing console of type %x\n"), epa->type); +xp_printf (SSE_TEXT("closing console of type %x\n"), epa->type); - if (epa->handle != XP_NULL && + if (epa->handle != SSE_NULL && epa->handle != stdin && epa->handle != stdout && epa->handle != stderr) @@ -513,11 +513,11 @@ xp_printf (XP_TEXT("closing console of type %x\n"), epa->type); return 0; } -static int next_extio_console (xp_awk_extio_t* epa) +static int next_extio_console (sse_awk_extio_t* epa) { int n; FILE* fp = epa->handle; -xp_printf (XP_TEXT("switching console[%s] of type %x\n"), epa->name, epa->type); +xp_printf (SSE_TEXT("switching console[%s] of type %x\n"), epa->name, epa->type); n = open_extio_console(epa); if (n == -1) return -1; @@ -528,14 +528,14 @@ xp_printf (XP_TEXT("switching console[%s] of type %x\n"), epa->name, epa->type); return 0; } - if (fp != XP_NULL && fp != stdin && + if (fp != SSE_NULL && fp != stdin && fp != stdout && fp != stderr) fclose (fp); return n; } -xp_awk_t* app_awk = NULL; +sse_awk_t* app_awk = NULL; void* app_run = NULL; #ifdef _WIN32 @@ -544,7 +544,7 @@ static BOOL WINAPI __stop_run (DWORD ctrl_type) if (ctrl_type == CTRL_C_EVENT || ctrl_type == CTRL_CLOSE_EVENT) { - xp_awk_stop (app_awk, app_run); + sse_awk_stop (app_awk, app_run); return TRUE; } @@ -554,27 +554,27 @@ static BOOL WINAPI __stop_run (DWORD ctrl_type) static void __stop_run (int sig) { signal (SIGINT, SIG_IGN); - xp_awk_stop (app_awk, app_run); - //xp_awk_stoprun (awk, handle); - /*xp_awk_stopallruns (awk); */ + sse_awk_stop (app_awk, app_run); + //sse_awk_stoprun (awk, handle); + /*sse_awk_stopallruns (awk); */ signal (SIGINT, __stop_run); } #endif -static void __on_run_start (xp_awk_t* awk, void* handle, void* arg) +static void __on_run_start (sse_awk_t* awk, void* handle, void* arg) { app_awk = awk; app_run = handle; -xp_printf (XP_T("AWK PRORAM ABOUT TO START...\n")); +xp_printf (SSE_T("AWK PRORAM ABOUT TO START...\n")); } -static void __on_run_end (xp_awk_t* awk, void* handle, int errnum, void* arg) +static void __on_run_end (sse_awk_t* awk, void* handle, int errnum, void* arg) { - if (errnum != XP_AWK_ENOERR) + if (errnum != SSE_AWK_ENOERR) { - xp_printf (XP_T("AWK PRORAM ABOUT TO END WITH AN ERROR - %d - %s\n"), errnum, xp_awk_geterrstr (errnum)); + xp_printf (SSE_T("AWK PRORAM ABOUT TO END WITH AN ERROR - %d - %s\n"), errnum, sse_awk_geterrstr (errnum)); } - else xp_printf (XP_T("AWK PRORAM ENDED SUCCESSFULLY\n")); + else xp_printf (SSE_T("AWK PRORAM ENDED SUCCESSFULLY\n")); app_awk = NULL; app_run = NULL; @@ -625,27 +625,27 @@ static int __main (int argc, char* argv[]) static int __main (int argc, xp_char_t* argv[]) #endif { - xp_awk_t* awk; - xp_awk_srcios_t srcios; - xp_awk_runcbs_t runcbs; - xp_awk_runios_t runios; - xp_awk_runarg_t runarg[10]; - xp_awk_syscas_t syscas; + sse_awk_t* awk; + sse_awk_srcios_t srcios; + sse_awk_runcbs_t runcbs; + sse_awk_runios_t runios; + sse_awk_runarg_t runarg[10]; + sse_awk_syscas_t syscas; struct src_io src_io = { NULL, NULL }; int opt, i, file_count = 0; #ifdef _WIN32 syscas_data_t syscas_data; #endif - opt = XP_AWK_EXPLICIT | XP_AWK_UNIQUE | XP_AWK_HASHSIGN | - /*XP_AWK_DBLSLASHES |*/ - XP_AWK_SHADING | XP_AWK_IMPLICIT | XP_AWK_SHIFT | - XP_AWK_EXTIO | XP_AWK_BLOCKLESS | XP_AWK_STRINDEXONE | - XP_AWK_STRIPSPACES | XP_AWK_NEWLINE; + opt = SSE_AWK_EXPLICIT | SSE_AWK_UNIQUE | SSE_AWK_HASHSIGN | + /*SSE_AWK_DBLSLASHES |*/ + SSE_AWK_SHADING | SSE_AWK_IMPLICIT | SSE_AWK_SHIFT | + SSE_AWK_EXTIO | SSE_AWK_BLOCKLESS | SSE_AWK_STRINDEXONE | + SSE_AWK_STRIPSPACES | SSE_AWK_NEWLINE; if (argc <= 1) { - xp_printf (XP_T("Usage: %s [-m] source_file [data_file ...]\n"), argv[0]); + xp_printf (SSE_T("Usage: %s [-m] source_file [data_file ...]\n"), argv[0]); return -1; } @@ -654,10 +654,10 @@ static int __main (int argc, xp_char_t* argv[]) #if defined(__STAND_ALONE) && !defined(_WIN32) if (strcmp(argv[i], "-m") == 0) #else - if (xp_awk_strcmp(argv[i], XP_T("-m")) == 0) + if (sse_awk_strcmp(argv[i], SSE_T("-m")) == 0) #endif { - opt |= XP_AWK_RUNMAIN; + opt |= SSE_AWK_RUNMAIN; } else if (file_count == 0) { @@ -667,12 +667,12 @@ static int __main (int argc, xp_char_t* argv[]) else if (file_count >= 1 && file_count < xp_countof(infiles)-1) { infiles[file_count-1] = argv[i]; - infiles[file_count] = XP_NULL; + infiles[file_count] = SSE_NULL; file_count++; } else { - xp_printf (XP_T("Usage: %s [-m] [-f source_file] [data_file ...]\n"), argv[0]); + xp_printf (SSE_T("Usage: %s [-m] [-f source_file] [data_file ...]\n"), argv[0]); return -1; } } @@ -685,7 +685,7 @@ static int __main (int argc, xp_char_t* argv[]) syscas.lock = NULL; syscas.unlock = NULL; -#ifdef XP_CHAR_IS_MCHAR +#ifdef SSE_CHAR_IS_MCHAR syscas.is_upper = isupper; syscas.is_lower = islower; syscas.is_alpha = isalpha; @@ -724,43 +724,43 @@ static int __main (int argc, xp_char_t* argv[]) syscas_data.heap = HeapCreate (0, 1000000, 1000000); if (syscas_data.heap == NULL) { - xp_printf (XP_T("Error: cannot create an awk heap\n")); + xp_printf (SSE_T("Error: cannot create an awk heap\n")); return -1; } syscas.custom_data = &syscas_data; #endif - if ((awk = xp_awk_open(&syscas)) == XP_NULL) + if ((awk = sse_awk_open(&syscas)) == SSE_NULL) { #ifdef _WIN32 HeapDestroy (syscas_data.heap); #endif - xp_printf (XP_T("Error: cannot open awk\n")); + xp_printf (SSE_T("Error: cannot open awk\n")); return -1; } - xp_awk_setopt (awk, opt); + sse_awk_setopt (awk, opt); srcios.in = process_source; srcios.out = dump_source; srcios.custom_data = &src_io; - if (xp_awk_parse (awk, &srcios) == -1) + if (sse_awk_parse (awk, &srcios) == -1) { - int errnum = xp_awk_geterrnum(awk); -#if defined(__STAND_ALONE) && !defined(_WIN32) && defined(XP_CHAR_IS_WCHAR) + int errnum = sse_awk_geterrnum(awk); +#if defined(__STAND_ALONE) && !defined(_WIN32) && defined(SSE_CHAR_IS_WCHAR) xp_printf ( - XP_T("ERROR: cannot parse program - line %u [%d] %ls\n"), - (unsigned int)xp_awk_getsrcline(awk), - errnum, xp_awk_geterrstr(errnum)); + SSE_T("ERROR: cannot parse program - line %u [%d] %ls\n"), + (unsigned int)sse_awk_getsrcline(awk), + errnum, sse_awk_geterrstr(errnum)); #else xp_printf ( - XP_T("ERROR: cannot parse program - line %u [%d] %s\n"), - (unsigned int)xp_awk_getsrcline(awk), - errnum, xp_awk_geterrstr(errnum)); + SSE_T("ERROR: cannot parse program - line %u [%d] %s\n"), + (unsigned int)sse_awk_getsrcline(awk), + errnum, sse_awk_geterrstr(errnum)); #endif - xp_awk_close (awk); + sse_awk_close (awk); return -1; } @@ -771,41 +771,41 @@ static int __main (int argc, xp_char_t* argv[]) #endif runios.pipe = process_extio_pipe; - runios.coproc = XP_NULL; + runios.coproc = SSE_NULL; runios.file = process_extio_file; runios.console = process_extio_console; runcbs.on_start = __on_run_start; runcbs.on_end = __on_run_end; - runcbs.custom_data = XP_NULL; + runcbs.custom_data = SSE_NULL; - runarg[0].ptr = XP_T("argument 0"); - runarg[0].len = xp_awk_strlen(runarg[0].ptr); - runarg[1].ptr = XP_T("argumetn 1"); - runarg[1].len = xp_awk_strlen(runarg[1].ptr); - runarg[2].ptr = XP_T("argumetn 2"); - runarg[2].len = xp_awk_strlen(runarg[2].ptr); - runarg[3].ptr = XP_NULL; + runarg[0].ptr = SSE_T("argument 0"); + runarg[0].len = sse_awk_strlen(runarg[0].ptr); + runarg[1].ptr = SSE_T("argumetn 1"); + runarg[1].len = sse_awk_strlen(runarg[1].ptr); + runarg[2].ptr = SSE_T("argumetn 2"); + runarg[2].len = sse_awk_strlen(runarg[2].ptr); + runarg[3].ptr = SSE_NULL; runarg[3].len = 0; - if (xp_awk_run (awk, &runios, &runcbs, runarg) == -1) + if (sse_awk_run (awk, &runios, &runcbs, runarg) == -1) { - int errnum = xp_awk_geterrnum(awk); -#if defined(__STAND_ALONE) && !defined(_WIN32) && defined(XP_CHAR_IS_WCHAR) + int errnum = sse_awk_geterrnum(awk); +#if defined(__STAND_ALONE) && !defined(_WIN32) && defined(SSE_CHAR_IS_WCHAR) xp_printf ( - XP_T("error: cannot run program - [%d] %ls\n"), - errnum, xp_awk_geterrstr(errnum)); + SSE_T("error: cannot run program - [%d] %ls\n"), + errnum, sse_awk_geterrstr(errnum)); #else xp_printf ( - XP_T("error: cannot run program - [%d] %s\n"), - errnum, xp_awk_geterrstr(errnum)); + SSE_T("error: cannot run program - [%d] %s\n"), + errnum, sse_awk_geterrstr(errnum)); #endif - xp_awk_close (awk); + sse_awk_close (awk); return -1; } - xp_awk_close (awk); + sse_awk_close (awk); #ifdef _WIN32 HeapDestroy (syscas_data.heap); #endif @@ -994,25 +994,25 @@ int xp_main (int argc, xp_char_t* argv[]) { xp_char_t buf[xp_sizeof(xp_long_t)*8+2+2]; xp_size_t n; -n = xp_awk_longtostr (-0x7FFFFFFFFFFFFFFFi64, 16, XP_T("0x"), buf, xp_countof(buf)); +n = sse_awk_longtostr (-0x7FFFFFFFFFFFFFFFi64, 16, SSE_T("0x"), buf, xp_countof(buf)); if (n == (xp_size_t)-1) { - xp_printf (XP_T("cannot convert...\n")); + xp_printf (SSE_T("cannot convert...\n")); } -else xp_printf (XP_T("%d, %s\n"), n, buf); +else xp_printf (SSE_T("%d, %s\n"), n, buf); } if (IsDebuggerPresent ()) { - xp_printf (XP_T("Running application in a debugger....\n")); + xp_printf (SSE_T("Running application in a debugger....\n")); } if (is_debugger_present ()) { - xp_printf (XP_T("Running application in a debugger by is_debugger_present...\n")); + xp_printf (SSE_T("Running application in a debugger by is_debugger_present...\n")); } if (is_debugger_present2 ()) { - xp_printf (XP_T("Running application in a debugger by is_debugger_present2...\n")); + xp_printf (SSE_T("Running application in a debugger by is_debugger_present2...\n")); } #endif diff --git a/ase/test/awk/makefile.in b/ase/test/awk/makefile.in index 0e156c89..ccbad3a4 100644 --- a/ase/test/awk/makefile.in +++ b/ase/test/awk/makefile.in @@ -2,9 +2,9 @@ SRCS = awk.c OUTS = $(SRCS:.c=.x) CC = @CC@ -CFLAGS = @CFLAGS@ -I@abs_top_builddir@ -LDFLAGS = @LDFLAGS@ -L@abs_top_builddir@/xp/bas -L@abs_top_builddir@/xp/awk -LIBS = @LIBS@ -lxpawk -lxpbas -lm +CFLAGS = @CFLAGS@ -I@abs_top_builddir@/.. -I$(XPKIT) +LDFLAGS = @LDFLAGS@ -L@abs_top_builddir@/awk -L$(XPKIT)/xp/bas +LIBS = @LIBS@ -lsseawk -lxpbas -lm all: $(OUTS)