enhanced lda with binary heap functions
added more wide character handling functions
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: parse.c 312 2009-12-10 13:03:54Z hyunghwan.chung $
|
||||
* $Id: parse.c 323 2010-04-05 12:50:01Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2009 Chung, Hyung-Hwan.
|
||||
This file is part of QSE.
|
||||
@ -226,8 +226,6 @@ static int skip_spaces (qse_awk_t* awk);
|
||||
static int skip_comment (qse_awk_t* awk);
|
||||
static int classify_ident (
|
||||
qse_awk_t* awk, const qse_char_t* name, qse_size_t len);
|
||||
static int is_plain_var (qse_awk_nde_t* nde);
|
||||
static int is_var (qse_awk_nde_t* nde);
|
||||
|
||||
static int deparse (qse_awk_t* awk);
|
||||
static qse_map_walk_t deparse_func (
|
||||
@ -400,6 +398,26 @@ static global_t gtab[] =
|
||||
|
||||
#define SETERR_ARG(awk,code,ep,el) SETERR_ARG_LOC(awk,code,ep,el,QSE_NULL)
|
||||
|
||||
static QSE_INLINE int is_plain_var (qse_awk_nde_t* nde)
|
||||
{
|
||||
return nde->type == QSE_AWK_NDE_GBL ||
|
||||
nde->type == QSE_AWK_NDE_LCL ||
|
||||
nde->type == QSE_AWK_NDE_ARG ||
|
||||
nde->type == QSE_AWK_NDE_NAMED;
|
||||
}
|
||||
|
||||
static QSE_INLINE int is_var (qse_awk_nde_t* nde)
|
||||
{
|
||||
return nde->type == QSE_AWK_NDE_GBL ||
|
||||
nde->type == QSE_AWK_NDE_LCL ||
|
||||
nde->type == QSE_AWK_NDE_ARG ||
|
||||
nde->type == QSE_AWK_NDE_NAMED ||
|
||||
nde->type == QSE_AWK_NDE_GBLIDX ||
|
||||
nde->type == QSE_AWK_NDE_LCLIDX ||
|
||||
nde->type == QSE_AWK_NDE_ARGIDX ||
|
||||
nde->type == QSE_AWK_NDE_NAMEDIDX;
|
||||
}
|
||||
|
||||
static int get_char (qse_awk_t* awk)
|
||||
{
|
||||
qse_ssize_t n;
|
||||
@ -5762,26 +5780,6 @@ static int classify_ident (
|
||||
return TOK_IDENT;
|
||||
}
|
||||
|
||||
static int is_plain_var (qse_awk_nde_t* nde)
|
||||
{
|
||||
return nde->type == QSE_AWK_NDE_GBL ||
|
||||
nde->type == QSE_AWK_NDE_LCL ||
|
||||
nde->type == QSE_AWK_NDE_ARG ||
|
||||
nde->type == QSE_AWK_NDE_NAMED;
|
||||
}
|
||||
|
||||
static int is_var (qse_awk_nde_t* nde)
|
||||
{
|
||||
return nde->type == QSE_AWK_NDE_GBL ||
|
||||
nde->type == QSE_AWK_NDE_LCL ||
|
||||
nde->type == QSE_AWK_NDE_ARG ||
|
||||
nde->type == QSE_AWK_NDE_NAMED ||
|
||||
nde->type == QSE_AWK_NDE_GBLIDX ||
|
||||
nde->type == QSE_AWK_NDE_LCLIDX ||
|
||||
nde->type == QSE_AWK_NDE_ARGIDX ||
|
||||
nde->type == QSE_AWK_NDE_NAMEDIDX;
|
||||
}
|
||||
|
||||
struct deparse_func_t
|
||||
{
|
||||
qse_awk_t* awk;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: run.c 312 2009-12-10 13:03:54Z hyunghwan.chung $
|
||||
* $Id: run.c 323 2010-04-05 12:50:01Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2009 Chung, Hyung-Hwan.
|
||||
This file is part of QSE.
|
||||
@ -273,17 +273,17 @@ static qse_cstr_t* xstr_to_cstr (qse_xstr_t* xstr)
|
||||
}
|
||||
#endif
|
||||
|
||||
qse_size_t qse_awk_rtx_getnargs (qse_awk_rtx_t* run)
|
||||
QSE_INLINE qse_size_t qse_awk_rtx_getnargs (qse_awk_rtx_t* run)
|
||||
{
|
||||
return (qse_size_t) STACK_NARGS (run);
|
||||
}
|
||||
|
||||
qse_awk_val_t* qse_awk_rtx_getarg (qse_awk_rtx_t* run, qse_size_t idx)
|
||||
QSE_INLINE qse_awk_val_t* qse_awk_rtx_getarg (qse_awk_rtx_t* run, qse_size_t idx)
|
||||
{
|
||||
return STACK_ARG (run, idx);
|
||||
}
|
||||
|
||||
qse_awk_val_t* qse_awk_rtx_getgbl (qse_awk_rtx_t* run, int id)
|
||||
QSE_INLINE qse_awk_val_t* qse_awk_rtx_getgbl (qse_awk_rtx_t* run, int id)
|
||||
{
|
||||
QSE_ASSERT (id >= 0 && id < (int)QSE_LDA_SIZE(run->awk->parse.gbls));
|
||||
return STACK_GBL (run, id);
|
||||
@ -618,7 +618,7 @@ static int set_global (
|
||||
return 0;
|
||||
}
|
||||
|
||||
void qse_awk_rtx_setretval (qse_awk_rtx_t* rtx, qse_awk_val_t* val)
|
||||
QSE_INLINE void qse_awk_rtx_setretval (qse_awk_rtx_t* rtx, qse_awk_val_t* val)
|
||||
{
|
||||
qse_awk_rtx_refdownval (rtx, STACK_RETVAL(rtx));
|
||||
STACK_RETVAL(rtx) = val;
|
||||
@ -626,7 +626,7 @@ void qse_awk_rtx_setretval (qse_awk_rtx_t* rtx, qse_awk_val_t* val)
|
||||
qse_awk_rtx_refupval (rtx, val);
|
||||
}
|
||||
|
||||
int qse_awk_rtx_setgbl (qse_awk_rtx_t* rtx, int id, qse_awk_val_t* val)
|
||||
QSE_INLINE int qse_awk_rtx_setgbl (qse_awk_rtx_t* rtx, int id, qse_awk_val_t* val)
|
||||
{
|
||||
QSE_ASSERT (id >= 0 && id < (int)QSE_LDA_SIZE(rtx->awk->parse.gbls));
|
||||
return set_global (rtx, (qse_size_t)id, QSE_NULL, val);
|
||||
|
Reference in New Issue
Block a user