Blender V5.3
bsl::SymbolParser Struct Reference

Inherits bsl::NodeErrorHandler.

Classes

struct  AnonScopePrefix

Public Member Functions

 SymbolParser (ErrorHandler &handler, SymbolTable &table)
void parse_scope (SymbolScope &scope, Node node, const std::string &prefix, TemplateInst template_inst={})
void parse_local_scope (SymbolScope &scope, LocalScope local_node, const std::string &prefix)
void parse_template_arguments (SymbolScope &scope, TemplateDecl decl, TemplateInst inst)
void parse_function_return_type (SymbolScope &scope, ast::IdType return_type)
void parse_function_arguments (SymbolScope &scope, FuncArgList arg_list)
void parse_loop_arguments (SymbolScope &scope, ForLoop loop)
void parse_preprocessor (SymbolScope &, Preprocessor directive)
void parse_namespace (SymbolScope &scope, ast::Namespace decl, string ns_prefix)
void parse_using_stmt (SymbolScope &scope, UsingStmt stmt)
void parse_enum_value (SymbolScope &scope, EnumValue val, ClassDecl cls, ConstexprValue &enum_last_val, const string &prefix)
SymbolClass * parse_class_decl (SymbolScope &scope, ClassDecl decl, ClassDecl parent_class, int &offset, const std::string &prefix, const std::string &suffix="", optional< SourceLocation > poi=nullopt, TemplateInst temp={}, SymbolClassTemplate *cls_template=nullptr)
void parse_func_forward_decl (SymbolScope &scope, FuncForwardDecl decl)
SymbolFunction * parse_func_decl (SymbolScope &scope, FuncDecl func, const std::string &prefix, const std::string &suffix="", optional< SourceLocation > poi=nullopt, TemplateInst temp={})
void parse_template_decl (SymbolScope &scope, TemplateDecl decl)
template<typename DeclAst, typename SymbolT>
TemplateDecl check_template_instance (TemplateParamList temp_params, DeclAst &decl, const SymbolT &sym)
void parse_template_inst (SymbolScope &scope, TemplateInst temp, const std::string &prefix)
void parse_template_spec (SymbolScope &scope, TemplateSpec temp, const std::string &prefix)
void parse_pipeline_decl (SymbolScope &scope, PipelineDecl decl, const std::string &prefix)
void parse_structured_binding (SymbolScope &scope, StructuredBinding decl)
void parse_var_decl (SymbolScope &scope, VarDecl var, int &offset, int &bitfield_offset, SymbolVariable *&bitfield_base, const std::string &prefix)
ExpressionResult eval_scalar_initializer_list (const SymbolScope &scope, SymbolClass *cls, InitializerList list)
ExpressionResult initialize_assign (const SymbolScope &scope, SymbolClass *cls, AssignStmt assign)
ExpressionResult initialize_constexpr (const SymbolScope &scope, SymbolClass *cls, Declarator decl)
Public Member Functions inherited from bsl::NodeErrorHandler
 NodeErrorHandler (ErrorHandler &handler)
void error (Token tok, const string &msg)
void error (ast::Node node, const string &msg)
void error (std::optional< AstNodeException > &err)
void error (std::optional< TokenException > &err)
template<typename... Args>
void error (Token tok, Diag code, Args &&...args)
template<typename... Args>
void error (ast::Node node, Diag code, Args &&...args)
template<typename... Args>
ScopedNote note (Token tok, Diag code, Args &&...args)
template<typename... Args>
ScopedNote note (ast::Node node, Diag code, Args &&...args)

Static Public Member Functions

static AnonScopePrefix anonymous_scope_prefix (SymbolClass *cls)

Public Attributes

SymbolTable & table
Public Attributes inherited from bsl::NodeErrorHandler
ErrorHandler & err_handler
vector< tuple< Token, string > > note_stack = {}

Detailed Description

Definition at line 22 of file symbol.cc.

Constructor & Destructor Documentation

◆ SymbolParser()

bsl::SymbolParser::SymbolParser ( ErrorHandler & handler,
SymbolTable & table )
inline

Definition at line 25 of file symbol.cc.

References bsl::NodeErrorHandler::NodeErrorHandler(), and table.

Member Function Documentation

◆ anonymous_scope_prefix()

AnonScopePrefix bsl::SymbolParser::anonymous_scope_prefix ( SymbolClass * cls)
inlinestatic

◆ check_template_instance()

template<typename DeclAst, typename SymbolT>
TemplateDecl bsl::SymbolParser::check_template_instance ( TemplateParamList temp_params,
DeclAst & decl,
const SymbolT & sym )
inline

◆ eval_scalar_initializer_list()

◆ initialize_assign()

◆ initialize_constexpr()

◆ parse_class_decl()

SymbolClass * bsl::SymbolParser::parse_class_decl ( SymbolScope & scope,
ClassDecl decl,
ClassDecl parent_class,
int & offset,
const std::string & prefix,
const std::string & suffix = "",
optional< SourceLocation > poi = nullopt,
TemplateInst temp = {},
SymbolClassTemplate * cls_template = nullptr )
inline

Definition at line 555 of file symbol.cc.

Referenced by parse_template_inst(), and parse_template_spec().

◆ parse_enum_value()

◆ parse_func_decl()

SymbolFunction * bsl::SymbolParser::parse_func_decl ( SymbolScope & scope,
FuncDecl func,
const std::string & prefix,
const std::string & suffix = "",
optional< SourceLocation > poi = nullopt,
TemplateInst temp = {} )
inline

Definition at line 657 of file symbol.cc.

Referenced by parse_template_inst(), and parse_template_spec().

◆ parse_func_forward_decl()

◆ parse_function_arguments()

void bsl::SymbolParser::parse_function_arguments ( SymbolScope & scope,
FuncArgList arg_list )
inline

Definition at line 194 of file symbol.cc.

References bsl::SymbolFunction::add_argument(), bsl::AttributeNotAllowedInComp, bsl::AttributeOnlyEntryPointsCanUseIn, bsl::AttributeOnlyEntryPointsCanUseOut, bsl::BARY_COORD, bsl::BASE_INSTANCE, blender::gpu::shader::parser::ast::Node::children_of_type(), bsl::CLIP_DISTANCES, bsl::SymbolFunction::COMP, bsl::SymbolVariable::condition, bsl::ConditionAttributeNotOnResource, bsl::ENTRY_POINT, bsl::SymbolFunction::entry_point_type, bsl::NodeErrorHandler::error(), bsl::ExpectedEntryPointResourceAttribute, bsl::ExpectedResourceOfEitherType, bsl::ExpectedResourceOfType, bsl::SymbolFunction::FRAG, bsl::FRAG_COORD, bsl::FRAG_DEPTH, bsl::FRAGMENT_IN, bsl::FRAGMENT_OUT, blender::gpu::shader::parser::ast::Node::front(), bsl::FRONT_FACING, bsl::SymbolScope::functions, bsl::GLOBAL_INVOCATION_ID, bsl::Symbol::identifier, bsl::IN, bsl::INSTANCE_ID, bsl::INSTANCE_INDEX, bsl::SymbolFunction::is_entry_point(), bsl::SymbolClass::is_error, bsl::LAYER, bsl::Symbol::loc, bsl::LOCAL_INVOCATION_ID, bsl::LOCAL_INVOCATION_INDEX, bsl::SymbolScope::lookup_class(), bsl::SymbolFunction::MEMBER, bsl::NONE, bsl::SymbolFunction::NONE, bsl::NUM_WORK_GROUP, bsl::OUT, bsl::Symbol::parent, bsl::POINT_COORD, bsl::POINT_SIZE, bsl::POSITION, bsl::Redefinition, bsl::RESOURCE_TABLE, bsl::resource_type_from_attributes(), bsl::ResourceAttributesOnlyOnEntryPointArgs, bsl::SymbolClass::srt_type, bsl::STENCIL_REF, table, bsl::SourceLocation::tok, bsl::UnknownTypeNameWithArg, bsl::SymbolTable::var_arena, bsl::SymbolScope::variable_emplace(), bsl::SymbolFunction::VERT, bsl::VERTEX_ID, bsl::VERTEX_IN, bsl::VERTEX_OUT, bsl::VIEWPORT_INDEX, and bsl::WORK_GROUP_ID.

Referenced by parse_func_forward_decl().

◆ parse_function_return_type()

◆ parse_local_scope()

void bsl::SymbolParser::parse_local_scope ( SymbolScope & scope,
LocalScope local_node,
const std::string & prefix )
inline

◆ parse_loop_arguments()

◆ parse_namespace()

void bsl::SymbolParser::parse_namespace ( SymbolScope & scope,
ast::Namespace decl,
string ns_prefix )
inline

◆ parse_pipeline_decl()

void bsl::SymbolParser::parse_pipeline_decl ( SymbolScope & scope,
PipelineDecl decl,
const std::string & prefix )
inline

◆ parse_preprocessor()

◆ parse_scope()

void bsl::SymbolParser::parse_scope ( SymbolScope & scope,
Node node,
const std::string & prefix,
TemplateInst template_inst = {} )
inline

Definition at line 29 of file symbol.cc.

References node.

Referenced by bsl::SymbolTable::parse(), parse_local_scope(), and parse_namespace().

◆ parse_structured_binding()

◆ parse_template_arguments()

◆ parse_template_decl()

◆ parse_template_inst()

◆ parse_template_spec()

◆ parse_using_stmt()

◆ parse_var_decl()

void bsl::SymbolParser::parse_var_decl ( SymbolScope & scope,
VarDecl var,
int & offset,
int & bitfield_offset,
SymbolVariable *& bitfield_base,
const std::string & prefix )
inline

Definition at line 967 of file symbol.cc.

References anonymous_scope_prefix(), bsl::SymbolScope::as_class(), blender::gpu::shader::parser::ast::VarDecl::attributes(), bsl::BitFieldNotIntegral, bsl::BitFieldSizeNegative, bsl::BitFieldSizeNull, bsl::BitFieldSizeTooLarge, bsl::CapacityArrayDimensionMismatch, blender::gpu::shader::parser::ast::Node::child_first(), blender::gpu::shader::parser::ast::Node::children_of_type(), bsl::ConditionAttributeNotOnResource, bsl::ConditionAttributeUnsupported, bsl::ConstexprGlobalNonStatic, bsl::ConstexprMemberNonStatic, bsl::ConstexprVarMustNotBeArray, blender::gpu::shader::parser::ast::Declarator, bsl::SymbolClass::ensure_size_and_align(), bsl::NodeErrorHandler::error(), bsl::ExpectedResourceDefinitionOfType, blender::gpu::shader::parser::ast::AssignStmt::expr(), blender::gpu::shader::parser::ast::BitField::expr(), bsl::SymbolTable::expr_type_analysis(), bsl::ExprNotIntegralConstant, bsl::FRAG_OUT, bsl::FRAGMENT_IN, bsl::FRAGMENT_OUT, blender::gpu::shader::parser::ast::IdType::identifier(), bsl::Symbol::identifier, initialize_constexpr(), bsl::SymbolTable::int_cls, bsl::InvalidResourceTypeForResourceTableClass, bsl::SymbolClass::is_anonymous, bsl::SymbolClass::is_error, blender::gpu::shader::parser::ast::VarDecl::is_reference(), bsl::SymbolClass::is_srt(), bsl::SymbolClass::is_std140_compatible, bsl::SymbolClass::is_std430_compatible, bsl::SymbolClass::is_union, blender::gpu::shader::parser::ast::Node::is_valid(), len(), bsl::SymbolScope::lookup_class(), bsl::NONE, NOTE, bsl::NoteInStorageBufferDeclaration, bsl::NoteInUniformBufferDeclaration, bsl::NotePreviousDefinition, bsl::SymbolVariable::offset, bsl::Symbol::original, bsl::Redefinition, bsl::ReferenceCannotBindTemporary, bsl::ReferenceMixedVarDecl, bsl::ReferenceTypeMismatch, bsl::ReferenceVariableRequiresInitializer, bsl::SymbolTable::resolve_auto_type(), bsl::RESOURCE_TABLE, bsl::resource_type_from_attributes(), bsl::ResourceOutOfClassDeclaration, bsl::ResourcesNotAllowedInAnonymousStruct, bsl::ResourceTableMustBeReference, blender::result, bsl::SHARED, bsl::SymbolClass::srt_type, bsl::StaticDataMemberNotAllowed, bsl::STORAGE_BUF, blender::gpu::shader::parser::ast::Node::str(), table, to_string(), blender::gpu::shader::parser::ast::VarDecl::type(), bsl::SymbolTable::uint_cls, bsl::UNIFORM_BUF, bsl::UnknownTypeNameWithArg, bsl::SymbolTable::var_arena, bsl::SymbolScope::variable_emplace(), bsl::SymbolScope::variables, bsl::VERT_ATTR_OUT, bsl::VERTEX_IN, and bsl::VERTEX_OUT.

Member Data Documentation

◆ table


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