NEURON
indexedname_visitor.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2023 Blue Brain Project, EPFL.
3  * See the top-level LICENSE file for details.
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
11 
12 namespace nmodl {
13 namespace visitor {
14 
17 }
18 
20  node.visit_children(*this);
21  const auto& bin_exp = std::static_pointer_cast<ast::BinaryExpression>(node.get_expression());
22  auto lhs = bin_exp->get_lhs();
23  auto rhs = bin_exp->get_rhs();
25 }
26 
28  node.visit_children(*this);
29 }
30 std::pair<std::string, std::unordered_set<std::string>> IndexedNameVisitor::get_dependencies() {
31  return dependencies;
32 }
34  return indexed_name;
35 }
36 
37 } // namespace visitor
38 } // namespace nmodl
Auto generated AST classes declaration.
Represents differential equation in DERIVATIVE block.
Represents specific element of an array variable.
Represents top level AST node for whole NMODL input.
Definition: program.hpp:39
void visit_program(ast::Program &node) override
visit node of type ast::Program
void visit_indexed_name(ast::IndexedName &node) override
Get node name with index for the IndexedName node.
std::pair< std::string, std::unordered_set< std::string > > get_dependencies()
get the attribute dependencies
std::string get_indexed_name()
get the attribute indexed_name
void visit_diff_eq_expression(ast::DiffEqExpression &node) override
Get dependencies for the DiffEqExpression node.
std::pair< std::string, std::unordered_set< std::string > > dependencies
Get node name with indexed for the IndexedName node and the dependencies of DiffEqExpression node.
#define rhs
Definition: lineq.h:6
encapsulates code generation backend implementations
Definition: ast_common.hpp:26
std::pair< std::string, std::unordered_set< std::string > > statement_dependencies(const std::shared_ptr< ast::Expression > &lhs, const std::shared_ptr< ast::Expression > &rhs)
If lhs and rhs combined represent an assignment (we assume to have an "=" in between them) we extract...
std::string get_indexed_name(const ast::IndexedName &node)
Given a Indexed node, return the name with index.
static Node * node(Object *)
Definition: netcvode.cpp:291
Utility functions for visitors implementation.