NAME ^

compilers/imcc/parser_util.c

DESCRIPTION ^

ParserUtil - Parser support functions.

Functions ^

Instruction *iNEW

 * P = new type, [init]
 * PASM like:
 *   new P, 'SomeThing'
 * is done in the lexer, this is a mess
 * best would be to have a flag in core.ops, where a PMC type is expected
void op_fullname

Lookup the full opcode given the short name

   set I0, 5  -> set_i_ic
   set I0, I1 -> set_i_i
Obviously the registers must be examined before returning the correct opcode.

NOTE: All this nasty IMC_TRACE is for tracking down equally nasty bugs, so if you don't like the looks of it, stay out, but please don't remove it. :) -Mel

int check_op

Return opcode value for op name

static Instruction *maybe_builtin

TODO: Needs to be documented!!!

int is_op

Is instruction a parrot opcode?

static const char *to_infix

sub x, y, z => infix .MMD_SUBTRACT, x, y, z

static int is_infix

TODO: Needs to be documented!!!

static Instruction *var_arg_ins

TODO: Needs to be documented!!!

Instruction *INS

Make an instruction.

name ... op name fmt ... optional format regs ... SymReg ** n ... # of params keyvec ... s. KEY_BIT() emit ... if true, append to instructions

s. e.g. imc.c for usage

int do_yylex_init

TODO: Needs to be documented!!!

PMC *imcc_compile

Compile a pasm or imcc string

FIXME as we have separate constants, the old constants in ghash must be deleted.

PMC *imcc_compile_pasm

TODO: Needs to be documented!!!

 * Note: This function is provided for backward compatibility. This
 * function can go away in future.
PMC *imcc_compile_pir

TODO: Needs to be documented!!!

 * Note: This function is provided for backward compatibility. This
 * function can go away in future.
PMC *IMCC_compile_pir_s

TODO: Needs to be documented!!!

PMC *IMCC_compile_pasm_s

TODO: Needs to be documented!!!

PMC *imcc_compile_pasm_ex

TODO: Needs to be documented!!!

PMC *imcc_compile_pir_ex

TODO: Needs to be documented!!!

static void *imcc_compile_file

Compile a file by filename (can be either PASM or IMCC code)

void *IMCC_compile_file

TODO: Needs to be documented!!!

 * Note: This function is provided for backward compatibility. This
 * function can go away in future.
void *IMCC_compile_file_s

TODO: Needs to be documented!!!

void register_compilers

Register additional compilers with the interpreter

static int change_op

TODO: Needs to be documented!!!

int try_find_op

Try to find valid op doing the same operation e.g.

   add_n_i_n  => add_n_n_i
   div_n_ic_n => div_n_nc_n
   div_n_i_n  => set_n_i ; div_n_n_n
   ge_n_ic_ic => ge_n_nc_ic
   acos_n_i   => acos_n_n
static const char *try_rev_cmp

TODO: Needs to be documented!!!

Instruction *multi_keyed

TODO: Needs to be documented!!!

int imcc_fprintf

TODO: Needs to be documented!!!

int imcc_vfprintf

TODO: Needs to be documented!!!

void imcc_init

TODO: Needs to be documented!!!

void imcc_destroy

TODO: Needs to be documented!!!


parrot