|
Blender V5.3
|
#include <scope.hh>
Public Member Functions | |
| Scope ()=delete | |
| Scope (const ParserBase &parser, int64_t index) | |
| Scope (const ParserBase &parser) | |
| bool | is_valid () const |
| bool | is_invalid () const |
| Token | operator[] (int i) |
| Token | front () const |
| Token | back () const |
| IndexRange | range () const |
| Token | operator[] (const int64_t index) const |
| size_t | token_count () const |
| ScopeType | type () const |
| void | set_type (ScopeType type) |
| Scope | scope () const |
| Scope | parent () const |
| Scope | prev_neighbor () const |
| Scope | next_neighbor () const |
| Scope | child_first () const |
| Scope | prev () const |
| Scope | next () const |
| bool | contains (const Scope sub) const |
| bool | contains (const std::string &str) const |
| std::string_view | str_with_whitespace () const |
| std::string_view | str () const |
| std::string_view | str_exclusive () const |
| Token | find_token (const char token_type) const |
| bool | contains_token (const char token_type) const |
| Scope | first_scope_of_type (const ScopeType type) const |
| template<bool include_preprocessor = false, typename CallbackFn> | |
| void | foreach_match (const std::string &pattern, CallbackFn callback) const |
| template<typename CallbackFn> | |
| void | foreach_scope (ScopeType type, CallbackFn callback) const |
| template<typename CallbackFn> | |
| void | foreach_attribute (CallbackFn callback) const |
| template<typename Callback> | |
| void | foreach_token (const TokenType token_type, Callback callback) const |
| template<typename Callback> | |
| void | foreach_function (Callback callback) const |
| template<typename Callback> | |
| void | foreach_struct (Callback callback) const |
| template<typename Callback> | |
| void | foreach_declaration (Callback callback) const |
| bool | operator== (const Scope &other) const |
| bool | operator!= (const Scope &other) const |
Public Attributes | |
| friend | ScopeParser |
|
delete |
Referenced by child_first(), contains(), first_scope_of_type(), foreach_attribute(), foreach_declaration(), foreach_scope(), foreach_struct(), next(), next_neighbor(), operator!=(), blender::gpu::shader::parser::IntermediateForm< parser::FullLexer, parser::FullParser >::operator()(), operator==(), parent(), prev(), prev_neighbor(), Scope(), and scope().
|
inline |
|
inline |
|
inline |
Definition at line 75 of file scope.hh.
References is_invalid(), range(), and lexit::Token::Token().
Referenced by blender::gpu::shader::parser::MutableString::erase_try(), blender::gpu::shader::SourceProcessor::guarded_scope_mutation(), blender::gpu::shader::lower_namespace(), next(), blender::gpu::shader::parser::MutableString::replace(), scope(), str(), str_exclusive(), and str_with_whitespace().
|
inline |
Definition at line 149 of file scope.hh.
References is_invalid(), and Scope().
|
inline |
|
inline |
|
inline |
Definition at line 221 of file scope.hh.
References find_token(), and lexit::Token::is_valid().
|
inline |
Definition at line 212 of file scope.hh.
References is_invalid(), range(), and lexit::Token::Token().
Referenced by contains_token().
|
inline |
Will iterate over all the attribute if this scope is an ScopeType::Attributes. Callback should have this signature void(Token attribute_name, Scope attribute_parameters).
Definition at line 367 of file scope.hh.
References blender::gpu::shader::metadata::assert, blender::gpu::shader::parser::Attribute, blender::gpu::shader::parser::Attributes, foreach_scope(), Scope(), scope(), and type().
|
inline |
Run a callback for all the variable declarations (without assignment) that are direct children Callback should have this signature void(Scope attributes, Token const_tok, Token type, Scope template_scope, Token name, Scope array, Token decl_end).
Definition at line 467 of file scope.hh.
References blender::gpu::shader::parser::Attributes, foreach_match(), lexit::Token::is_valid(), lexit::Token::prev(), Scope(), scope(), and type().
|
inline |
Run a callback for all the function scopes that are direct children of this scope. Callback should have this signature void(bool is_static, Token type, Token name, Scope args, bool is_const, Scope body).
Definition at line 399 of file scope.hh.
References lexit::Const, foreach_match(), scope(), and lexit::Static.
|
inline |
Small pattern matching engine.
If include_preprocessor is true, try to match any token. Otherwise ignore tokens in preprocessor scopes.
Callback should have this signature void(const std::vector<Token>).
Definition at line 255 of file scope.hh.
References blender::gpu::shader::metadata::assert, is_invalid(), blender::gpu::shader::parser::Preprocessor, range(), scope(), blender::gpu::shader::parser::IndexRange::start, lexit::Token::Token(), and type().
Referenced by foreach_declaration(), foreach_function(), foreach_struct(), blender::gpu::shader::lower_namespace(), and blender::gpu::shader::parse_template_definition_args().
|
inline |
Will iterate over all the scopes that are direct children. Callback should have this signature void(Scope).
Definition at line 339 of file scope.hh.
References blender::gpu::shader::metadata::assert, front(), blender::gpu::shader::parser::Global, lexit::Token::index_, is_invalid(), Scope(), scope(), and type().
Referenced by foreach_attribute(), blender::gpu::shader::lower_namespace(), and blender::gpu::shader::SourceProcessor::template_arguments_mangle().
|
inline |
Run a callback for all the struct scopes that are direct children of this scope. Callback should have this signature void(Token struct_tok, Scope attributes, Token name, Scope body).
Definition at line 440 of file scope.hh.
References foreach_match(), Scope(), and scope().
|
inline |
Will iterate over all tokens of the scope (and its contained scopes). Callback should have this signature void(Token).
Definition at line 380 of file scope.hh.
References blender::gpu::shader::parser::IndexRange::size, blender::gpu::shader::parser::IndexRange::start, and lexit::Token::Token().
Referenced by blender::gpu::shader::lower_namespace().
|
inline |
Definition at line 69 of file scope.hh.
References is_invalid(), range(), and lexit::Token::Token().
Referenced by blender::gpu::shader::parser::MutableString::erase_try(), foreach_scope(), blender::gpu::shader::get_prefix(), blender::gpu::shader::SourceProcessor::guarded_scope_mutation(), blender::gpu::shader::lower_namespace(), blender::gpu::shader::parse_template_definition_args(), prev(), blender::gpu::shader::parser::MutableString::replace(), scope(), str(), str_exclusive(), and str_with_whitespace().
|
inline |
Definition at line 58 of file scope.hh.
Referenced by back(), child_first(), find_token(), foreach_match(), foreach_scope(), front(), next(), next_neighbor(), operator[](), parent(), prev(), prev_neighbor(), range(), scope(), str(), str_exclusive(), str_with_whitespace(), token_count(), and type().
|
inline |
Definition at line 54 of file scope.hh.
Referenced by blender::gpu::shader::lower_namespace().
|
inline |
Definition at line 166 of file scope.hh.
References back(), is_invalid(), lexit::Token::next(), and Scope().
Referenced by str_exclusive().
|
inline |
Definition at line 141 of file scope.hh.
References is_invalid(), and Scope().
|
inline |
|
inline |
Definition at line 85 of file scope.hh.
References range(), and lexit::Token::Token().
|
inline |
Definition at line 63 of file scope.hh.
References is_invalid(), range(), and lexit::Token::Token().
|
inline |
Definition at line 125 of file scope.hh.
References is_invalid(), and Scope().
Referenced by contains().
|
inline |
Definition at line 159 of file scope.hh.
References front(), is_invalid(), lexit::Token::prev(), and Scope().
Referenced by scope(), and str_exclusive().
|
inline |
Definition at line 133 of file scope.hh.
References is_invalid(), and Scope().
|
inline |
Definition at line 80 of file scope.hh.
References blender::IndexRange::IndexRange(), and is_invalid().
Referenced by back(), find_token(), foreach_match(), front(), operator[](), operator[](), and token_count().
|
inline |
Definition at line 108 of file scope.hh.
References back(), front(), is_invalid(), prev(), Scope(), and scope().
Referenced by contains(), first_scope_of_type(), foreach_attribute(), foreach_declaration(), foreach_function(), foreach_match(), foreach_scope(), foreach_struct(), blender::gpu::shader::get_prefix(), and scope().
|
inline |
|
inline |
Definition at line 194 of file scope.hh.
References back(), front(), and is_invalid().
Referenced by contains(), and blender::gpu::shader::SourceProcessor::template_arguments_mangle().
|
inline |
Definition at line 203 of file scope.hh.
References back(), front(), is_invalid(), next(), prev(), and token_count().
|
inline |
Definition at line 186 of file scope.hh.
References back(), front(), and is_invalid().
|
inline |
Definition at line 90 of file scope.hh.
References is_invalid(), range(), and blender::gpu::shader::parser::IndexRange::size.
Referenced by str_exclusive().
|
inline |
Definition at line 95 of file scope.hh.
References blender::gpu::shader::parser::Invalid, and is_invalid().
Referenced by contains(), first_scope_of_type(), foreach_attribute(), foreach_declaration(), foreach_match(), foreach_scope(), blender::gpu::shader::get_prefix(), and set_type().