ceptr
|
Data has both meaningful and structural aspects, both of which must be defined. More...
Files | |
file | base_defs.c |
auto-generated system definitions | |
file | base_defs.h |
auto-generated system definitions | |
file | def.c |
implementation file for symbol and structure definition functions | |
file | def.h |
header file for symbol and structure definition functions | |
file | semtable.c |
implementation of table for coordinating meaning across a vmhost | |
file | semtable.h |
header file for table for coordinating meaning across a vmhost | |
file | sys_defs.c |
definition of system semantic elements for bootstrapping | |
file | sys_defs.h |
Defines types and vars for system defined semantics. | |
Macros | |
#define | ST(r, name, num,...) name = _r_define_structure(r,"" #name "",num,__VA_ARGS__) |
#define | SY(r, name, str) name = _r_define_symbol(r,str,"" #name "") |
#define | SP(r, code, name, intention, signature, link) name = _r_define_process(r,code,"" #name "",intention,signature,link) |
#define | t2s(t) _t2s(G_sem,t) |
#define | t2sp(t) __t2s(G_sem,t,INDENT) |
#define | _t2s(d, t) __t2s(d,t,NO_INDENT) |
#define | _d_get_def(defs, s) _t_child(defs,(s).id); |
#define | _d_get_process_code(processes, p) _d_get_def(processes,p) |
#define | _d_get_symbol_def(symbols, s) _d_get_def(symbols,s) |
#define | _d_get_structure_def(structures, s) _d_get_def(structures,s) |
#define | spec_is_sem_equal(got, expected) spec_total++; if (semeq(expected,got)){putchar('.');} else {putchar('F');sprintf(failures[spec_failures++],"%s:%d expected %s to be %d.%d.%d but was %d.%d.%d",__FUNCTION__,__LINE__,#got,(expected).context,(expected).semtype,(expected).id,(got).context,(got).semtype,(got).id);} |
Functions | |
int | semeq (SemanticID s1, SemanticID s2) |
SemanticID | _d_define (SemTable *sem, T *def, SemanticType semtype, Context c) |
void | __d_validate_symbol (SemTable *sem, Symbol s, char *n) |
void | __d_validate_structure (SemTable *sem, Structure s, char *n) |
void | __d_set_symbol_structure (T *symbols, Symbol sym, Structure s) |
SemanticAddr | _d_get_def_addr (T *def) |
Symbol | _d_define_symbol (SemTable *sem, Structure s, char *label, Context c) |
Structure | _d_define_structure (SemTable *sem, char *label, T *structure_def, Context c) |
Structure | _d_define_structure_v (SemTable *sem, char *label, Context c, int num_params,...) |
T * | _d_make_vstruc_def (SemTable *sem, char *label, int num_params, va_list params) |
Structure | __d_get_symbol_structure (T *symbols, Symbol s) |
size_t | _d_get_symbol_size (SemTable *sem, Symbol s, void *surface) |
size_t | _d_get_structure_size (SemTable *sem, Symbol s, void *surface) |
T * | _d_make_process_def (T *code, char *name, char *intention, T *signature, T *link) |
Process | _d_define_process (SemTable *sem, T *code, char *name, char *intention, T *signature, T *link, Context c) |
Protocol | _d_define_protocol (SemTable *sem, T *def, Context c) |
T * | _d_make_protocol_def (SemTable *sem, char *label,...) |
T * | _d_build_def_semtrex (SemTable *sem, Symbol s, T *parent) |
size_t | _sys_structure_size (int id, void *surface) |
SemanticID | _d_define_receptor (SemTable *sem, char *label, T *definitions, Context c) |
SemanticID | __d_define_receptor (SemTable *sem, T *def, Context c) |
Context | _d_get_receptor_context (SemTable *sem, SemanticID r) |
char * | __t2s (SemTable *sem, T *t, int indent) |
char * | _indent_line (int level, char *buf) |
char * | __t_dump (SemTable *sem, T *t, int level, char *buf) |
SemTable * | def_sys () |
void | sys_free (SemTable *sem) |
Variables | |
T * | G_cursor |
Data has both meaningful and structural aspects, both of which must be defined.
Structures are definitons of how data is organized; Symbols are a numeric semantic indicator (like a type) of what a given structure means. For example an "integer"" defines a structures of bits and how to interpret them, whereas a "shoe size" is a symbol for what a use of an integer means.
SemanticID __d_define_receptor | ( | SemTable * | sem, |
T * | def, | ||
Context | c | ||
) |
helper to define a new receptor
this call creates a receptor as a new semantic context inside given context
[in] | sem | the SemanticTable of contexts |
[in] | def | a human readable name for this receptor |
[in] | def | RECEPTOR_DEFINITION for the receptor [in] the context in which to define this receptor |
Walks the definition of a symbol to build a semtrex that would match that definiton
[in] | sem | the semantic context |
[in] | s | the symbol to build a semtrex for |
[in] | parent | the parent semtrex node because this function calls itself recursively. Pass in 0 to start. |
Examples (from test suite):
Process _d_define_process | ( | SemTable * | sem, |
T * | code, | ||
char * | name, | ||
char * | intention, | ||
T * | signature, | ||
T * | link, | ||
Context | c | ||
) |
add a new process definition to the processes tree
[in,out] | processes | a process def tree containing process codings which will be added to |
[in] | code | the code tree for this process |
[in] | name | the name of the process |
[in] | intention | a description of what the process intends to do/transform |
[in] | signature | the signature for the process |
Examples (from test suite):
SemanticID _d_define_receptor | ( | SemTable * | sem, |
char * | label, | ||
T * | definitions, | ||
Context | c | ||
) |
helper to define a new receptor
this call creates a receptor as a new semantic context inside given context
[in] | sem | the SemanticTable of contexts |
[in] | label | a human readable name for this receptor |
[in] | def | definitions that make up the receptor [in] the context in which to define this receptor |
define a new structure
[in] | sem | is the semantic table to which to add the structure |
[in] | label | a c-string label for this structures |
[in] | structure_def | the STRUCTURE_DEF definitions |
Examples (from test suite):
helper to add a STRUCTURE_SEQUENCE of symbols structure definition to a semantic table
[in] | sem | is the semantic table to which to add the structure |
[in] | label | a c-string label for this structures |
[in] | num_params | number of symbols in the structure |
[in] | ... | variable list of Symbol type symbols |
Examples (from test suite):
add a symbol definition to a symbol defs tree
[in] | sem | is the semantic table to which to add the symbol |
[in] | s | the structure type for this symbol |
[in] | label | a c-string label for this symbol |
[in] | the | context in which this symbol is being declared |
Examples (from test suite):
get the size of a structure
[in] | sem | is the semantic table where symbols and structures are defined |
[in] | s | the structure |
[in] | surface | the surface of the structure (may be necessary beause some structures have length info in the data) |
Examples (from test suite):
get the size of a symbol
[in] | sem | is the semantic table where symbols and structures are define |
[in] | s | the symbol |
[in] | surface | the surface of the structure (may be necessary beause some structures have length info in the data) |
Examples (from test suite):
build a new process definition
[in] | code | the code tree for this process |
[in] | name | the name of the process |
[in] | intention | a description of what the process intends to do/transform |
[in] | signature | the signature for the process |
Examples (from test suite):