parrotcode: Untitled | |
Contents | Compilers |
This file contains emit functions. Depending on the requested output, the appropriate emit functions are used. Options are:
-p for PASM output
-b for bytecode output
void print_key(key *k)
k
. The total key is enclosed in square brackets, and different key elements are separated by semicolons. Example: ["hi";42]
"hi"
and 42
.void print_target(target *const t)
t
; if t
has a key, that key is printed as well. Examples: S1, P1[42]
void print_constant(constant *c)
c
.void print_expr(lexer_state *const lexer, expression *const expr)
expr
.void print_expressions(expression *const expr)
expr
, if expr
is not NULL. Expressions are separated by commas.void print_subs(struct lexer_state *const lexer)
static void emit_pbc_const_arg(lexer_state *const lexer, constant *const c)
static void emit_pbc_target_arg(lexer_state *const lexer, target *const t)
t
. The assigned register is stored in the color
field, of either the pir_reg
or symbol
structure, depending on whether t
is a register or a symbol, respectively.static void emit_pbc_label_arg(lexer_state *const lexer, label *const l)
l
.static void emit_pbc_instr(lexer_state *const lexer, instruction *const instr)
static void emit_pbc_sub(lexer_state *const lexer, subroutine *const sub)
sub
.void emit_pbc(lexer_state *const lexer)
|
![]() |