parrotcode: bcg.c Byte Code Generator (BCG) Public API implementation. | |
Contents | Compilers |
bcg.c Byte Code Generator (BCG) Public API implementation.
The functions in this file implement the API defined in bcg.h, the public API for BCG.
List of methods implemented in this file.
BCG_info *BCG_create(void)
void BCG_destroy(BCG_info *bcg_info)
void BCG_start_code_gen(BCG_info *bcg_info)
void BCG_end_code_gen(BCG_info *bcg_info)
void BCG_start_sub(BCG_info *bcg_info, char *sub_name, char *pragma)
void BCG_end_sub(BCG_info *bcg_info)
void BCG_start_call(BCG_info *bcg_info, char *sub_name)
void BCG_end_call(BCG_info *bcg_info)
void BCG_start_op(BCG_info *bcg_info, char *op_name)
op_name
into the current unit.
If BCG is not in the SUB state initially,
an exception is thrown.void BCG_end_op(BCG_info *bcg_info)
void BCG_var(BCG_info *bcg_info, char *var_name, char var_type)
var_name
with type var_type
to the current op.
Makes sure the variable is located in the current unit's symbol table.
If BCG is not in the OP state to begin with,
an exception is thrown.void BCG_val(BCG_info *bcg_info, char *val, char val_type)
val
of type val_type
to the current op.
If BCG is not in the OP state,
an exception is thrown.void BCG_label(BCG_info *bcg_info, char *label)
label
to the current unit.
If BCG is not in the SUB state,
an exception is thrown.void BCG_print_pasm(BCG_info *bcg_info)
bcg_info_private *bcg_info_private_create(BCG_info *bcg_info)
bcg_info
's private data structure.
This structure is allocated from the system and needs to be freed.void bcg_info_private_destroy(BCG_info *bcg_info, bcg_info_private *bcg_info_priv)
bcg_info
's private data structure bcg_info_priv
.
Destroy's all units in the private structure.void bcg_info_add_unit(BCG_info *bcg_info, bcg_unit *unit)
unit
to the double-linked list in bcg_info
.static void set_state(BCG_info *bcg_info, bcg_state state)
state
.static void unset_state(BCG_info *bcg_info, bcg_state state)
state
.static int in_state(BCG_info *bcg_info, bcg_state state)
state
.
Returns 1 if true,
0 otherwise.Copyright (C) 2006, The Perl Foundation.
This is free software; you may redistribute it and/or modify it under the same terms as Parrot.
Vishal Soni <vishalrsoni@gmail.com>
|