1 // ================================================================
2 // These evaluate right-hand-side values (rvals) and return mlrvals (mv_t).
3 // This is for scalar-valued contexts: almost all expressions except for rxval
4 // contexts.
5 //
6 // Values propagating up through the concrete syntax tree are always dynamically
7 // allocated: e.g. in '$c = $a . $b' the $a and $b are copied out as ephemerals;
8 // in the concat function their concatenation is computed and the ephemeral
9 // input arguments are freed; then the result is stored in field $c.
10 //
11 // (This is distinct from rxvals which are copy-on-write:
12 // expression-intermediate values are not always ephemeral.)
13 // ================================================================
14 
15 #ifndef RVAL_EVALUATOR_H
16 #define RVAL_EVALUATOR_H
17 
18 #include "lib/context.h"
19 #include "containers/lrec.h"
20 #include "containers/lhmsmv.h"
21 #include "containers/mlhmmv.h"
22 #include "lib/mvfuncs.h"
23 #include "containers/boxed_xval.h"
24 #include "containers/local_stack.h"
25 #include "containers/loop_stack.h"
26 #include "lib/string_array.h"
27 #include "dsl/variables.h"
28 
29 
30 struct _rval_evaluator_t;  // forward reference for method declarations
31 
32 typedef mv_t rval_evaluator_process_func_t(void* pvstate, variables_t* pvars);
33 
34 typedef void rval_evaluator_free_func_t(struct _rval_evaluator_t*);
35 
36 typedef struct _rval_evaluator_t {
37 	void* pvstate;
38 	rval_evaluator_process_func_t* pprocess_func;
39 	rval_evaluator_free_func_t*    pfree_func;
40 } rval_evaluator_t;
41 
42 #endif // RVAL_EVALUATOR_H
43