Blender V5.0
blender::gpu::shader::parser::Scope Struct Reference

#include <shader_parser.hh>

Public Member Functions

Token start () const
Token end () const
IndexRange range () const
Token operator[] (const int64_t index) const
size_t token_count () const
ScopeType type () const
Scope scope () const
bool is_valid () const
bool is_invalid () const
bool contains (const Scope sub) const
std::string str () const
std::string str_exclusive () const
Token find_token (const char token_type) const
bool contains_token (const char token_type) const
void foreach_match (const std::string &pattern, std::function< void(const std::vector< Token >)> callback) const
void foreach_scope (ScopeType type, std::function< void(Scope)> callback) const
void foreach_token (const TokenType token_type, std::function< void(const Token)> callback) const
void foreach_function (std::function< void(bool is_static, Token type, Token name, Scope args, bool is_const, Scope body)> callback) const
void foreach_struct (std::function< void(Token struct_tok, Token name, Scope body)> callback) const
bool operator== (const Scope &other) const
bool operator!= (const Scope &other) const

Static Public Member Functions

static Scope from_position (const ParserData *data, int64_t index)
static Scope invalid ()

Public Attributes

std::string_view token_view
std::string_view str_view
const ParserDatadata
int64_t index

Detailed Description

Definition at line 718 of file shader_parser.hh.

Member Function Documentation

◆ contains()

bool blender::gpu::shader::parser::Scope::contains ( const Scope sub) const
inline

Definition at line 787 of file shader_parser.hh.

References blender::gpu::shader::parser::Global, scope(), and type().

◆ contains_token()

bool blender::gpu::shader::parser::Scope::contains_token ( const char token_type) const
inline

◆ end()

Token blender::gpu::shader::parser::Scope::end ( ) const
inline

◆ find_token()

Token blender::gpu::shader::parser::Scope::find_token ( const char token_type) const
inline

◆ foreach_function()

void blender::gpu::shader::parser::Scope::foreach_function ( std::function< void(bool is_static, Token type, Token name, Scope args, bool is_const, Scope body)> callback) const
inline

◆ foreach_match()

void blender::gpu::shader::parser::Scope::foreach_match ( const std::string & pattern,
std::function< void(const std::vector< Token >)> callback ) const
inline

◆ foreach_scope()

void blender::gpu::shader::parser::Scope::foreach_scope ( ScopeType type,
std::function< void(Scope)> callback ) const
inline

Definition at line 892 of file shader_parser.hh.

References data, from_position(), pos, scope(), and type().

◆ foreach_struct()

void blender::gpu::shader::parser::Scope::foreach_struct ( std::function< void(Token struct_tok, Token name, Scope body)> callback) const
inline

Definition at line 948 of file shader_parser.hh.

References foreach_match(), name, and scope().

◆ foreach_token()

void blender::gpu::shader::parser::Scope::foreach_token ( const TokenType token_type,
std::function< void(const Token)> callback ) const
inline

Definition at line 909 of file shader_parser.hh.

References foreach_match(), and str().

◆ from_position()

◆ invalid()

Scope blender::gpu::shader::parser::Scope::invalid ( )
inlinestatic

◆ is_invalid()

bool blender::gpu::shader::parser::Scope::is_invalid ( ) const
inline

Definition at line 782 of file shader_parser.hh.

References is_valid().

Referenced by str(), and str_exclusive().

◆ is_valid()

bool blender::gpu::shader::parser::Scope::is_valid ( ) const
inline

Definition at line 778 of file shader_parser.hh.

References data, and index.

Referenced by is_invalid().

◆ operator!=()

bool blender::gpu::shader::parser::Scope::operator!= ( const Scope & other) const
inline

Definition at line 968 of file shader_parser.hh.

◆ operator==()

bool blender::gpu::shader::parser::Scope::operator== ( const Scope & other) const
inline

Definition at line 964 of file shader_parser.hh.

References data, and index.

◆ operator[]()

Token blender::gpu::shader::parser::Scope::operator[] ( const int64_t index) const
inline

◆ range()

IndexRange blender::gpu::shader::parser::Scope::range ( ) const
inline

Definition at line 747 of file shader_parser.hh.

References data, and index.

Referenced by end(), find_token(), foreach_match(), operator[](), start(), and token_count().

◆ scope()

Scope blender::gpu::shader::parser::Scope::scope ( ) const
inline

◆ start()

◆ str()

std::string blender::gpu::shader::parser::Scope::str ( ) const
inline

Definition at line 796 of file shader_parser.hh.

References end(), is_invalid(), start(), and blender::gpu::shader::parser::ParserData::str.

Referenced by foreach_token().

◆ str_exclusive()

std::string blender::gpu::shader::parser::Scope::str_exclusive ( ) const
inline

◆ token_count()

size_t blender::gpu::shader::parser::Scope::token_count ( ) const
inline

Definition at line 757 of file shader_parser.hh.

References range(), and blender::gpu::shader::parser::IndexRange::size.

◆ type()

ScopeType blender::gpu::shader::parser::Scope::type ( ) const
inline

Member Data Documentation

◆ data

const ParserData* blender::gpu::shader::parser::Scope::data

◆ index

int64_t blender::gpu::shader::parser::Scope::index

Definition at line 724 of file shader_parser.hh.

Referenced by from_position(), is_valid(), operator==(), operator[](), range(), and type().

◆ str_view

std::string_view blender::gpu::shader::parser::Scope::str_view

Definition at line 721 of file shader_parser.hh.

◆ token_view

std::string_view blender::gpu::shader::parser::Scope::token_view

Definition at line 720 of file shader_parser.hh.


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