Formula Tokens
-
struct formula_token
Represents a single formula token.
Public Types
-
using value_type = std::variant<address_t, range_t, table_t, formula_function_t, double, string_id_t, std::string>
Public Functions
-
formula_token() = delete
-
formula_token(const address_t &addr)
Constructor for a single-cell reference token. The opcode will be implicitly set to fop_single_ref.
- Parameters:
addr – single-cell reference.
-
formula_token(const range_t &range)
Constructor for a range reference token. The opcode will be implicitly set to fop_range_ref.
- Parameters:
range – range reference.
-
formula_token(const table_t &table)
Constructor for a table reference token. The opcode will be implicitly set to fop_table_ref.
- Parameters:
table – table reference.
-
formula_token(formula_function_t func)
Constructor for a formula function token. The opcode will be implicitly set to fop_function.
- Parameters:
func – function name enum value.
-
formula_token(double v)
Constructor for a numeric value token. The opcode will be implicitly set to fop_value.
- Parameters:
v – numeric value to be stored in the token.
-
formula_token(string_id_t sid)
Constructor for a string value token. The opcode will be implicitly set to fop_string.
- Parameters:
sid – string ID to be stored in the token.
-
formula_token(std::string name)
Constructor for a named-expression token. The opcode will be implicitly set to fop_named_expression.
- Parameters:
name – named expression to be stored in the token.
-
formula_token(const formula_token &r)
Copy constructor.
-
formula_token(formula_token &&r)
Move constructor.
Note
This will be the same as the copy constructor if the stored value is not movable.
-
~formula_token()
-
bool operator==(const formula_token &r) const
-
bool operator!=(const formula_token &r) const
Public Members
-
const fopcode_t opcode
Opcode that specifies the type of token. The value of this data member should not be modified after construction.
-
value_type value
Value stored in the token. The type of this value varies depending on the token opcode value.
-
using value_type = std::variant<address_t, range_t, table_t, formula_function_t, double, string_id_t, std::string>
-
class formula_tokens_store
Storage for a series of formula tokens.
Public Functions
-
~formula_tokens_store()
-
formula_tokens_store(const formula_tokens_store&) = delete
-
formula_tokens_store &operator=(const formula_tokens_store&) = delete
-
size_t get_reference_count() const
-
formula_tokens_t &get()
-
const formula_tokens_t &get() const
Public Static Functions
-
static formula_tokens_store_ptr_t create()
-
~formula_tokens_store()
-
struct named_expression_t
Represents a named expression which stores a series of formula tokens.
Public Functions
-
named_expression_t()
-
named_expression_t(const abs_address_t &_origin, formula_tokens_t _tokens)
-
named_expression_t(const named_expression_t&) = delete
-
named_expression_t(named_expression_t &&other)
-
~named_expression_t()
Public Members
-
abs_address_t origin
Origin cell position which affects any relative references stored in the named expression.
-
formula_tokens_t tokens
Formula tokens.
-
named_expression_t()