mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Data Fields
m::ast::Sema::SemaContext Struct Reference

Holds context information used by semantic analysis of a single statement. More...

#include <Sema.hpp>

Collaboration diagram for m::ast::Sema::SemaContext:
[legend]

Data Structures

struct  result_t
 

Public Types

enum  stage_t {
  S_From , S_Where , S_GroupBy , S_Having ,
  S_Select , S_OrderBy , S_Limit
}
 
using named_expr_table = std::unordered_multimap< ThreadSafePooledString, std::pair< std::reference_wrapper< Expr >, unsigned > >
 

‍list of all computed expressions along with their order


 
using source_type = std::variant< std::monostate, std::reference_wrapper< const Table >, named_expr_table >
 

‍the type of a source of data: either a database table or a nested query with named results


 
using source_table = std::unordered_map< ThreadSafePooledString, std::pair< source_type, unsigned > >
 

‍associative container mapping source name to data source and its order


 

Public Member Functions

 SemaContext (Stmt &stmt)
 

Data Fields

ThreadSafePooledOptionalString alias
 

‍if the statement that is being analyzed is a nested query, this is its alias in the outer statement


 
Stmtstmt
 

‍the statement that is currently being analyzed and for which this SemaContext is used


 
enum m::ast::Sema::SemaContext::stage_t stage = S_From
 current stage
 
bool needs_grouping = false
 
source_table sources
 

‍list of all sources along with their order


 
std::unordered_multimap< ThreadSafePooledString, result_tresults
 

‍list of all results computed by this statement along with their order


 
std::unordered_multimap< ThreadSafePooledString, std::reference_wrapper< Expr > > grouping_keys
 

‍list of grouping keys


 

Detailed Description

Holds context information used by semantic analysis of a single statement.

Definition at line 19 of file Sema.hpp.

Member Typedef Documentation

◆ named_expr_table

using m::ast::Sema::SemaContext::named_expr_table = std::unordered_multimap<ThreadSafePooledString, std::pair<std::reference_wrapper<Expr>, unsigned> >

‍list of all computed expressions along with their order

Definition at line 56 of file Sema.hpp.

◆ source_table

using m::ast::Sema::SemaContext::source_table = std::unordered_map<ThreadSafePooledString, std::pair<source_type, unsigned> >

‍associative container mapping source name to data source and its order

Definition at line 61 of file Sema.hpp.

◆ source_type

using m::ast::Sema::SemaContext::source_type = std::variant<std::monostate, std::reference_wrapper<const Table>, named_expr_table>

‍the type of a source of data: either a database table or a nested query with named results

Definition at line 59 of file Sema.hpp.

Member Enumeration Documentation

◆ stage_t

Enumerator
S_From 
S_Where 
S_GroupBy 
S_Having 
S_Select 
S_OrderBy 
S_Limit 

Definition at line 26 of file Sema.hpp.

Constructor & Destructor Documentation

◆ SemaContext()

m::ast::Sema::SemaContext::SemaContext ( Stmt stmt)
inline

Definition at line 69 of file Sema.hpp.

Field Documentation

◆ alias

ThreadSafePooledOptionalString m::ast::Sema::SemaContext::alias

‍if the statement that is being analyzed is a nested query, this is its alias in the outer statement

Definition at line 22 of file Sema.hpp.

◆ grouping_keys

std::unordered_multimap<ThreadSafePooledString, std::reference_wrapper<Expr> > m::ast::Sema::SemaContext::grouping_keys

‍list of grouping keys

Definition at line 67 of file Sema.hpp.

◆ needs_grouping

bool m::ast::Sema::SemaContext::needs_grouping = false

Definition at line 36 of file Sema.hpp.

◆ results

std::unordered_multimap<ThreadSafePooledString, result_t> m::ast::Sema::SemaContext::results

‍list of all results computed by this statement along with their order

Definition at line 65 of file Sema.hpp.

◆ sources

source_table m::ast::Sema::SemaContext::sources

‍list of all sources along with their order

Definition at line 63 of file Sema.hpp.

◆ stage

enum m::ast::Sema::SemaContext::stage_t m::ast::Sema::SemaContext::stage = S_From

current stage

◆ stmt

Stmt& m::ast::Sema::SemaContext::stmt

‍the statement that is currently being analyzed and for which this SemaContext is used

Definition at line 25 of file Sema.hpp.


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