mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes
m::wasm::ExprCompiler Struct Reference

Compiles AST expressions m::Expr to Wasm ASTs m::wasm::Expr<T>. More...

#include <WasmUtil.hpp>

Inheritance diagram for m::wasm::ExprCompiler:
[legend]
Collaboration diagram for m::wasm::ExprCompiler:
[legend]

Public Member Functions

 ExprCompiler (const Environment &env)
 
SQL_t compile (const m::ast::Expr &e)
 

‍Compiles a m::Expr e of statically unknown type to a SQL_t.


 
template<sql_type T>
T compile (const m::ast::Expr &e)
 

‍Compile a m::Expr e of statically known type to


 
SQL_boolean_t compile (const cnf::CNF &cnf)
 

‍Compile a m::cnf::CNF cnf of statically unknown type to a SQL_t.


 
template<sql_boolean_type T>
T compile (const cnf::CNF &cnf)
 

‍Compile a m::cnf::CNF cnf of statically known type to


 

Private Member Functions

void operator() (const ast::ErrorExpr &) override
 
void operator() (const ast::Designator &op) override
 
void operator() (const ast::Constant &op) override
 
void operator() (const ast::UnaryExpr &op) override
 
void operator() (const ast::BinaryExpr &op) override
 
void operator() (const ast::FnApplicationExpr &op) override
 
void operator() (const ast::QueryExpr &op) override
 
SQL_t get ()
 
template<sql_type T>
T get ()
 
void set (SQL_t &&value)
 
template<sql_type T>
void set (T &&value)
 

Private Attributes

SQL_t intermediate_result_
 

‍current intermediate results during AST traversal and compilation


 
const Environmentenv_
 

‍the environment to use for resolving designators to Expr<T>s


 

Detailed Description

Compiles AST expressions m::Expr to Wasm ASTs m::wasm::Expr<T>.

Also supports compiling m::cnf::CNFs.

Definition at line 494 of file WasmUtil.hpp.

Constructor & Destructor Documentation

◆ ExprCompiler()

m::wasm::ExprCompiler::ExprCompiler ( const Environment env)
inline

Definition at line 503 of file WasmUtil.hpp.

Member Function Documentation

◆ compile() [1/4]

SQL_boolean_t ExprCompiler::compile ( const cnf::CNF cnf)

‍Compile a m::cnf::CNF cnf of statically unknown type to a SQL_t.

Definition at line 505 of file WasmUtil.cpp.

References m::cnf::CNF::can_be_null(), m::wasm::CodeGenContext::Get(), M_unreachable, and m::wasm::num_simd_lanes.

◆ compile() [2/4]

template<sql_boolean_type T>
T m::wasm::ExprCompiler::compile ( const cnf::CNF cnf)
inline

‍Compile a m::cnf::CNF cnf of statically known type to

Template Parameters
T.

Definition at line 523 of file WasmUtil.hpp.

References compile(), M_insist, and m::T().

◆ compile() [3/4]

SQL_t m::wasm::ExprCompiler::compile ( const m::ast::Expr e)
inline

‍Compiles a m::Expr e of statically unknown type to a SQL_t.

Definition at line 506 of file WasmUtil.hpp.

References intermediate_result_.

Referenced by compile(), m::wasm::Environment::compile(), and compile_cnf().

◆ compile() [4/4]

template<sql_type T>
T m::wasm::ExprCompiler::compile ( const m::ast::Expr e)
inline

‍Compile a m::Expr e of statically known type to

Template Parameters
T.

Definition at line 512 of file WasmUtil.hpp.

References intermediate_result_, M_insist, and m::T().

◆ get() [1/2]

SQL_t m::wasm::ExprCompiler::get ( )
inlineprivate

Definition at line 539 of file WasmUtil.hpp.

References intermediate_result_.

Referenced by operator()().

◆ get() [2/2]

template<sql_type T>
T m::wasm::ExprCompiler::get ( )
inlineprivate

Definition at line 542 of file WasmUtil.hpp.

References intermediate_result_, M_insist, and m::T().

◆ operator()() [1/7]

void ExprCompiler::operator() ( const ast::BinaryExpr op)
overrideprivate

◆ operator()() [2/7]

void ExprCompiler::operator() ( const ast::Constant op)
overrideprivate

◆ operator()() [3/7]

void ExprCompiler::operator() ( const ast::Designator op)
overrideprivate

◆ operator()() [4/7]

void ExprCompiler::operator() ( const ast::ErrorExpr )
overrideprivate

Definition at line 153 of file WasmUtil.cpp.

References M_unreachable.

◆ operator()() [5/7]

void ExprCompiler::operator() ( const ast::FnApplicationExpr op)
overrideprivate

◆ operator()() [6/7]

void ExprCompiler::operator() ( const ast::QueryExpr op)
overrideprivate

◆ operator()() [7/7]

void ExprCompiler::operator() ( const ast::UnaryExpr op)
overrideprivate

◆ set() [1/2]

void m::wasm::ExprCompiler::set ( SQL_t &&  value)
inlineprivate

Definition at line 547 of file WasmUtil.hpp.

References intermediate_result_, and m::wasm::value.

Referenced by operator()().

◆ set() [2/2]

template<sql_type T>
void m::wasm::ExprCompiler::set ( T &&  value)
inlineprivate

Definition at line 553 of file WasmUtil.hpp.

References set(), and m::wasm::value.

Referenced by set().

Field Documentation

◆ env_

const Environment& m::wasm::ExprCompiler::env_
private

‍the environment to use for resolving designators to Expr<T>s

Definition at line 500 of file WasmUtil.hpp.

Referenced by operator()().

◆ intermediate_result_

SQL_t m::wasm::ExprCompiler::intermediate_result_
private

‍current intermediate results during AST traversal and compilation

Definition at line 498 of file WasmUtil.hpp.

Referenced by compile(), get(), and set().


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