This commit is contained in:
John Kerl 2016-05-11 22:01:32 -04:00
parent a1d02b0980
commit fd941cffde
2 changed files with 38 additions and 1 deletions

View file

@ -279,6 +279,42 @@ static mlr_dsl_cst_t* mlr_dsl_cst_alloc_from_ast(mlr_dsl_ast_t* past, int type_i
return pcst;
}
// ----------------------------------------------------------------
// begin {}
// end {}
// ----------------------------------------------------------------
// cond-expr {}
// while (expr) {}
// for (k, v in $*) {}
// for (k1, k2, v in @v["a"]) {}
// if (expr) {} elif (expr) {} elif (expr) else {}
// $srec = RHS
// @v["a"] = $*
// $* = @v["a"]
// bare-boolean
// @v["a"] = RHS
// filter
// unset
// emitf
// emitp
// emit
// dump
// break
// continue
// LHS:
// * pfunc
// * srec_lhs_field_name
// * poosvar_lhs_keylist_evaluators
// * poosvar_lhs_namelist_evaluators
// * all_flag
// * prhs_evaluator
// * pbody_statements: cond, while, for
// * poosvar_rhs_keylist_evaluators
// * if-elif-elif-else -- ???
// * for-srec -- ???
// * for-oosvar -- ???
// ----------------------------------------------------------------
void mlr_dsl_cst_free(mlr_dsl_cst_t* pcst) {
if (pcst == NULL)

View file

@ -60,8 +60,9 @@ typedef void mlr_dsl_cst_node_evaluator_func_t(
typedef struct _mlr_dsl_cst_statement_item_t {
// LHS:
char* output_field_name;
// E.g. emit @a[$b]["c"], "d", @e: keylist is [$b, "c"] and namelist is ["d", @e].
sllv_t* poosvar_lhs_keylist_evaluators;
sllv_t* poosvar_lhs_namelist_evaluators;
sllv_t* poosvar_lhs_namelist_evaluators; // for emit
int all_flag; // for emit all and unset all
// RHS: