176 if (new_order >
order) {
186 value = std::make_shared<double>(val);
219 const std::shared_ptr<double>&
get_value() const noexcept {
247 const std::vector<ast::Ast*>&
get_nodes() const noexcept {
252 std::initializer_list<ast::AstNodeType> l)
const noexcept;
290 return static_cast<bool>(
properties & new_properties);
295 return ((
properties & new_properties) == new_properties);
300 return static_cast<bool>(
status & new_status);
305 return ((
status & new_status) == new_status);
THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.
Represent token returned by scanner.
Represent symbol in symbol table.
void set_order(int new_order) noexcept
Set order in case of prime/state variable.
syminfo::NmodlType properties
properties of symbol as a result of usage across whole mod file
void set_value(double val)
int get_write_count() const noexcept
Symbol(std::string name, ModToken token)
bool has_any_status(syminfo::Status new_status) const noexcept
check if symbol has any of the status
int write_count
number of times symbol is written
void mark_localized() noexcept
mark symbol as localized (e.g. from RANGE to LOCAL conversion)
int order
order in case of state / prime variable
int length
dimension/length in case of array variable
int id
unique id or index position when symbol is inserted into specific table
void add_node(ast::Ast *node) noexcept
void mark_created() noexcept
mark symbol as newly created (in case of new variable)
int definition_order
order in which symbol appears in the mod file Different variables appear in different blocks (NEURON,...
bool is_array() const noexcept
void set_as_array(int len) noexcept
Symbol(std::string name, ast::Ast *node, ModToken token)
ModToken token
token associated with symbol (from node)
std::shared_ptr< double > value
associated value in case of parameters, constant variable
void set_original_name(const std::string &new_name)
void created_from_state() noexcept
mark symbol as newly created variable for the STATE variable this is used with legacy euler/derivimpl...
void mark_thread_safe() noexcept
const ModToken & get_token() const noexcept
void add_property(syminfo::NmodlType property) noexcept
add new property to symbol
bool has_all_properties(syminfo::NmodlType new_properties) const noexcept
check if symbol has all of the given properties
bool has_all_status(syminfo::Status new_status) const noexcept
check if symbol has all of the status
const std::shared_ptr< double > & get_value() const noexcept
void read() noexcept
increment read count
bool is_writable() const noexcept
void set_scope(const std::string &s)
void set_definition_order(int order) noexcept
const std::vector< ast::Ast * > & get_nodes() const noexcept
const syminfo::Status & get_status() const noexcept
syminfo::Status status
status of symbol after processing through various passes
std::string to_string() const
void add_properties(syminfo::NmodlType new_properties) noexcept
add new properties to symbol
bool array
true if symbol represent array variable
void mark_inlined() noexcept
mark symbol as inlined (in case of procedure/function)
int read_count
number of times symbol is read
Symbol(std::string name, ast::Ast *node)
void set_num_values(int n) noexcept
std::string renamed_from
original name of the symbol if renamed
std::vector< ast::Ast * > nodes
All given AST nodes for this symbol.
int get_num_values() const noexcept
const std::string & get_scope() const noexcept
void mark_renamed() noexcept
bool has_any_property(syminfo::NmodlType new_properties) const noexcept
check if symbol has any of the given property
void set_id(int i) noexcept
const syminfo::NmodlType & get_properties() const noexcept
int get_definition_order() const noexcept
int get_length() const noexcept
int get_id() const noexcept
int num_values
number of values that variable can take in case of table variable
bool is_external_variable() const noexcept
Check if symbol represent an external variable.
int get_read_count() const noexcept
std::string scope
scope of the symbol (nmodl block name where it appears)
std::string name
name of the symbol
const std::string & get_name() const noexcept
bool is_variable() const noexcept
check if symbol is a variable in nmodl
void set_name(const std::string &new_name)
Set new name for the symbol.
std::vector< ast::Ast * > get_nodes_by_type(std::initializer_list< ast::AstNodeType > l) const noexcept
void write() noexcept
increment write count
void remove_property(syminfo::NmodlType property)
remove property from symbol
const std::string & get_original_name() const noexcept
void move(Item *q1, Item *q2, Item *q3)
Status
state during various compiler passes
@ from_state
derived from state
@ thread_safe
variable marked as thread safe
@ localized
converted to local
NmodlType
NMODL variable properties.
@ state_var
state variable
@ extern_neuron_variable
neuron variable accessible in mod file
@ write_ion_var
Write Ion.
@ range_var
Range Variable.
@ extern_method
neuron solver methods and math functions
@ assigned_definition
Assigned Definition.
encapsulates code generation backend implementations
static Node * node(Object *)
int const size_t const size_t n
Base class for all Abstract Syntax Tree node types.
Implement various classes to represent various Symbol properties.