MySQL  8.0.17
Source Code Documentation
Parse_tree_node_tmpl< Context > Class Template Reference

Base class for parse tree nodes (excluding the Parse_tree_root hierarchy) More...

#include <parse_tree_node_base.h>

Inheritance diagram for Parse_tree_node_tmpl< Context >:
Item PT_adm_partition PT_alter_tablespace_option< Option_type, Option > PT_alter_tablespace_option_comment PT_alter_tablespace_option_engine PT_alter_tablespace_option_file_block_size PT_alter_tablespace_option_nodegroup PT_assign_to_keycache PT_base_index_option PT_border PT_borders PT_common_table_expr PT_ddl_table_option PT_exclusion PT_field_def_base PT_frame PT_group PT_hint PT_hint_list PT_insert_values_list PT_internal_variable_name PT_into_destination PT_item_list PT_json_table_column PT_key_part_specification PT_limit_clause PT_locking_clause PT_locking_clause_list PT_option_value_following_option_type PT_option_value_list_head PT_option_value_no_option_type PT_option_value_type PT_order PT_order_expr PT_order_list PT_part_definition PT_part_type_def PT_part_value_item PT_part_values PT_partition PT_partition_option PT_preload_keys PT_query_expression PT_query_expression_body PT_query_primary PT_role_or_privilege PT_select_var PT_set PT_start_option_value_list PT_start_option_value_list_following_option_type PT_sub_partition PT_subpartition PT_subquery PT_table_element PT_table_reference PT_transaction_characteristic PT_transaction_characteristics PT_type PT_window PT_window_list PT_with_clause PT_with_list

Public Types

typedef Context context_t
 

Public Member Functions

virtual ~Parse_tree_node_tmpl ()
 
bool is_contextualized () const
 
virtual bool contextualize (Context *pc)
 Do all context-sensitive things and mark the node as contextualized. More...
 
virtual bool contextualize_ (Context *)
 
Intermediate version of the contextualize() function More...
 
void error (Context *pc, const POS &pos) const
 syntax_error() function replacement for deferred reporting of syntax errors More...
 
void error (Context *pc, const POS &pos, const char *msg) const
 syntax_error() function replacement for deferred reporting of syntax errors More...
 
void errorf (Context *pc, const POS &pos, const char *format,...) const
 syntax_error() function replacement for deferred reporting of syntax errors More...
 

Static Public Member Functions

static void * operator new (size_t size, MEM_ROOT *mem_root, const std::nothrow_t &arg=std::nothrow) noexcept
 
static void operator delete (void *ptr, size_t size)
 
static void operator delete (void *, MEM_ROOT *, const std::nothrow_t &) noexcept
 

Protected Member Functions

 Parse_tree_node_tmpl ()
 

Private Member Functions

 Parse_tree_node_tmpl (const Parse_tree_node_tmpl &)
 
void operator= (const Parse_tree_node_tmpl &)
 

Private Attributes

bool contextualized
 
bool transitional
 

Friends

class Item
 

Detailed Description

template<typename Context>
class Parse_tree_node_tmpl< Context >

Base class for parse tree nodes (excluding the Parse_tree_root hierarchy)

Member Typedef Documentation

◆ context_t

template<typename Context>
typedef Context Parse_tree_node_tmpl< Context >::context_t

Constructor & Destructor Documentation

◆ Parse_tree_node_tmpl() [1/2]

template<typename Context>
Parse_tree_node_tmpl< Context >::Parse_tree_node_tmpl ( const Parse_tree_node_tmpl< Context > &  )
private

◆ Parse_tree_node_tmpl() [2/2]

template<typename Context>
Parse_tree_node_tmpl< Context >::Parse_tree_node_tmpl ( )
inlineprotected

◆ ~Parse_tree_node_tmpl()

template<typename Context>
virtual Parse_tree_node_tmpl< Context >::~Parse_tree_node_tmpl ( )
inlinevirtual

Member Function Documentation

◆ contextualize()

template<typename Context>
virtual bool Parse_tree_node_tmpl< Context >::contextualize ( Context *  pc)
inlinevirtual

Do all context-sensitive things and mark the node as contextualized.

Parameters
pccurrent parse context
Return values
falsesuccess
truesyntax/OOM/etc error

Reimplemented in PT_generated_default_val_column_attr, PT_storage_media_column_attr, PT_column_format_column_attr, PT_serial_default_value_column_attr, PT_auto_increment_column_attr, PT_on_update_column_attr, PT_default_column_attr, and PT_check_constraint_column_attr.

◆ contextualize_()

template<typename Context>
virtual bool Parse_tree_node_tmpl< Context >::contextualize_ ( Context *  )
inlinevirtual


Intermediate version of the contextualize() function

This function is intended to resolve parser grammar loops.

During the step-by-step refactoring of the parser grammar we wrap each context-sensitive semantic action with 3 calls:

  1. Parse_tree_node_tmpl() context-independent constructor call,
  2. contextualize_() function call to evaluate all context-sensitive things from the former context-sensitive semantic action code.
  3. Call of dummy contextualize() function.

Then we lift the contextualize() function call to outer grammar rules but save the contextualize_() function call untouched.

When all loops in the grammar rules are resolved (i.e. transformed as described above) we: a. remove all contextualize_() function calls and b. rename all contextualize_() function definitions to contextualize() function definitions.

Note: it's not necessary to transform the whole grammar and remove this function calls in one pass: it's possible to transform the grammar statement by statement in a way described above.

Note: remove this function together with Item::contextualize_().

◆ error() [1/2]

template<typename Context>
void Parse_tree_node_tmpl< Context >::error ( Context *  pc,
const POS pos 
) const
inline

syntax_error() function replacement for deferred reporting of syntax errors

Parameters
pcCurrent parse context.
posLocation of the error in lexical scanner buffers.

◆ error() [2/2]

template<typename Context>
void Parse_tree_node_tmpl< Context >::error ( Context *  pc,
const POS pos,
const char *  msg 
) const
inline

syntax_error() function replacement for deferred reporting of syntax errors

Parameters
pcCurrent parse context.
posLocation of the error in lexical scanner buffers.
msgError message.

◆ errorf()

template<typename Context>
void Parse_tree_node_tmpl< Context >::errorf ( Context *  pc,
const POS pos,
const char *  format,
  ... 
) const
inline

syntax_error() function replacement for deferred reporting of syntax errors

Parameters
pcCurrent parse context.
posLocation of the error in lexical scanner buffers.
formatError message format string with optional argument list.

◆ is_contextualized()

template<typename Context>
bool Parse_tree_node_tmpl< Context >::is_contextualized ( ) const
inline

◆ operator delete() [1/2]

template<typename Context>
static void Parse_tree_node_tmpl< Context >::operator delete ( void *  ptr,
size_t  size 
)
inlinestatic

◆ operator delete() [2/2]

template<typename Context>
static void Parse_tree_node_tmpl< Context >::operator delete ( void *  ,
MEM_ROOT ,
const std::nothrow_t &   
)
inlinestaticnoexcept

◆ operator new()

template<typename Context>
static void* Parse_tree_node_tmpl< Context >::operator new ( size_t  size,
MEM_ROOT mem_root,
const std::nothrow_t &  arg = std::nothrow 
)
inlinestaticnoexcept

◆ operator=()

template<typename Context>
void Parse_tree_node_tmpl< Context >::operator= ( const Parse_tree_node_tmpl< Context > &  )
private

Friends And Related Function Documentation

◆ Item

template<typename Context>
friend class Item
friend

Member Data Documentation

◆ contextualized

template<typename Context>
bool Parse_tree_node_tmpl< Context >::contextualized
private

◆ transitional

template<typename Context>
bool Parse_tree_node_tmpl< Context >::transitional
private

The documentation for this class was generated from the following file: