|
Blender V5.3
|
#include <expression.hh>
Inherits blender::gpu::shader::parser::Parser< ExpressionLexer, NullParser >.
Public Member Functions | |
| int64_t | eval () const |
| Public Member Functions inherited from blender::gpu::shader::parser::Parser< ExpressionLexer, NullParser > | |
| void | lexical_analysis (std::string_view input) |
| void | semantic_analysis (ErrorHandler &err_handler) |
| Public Member Functions inherited from blender::gpu::shader::parser::ParserBase | |
| Token | operator[] (int i) const |
| void | build_scope_tree (ErrorHandler &err_handler) |
| void | build_token_to_scope_map () |
| void | parse_bsl (ErrorHandler &err_handler) |
| ast::LocalScope | root () const |
| void | print_ast () const |
| Public Member Functions inherited from blender::gpu::shader::parser::LexerBase | |
| std::string_view | token_types_str () const |
| void | identify_keywords () |
| void | identify_template_tokens () |
| void | reset_template_tokens () |
| Public Member Functions inherited from lexit::TokenBuffer | |
| TokenBuffer ()=default | |
| TokenBuffer (const std::string_view str, const CharClass char_class_table[128]) | |
| void | process (const std::string_view str, const CharClass char_class_table[128]) |
| void | clear () |
| Discard all currently held data. Does not reallocate. | |
| void | reserve (const uint32_t count) |
| Allocate backing memory for the given number of tokens and move currently held data. | |
| void | tokenize (const CharClass char_class_table[128]) |
| Tokenizes the input string by grouping contiguous characters of the same class. | |
| void | merge_complex_literals (bool bsl_template_angle_bracket_lexing=false) |
| Merge complex literals such as floats, strings and comments. | |
| void | atomize_words (IdentifierMap &identifiers, const KeywordTable &keywords) |
| Assign keyword types and atoms for a small set of identifier. | |
| void | compute_lengths () |
| Compute small token length for speeding up certain tasks. | |
| uint32_t | size () const |
| Return the amount of token inside the buffer. | |
| std::string_view | substr (const Token &start, const Token &end, const bool with_trailing_whitespaces=false) const |
| Return the substring between the start and end tokens (included). | |
| void | append (TokenType type, TokenAtom atom, int32_t str_size, int32_t str_size_with_witespaces) |
| Append a Token at the end of the buffer. | |
| Token | operator[] (int index) const |
| TokenMut | operator[] (int index) |
| TokenIt | begin () |
| TokenIt | end () |
| Token | front () |
| Token | back () |
Additional Inherited Members | |
| Public Attributes inherited from blender::gpu::shader::parser::ParserBase | |
| int | include_id = 0 |
| std::string_view | scope_types_str |
| std::vector< ScopeType > | scope_types |
| std::vector< IndexRange > | scope_ranges |
| std::vector< ScopeLinks > | scope_links |
| std::vector< int > | token_scope |
| std::vector< ast::NodeData > | ast_nodes |
| Public Attributes inherited from lexit::TokenBuffer | |
| std::string_view | str_ |
| AlignedArrayPtr< TokenType > | types_ |
| AlignedArrayPtr< uint32_t > | offsets_ |
| AlignedArrayPtr< uint32_t > | offsets_end_ |
| AlignedArrayPtr< uint8_t > | lengths_ |
| AlignedArrayPtr< TokenAtom > | atoms_ |
| uint32_t | size_ = 0 |
| uint32_t | allocated_size_ = 0 |
| Static Public Attributes inherited from blender::gpu::shader::parser::LexerBase | |
| static const std::array< CharClass, 128 > | bsl_char_class_table |
| static const std::array< CharClass, 128 > | default_char_class_table |
Simple expression parsing and evaluation. Will evaluate starting the given token until the end of the token stream. As this is supposed to be use for preprocessor directives, unknown identifiers (words) will evaluate to 0.
Definition at line 40 of file expression.hh.
|
inline |
Definition at line 42 of file expression.hh.
References blender::gpu::shader::metadata::assert, PrattParser< Derived, ResultT, NodeT >::expr(), lexit::Invalid, lexit::TokenBuffer::size_, and blender::v.