Blender V5.3
bsl::SymbolTable Struct Reference

#include <symbol_table.hh>

Classes

struct  Allocator

Public Member Functions

template<typename SymbolT>
SymbolT * alloc (SymbolT &&sym)
 SymbolTable (ParserBase &builtin_parser)
void parse (ast::LocalScope node, ErrorHandler &err_handler)
Result< StringPair > mangle_identifier (ast::TemplateArgList args, ast::TemplateParamList list, const SymbolScope &scope) const
Result< StringPair > mangle_identifier (const SymbolFunctionTemplate &tmp, ast::FuncParamList list, const SymbolScope &scope) const
Result< ExpressionResult > expr_type_analysis (const SymbolScope &scope, ast::Node start_node, bool is_reference=false) const
Result< SymbolClass * > resolve_auto_type (SymbolScope &scope, ast::Declarator decl) const
Result< string > expr_to_string (const SymbolScope &scope, ast::Node start, int &node_count, bool allow_compilation_constant=false) const
SymbolClass * get_literal_type (string_view lit) const
MatchRank get_conversion_rank (const SymbolClass *from, const SymbolClass *to, const bool ctor_conversion=false) const
SymbolClass * to_class (builtin::ClassId id) const
SymbolClass * make_type (SymbolClass *base, int size) const

Public Attributes

Allocator< SymbolVariable > var_arena
Allocator< SymbolFunction > fun_arena
Allocator< SymbolClass > cls_arena
Allocator< SymbolScope > scp_arena
Allocator< SymbolClassTemplate > tmp_cls_arena
Allocator< SymbolFunctionTemplate > tmp_fun_arena
SymbolVariable * err_var = nullptr
SymbolFunction * err_func = nullptr
SymbolClass * err_cls = nullptr
SymbolClass * char_cls = nullptr
SymbolClass * short_cls = nullptr
SymbolClass * int_cls = nullptr
SymbolClass * uchar_cls = nullptr
SymbolClass * ushort_cls = nullptr
SymbolClass * uint_cls = nullptr
SymbolClass * half_cls = nullptr
SymbolClass * float_cls = nullptr
SymbolClass * void_cls = nullptr
SymbolClass * str_cls = nullptr
SymbolClass * char2_cls = nullptr
SymbolClass * short2_cls = nullptr
SymbolClass * int2_cls = nullptr
SymbolClass * uchar2_cls = nullptr
SymbolClass * ushort2_cls = nullptr
SymbolClass * uint2_cls = nullptr
SymbolClass * half2_cls = nullptr
SymbolClass * char3_cls = nullptr
SymbolClass * short3_cls = nullptr
SymbolClass * int3_cls = nullptr
SymbolClass * uchar3_cls = nullptr
SymbolClass * ushort3_cls = nullptr
SymbolClass * uint3_cls = nullptr
SymbolClass * half3_cls = nullptr
SymbolClass * char4_cls = nullptr
SymbolClass * short4_cls = nullptr
SymbolClass * int4_cls = nullptr
SymbolClass * uchar4_cls = nullptr
SymbolClass * ushort4_cls = nullptr
SymbolClass * uint4_cls = nullptr
SymbolClass * half4_cls = nullptr
SymbolClass * float2_cls = nullptr
SymbolClass * float3_cls = nullptr
SymbolClass * float4_cls = nullptr
SymbolClass * packed_float2_cls = nullptr
SymbolClass * packed_float3_cls = nullptr
SymbolClass * packed_float4_cls = nullptr
SymbolClass * bool_cls = nullptr
SymbolClass * bool2_cls = nullptr
SymbolClass * bool3_cls = nullptr
SymbolClass * bool4_cls = nullptr
SymbolClass * float2x2_cls = nullptr
SymbolClass * float3x3_cls = nullptr
SymbolClass * float4x4_cls = nullptr
SymbolClass * float2x3_cls = nullptr
SymbolClass * float2x4_cls = nullptr
SymbolClass * float3x2_cls = nullptr
SymbolClass * float3x4_cls = nullptr
SymbolClass * float4x2_cls = nullptr
SymbolClass * float4x3_cls = nullptr
SymbolClass * bool32_t_cls = nullptr
unordered_map< int, string > image_formats
SymbolScope * root = nullptr

Static Public Attributes

static constexpr const char * err_symbol = "ERROR_SYMBOL"
static constexpr const char * subscript_operator_id = "arr_op_"

Detailed Description

Definition at line 33 of file symbol_table.hh.

Constructor & Destructor Documentation

◆ SymbolTable()

bsl::SymbolTable::SymbolTable ( ParserBase & builtin_parser)

Definition at line 22 of file symbol_table.cc.

References node, root, and scp_arena.

Member Function Documentation

◆ alloc()

template<typename SymbolT>
SymbolT * bsl::SymbolTable::alloc ( SymbolT && sym)

◆ expr_to_string()

◆ expr_type_analysis()

◆ get_conversion_rank()

MatchRank bsl::SymbolTable::get_conversion_rank ( const SymbolClass * from,
const SymbolClass * to,
const bool ctor_conversion = false ) const

◆ get_literal_type()

SymbolClass * bsl::SymbolTable::get_literal_type ( string_view lit) const

Definition at line 635 of file symbol_table.cc.

References bool_cls, float_cls, int_cls, str, and uint_cls.

Referenced by bsl::SymbolParser::parse_preprocessor().

◆ make_type()

◆ mangle_identifier() [1/2]

◆ mangle_identifier() [2/2]

Result< StringPair > bsl::SymbolTable::mangle_identifier ( const SymbolFunctionTemplate & tmp,
ast::FuncParamList list,
const SymbolScope & scope ) const

◆ parse()

void bsl::SymbolTable::parse ( ast::LocalScope node,
ErrorHandler & err_handler )

◆ resolve_auto_type()

◆ to_class()

SymbolClass * bsl::SymbolTable::to_class ( builtin::ClassId id) const

Definition at line 238 of file operator.cc.

References bool2_cls, bsl::builtin::bool2_t, bool3_cls, bsl::builtin::bool3_t, bool4_cls, bsl::builtin::bool4_t, bool_cls, bsl::builtin::bool_t, char2_cls, bsl::builtin::char2_t, char3_cls, bsl::builtin::char3_t, char4_cls, bsl::builtin::char4_t, char_cls, bsl::builtin::char_t, err_cls, float2_cls, bsl::builtin::float2_t, float2x2_cls, bsl::builtin::float2x2_t, float2x3_cls, bsl::builtin::float2x3_t, float2x4_cls, bsl::builtin::float2x4_t, float3_cls, bsl::builtin::float3_t, float3x2_cls, bsl::builtin::float3x2_t, float3x3_cls, bsl::builtin::float3x3_t, float3x4_cls, bsl::builtin::float3x4_t, float4_cls, bsl::builtin::float4_t, float4x2_cls, bsl::builtin::float4x2_t, float4x3_cls, bsl::builtin::float4x3_t, float4x4_cls, bsl::builtin::float4x4_t, float_cls, bsl::builtin::float_t, half2_cls, bsl::builtin::half2_t, half3_cls, bsl::builtin::half3_t, half4_cls, bsl::builtin::half4_t, half_cls, bsl::builtin::half_t, int2_cls, bsl::builtin::int2_t, int3_cls, bsl::builtin::int3_t, int4_cls, bsl::builtin::int4_t, int_cls, bsl::builtin::int_t, short2_cls, bsl::builtin::short2_t, short3_cls, bsl::builtin::short3_t, short4_cls, bsl::builtin::short4_t, short_cls, bsl::builtin::short_t, uchar2_cls, bsl::builtin::uchar2_t, uchar3_cls, bsl::builtin::uchar3_t, uchar4_cls, bsl::builtin::uchar4_t, uchar_cls, bsl::builtin::uchar_t, uint2_cls, bsl::builtin::uint2_t, uint3_cls, bsl::builtin::uint3_t, uint4_cls, bsl::builtin::uint4_t, uint_cls, bsl::builtin::uint_t, ushort2_cls, bsl::builtin::ushort2_t, ushort3_cls, bsl::builtin::ushort3_t, ushort4_cls, bsl::builtin::ushort4_t, ushort_cls, and bsl::builtin::ushort_t.

Member Data Documentation

◆ bool2_cls

SymbolClass* bsl::SymbolTable::bool2_cls = nullptr

Definition at line 98 of file symbol_table.hh.

Referenced by bsl::SymbolParser::initialize_constexpr(), make_type(), and to_class().

◆ bool32_t_cls

SymbolClass* bsl::SymbolTable::bool32_t_cls = nullptr

Definition at line 110 of file symbol_table.hh.

◆ bool3_cls

SymbolClass* bsl::SymbolTable::bool3_cls = nullptr

Definition at line 99 of file symbol_table.hh.

Referenced by bsl::SymbolParser::initialize_constexpr(), make_type(), and to_class().

◆ bool4_cls

SymbolClass* bsl::SymbolTable::bool4_cls = nullptr

Definition at line 100 of file symbol_table.hh.

Referenced by bsl::SymbolParser::initialize_constexpr(), make_type(), and to_class().

◆ bool_cls

SymbolClass* bsl::SymbolTable::bool_cls = nullptr

◆ char2_cls

SymbolClass* bsl::SymbolTable::char2_cls = nullptr

Definition at line 70 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ char3_cls

SymbolClass* bsl::SymbolTable::char3_cls = nullptr

Definition at line 77 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ char4_cls

SymbolClass* bsl::SymbolTable::char4_cls = nullptr

Definition at line 84 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ char_cls

SymbolClass* bsl::SymbolTable::char_cls = nullptr

Definition at line 60 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ cls_arena

Allocator<SymbolClass> bsl::SymbolTable::cls_arena

Definition at line 51 of file symbol_table.hh.

Referenced by bsl::SymbolParser::parse_template_decl().

◆ err_cls

◆ err_func

SymbolFunction* bsl::SymbolTable::err_func = nullptr

Definition at line 57 of file symbol_table.hh.

◆ err_symbol

const char* bsl::SymbolTable::err_symbol = "ERROR_SYMBOL"
staticconstexpr

◆ err_var

SymbolVariable* bsl::SymbolTable::err_var = nullptr

Definition at line 56 of file symbol_table.hh.

◆ float2_cls

SymbolClass* bsl::SymbolTable::float2_cls = nullptr

Definition at line 91 of file symbol_table.hh.

Referenced by bsl::SymbolParser::initialize_constexpr(), make_type(), and to_class().

◆ float2x2_cls

SymbolClass* bsl::SymbolTable::float2x2_cls = nullptr

Definition at line 101 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ float2x3_cls

SymbolClass* bsl::SymbolTable::float2x3_cls = nullptr

Definition at line 104 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ float2x4_cls

SymbolClass* bsl::SymbolTable::float2x4_cls = nullptr

Definition at line 105 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ float3_cls

SymbolClass* bsl::SymbolTable::float3_cls = nullptr

Definition at line 92 of file symbol_table.hh.

Referenced by bsl::SymbolParser::initialize_constexpr(), make_type(), and to_class().

◆ float3x2_cls

SymbolClass* bsl::SymbolTable::float3x2_cls = nullptr

Definition at line 106 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ float3x3_cls

SymbolClass* bsl::SymbolTable::float3x3_cls = nullptr

Definition at line 102 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ float3x4_cls

SymbolClass* bsl::SymbolTable::float3x4_cls = nullptr

Definition at line 107 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ float4_cls

SymbolClass* bsl::SymbolTable::float4_cls = nullptr

Definition at line 93 of file symbol_table.hh.

Referenced by bsl::SymbolParser::initialize_constexpr(), make_type(), and to_class().

◆ float4x2_cls

SymbolClass* bsl::SymbolTable::float4x2_cls = nullptr

Definition at line 108 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ float4x3_cls

SymbolClass* bsl::SymbolTable::float4x3_cls = nullptr

Definition at line 109 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ float4x4_cls

SymbolClass* bsl::SymbolTable::float4x4_cls = nullptr

Definition at line 103 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ float_cls

SymbolClass* bsl::SymbolTable::float_cls = nullptr

◆ fun_arena

◆ half2_cls

SymbolClass* bsl::SymbolTable::half2_cls = nullptr

Definition at line 76 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ half3_cls

SymbolClass* bsl::SymbolTable::half3_cls = nullptr

Definition at line 83 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ half4_cls

SymbolClass* bsl::SymbolTable::half4_cls = nullptr

Definition at line 90 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ half_cls

SymbolClass* bsl::SymbolTable::half_cls = nullptr

Definition at line 66 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ image_formats

unordered_map<int, string> bsl::SymbolTable::image_formats

Definition at line 112 of file symbol_table.hh.

◆ int2_cls

SymbolClass* bsl::SymbolTable::int2_cls = nullptr

Definition at line 72 of file symbol_table.hh.

Referenced by bsl::SymbolParser::initialize_constexpr(), make_type(), and to_class().

◆ int3_cls

SymbolClass* bsl::SymbolTable::int3_cls = nullptr

Definition at line 79 of file symbol_table.hh.

Referenced by bsl::SymbolParser::initialize_constexpr(), make_type(), and to_class().

◆ int4_cls

SymbolClass* bsl::SymbolTable::int4_cls = nullptr

Definition at line 86 of file symbol_table.hh.

Referenced by bsl::SymbolParser::initialize_constexpr(), make_type(), and to_class().

◆ int_cls

◆ packed_float2_cls

SymbolClass* bsl::SymbolTable::packed_float2_cls = nullptr

Definition at line 94 of file symbol_table.hh.

◆ packed_float3_cls

SymbolClass* bsl::SymbolTable::packed_float3_cls = nullptr

Definition at line 95 of file symbol_table.hh.

◆ packed_float4_cls

SymbolClass* bsl::SymbolTable::packed_float4_cls = nullptr

Definition at line 96 of file symbol_table.hh.

◆ root

◆ scp_arena

Allocator<SymbolScope> bsl::SymbolTable::scp_arena

◆ short2_cls

SymbolClass* bsl::SymbolTable::short2_cls = nullptr

Definition at line 71 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ short3_cls

SymbolClass* bsl::SymbolTable::short3_cls = nullptr

Definition at line 78 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ short4_cls

SymbolClass* bsl::SymbolTable::short4_cls = nullptr

Definition at line 85 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ short_cls

SymbolClass* bsl::SymbolTable::short_cls = nullptr

Definition at line 61 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ str_cls

SymbolClass* bsl::SymbolTable::str_cls = nullptr

Definition at line 69 of file symbol_table.hh.

◆ subscript_operator_id

const char* bsl::SymbolTable::subscript_operator_id = "arr_op_"
staticconstexpr

◆ tmp_cls_arena

Allocator<SymbolClassTemplate> bsl::SymbolTable::tmp_cls_arena

Definition at line 53 of file symbol_table.hh.

Referenced by bsl::SymbolParser::parse_template_decl().

◆ tmp_fun_arena

Allocator<SymbolFunctionTemplate> bsl::SymbolTable::tmp_fun_arena

Definition at line 54 of file symbol_table.hh.

Referenced by bsl::SymbolParser::parse_template_decl().

◆ uchar2_cls

SymbolClass* bsl::SymbolTable::uchar2_cls = nullptr

Definition at line 73 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ uchar3_cls

SymbolClass* bsl::SymbolTable::uchar3_cls = nullptr

Definition at line 80 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ uchar4_cls

SymbolClass* bsl::SymbolTable::uchar4_cls = nullptr

Definition at line 87 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ uchar_cls

SymbolClass* bsl::SymbolTable::uchar_cls = nullptr

Definition at line 63 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ uint2_cls

SymbolClass* bsl::SymbolTable::uint2_cls = nullptr

Definition at line 75 of file symbol_table.hh.

Referenced by bsl::SymbolParser::initialize_constexpr(), make_type(), and to_class().

◆ uint3_cls

SymbolClass* bsl::SymbolTable::uint3_cls = nullptr

Definition at line 82 of file symbol_table.hh.

Referenced by bsl::SymbolParser::initialize_constexpr(), make_type(), and to_class().

◆ uint4_cls

SymbolClass* bsl::SymbolTable::uint4_cls = nullptr

Definition at line 89 of file symbol_table.hh.

Referenced by bsl::SymbolParser::initialize_constexpr(), make_type(), and to_class().

◆ uint_cls

◆ ushort2_cls

SymbolClass* bsl::SymbolTable::ushort2_cls = nullptr

Definition at line 74 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ ushort3_cls

SymbolClass* bsl::SymbolTable::ushort3_cls = nullptr

Definition at line 81 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ ushort4_cls

SymbolClass* bsl::SymbolTable::ushort4_cls = nullptr

Definition at line 88 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ ushort_cls

SymbolClass* bsl::SymbolTable::ushort_cls = nullptr

Definition at line 64 of file symbol_table.hh.

Referenced by make_type(), and to_class().

◆ var_arena

◆ void_cls

SymbolClass* bsl::SymbolTable::void_cls = nullptr

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