19 auto function_name =
node.get_node_name();
20 auto const& arguments =
node.get_arguments();
21 if (function_name ==
"nrn_ghk") {
28 if (arguments.size() == 4) {
29 auto new_arguments = arguments;
30 new_arguments.insert(new_arguments.end(),
31 std::make_shared<ast::Name>(std::make_shared<ast::String>(
38 auto const is_nt = [](
auto const& arg) {
41 auto const node_type = arg.get_node_type();
44 node_type == AstNodeType::CONSTANT_VAR || node_type == AstNodeType::VAR_NAME ||
45 node_type == AstNodeType::LOCAL_VAR) {
46 return arg.get_node_name() ==
"nt";
50 if (arguments.empty() || !is_nt(*arguments.front())) {
51 auto new_arguments = arguments;
52 new_arguments.insert(new_arguments.begin(), std::make_shared<ast::String>(
"nt"));
56 node.visit_children(*
this);
THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.
Auto generated AST classes declaration.
AstNodeType
Enum type for every AST node type.
Visitor for adding implicit arguments to [Core]NEURON functions.
void move(Item *q1, Item *q2, Item *q3)
static constexpr char CELSIUS_VARIABLE[]
global temperature variable
bool needs_neuron_thread_first_arg(const std::string &token)
Checks if token is one of the functions coming from NEURON/CoreNEURON and needs passing NrnThread* as...
encapsulates code generation backend implementations
static Node * node(Object *)
Auto generated AST classes declaration.
void visit_function_call(ast::FunctionCall &node) override
visit node of type ast::FunctionCall
Map different tokens from lexer to token types.