diff options
author | Maria Matejka <mq@ucw.cz> | 2022-07-11 11:08:10 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-07-11 11:08:10 +0200 |
commit | 2e5bfeb73ac25e236a24b6c1a88d0f2221ca303f (patch) | |
tree | 396657a62a5a63b0a304268bd011934f56d414ce /filter/f-inst.h | |
parent | d429bc5c841a8e9d4c81786973edfa56d20a407e (diff) | |
parent | cb339a30677901f2c248de08ff535cf0a9efab3d (diff) |
Merge remote-tracking branch 'origin/master' into backport
Diffstat (limited to 'filter/f-inst.h')
-rw-r--r-- | filter/f-inst.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/filter/f-inst.h b/filter/f-inst.h index df45f88e..e35f71c6 100644 --- a/filter/f-inst.h +++ b/filter/f-inst.h @@ -22,7 +22,7 @@ /* Flags for instructions */ enum f_instruction_flags { - FIF_PRINTED = 1, /* FI_PRINT_AND_DIE: message put in buffer */ + FIF_RECURSIVE = 1, /* FI_CALL: function is directly recursive */ } PACKED; /* Include generated filter instruction declarations */ @@ -35,19 +35,26 @@ const char *f_instruction_name_(enum f_instruction_code fi); static inline const char *f_instruction_name(enum f_instruction_code fi) { return f_instruction_name_(fi) + 3; } +struct f_arg { + struct symbol *arg; + struct f_arg *next; +}; + /* Filter structures for execution */ /* Line of instructions to be unconditionally executed one after another */ struct f_line { uint len; /* Line length */ u8 args; /* Function: Args required */ u8 vars; + u8 results; /* Results left on stack: cmd -> 0, term -> 1 */ + struct f_arg *arg_list; struct f_line_item items[0]; /* The items themselves */ }; /* Convert the f_inst infix tree to the f_line structures */ -struct f_line *f_linearize_concat(const struct f_inst * const inst[], uint count); -static inline struct f_line *f_linearize(const struct f_inst *root) -{ return f_linearize_concat(&root, 1); } +struct f_line *f_linearize_concat(const struct f_inst * const inst[], uint count, uint results); +static inline struct f_line *f_linearize(const struct f_inst *root, uint results) +{ return f_linearize_concat(&root, 1, results); } void f_dump_line(const struct f_line *, uint indent); |