NAME ^

jsonout.c - JSON backend for PIRC

DESCRIPTION ^

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.

JSON BACK END INTERNALS ^

HELPER METHODS ^

static int indent(emit_data *data)

increase the indention level

static int dedent(emit_data *data)

decrease the indention level

static target *new_target(char *name)

RT#48260: Not yet documented!!!

static void add_target(emit_data *data, target *t)

RT#48260: Not yet documented!!!

VTABLE METHODS ^

static void json_start_object(emit_data *data)

RT#48260: Not yet documented!!!

static void json_init(emit_data *data)

RT#48260: Not yet documented!!!

static void json_end(emit_data *data)

RT#48260: Not yet documented!!!

static void json_sub_start(emit_data *data)

RT#48260: Not yet documented!!!

static void json_source(emit_data *data, char *source)

RT#48260: Not yet documented!!!

static void json_position(emit_data *data, int pos)

RT#48260: Not yet documented!!!

static void json_sub_end(emit_data *data)

RT#48260: Not yet documented!!!

static void json_name(emit_data *data, char *name)

RT#48260: Not yet documented!!!

static void json_stmts_start(emit_data *data)

RT#48260: Not yet documented!!!

static void json_param_start(emit_data *data)

RT#48260: Not yet documented!!!

static void json_sub_flag_start(emit_data *data)

RT#48260: Not yet documented!!!

static void json_sub_flag_end(emit_data *data)

RT#48260: Not yet documented!!!

static void json_sub_flag(emit_data *data, int flag)

RT#48260: Not yet documented!!!

static void json_list_start(emit_data *data)

RT#48260: Not yet documented!!!

static void json_list_end(emit_data *data)

RT#48260: Not yet documented!!!

static void json_stmts_end(emit_data *data)

RT#48260: Not yet documented!!!

static void json_op_start(emit_data *data, char *op)

RT#48260: Not yet documented!!!

static void json_op_end(emit_data *data)

RT#48260: Not yet documented!!!

static void json_expr(emit_data *data, char *expr)

RT#48260: Not yet documented!!!

static void json_method(emit_data *data, char *name)

RT#48260: Not yet documented!!!

static void json_invocant(emit_data *data, char *invocant)

RT#48260: Not yet documented!!!

static void json_args_start(emit_data *data)

RT#48260: Not yet documented!!!

static void json_args_end(emit_data *data)

RT#48260: Not yet documented!!!

static void json_target(emit_data *data, char *name)

RT#48260: Not yet documented!!!

static void json_invokable(emit_data *data, char *invokable)

RT#48260: Not yet documented!!!

static void json_invocation_start(emit_data *data)

RT#48260: Not yet documented!!!

static void json_invocation_end(emit_data *data)

RT#48260: Not yet documented!!!

static void json_destroy(emit_data *data)

Destructor for emit_data structure

pirvtable *init_json_vtable(char *outputfile)

Initializes a vtable for the JSON back-end. Each of the vtable method slots is assigned a function address that implements that method.


parrot