CUBRID Engine  latest
cnf.c File Reference
#include <stdarg.h>
#include <ctype.h>
#include <assert.h>
#include "error_manager.h"
#include "parser.h"
Include dependency graph for cnf.c:

Go to the source code of this file.

Classes

struct  find_id_info
 
struct  similarity_context
 

Typedefs

typedef enum cnf_mode CNF_MODE
 
typedef struct find_id_info FIND_ID_INFO
 
typedef struct similarity_context SIMILARITY_CONTEXT
 

Enumerations

enum  cnf_mode { TRANSFORM_CNF_OR_COMPACT = 0, TRANSFORM_CNF_OR_PRUNE = 1, TRANSFORM_CNF_AND_OR = 2 }
 

Functions

static PT_NODEpt_and_or_form (PARSER_CONTEXT *parser, PT_NODE *node)
 
static PT_NODEpt_negate_expr (PARSER_CONTEXT *parser, PT_NODE *node)
 
static int count_and_or (PARSER_CONTEXT *parser, const PT_NODE *node)
 
static PT_NODEpt_transform_cnf_pre (PARSER_CONTEXT *parser, PT_NODE *node, void *arg, int *continue_walk)
 
static PT_NODEpt_transform_cnf_post (PARSER_CONTEXT *parser, PT_NODE *node, void *arg, int *continue_walk)
 
static PT_NODEpt_find_name_id_pre (PARSER_CONTEXT *parser, PT_NODE *tree, void *arg, int *continue_walk)
 
static PT_NODEpt_find_name_id_post (PARSER_CONTEXT *parser, PT_NODE *tree, void *arg, int *continue_walk)
 
static void pt_tag_term_with_id (PARSER_CONTEXT *parser, PT_NODE *term, UINTPTR id, UINTPTR join_spec, bool tag_subqueries)
 
static void pt_tag_terms_with_id (PARSER_CONTEXT *parser, PT_NODE *terms, UINTPTR id, UINTPTR join_spec)
 
static void pt_tag_terms_with_specs (PARSER_CONTEXT *parser, PT_NODE *terms, PT_NODE *join_spec, UINTPTR join_id)
 
static PT_NODEpt_tag_start_of_cnf_post (PARSER_CONTEXT *parser, PT_NODE *node, void *arg, int *continue_walk)
 
static PT_NODEpt_calculate_similarity (PARSER_CONTEXT *parser, PT_NODE *node, void *arg, int *continue_walk)
 
PT_NODEpt_cnf (PARSER_CONTEXT *parser, PT_NODE *node)
 
PT_NODEpt_do_cnf (PARSER_CONTEXT *parser, PT_NODE *node, void *arg, int *continue_walk)
 

Typedef Documentation

typedef enum cnf_mode CNF_MODE

Definition at line 38 of file cnf.c.

typedef struct find_id_info FIND_ID_INFO

Definition at line 40 of file cnf.c.

Definition at line 50 of file cnf.c.

Enumeration Type Documentation

enum cnf_mode
Enumerator
TRANSFORM_CNF_OR_COMPACT 
TRANSFORM_CNF_OR_PRUNE 
TRANSFORM_CNF_AND_OR 

Definition at line 32 of file cnf.c.

Function Documentation

static int count_and_or ( PARSER_CONTEXT parser,
const PT_NODE node 
)
static

Definition at line 462 of file cnf.c.

References pt_expr_info::arg1, pt_expr_info::arg2, pt_statement_info::expr, parser_node::info, pt_expr_info::op, PT_AND, and PT_OR.

Referenced by pt_cnf().

Here is the caller graph for this function:

static PT_NODE * pt_and_or_form ( PARSER_CONTEXT parser,
PT_NODE node 
)
static
static PT_NODE * pt_find_name_id_post ( PARSER_CONTEXT parser,
PT_NODE tree,
void *  arg,
int *  continue_walk 
)
static

Definition at line 1070 of file cnf.c.

References find_id_info::in_query, NULL, and PT_CONTINUE_WALK.

Referenced by pt_tag_term_with_id().

Here is the caller graph for this function:

static PT_NODE * pt_tag_start_of_cnf_post ( PARSER_CONTEXT parser,
PT_NODE node,
void *  arg,
int *  continue_walk 
)
static

Definition at line 87 of file cnf.c.

References parser_node::flag, parser_node::is_cnf_start, parser_node::next, NULL, parser_node::or_next, PT_TYPE_LOGICAL, and parser_node::type_enum.

Referenced by pt_cnf().

Here is the caller graph for this function:

static void pt_tag_term_with_id ( PARSER_CONTEXT parser,
PT_NODE term,
UINTPTR  id,
UINTPTR  join_spec,
bool  tag_subqueries 
)
static
static void pt_tag_terms_with_id ( PARSER_CONTEXT parser,
PT_NODE terms,
UINTPTR  id,
UINTPTR  join_spec 
)
static
static void pt_tag_terms_with_specs ( PARSER_CONTEXT parser,
PT_NODE terms,
PT_NODE join_spec,
UINTPTR  join_id 
)
static
static PT_NODE * pt_transform_cnf_pre ( PARSER_CONTEXT parser,
PT_NODE node,
void *  arg,
int *  continue_walk 
)
static

Definition at line 503 of file cnf.c.

References pt_statement_info::expr, parser_node::info, mode, parser_node::node_type, pt_expr_info::op, PT_AND, PT_EXPR, PT_OR, PT_SELECT, PT_STOP_WALK, and TRANSFORM_CNF_OR_PRUNE.

Referenced by pt_cnf().

Here is the caller graph for this function: