2007-05-02 01:07:00 +00:00
|
|
|
/*
|
2012-08-16 03:47:55 +00:00
|
|
|
* $Id$
|
2007-05-02 01:07:00 +00:00
|
|
|
*
|
2019-06-06 05:28:23 +00:00
|
|
|
Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved.
|
2008-12-30 04:49:25 +00:00
|
|
|
|
2014-11-19 14:42:24 +00:00
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
|
|
modification, are permitted provided that the following conditions
|
|
|
|
are met:
|
|
|
|
1. Redistributions of source code must retain the above copyright
|
|
|
|
notice, this list of conditions and the following disclaimer.
|
|
|
|
2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
notice, this list of conditions and the following disclaimer in the
|
|
|
|
documentation and/or other materials provided with the distribution.
|
2008-12-30 04:49:25 +00:00
|
|
|
|
2014-11-19 14:42:24 +00:00
|
|
|
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
|
|
|
|
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
2007-05-02 01:07:00 +00:00
|
|
|
*/
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
#ifndef _QSE_LIB_AWK_TREE_H_
|
|
|
|
#define _QSE_LIB_AWK_TREE_H_
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
enum qse_awk_in_type_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
|
|
|
/* the order of these values match
|
2009-02-16 08:31:34 +00:00
|
|
|
* __in_type_map and __in_opt_map in rio.c */
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_IN_PIPE,
|
2009-01-17 04:20:22 +00:00
|
|
|
QSE_AWK_IN_RWPIPE,
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_IN_FILE,
|
|
|
|
QSE_AWK_IN_CONSOLE
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
enum qse_awk_out_type_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
|
|
|
/* the order of these values match
|
2009-02-16 08:31:34 +00:00
|
|
|
* __out_type_map and __out_opt_map in rio.c */
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_OUT_PIPE,
|
2009-01-17 04:20:22 +00:00
|
|
|
QSE_AWK_OUT_RWPIPE, /* dual direction pipe */
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_OUT_FILE,
|
2009-01-17 04:20:22 +00:00
|
|
|
QSE_AWK_OUT_APFILE, /* file for appending */
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_OUT_CONSOLE
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
typedef struct qse_awk_nde_blk_t qse_awk_nde_blk_t;
|
|
|
|
typedef struct qse_awk_nde_grp_t qse_awk_nde_grp_t;
|
|
|
|
typedef struct qse_awk_nde_ass_t qse_awk_nde_ass_t;
|
|
|
|
typedef struct qse_awk_nde_exp_t qse_awk_nde_exp_t;
|
|
|
|
typedef struct qse_awk_nde_cnd_t qse_awk_nde_cnd_t;
|
|
|
|
typedef struct qse_awk_nde_pos_t qse_awk_nde_pos_t;
|
|
|
|
|
|
|
|
typedef struct qse_awk_nde_int_t qse_awk_nde_int_t;
|
2011-11-22 05:03:31 +00:00
|
|
|
typedef struct qse_awk_nde_flt_t qse_awk_nde_flt_t;
|
2008-12-21 21:35:07 +00:00
|
|
|
typedef struct qse_awk_nde_str_t qse_awk_nde_str_t;
|
2019-04-18 08:42:54 +00:00
|
|
|
typedef struct qse_awk_nde_mbs_t qse_awk_nde_mbs_t;
|
2008-12-21 21:35:07 +00:00
|
|
|
typedef struct qse_awk_nde_rex_t qse_awk_nde_rex_t;
|
2019-04-29 09:40:13 +00:00
|
|
|
typedef struct qse_awk_nde_fun_t qse_awk_nde_fun_t;
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
typedef struct qse_awk_nde_var_t qse_awk_nde_var_t;
|
2011-05-30 09:15:52 +00:00
|
|
|
typedef struct qse_awk_nde_fncall_t qse_awk_nde_fncall_t;
|
2008-12-21 21:35:07 +00:00
|
|
|
typedef struct qse_awk_nde_getline_t qse_awk_nde_getline_t;
|
|
|
|
|
|
|
|
typedef struct qse_awk_nde_if_t qse_awk_nde_if_t;
|
|
|
|
typedef struct qse_awk_nde_while_t qse_awk_nde_while_t;
|
|
|
|
typedef struct qse_awk_nde_for_t qse_awk_nde_for_t;
|
|
|
|
typedef struct qse_awk_nde_foreach_t qse_awk_nde_foreach_t;
|
|
|
|
typedef struct qse_awk_nde_break_t qse_awk_nde_break_t;
|
|
|
|
typedef struct qse_awk_nde_continue_t qse_awk_nde_continue_t;
|
|
|
|
typedef struct qse_awk_nde_return_t qse_awk_nde_return_t;
|
|
|
|
typedef struct qse_awk_nde_exit_t qse_awk_nde_exit_t;
|
|
|
|
typedef struct qse_awk_nde_next_t qse_awk_nde_next_t;
|
|
|
|
typedef struct qse_awk_nde_nextfile_t qse_awk_nde_nextfile_t;
|
|
|
|
typedef struct qse_awk_nde_delete_t qse_awk_nde_delete_t;
|
|
|
|
typedef struct qse_awk_nde_reset_t qse_awk_nde_reset_t;
|
|
|
|
typedef struct qse_awk_nde_print_t qse_awk_nde_print_t;
|
|
|
|
|
|
|
|
/* QSE_AWK_NDE_BLK - block statement including top-level blocks */
|
|
|
|
struct qse_awk_nde_blk_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
2009-07-17 02:27:53 +00:00
|
|
|
qse_size_t nlcls; /* number of local variables */
|
2008-12-21 21:35:07 +00:00
|
|
|
qse_awk_nde_t* body;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_GRP - expression group */
|
|
|
|
struct qse_awk_nde_grp_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
|
|
|
qse_awk_nde_t* body;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_ASS - assignment */
|
|
|
|
struct qse_awk_nde_ass_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
2007-05-02 01:07:00 +00:00
|
|
|
int opcode;
|
2008-12-21 21:35:07 +00:00
|
|
|
qse_awk_nde_t* left;
|
|
|
|
qse_awk_nde_t* right;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_EXP_BIN, QSE_AWK_NDE_EXP_UNR,
|
|
|
|
* QSE_AWK_NDE_EXP_INCPRE, QSE_AW_NDE_EXP_INCPST */
|
|
|
|
struct qse_awk_nde_exp_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
2007-05-02 01:07:00 +00:00
|
|
|
int opcode;
|
2008-12-21 21:35:07 +00:00
|
|
|
qse_awk_nde_t* left;
|
|
|
|
qse_awk_nde_t* right; /* QSE_NULL for UNR, INCPRE, INCPST */
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_CND */
|
|
|
|
struct qse_awk_nde_cnd_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
|
|
|
qse_awk_nde_t* test;
|
|
|
|
qse_awk_nde_t* left;
|
|
|
|
qse_awk_nde_t* right;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_POS - positional - $1, $2, $x, etc */
|
|
|
|
struct qse_awk_nde_pos_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
|
|
|
qse_awk_nde_t* val;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_INT */
|
|
|
|
struct qse_awk_nde_int_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
2013-11-05 14:16:45 +00:00
|
|
|
qse_awk_int_t val;
|
|
|
|
qse_char_t* str;
|
|
|
|
qse_size_t len;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2011-11-22 05:03:31 +00:00
|
|
|
/* QSE_AWK_NDE_FLT */
|
|
|
|
struct qse_awk_nde_flt_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
2013-11-05 14:16:45 +00:00
|
|
|
qse_awk_flt_t val;
|
|
|
|
qse_char_t* str;
|
|
|
|
qse_size_t len;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_STR */
|
|
|
|
struct qse_awk_nde_str_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
2008-12-30 04:49:25 +00:00
|
|
|
qse_char_t* ptr;
|
2008-12-21 21:35:07 +00:00
|
|
|
qse_size_t len;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2019-04-18 08:42:54 +00:00
|
|
|
/* QSE_AWK_NDE_MBS */
|
|
|
|
struct qse_awk_nde_mbs_t
|
|
|
|
{
|
|
|
|
QSE_AWK_NDE_HDR;
|
|
|
|
qse_mchar_t* ptr;
|
|
|
|
qse_size_t len;
|
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_REX */
|
|
|
|
struct qse_awk_nde_rex_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
2014-07-08 14:30:42 +00:00
|
|
|
qse_cstr_t str;
|
2013-08-23 15:19:29 +00:00
|
|
|
void* code[2]; /* [0]: case sensitive, [1]: case insensitive */
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2019-04-29 09:40:13 +00:00
|
|
|
/* QSE_AWK_NDE_FUN - function as a value */
|
|
|
|
struct qse_awk_nde_fun_t
|
|
|
|
{
|
|
|
|
QSE_AWK_NDE_HDR;
|
|
|
|
qse_cstr_t name; /* function name */
|
2019-04-30 07:23:34 +00:00
|
|
|
qse_awk_fun_t* funptr; /* QSE_NULL or actual pointer */
|
2019-04-29 09:40:13 +00:00
|
|
|
};
|
|
|
|
|
2009-02-02 08:28:04 +00:00
|
|
|
/* QSE_AWK_NDE_NAMED, QSE_AWK_NDE_GBL,
|
|
|
|
* QSE_AWK_NDE_LCL, QSE_AWK_NDE_ARG
|
|
|
|
* QSE_AWK_NDE_NAMEDIDX, QSE_AWK_NDE_GBLIDX,
|
|
|
|
* QSE_AWK_NDE_LCLIDX, QSE_AWK_NDE_ARGIDX */
|
2008-12-21 21:35:07 +00:00
|
|
|
struct qse_awk_nde_var_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
2007-05-02 01:07:00 +00:00
|
|
|
struct
|
|
|
|
{
|
2014-07-08 14:30:42 +00:00
|
|
|
qse_cstr_t name;
|
2008-12-21 21:35:07 +00:00
|
|
|
qse_size_t idxa;
|
2007-05-02 01:07:00 +00:00
|
|
|
} id;
|
2008-12-21 21:35:07 +00:00
|
|
|
qse_awk_nde_t* idx; /* QSE_NULL for non-XXXXIDX */
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2019-04-29 09:40:13 +00:00
|
|
|
/* QSE_AWK_NDE_FNCALL_FNC, QSE_AWK_NDE_FNCALL_FUN, QSE_AWK_NDE_FNCALL_VAR */
|
2011-05-30 09:15:52 +00:00
|
|
|
struct qse_awk_nde_fncall_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
2007-05-02 01:07:00 +00:00
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
2014-07-08 14:30:42 +00:00
|
|
|
qse_cstr_t name;
|
2019-06-07 09:26:50 +00:00
|
|
|
qse_awk_fun_t* fun; /* cache it */
|
2009-02-01 03:59:46 +00:00
|
|
|
} fun;
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2007-09-25 00:12:00 +00:00
|
|
|
/* minimum information of a intrinsic function
|
2007-05-02 01:07:00 +00:00
|
|
|
* needed during run-time. */
|
|
|
|
struct
|
|
|
|
{
|
2012-10-23 17:08:56 +00:00
|
|
|
qse_awk_fnc_info_t info;
|
2012-11-03 17:44:23 +00:00
|
|
|
qse_awk_fnc_spec_t spec;
|
2009-02-01 03:59:46 +00:00
|
|
|
} fnc;
|
2019-04-28 15:44:10 +00:00
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
qse_awk_nde_var_t* var;
|
2019-04-29 09:40:13 +00:00
|
|
|
} var;
|
2011-05-30 09:15:52 +00:00
|
|
|
} u;
|
2008-12-21 21:35:07 +00:00
|
|
|
qse_awk_nde_t* args;
|
|
|
|
qse_size_t nargs;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_GETLINE */
|
|
|
|
struct qse_awk_nde_getline_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
|
|
|
qse_awk_nde_t* var;
|
|
|
|
int in_type; /* QSE_AWK_GETLINE_XXX */
|
|
|
|
qse_awk_nde_t* in;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_IF */
|
|
|
|
struct qse_awk_nde_if_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
|
|
|
qse_awk_nde_t* test;
|
|
|
|
qse_awk_nde_t* then_part;
|
|
|
|
qse_awk_nde_t* else_part; /* optional */
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_WHILE, QSE_AWK_NDE_DOWHILE */
|
|
|
|
struct qse_awk_nde_while_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
|
|
|
qse_awk_nde_t* test;
|
|
|
|
qse_awk_nde_t* body;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_FOR */
|
|
|
|
struct qse_awk_nde_for_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
|
|
|
qse_awk_nde_t* init; /* optional */
|
|
|
|
qse_awk_nde_t* test; /* optional */
|
|
|
|
qse_awk_nde_t* incr; /* optional */
|
|
|
|
qse_awk_nde_t* body;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_FOREACH */
|
|
|
|
struct qse_awk_nde_foreach_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
|
|
|
qse_awk_nde_t* test;
|
|
|
|
qse_awk_nde_t* body;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_BREAK */
|
|
|
|
struct qse_awk_nde_break_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_CONTINUE */
|
|
|
|
struct qse_awk_nde_continue_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_RETURN */
|
|
|
|
struct qse_awk_nde_return_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
|
|
|
qse_awk_nde_t* val; /* optional (no return code if QSE_NULL) */
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_EXIT */
|
|
|
|
struct qse_awk_nde_exit_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
|
|
|
qse_awk_nde_t* val; /* optional (no exit code if QSE_NULL) */
|
2012-08-19 14:20:05 +00:00
|
|
|
int abort;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_NEXT */
|
|
|
|
struct qse_awk_nde_next_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_NEXTFILE */
|
|
|
|
struct qse_awk_nde_nextfile_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
2007-05-02 01:07:00 +00:00
|
|
|
int out;
|
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_DELETE */
|
|
|
|
struct qse_awk_nde_delete_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
|
|
|
qse_awk_nde_t* var;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_RESET */
|
|
|
|
struct qse_awk_nde_reset_t
|
2007-09-27 20:33:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
|
|
|
qse_awk_nde_t* var;
|
2007-09-27 20:33:00 +00:00
|
|
|
};
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
/* QSE_AWK_NDE_PRINT */
|
|
|
|
struct qse_awk_nde_print_t
|
2007-05-02 01:07:00 +00:00
|
|
|
{
|
2008-12-21 21:35:07 +00:00
|
|
|
QSE_AWK_NDE_HDR;
|
|
|
|
qse_awk_nde_t* args;
|
|
|
|
int out_type; /* QSE_AWK_OUT_XXX */
|
|
|
|
qse_awk_nde_t* out;
|
2007-05-02 01:07:00 +00:00
|
|
|
};
|
|
|
|
|
2014-11-14 02:44:20 +00:00
|
|
|
#if defined(__cplusplus)
|
2007-05-02 01:07:00 +00:00
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2007-12-08 00:24:28 +00:00
|
|
|
/* print the entire tree */
|
2008-12-21 21:35:07 +00:00
|
|
|
int qse_awk_prnpt (qse_awk_t* awk, qse_awk_nde_t* tree);
|
2007-12-08 00:24:28 +00:00
|
|
|
/* print a single top-level node */
|
2008-12-21 21:35:07 +00:00
|
|
|
int qse_awk_prnnde (qse_awk_t* awk, qse_awk_nde_t* node);
|
2007-12-08 00:24:28 +00:00
|
|
|
/* print the pattern part */
|
2008-12-21 21:35:07 +00:00
|
|
|
int qse_awk_prnptnpt (qse_awk_t* awk, qse_awk_nde_t* tree);
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
void qse_awk_clrpt (qse_awk_t* awk, qse_awk_nde_t* tree);
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2014-11-14 02:44:20 +00:00
|
|
|
#if defined(__cplusplus)
|
2007-05-02 01:07:00 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|