#ifndef LKB_AVM_H #define LKB_AVM_H #include "lkb-protocol.h" enum { avm_terminal = 1, avm_structure = 2, avm_list = 3, avm_tag = 4 // not in trees, but can be *click*ed on. }; typedef struct lkb_failure { int what, id, ctx; char *type1, *type2, *constraint; lui_list *path, *cycle; int x, y; // location to zero-in on when this is selected } lkb_failure; typedef struct lkb_avm_tag { char *name; int is_def; // definition? or reference? lkb_failure *failure; // is this tag part of a cycle? int x1, y1; // location int width; } lkb_avm_tag; typedef struct lkb_avm_list { int length; int *what; char **type; void **items; lkb_avm_tag **tags; lkb_avm_tag **rtags; //void *rest; // if the list is terminated by a coreference, this is non-nil // not counted in 'length'... void *rest_weird; // if terminated by a non-list type int rest_type; // what type is `rest_weird'? int open_ended; // if 1, displayed with '...' after last item } lkb_avm_list; typedef struct lkb_avm { char *type; int nattr; int *attr_what; char **attr_name; void **attr_value; int *attr_ldx; // text width of attribute's label int *attr_hide; // 0 means always visible, 1 means default hidden but now displayed, 2 means now hidden int *attr_x, *attr_y; // view-coords display of attribute int *attr_dx, *attr_dy; // view-coords size of attribute lkb_avm_tag **attr_tag; lkb_failure **attr_cycle; // is the attribute part of a cycle-error? int x1, y1; // view-coords display x and y int dx, dy; // view-coords display size int expand; // is this structure open or collapsed? int show_hiders; // showing hidden elements? char *path; // feature path to this avm lkb_failure *failure; int type_dx, type_dy; // pixels used by type display } lkb_avm; enum { ufail_no_glb = 1, ufail_cycle = 2, ufail_constraint = 3 }; lkb_avm *find_attribute(lkb_avm *fs, char *attr, int *tt, lkb_avm_tag **tag); lkb_avm *convert_symbol_to_dag(char *sym); lkb_avm_list *convert_to_list(lkb_avm *fs); void print_attribs(lkb_avm *fs); lkb_avm_tag *lkb_tagdup(lkb_avm_tag *told); void free_avm(lkb_avm *fs); lkb_avm_list *empty_avm_list(int *tt, char *type); #define PATH_DIV ' ' #define PATH_DIV_STR " " #endif