NAME
src/pmc/lexpad.pmc - LexPad PMC
DESCRIPTION
These are the vtable functions for the lexpad PMC.
LexPad provides a Hash interface for lexical fetch/store needed:
struct_val ... Context *ctx pmc_val ... LexInfo
Functions
static void throw_wrong_register_type(PARROT_INTERP, STRING *name)
static void throw_lexical_not_found(PARROT_INTERP, STRING *name)
Helper functions for common exceptions.
static HashBucket * register_bucket(PARROT_INTERP, PMC *info, STRING *name)
Helper for register_number_ functions.
static INTVAL register_number_for_get(PARROT_INTERP, PMC *info, STRING *name, INTVAL reg_type)
Locates the register number for getting the specified name and type of lexical.
static INTVAL register_number_for_set(PARROT_INTERP, PMC *info, STRING *name, INTVAL reg_type)
Locates the register number for setting the specified name and type of lexical.
init_pmc(PMC *lexinfo)
Initialize the LexPad PMC and remember the associate lexinfo.
void set_pointer(void *)
Initialize the LexPad PMC and remember the associate context.
INTVAL elements()
Returns the number of elements in the hash.
INTVAL exists_keyed(PMC *name)
INTVAL exists_keyed_str(STRING *name)
Returns whether a lexical PMC *get_pmc_keyed_str(STRING *name)
PMC *get_pmc_keyed(PMC *name)
Return the lexical with the given name, or NULL (not PMCNULL), if the lexical doesn't exist.
void set_pmc_keyed(PMC *name, PMC *value)
void set_pmc_keyed_str(STRING *name, PMC *value)
Set the lexical with the given name to value. If the lexical name doesn't exist, it is created.
PMC *get_lexinfo()
Return the LexInfo PMC, if any or a Null PMC.
PMC *get_iter()
Get iterator for declared lexicals.
INTVAL register_type(STRING *name)
Returns a number based on the type of the variable named name.
- -1 = Not Found
- 0 = Integer
- 1 = Num
- 2 = String
- 3 = PMC
name
exists in the hash.
SEE ALSO
docs/pdds/pdd20_lexical_vars.pod, src/pmc/lexinfo.pmc.