parrotcode: JSON backend for PIRC | |
Contents | Compilers |
jsonout.c - JSON backend for PIRC
Each vtable method is implemented by a private (static) function. This back-end emits a JSON representation of the source. Although JSON is quite a simple format, it is not very trivial to emit it. Due to some householding code, it isn't very straightforward (indention and commas). Some refactoring would be in order, once this back-end is finished.
static int indent(emit_data *data)
static int dedent(emit_data *data)
static target *new_target(char *name)
static void add_target(emit_data *data, target *t)
static void json_start_object(emit_data *data)
static void json_init(emit_data *data)
static void json_end(emit_data *data)
static void json_sub_start(emit_data *data)
static void json_source(emit_data *data, char *source)
static void json_position(emit_data *data, int pos)
static void json_sub_end(emit_data *data)
static void json_name(emit_data *data, char *name)
static void json_stmts_start(emit_data *data)
static void json_param_start(emit_data *data)
static void json_sub_flag_start(emit_data *data)
static void json_sub_flag_end(emit_data *data)
static void json_sub_flag(emit_data *data, int flag)
static void json_list_start(emit_data *data)
static void json_list_end(emit_data *data)
static void json_stmts_end(emit_data *data)
static void json_op_start(emit_data *data, char *op)
static void json_op_end(emit_data *data)
static void json_expr(emit_data *data, char *expr)
static void json_method(emit_data *data, char *name)
static void json_invocant(emit_data *data, char *invocant)
static void json_args_start(emit_data *data)
static void json_args_end(emit_data *data)
static void json_target(emit_data *data, char *name)
static void json_invokable(emit_data *data, char *invokable)
static void json_invocation_start(emit_data *data)
static void json_invocation_end(emit_data *data)
static void json_destroy(emit_data *data)
pirvtable *init_json_vtable(char *outputfile)
|