Blender V5.3
bsl::SymbolFunction Struct Reference

#include <symbol_function.hh>

Inherits bsl::SymbolScope.

Public Types

enum  Type { STATIC , MEMBER , GLOBAL }
enum class  EntryPointType { FRAG , VERT , COMP , NONE }
Public Types inherited from bsl::SymbolScope
enum  Type {
  FUNCTION , CLASS , NAMESPACE , LOCAL ,
  ROOT
}

Public Member Functions

template<typename AstNodeT>
 SymbolFunction (SymbolScope *parent, SymbolClass *return_type, AstNodeT decl, const string &suffix="")
 SymbolFunction (SymbolScope *parent, Token tok, SymbolClass *return_type, const string &id, Type fn_type)
SymbolClass * parent_class ()
bool is_entry_point () const
Result< SymbolFunction * > lookup_overload (ast::IdQualified id, const SymbolTable &table, const vector< SymbolClass * > &arg_types)
void add_overload (SymbolFunction *fn)
void add_argument (bool is_const, SymbolClass *type, ast::Expr default_value={})
void reserve_arguments (int n)
Public Member Functions inherited from bsl::SymbolScope
 SymbolScope (ast::LocalScope decl)
 SymbolScope (SymbolScope *parent, Token tok, const string &id, Type type)
 SymbolScope (SymbolScope *parent, ast::LocalScope decl)
 SymbolScope (SymbolScope *parent, ast::Id id, Type type)
SymbolVariable * lookup_variable (const SymbolTable &table, ast::IdQualified id) const
Result< SymbolFunction * > lookup_function (const SymbolTable &table, ast::IdQualified id, optional< SourceLocation > loc=nullopt) const
template<typename ArgOrParamList>
Result< SymbolFunction * > lookup_function (const SymbolTable &table, ast::IdQualified id, ArgOrParamList params, const SymbolScope &arguments_scope, optional< SourceLocation > loc=nullopt) const
Result< SymbolClass * > lookup_class (const SymbolTable &table, ast::IdQualified id, optional< SourceLocation > loc=nullopt) const
Result< SymbolClass * > lookup_class (const SymbolTable &table, ast::Id id, ast::Id last, optional< SourceLocation > loc=nullopt) const
SymbolVariable * lookup_variable (string id) const
SymbolFunction * lookup_function (string id) const
SymbolClass * lookup_class (string id) const
SymbolFunction * lookup_function_base (const SymbolTable &table, ast::IdQualified id) const
SymbolClass * lookup_class_base (const SymbolTable &table, ast::IdQualified id) const
std::pair< ast::FuncForwardDecl, SymbolFunction * > lookup_function_forward_decl (ast::FuncDecl decl) const
void print () const
const SymbolScope * root_scope () const
SymbolScope * root_scope ()
SymbolClass * as_class ()
SymbolFunction * as_function ()
const SymbolFunction * as_function () const
SymbolFunction * parent_function ()
const SymbolFunction * parent_function () const
bool function_emplace (SymbolFunction *fn, bool builtin=false)
bool variable_emplace (string id, SymbolVariable *var)
bool variable_emplace (SymbolVariable *var)
vector< SymbolVariable * > non_static_variables_in_declaration_order () const
SymbolScope * child_scope (int n)

Static Public Member Functions

static Result< vector< SymbolClass * > > to_arg_types (const SymbolTable &table, const SymbolScope &scope, ast::FuncParamList list)
static Result< vector< SymbolClass * > > to_arg_types (const SymbolTable &table, const SymbolScope &scope, ast::FuncArgList list)

Public Attributes

SymbolFunction * overload_next = nullptr
SymbolFunctionTemplate * template_data = nullptr
SymbolClass * return_type = nullptr
ast::FuncDecl decl = {}
vector< bool > arg_const
vector< SymbolClass * > arg_types
vector< ast::Expr > arg_defaults
bool is_error = false
bool is_complete = true
bool allow_vector_promotion = false
bool is_builtin = false
bool is_constexpr = false
bool is_specialization = false
bool is_inline = false
bool is_defined = true
enum bsl::SymbolFunction::Type fn_type
enum bsl::SymbolFunction::EntryPointType entry_point_type
Public Attributes inherited from bsl::SymbolScope
friend SymbolParser
unordered_map< string, SymbolScope * > scopes
SymbolMap< SymbolVariable > variables
SymbolMap< SymbolFunction > functions
SymbolMap< SymbolClass > classes
vector< std::pair< ast::FuncForwardDecl, SymbolFunction * > > function_prototypes
optional< SourceLocation > poi
enum bsl::SymbolScope::Type type = ROOT
Public Attributes inherited from bsl::Symbol
string identifier
string original
SourceLocation loc
SymbolScope * parent = nullptr

Static Public Attributes

static constexpr const char * inline_fn_ret_id = "_r"

Detailed Description

Container for a function symbol.

All overloads of this function are contained inside the first declaration.

Definition at line 23 of file symbol_function.hh.

Member Enumeration Documentation

◆ EntryPointType

Enumerator
FRAG 
VERT 
COMP 
NONE 

Definition at line 57 of file symbol_function.hh.

◆ Type

Enumerator
STATIC 
MEMBER 
GLOBAL 

Definition at line 56 of file symbol_function.hh.

Constructor & Destructor Documentation

◆ SymbolFunction() [1/2]

template<typename AstNodeT>
bsl::SymbolFunction::SymbolFunction ( SymbolScope * parent,
SymbolClass * return_type,
AstNodeT decl,
const string & suffix = "" )
inline

◆ SymbolFunction() [2/2]

bsl::SymbolFunction::SymbolFunction ( SymbolScope * parent,
Token tok,
SymbolClass * return_type,
const string & id,
Type fn_type )
inline

Member Function Documentation

◆ add_argument()

void bsl::SymbolFunction::add_argument ( bool is_const,
SymbolClass * type,
ast::Expr default_value = {} )

◆ add_overload()

void bsl::SymbolFunction::add_overload ( SymbolFunction * fn)

Definition at line 173 of file symbol_function.cc.

References overload_next, and SymbolFunction().

◆ is_entry_point()

bool bsl::SymbolFunction::is_entry_point ( ) const
inline

◆ lookup_overload()

◆ parent_class()

SymbolClass * bsl::SymbolFunction::parent_class ( )
inline

Definition at line 99 of file symbol_function.hh.

References bsl::SymbolScope::as_class(), and bsl::Symbol::parent.

◆ reserve_arguments()

void bsl::SymbolFunction::reserve_arguments ( int n)

Definition at line 179 of file symbol_function.cc.

References arg_const, arg_defaults, and arg_types.

◆ to_arg_types() [1/2]

Result< vector< SymbolClass * > > bsl::SymbolFunction::to_arg_types ( const SymbolTable & table,
const SymbolScope & scope,
ast::FuncArgList list )
static

◆ to_arg_types() [2/2]

Result< vector< SymbolClass * > > bsl::SymbolFunction::to_arg_types ( const SymbolTable & table,
const SymbolScope & scope,
ast::FuncParamList list )
static

Member Data Documentation

◆ allow_vector_promotion

bool bsl::SymbolFunction::allow_vector_promotion = false

Definition at line 40 of file symbol_function.hh.

◆ arg_const

vector<bool> bsl::SymbolFunction::arg_const

Definition at line 32 of file symbol_function.hh.

Referenced by add_argument(), and reserve_arguments().

◆ arg_defaults

vector<ast::Expr> bsl::SymbolFunction::arg_defaults

Definition at line 34 of file symbol_function.hh.

Referenced by add_argument(), and reserve_arguments().

◆ arg_types

vector<SymbolClass *> bsl::SymbolFunction::arg_types

◆ decl

ast::FuncDecl bsl::SymbolFunction::decl = {}

Definition at line 30 of file symbol_function.hh.

Referenced by SymbolFunction().

◆ entry_point_type

◆ fn_type

enum bsl::SymbolFunction::Type bsl::SymbolFunction::fn_type

Referenced by SymbolFunction(), and SymbolFunction().

◆ inline_fn_ret_id

const char* bsl::SymbolFunction::inline_fn_ret_id = "_r"
staticconstexpr

Definition at line 54 of file symbol_function.hh.

◆ is_builtin

bool bsl::SymbolFunction::is_builtin = false

Definition at line 42 of file symbol_function.hh.

◆ is_complete

bool bsl::SymbolFunction::is_complete = true

Definition at line 38 of file symbol_function.hh.

◆ is_constexpr

bool bsl::SymbolFunction::is_constexpr = false

Definition at line 44 of file symbol_function.hh.

Referenced by bsl::ExpressionTypeParser::identifier().

◆ is_defined

bool bsl::SymbolFunction::is_defined = true

Definition at line 50 of file symbol_function.hh.

◆ is_error

bool bsl::SymbolFunction::is_error = false

◆ is_inline

bool bsl::SymbolFunction::is_inline = false

Definition at line 48 of file symbol_function.hh.

Referenced by SymbolFunction().

◆ is_specialization

bool bsl::SymbolFunction::is_specialization = false

◆ overload_next

SymbolFunction* bsl::SymbolFunction::overload_next = nullptr

Definition at line 25 of file symbol_function.hh.

Referenced by add_overload().

◆ return_type

◆ template_data

SymbolFunctionTemplate* bsl::SymbolFunction::template_data = nullptr

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