Environment/Map
[Base containers]


Detailed Description

A Text segment / Symbol table plus a Dynamic Array. Define key => data associations.

The map supports indexed access to keys and values and random access by key lookup. Once a key is created, it is never moved. This allows for compiling indexed accesses using lookup at compile-time only.

The VM creates its own environment, which is used to (un)serialize programs.


Data Structures

struct  _vm_dyn_env_t

Functions

word_t env_sym_to_index (vm_dyn_env_t env, const char *key)
 Get index associated to symbol key. 0 means key dosen't exist in map.
const char * env_index_to_sym (vm_dyn_env_t env, word_t index)
 Get key associated to index.
vm_data_t env_get (vm_dyn_env_t env, word_t index)
 Get value at index.
void env_set (vm_t vm, vm_dyn_env_t env, word_t index, vm_data_t)
 Set value at index.


Function Documentation

word_t env_sym_to_index ( vm_dyn_env_t  env,
const char *  key 
)

Get index associated to symbol key. 0 means key dosen't exist in map.

const char* env_index_to_sym ( vm_dyn_env_t  env,
word_t  index 
)

Get key associated to index.

vm_data_t env_get ( vm_dyn_env_t  env,
word_t  index 
)

Get value at index.

void env_set ( vm_t  vm,
vm_dyn_env_t  env,
word_t  index,
vm_data_t   
)

Set value at index.


Generated on Wed Feb 6 14:46:05 2008 for TinyaML by  doxygen 1.5.3