ceptr
 All Data Structures Files Functions Variables Typedefs Macros Modules Pages
tree.h File Reference

semantic trees header file More...

#include <string.h>
#include <stdlib.h>
#include "ceptr_error.h"
#include "sys_defs.h"
#include "base_defs.h"
#include "ceptr_types.h"
#include "stream.h"
Include dependency graph for tree.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TREE_CHILDREN_BLOCK   5
 
#define TREE_PATH_TERMINATOR   0xFFFFFFFF
 
#define _t_new(p, sy, su, s)   __t_new(p,sy,su,s,0)
 
#define _t_newc(parent, symbol, c)   __t_newc(parent,symbol,c,0)
 
#define _t_newi(p, sy, su)   __t_newi(p,sy,su,0)
 
#define _t_newi64(p, sy, su)   __t_newi64(p,sy,su,0)
 
#define _t_news(parent, symbol, surface)   __t_news(parent,symbol,surface,0)
 
#define _t_new_str(parent, symbol, str)   __t_new_str(parent,symbol,str,0)
 
#define _t_newr(p, s)   __t_newr(p,s,0)
 
#define _t_fill_template(t, i)   __t_fill_template(t,i,false)
 
#define _t_find(t, sym)   __t_find(t,sym,1)
 
#define DO_KIDS(t, x)   {int i,_c=_t_children(t);for(i=1;i<=_c;i++){x;}}
 
#define root_check(c)   if (c->structure.parent != 0) {raise_error("can't add a node that isn't a root!");}
 

Enumerations

enum  TreeSurfaceFlags {
  TFLAG_ALLOCATED =0x0001, TFLAG_SURFACE_IS_TREE =0x0002, TFLAG_SURFACE_IS_RECEPTOR = 0x0004, TFLAG_SURFACE_IS_SCAPE =0x0008,
  TFLAG_SURFACE_IS_CPTR =0x0010, TFLAG_DELETED =0x0020, TFLAG_RUN_NODE =0x0040, TFLAG_REFERENCE =0x8000
}
 

Functions

T__t_new (T *t, Symbol symbol, void *surface, size_t size, bool is_run_node)
 
T__t_newc (T *t, Symbol symbol, char c, bool is_run_node)
 
T__t_newi (T *parent, Symbol symbol, int surface, bool is_run_node)
 
T__t_newi64 (T *parent, Symbol symbol, long surface, bool is_run_node)
 
T__t_news (T *parent, Symbol symbol, SemanticID surface, bool is_run_node)
 
T_t_newt (T *parent, Symbol symbol, T *t)
 
T__t_new_str (T *parent, Symbol symbol, char *str, bool is_run_node)
 
T_t_new_root (Symbol symbol)
 
T__t_newr (T *parent, Symbol symbol, bool is_run_node)
 
T_t_new_receptor (T *parent, Symbol symbol, Receptor *r)
 
T_t_new_scape (T *parent, Symbol symbol, Scape *s)
 
T_t_new_cptr (T *parent, Symbol symbol, void *s)
 
T_t_newp (T *parent, Symbol symbol, Process surface)
 
void _t_add (T *t, T *c)
 
void _t_detach_by_ptr (T *t, T *c)
 
T_t_detach_by_idx (T *t, int i)
 
void _t_replace (T *t, int i, T *r)
 
void _t_replace_node (T *t, T *r)
 
T_t_swap (T *t, int i, T *r)
 
void _t_insert_at (T *t, int *path, T *i)
 
void _t_morph (T *dst, T *src)
 
void __t_morph (T *t, Symbol s, void *surface, size_t length, int allocate)
 
void __t_free_children (T *t)
 
void __t_free (T *t)
 
void _t_free (T *t)
 
T_t_clone (T *t)
 
T_t_rclone (T *t)
 
T_t_build (SemTable *sem, T *t,...)
 
T_t_build2 (SemTable *sem, T *t,...)
 
T__t_tokenize (char *s)
 
T_t_parse (SemTable *sem, T *parent, char *s,...)
 
bool __t_fill_template (T *template, T *items, bool as_run_node)
 
int _t_children (T *t)
 
void * _t_surface (T *t)
 
Symbol _t_symbol (T *t)
 
size_t _t_size (T *t)
 
T_t_parent (T *t)
 
T_t_child (T *t, int i)
 
T_t_root (T *t)
 
T_t_next_sibling (T *t)
 
int _t_node_index (T *t)
 
T__t_find (T *t, Symbol sym, int start_child)
 
int _t_path_equal (int *p1, int *p2)
 
int _t_path_depth (int *p)
 
void _t_pathcpy (int *dst_p, int *src_p)
 
T_t_get (T *t, int *p)
 
T_t_getv (T *t,...)
 
int * _t_get_path (T *t)
 
void * _t_get_surface (T *t, int *p)
 
char * _t_sprint_path (int *fp, char *buf)
 
T_t_path_walk (T *t, int **pathP, int *lenP)
 
TreeHash _t_hash (SemTable *sem, T *t)
 
int _t_hash_equal (TreeHash h1, TreeHash h2)
 
UUIDt __uuid_gen ()
 
int __uuid_equal (UUIDt *u1, UUIDt *u2)
 
size_t __t_serialize (SemTable *sem, T *t, void **bufferP, size_t offset, size_t current_size, int compact)
 
void _t_serialize (SemTable *sem, T *t, void **surfaceP, size_t *sizeP)
 
T_t_unserialize (SemTable *sem, void **surfaceP, size_t *lengthP, T *t)
 
char * _t2rawjson (SemTable *sem, T *t, int level, char *buf)
 
char * _t2json (SemTable *sem, T *t, int level, char *buf)
 
int _t_write (SemTable *sem, T *t, Stream *stream)
 

Detailed Description

semantic trees header file

Definition in file tree.h.