Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals  

type.c File Reference

plint type handling. More...

#include "plint.h"
#include "share.h"
#include "error.h"
#include "type.h"
#include "action.h"

Include dependency graph for prog/type.c:

Include dependency graph

Go to the source code of this file.

Type Action Operator Stubs

#define PLINT_SELF_INFO   (type_hook(*plint->act.oper.self)->info)
#define PLINT_SELF_STRATEGY   (type_hook(*plint->act.oper.self)->strategy)
#define PLINT_KEY_HOOK(__key__)   ((plint_type_t)(__key__))->hook
#define PLINT_VAR_KEY(__var__)   (plint_var_getkey(__var__))
#define PLINT_ISA(__key__, __self__)   (PLINT_KEY_HOOK(__key__)->isa((__key__), PLINT_VAR_KEY(__self__)))
#define PLINT_MSQ(__self__, __key__)   (PLINT_KEY_HOOK(PLINT_VAR_KEY(__self__))->msq(PLINT_VAR_KEY(__self__), (__key__)))
#define PLINT_FIND_FUNC(__key__...)   ((plint_type_gethook(__key__, plint->act.oper.type)) ? : PLINT_KEY_HOOK(__key__)->lup((PLINT_KEY_HOOK(__key__)->info)))
#define PLINT_ACTION_FIND(__foo__, __bar__)   if (!(plint->act.oper._func = PLINT_FIND_FUNC(__foo__ (__bar__)))) PLINT_ERROR(PLINT_ERR_TYPE_CALL);
#define PLINT_ACTION_INIT
#define PLINT_OPER_OPUNI(__op__)
#define PLINT_TYPE_CONV(__typ__)
#define PLINT_OPER_ASSGN(__op__)
#define PLINT_OPER_OPCMP(__fnc__, __op__)
#define PLINT_OPER_OPCMP(__op__)
#define PLINT_OPER_OPBIN(__op__)
#define PLINT_OPER_OPUNI(__op__)
void plint_type_new (char const *type, plint_tab_t args)
 the new operator. More...

void plint_type_assgn (plint_mem_t mem, plint_ref_t dst, plint_var_t src, plint_easg_t typ)
 the assignment operator. More...

void plint_type_meth (plint_var_t self, plint_str_t meth)
 the method call. More...

void plint_type_call (plint_var_t self, plint_tab_t args)
 the call operator. More...

void plint_type_echo (plint_var_t self)
 the echo operator. More...

void plint_type_read (char const *type, plint_tab_t args)
 the read operator. More...

void plint_type_sync (plint_var_t self)
 the sync operator. More...

void plint_type_cast (plint_var_t self, char const *type)
 the cast operator. More...

void plint_type_len (plint_var_t self)
 the len operator. More...

void plint_type_range (plint_var_t self, plint_range_t range)
 the range operator. More...

void plint_type_merge (plint_var_t self, plint_tab_t tab)
 the merge operator. More...


Type Action Automata

void plint_type_action_done (plint_var_t *presult)
 collects the result of an action. More...

void plint_type_action_call (plint_var_t *pself, plint_str_t *pname, plint_tab_t *pargs)
 collects the data necessary to call a method from an action. More...

void plint_type_action_return (plint_var_t result)
 specifies how an action has succesfully returned. More...

void plint_type_action_abort ()
 called if somewhere within a call from an action the flow started aborting. More...

void plint_type_strategy_default ()
 implements default action automata state transitions. More...


init/finit

void plint_type_once_finish ()
 finalises the type engine. More...

int plint_type_once_init ()
 initialises the type engine. More...

void plint_type_init ()
 initialises the type engine before interpreting a source file. More...

void plint_type_finish ()
 finalises the type engine after interpreting a source file. More...


Functions

plint_typkey_t plint_type_register (char const *name, char const *const *deps, plint_hook_t h)
 register a new variable type. More...

int plint_type_unregister (plint_typkey_t key)
 unregisters a variable type. More...

void plint_type_guard (plint_typkey_t typ)
 make sure the type won't get unregistered without you knowing it. More...

void plint_type_unguard (plint_typkey_t typ)
 from now on, you agree with an asynchronus unregistering. More...

plint_typkey_t plint_type_getkey (char const *typ)
 maps a type name to a type key. More...

char const * plint_type_gettyp (plint_typkey_t key)
 maps a type key to a type name. More...

int plint_type_isa (plint_typkey_t who, plint_typkey_t what)
 determines whether one type "is a" other type. More...

int plint_type_msq (plint_typkey_t who, plint_typkey_t what)
 determines whether one type "masquerades" as other type. More...

plint_iface_t plint_type_gethook (plint_typkey_t key, plint_eoper_t e)
 queries a type hook operator interface callback function. More...

void plint_type_sethook (plint_typkey_t key, plint_eoper_t e, plint_iface_t i)
 post-register modification of a type hook operator interface callback function. More...

plint_iface_t(*)(void *) plint_type_getlookup (plint_typkey_t key)
 queries a type hook operator lookup callback function. More...

void plint_type_setlookup (plint_typkey_t key, plint_iface_t(*l)(void *))
 changes the type hook operator lookup callback function. More...

void * plint_type_getinfo (plint_typkey_t key)
 reads the current hook information. More...

plint_typkey_t plint_type_setinfo (plint_typkey_t key, void *info)
 changes the hook information. More...

plint_strat_t plint_type_getstrategy (plint_typkey_t key)
 reads a type's hook's strategy. More...

plint_typkey_t plint_type_setstrategy (plint_typkey_t key, plint_strat_t str)
 changes the type's hook's strategy. More...

size_t plint_type_ndeps (plint_typkey_t key)
 reads the number of dependent-on types. More...

plint_typkey_tplint_type_adeps (plint_typkey_t key)
 reads the array of dependent-on types. More...

int plint_type_deps (plint_typkey_t who, plint_typkey_t whom)
 checks whether a type depends on another. More...

plint_var_t plint_var_setkey (plint_var_t var, plint_typkey_t key)
 sets the type key of a variable. More...

plint_typkey_t plint_var_getkey (plint_var_const_t var)
 reads the type key of a variable. More...

char const * plint_var_gettyp (plint_var_const_t var)
 reads the type name of a variable. More...

plint_var_t plint_var_settyp (plint_var_t var, char const *typ)
 changes the type of a variable. More...

void * plint_var_getinfo (plint_var_const_t var)
 reads the current hook information, indirectly through a variable. More...

plint_var_t plint_var_setinfo (plint_var_t var, void *info)
 changes the hook information, indirectly through a variable. More...


Variables

plint_str_t const plint_seek_what [_PLINT_OPER_NO]
 the representation of the seeked operators as strings.

plint_eoper_t const plint_oper_map [5][256]
 the map between operator character representation and their type.


Detailed Description

plint type handling.

Author:
Sebastian Glita

Definition in file prog/type.c.


Generated on Thu Jan 9 19:02:53 2003 for plint by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002