CWB
|
#include <stdio.h>
Macros | |
#define | CQPRC_NAME ".cqprc" |
#define | CQPMACRORC_NAME ".cqpmacros" |
#define | MAXCQPFILES 20 |
The number of file handles CQP can store in its file-array (ie max number of nested files) More... | |
#define | QUERY_BUFFER_SIZE 2048 |
Size of the CQP query buffer. More... | |
#define | True 1 |
DEPRACATED macros for Boolean true and false. More... | |
#define | False 0 |
DEPRACATED macros for Boolean true and false. More... | |
Typedefs | |
typedef int | Boolean |
DEPRACATED means of storing a Boolean value. More... | |
typedef enum _cyctype | CYCtype |
The "corpus yielding command type" type. More... | |
typedef void(* | InterruptCheckProc )(void) |
Interrupt callback functions are of this type. More... | |
Enumerations | |
enum | _cyctype { NoExpression, Query, Activation, SetOperation, Assignment } |
The "corpus yielding command type" type. More... | |
Functions | |
int | initialize_cqp (int argc, char **argv) |
Initialises the CQP program (or cqpserver or cqpcl). More... | |
int | cqp_parse_file (FILE *fd, int exit_on_parse_errors) |
Parses a stream for CQP query syntax. More... | |
int | cqp_parse_string (char *s) |
Parses a string for CQP query syntax. More... | |
int | setInterruptCallback (InterruptCheckProc f) |
Sets the interrupt callback function. More... | |
void | CheckForInterrupts (void) |
Calls the interrupt callback function, if set. More... | |
void | install_signal_handler (void) |
Installs the interrupt signal handler function with the OS. More... | |
Variables | |
CYCtype | LastExpression |
Global variable indicating type (CYC) of last expression. More... | |
int | reading_cqprc |
Boolean: true iff cqp_parse_file() - the main query syntax parsing function - is currently reading from the cqprc file handler. More... | |
int | cqp_error_status |
Global error status for CQP (will be returned to the caller when CQP exits). More... | |
char | QueryBuffer [QUERY_BUFFER_SIZE] |
buffer for queries More... | |
int | QueryBufferP |
index into this buffer, for appending More... | |
int | QueryBufferOverflow |
flag which signals buffer overflows More... | |
char * | searchstr |
Global variable containing a search string that is to be converted to a DFA. More... | |
int | exit_cqp |
1 iff exit-command was issued while parsing More... | |
char * | cqp_input_string |
int | cqp_input_string_position |
int | EvaluationIsRunning |
Boolean indicating that an interruptible process is currently running. More... | |
int | signal_handler_is_installed |
#define CQPMACRORC_NAME ".cqpmacros" |
Referenced by initialize_cqp().
#define CQPRC_NAME ".cqprc" |
Referenced by initialize_cqp().
#define False 0 |
DEPRACATED macros for Boolean true and false.
Referenced by access_corpus(), accessible(), after_CorpusCommand(), assign_temp_to_sub(), attach_subcorpus(), calculate_initial_matchlist_1(), calculate_ranges(), call_predefined_function(), catalog_corpus(), change_corpus(), copy_intervals(), do_NamedWfPattern(), do_WordformPattern(), duplicate_corpus(), ensure_corpus_size(), eval_bool(), eval_constraint(), evaluate_target(), expand_dataspace(), free_environment(), get_leaf_value(), GetSystemCorpus(), initialize_cl(), load_corpusnames(), make_temp_corpus(), matchfirstpattern(), NewCL(), open_stream(), parse_options(), regex2dfa(), save_subcorpus(), save_unsaved_subcorpora(), valid_subcorpus_id(), and valid_subcorpus_name().
#define MAXCQPFILES 20 |
The number of file handles CQP can store in its file-array (ie max number of nested files)
Referenced by cqp_parse_file().
#define QUERY_BUFFER_SIZE 2048 |
Size of the CQP query buffer.
Referenced by yy_input_char().
#define True 1 |
DEPRACATED macros for Boolean true and false.
Referenced by access_corpus(), accessible(), assign_temp_to_sub(), attach_subcorpus(), calculate_initial_matchlist_1(), call_predefined_function(), catalog_corpus(), change_corpus(), do_NamedWfPattern(), drop_temp_corpora(), dropcorpus(), duplicate_corpus(), ensure_corpus_size(), eval_bool(), eval_constraint(), expand_dataspace(), findcorpus(), free_corpuslist(), get_leaf_value(), GetSystemCorpus(), in_CorpusCommand(), load_corpusnames(), make_temp_corpus(), matchfirstpattern(), open_stream(), parse_options(), regex2dfa(), save_subcorpus(), simulate_dfa(), valid_subcorpus_id(), and valid_subcorpus_name().
typedef int Boolean |
DEPRACATED means of storing a Boolean value.
The "corpus yielding command type" type.
Each possible value of the enumeration represents a particular "type" of command that may potentially yield a (sub)corpus.
typedef void(* InterruptCheckProc)(void) |
Interrupt callback functions are of this type.
enum _cyctype |
The "corpus yielding command type" type.
Each possible value of the enumeration represents a particular "type" of command that may potentially yield a (sub)corpus.
Enumerator | |
---|---|
NoExpression | |
Query |
A query (yielding a query-result subcorpus) |
Activation |
A corpus-activation command. |
SetOperation | |
Assignment |
void CheckForInterrupts | ( | void | ) |
Calls the interrupt callback function, if set.
References interruptCallbackHook.
Referenced by evaluate_target(), and simulate().
int cqp_parse_file | ( | FILE * | fd, |
int | exit_on_parse_errors | ||
) |
Parses a stream for CQP query syntax.
Note that cqp_parse_file() fclose()s fd unless it is STDOUT.
fd | File handle of the file to parse. |
exit_on_parse_errors | Boolean: should CQP exit on parse errors? |
References child_process, cqp_file_p, cqp_files, current_corpus, exit_cqp, MAXCQPFILES, cl::mother_name, cl::name, quiet, reading_cqprc, save_on_exit, save_unsaved_subcorpora(), silent, cl::size, STREQ, yyin, yyparse(), and yyrestart().
Referenced by do_exec(), initialize_cqp(), and main().
int cqp_parse_string | ( | char * | s | ) |
Parses a string for CQP query syntax.
s | The string to parse. |
References cqp_input_string, cqp_input_string_position, cqpmessage(), cqpserver, Error, exit_cqp, which_app, and yyparse().
Referenced by do_cqi_cqp_query(), and main().
int initialize_cqp | ( | int | argc, |
char ** | argv | ||
) |
Initialises the CQP program (or cqpserver or cqpcl).
This function:
References batchfd, batchmode, check_available_corpora(), child_process, cl_free, cl_malloc(), CL_MAX_FILENAME_LENGTH, cl_randomize(), corpuslist, cqp_file_p, cqp_init_file, cqp_parse_file(), CQPMACRORC_NAME, cqpmessage(), CQPRC_NAME, cqpserver, default_corpus, eep, enable_macros, exit_cqp, init_macros(), macro_init_file, parse_options(), parser_debug, reading_cqprc, set_current_corpus_name(), SUBDIR_SEPARATOR, UNDEF, Warning, and which_app.
Referenced by main().
void install_signal_handler | ( | void | ) |
Installs the interrupt signal handler function with the OS.
This function installs a Ctrl-C interrupt handler (clears EvaluationIsRunning flag). The function installed is sigINT_signal_handler.
References cqpmessage(), sigINT_signal_handler(), signal_handler_is_installed, and Warning.
Referenced by check_alignment_constraints(), ComputeGroupInternally(), evaluate_subset(), evaluate_target(), main(), simulate_dfa(), SortSubcorpus(), and SortSubcorpusRandomize().
int setInterruptCallback | ( | InterruptCheckProc | f | ) |
Sets the interrupt callback function.
f | Pointer to the function to set as interrupt callback. |
References interruptCallbackHook.
int cqp_error_status |
Global error status for CQP (will be returned to the caller when CQP exits).
For the moment, it's simply boolean (0 = all OK, anything else = error.) Later, we might want to define some error macros (maybe have the CDA_ macros as a subset for errors bubbling up from CL, plus also extra macros for other errors.
TODO actually get this variable set in various error conditions. TODO work out whether cqpserver should exit with this error.
Referenced by main().
char* cqp_input_string |
Referenced by cqp_parse_string(), and yy_input_char().
int cqp_input_string_position |
Referenced by cqp_parse_string(), and yy_input_char().
int EvaluationIsRunning |
Boolean indicating that an interruptible process is currently running.
The process in question is one that may be expected to be non-instantaneous. This variable is turned off by the Ctrl+C interrupt handler.
Referenced by calculate_initial_matchlist_1(), check_alignment_constraints(), ComputeGroupInternally(), eval_bool(), eval_mu_tree(), evaluate_subset(), evaluate_target(), get_leaf_value(), group2compare(), i2compare(), matchfirstpattern(), sigINT_signal_handler(), simulate(), simulate_dfa(), SortSubcorpus(), and SortSubcorpusRandomize().
int exit_cqp |
1 iff exit-command was issued while parsing
Referenced by cqp_parse_file(), cqp_parse_string(), and initialize_cqp().
CYCtype LastExpression |
Global variable indicating type (CYC) of last expression.
Referenced by after_CorpusCommand(), and prepare_input().
char QueryBuffer[QUERY_BUFFER_SIZE] |
buffer for queries
Referenced by addHistoryLine(), after_CorpusCommand(), after_Query(), prepare_Query(), resetQueryBuffer(), and yy_input_char().
int QueryBufferOverflow |
flag which signals buffer overflows
Referenced by after_CorpusCommand(), after_Query(), resetQueryBuffer(), and yy_input_char().
int QueryBufferP |
index into this buffer, for appending
Referenced by after_Query(), resetQueryBuffer(), and yy_input_char().
int reading_cqprc |
Boolean: true iff cqp_parse_file() - the main query syntax parsing function - is currently reading from the cqprc file handler.
Referenced by addHistoryLine(), cqp_parse_file(), initialize_cqp(), and yy_input_char().
char* searchstr |
Global variable containing a search string that is to be converted to a DFA.
(Needs to be global; functions using the DFA write to it, and then the DFA parser reads from it. Declared as an external global in cqp.h so other parts of CQP can access it.)
Referenced by do_SearchPattern(), do_StandardQuery(), GET(), prepare_input(), prepare_Query(), and regex2dfa().
int signal_handler_is_installed |
Referenced by install_signal_handler(), and sigINT_signal_handler().