symtab.h File Reference

Data Structures

Defines

Typedefs

Functions


Define Documentation

#define LAB_DEFINED   1

whether label has been defined or is defined by this call

Referenced by check_labels(), do_NamedWfPattern(), do_XMLTag(), and simulate().

#define LAB_RDAT   8

name space #2 used for s-attribute region boundaries by query engine

Referenced by do_XMLTag(), findlabel(), labellookup(), simulate(), and symbol_table_new_iterator().

#define LAB_SPECIAL   4

special labels must not be set/modified by user; defined/used consistency isn't checked for special labels

Referenced by check_labels(), do_IDReference(), do_LabelReference(), do_NamedWfPattern(), and labellookup().

#define LAB_USED   2

whether label has been used (i.e.

read out) or is used by this call

Referenced by check_labels(), do_IDReference(), do_LabelReference(), do_NamedWfPattern(), do_XMLTag(), and simulate().


Typedef Documentation

typedef struct _label_entry * LabelEntry

LabelEntry: the symbol tables are made up of two linked lists of.

See also:
SymbolTable.
typedef struct _RefTab * RefTab

The REfTab object (represents a reference table).

typedef struct _symbol_table * SymbolTable

The SymbolTable object.

cqp-2.2 uses a global symbol table to store label references which gives erroneous results for queries that contain optional elements. A proper treatment of labels requires each of the simulations traversing the NFA in parallel to have its own symbol table. Since the actual symbols are the same for all states, it is more efficient to split the symbol tables into symbol lookup and the actual data. Each simulation has its own data array (which stores corpus positions), but symbol lookup is shared between all simulations and returns an _index_ into the data array. If a simulation branches -- which happens at the left edge of alternatives or optional elements -- the symbol data array must be duplicated.

A symbol table now contains multiple namespaces (accessed by flags such as LAB_RDAT


Function Documentation

int check_labels ( SymbolTable  st  ) 
void delete_reftab ( RefTab  rt  ) 
void delete_symbol_table ( SymbolTable  st  ) 
void droplabel ( SymbolTable  st,
LabelEntry  l 
)
void dup_reftab ( RefTab  rt1,
RefTab  rt2 
)

References _RefTab::data, and _RefTab::size.

Referenced by eval_constraint(), and simulate().

LabelEntry findlabel ( SymbolTable  st,
char *  s,
int  flags 
)
int get_reftab ( RefTab  rt,
int  index,
int  cpos 
)
LabelEntry labellookup ( SymbolTable  st,
char *  s,
int  flags,
int  create 
)
RefTab new_reftab ( SymbolTable  st  ) 
SymbolTable new_symbol_table (  ) 
void print_label_values ( SymbolTable  st,
RefTab  rt,
int  cpos 
)

Prints the current label values (for debugging).

Parameters:
st The SymbolTable
rt 
cpos The corpus position

References get_reftab(), _label_entry::name, _label_entry::next, _symbol_table::next_index, _symbol_table::rdat, _label_entry::ref, _RefTab::size, and _symbol_table::user.

Referenced by simulate().

void print_symbol_table ( SymbolTable  st  ) 
void reset_reftab ( RefTab  rt  ) 

References _RefTab::data, and _RefTab::size.

Referenced by simulate(), and simulate_dfa().

void set_reftab ( RefTab  rt,
int  index,
int  value 
)
LabelEntry symbol_table_iterator ( LabelEntry  prev,
int  flags 
)
LabelEntry symbol_table_new_iterator ( SymbolTable  st,
int  flags 
)

Generated on Sun Feb 28 18:08:04 2010 for CWB by  doxygen 1.6.1