CWB
Functions
matchlist.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "../cl/macros.h"
#include "../cl/attributes.h"
#include "../cl/cdaccess.h"
#include "matchlist.h"
#include "output.h"
#include "eval.h"

Functions

void init_matchlist (Matchlist *matchlist)
 Initialise the memebrs of the given Matchlist object. More...
 
void show_matchlist (Matchlist matchlist)
 Prints the entire contents of a Matchlist to stdout. More...
 
void show_matchlist_firstelements (Matchlist matchlist)
 Prints the first few elements of a matchlist to stdout. More...
 
void free_matchlist (Matchlist *matchlist)
 Frees all the memory used within a matchlist, and re-initialises all its variables. More...
 
int Setop (Matchlist *list1, MLSetOp operation, Matchlist *list2)
 Perform "operation" on the two match lists (can be initial). More...
 

Function Documentation

void free_matchlist ( Matchlist matchlist)
void init_matchlist ( Matchlist matchlist)
int Setop ( Matchlist list1,
MLSetOp  operation,
Matchlist list2 
)

Perform "operation" on the two match lists (can be initial).

The result is assigned to list1.

this whole code is WRONG when one of the matchlists is inverted TODO!

Also TODO: give it a better name.

This contains, by far, most of the code in the Matchlist module.

References access_corpus(), ATT_POS, CDA_OK, cl_errno, cl_free, cl_malloc(), cl_max_cpos(), cl_realloc(), Complement, cl::corpus, DEFAULT_ATT_NAME, _Matchlist::end, find_attribute, free_matchlist(), Identity, Intersection, _Matchlist::is_inverted, _Matchlist::matches_whole_corpus, MIN, evalenv::query_corpus, Reduce, Setop(), _Matchlist::start, _Matchlist::tabsize, _Matchlist::target_positions, Union, and Uniq.

Referenced by calculate_initial_matchlist(), calculate_initial_matchlist_1(), cqp_run_mu_query(), cqp_run_tab_query(), eval_mu_tree(), matchfirstpattern(), Setop(), simulate_dfa(), and try_optimization().

void show_matchlist ( Matchlist  matchlist)

Prints the entire contents of a Matchlist to stdout.

References _Matchlist::end, _Matchlist::is_inverted, _Matchlist::start, _Matchlist::tabsize, and _Matchlist::target_positions.

Referenced by simulate_dfa().

void show_matchlist_firstelements ( Matchlist  matchlist)

Prints the first few elements of a matchlist to stdout.

"First few" equals up to 1000.

Only the start positions are printed.

References _Matchlist::start, and _Matchlist::tabsize.

Referenced by simulate_dfa().