1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00
stedolan-jq/c/compile.h

39 lines
1014 B
C
Raw Normal View History

2012-08-16 01:00:30 +01:00
#include <stdint.h>
#include "bytecode.h"
#include "opcode.h"
struct inst;
typedef struct inst inst;
typedef struct block {
inst* first;
inst* last;
} block;
block gen_noop();
block gen_op_simple(opcode op);
block gen_op_const(opcode op, json_t* constant);
block gen_op_target(opcode op, block target);
block gen_op_var_unbound(opcode op, const char* name);
block gen_op_var_bound(opcode op, block binder);
2012-08-21 18:14:13 +01:00
block gen_op_block_defn(opcode op, const char* name, block block);
block gen_op_block_unbound(opcode op, const char* name);
block gen_op_call(opcode op, block arglist);
2012-08-16 01:00:30 +01:00
block gen_op_symbol(opcode op, const char* name);
block gen_subexp(block a);
block gen_both(block a, block b);
block gen_collect(block expr);
2012-08-27 10:11:55 +01:00
block gen_assign(block expr);
2012-08-16 01:00:30 +01:00
block gen_else(block a, block b);
void block_append(block* b, block b2);
block block_join(block a, block b);
2012-08-21 18:14:13 +01:00
block block_bind(block binder, block body, int bindflags);
2012-08-16 01:00:30 +01:00
struct bytecode* block_compile(struct symbol_table*, block);
void block_free(block);