CWB
|
The SymbolTable object. More...
#include <symtab.h>
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)
int next_index |
next free reference table index
Referenced by labellookup(), new_reftab(), new_symbol_table(), and print_label_values().
namespace for LAB_RDAT labels
Referenced by delete_symbol_table(), findlabel(), labellookup(), new_symbol_table(), print_label_values(), print_symbol_table(), and symbol_table_new_iterator().
user namespace
Referenced by check_labels(), delete_symbol_table(), findlabel(), labellookup(), new_symbol_table(), print_label_values(), print_symbol_table(), and symbol_table_new_iterator().