User Guide

Code generation backends for CoreNEURON. More...

Detailed Description

Code generation backends for CoreNEURON.

Code generation backends for NEURON.

Classes

class  nmodl::codegen::CodegenAccVisitor
 Visitor for printing C++ code with OpenACC backend More...
 
class  nmodl::codegen::CodegenCompatibilityVisitor
 Visitor for printing compatibility issues of the mod file More...
 
class  nmodl::codegen::CodegenCoreneuronCppVisitor
 Visitor for printing C++ code compatible with legacy api of CoreNEURON More...
 
class  nmodl::codegen::CodegenCppVisitor
 Visitor for printing C++ code compatible with legacy api of CoreNEURON More...
 
class  nmodl::codegen::CodegenNeuronCppVisitor
 Visitor for printing C++ code compatible with legacy api of NEURON More...
 

Functions

template<typename T >
void nmodl::codegen::CodegenCoreneuronCppVisitor::print_function_declaration (const T &node, const std::string &name)
 Print prototype declarations of functions or procedures. More...
 
template<typename T >
void nmodl::codegen::CodegenCppVisitor::print_vector_elements (const std::vector< T > &elements, const std::string &separator, const std::string &prefix="")
 Print the items in a vector as a list. More...
 
template<typename T >
void nmodl::codegen::CodegenNeuronCppVisitor::print_function_declaration (const T &node, const std::string &name)
 Print prototype declarations of functions or procedures. More...
 

Function Documentation

◆ print_function_declaration() [1/2]

template<typename T >
void nmodl::codegen::CodegenNeuronCppVisitor::print_function_declaration ( const T &  node,
const std::string &  name 
)
protected

Print prototype declarations of functions or procedures.

Template Parameters
TThe AST node type of the node (must be of nmodl::ast::Ast or subclass)
Parameters
nodeThe AST node representing the function or procedure block
nameA user defined name for the function

If there is an argument with name (say alpha) same as range variable (say alpha), we want to avoid it being printed as instance->alpha. And hence we disable variable name lookup during prototype declaration. Note that the name of procedure can be different in case of table statement.

TODO: Edit for NEURON

Definition at line 682 of file codegen_neuron_cpp_visitor.hpp.

◆ print_function_declaration() [2/2]

template<typename T >
void nmodl::codegen::CodegenCoreneuronCppVisitor::print_function_declaration ( const T &  node,
const std::string &  name 
)
protected

Print prototype declarations of functions or procedures.

Template Parameters
TThe AST node type of the node (must be of nmodl::ast::Ast or subclass)
Parameters
nodeThe AST node representing the function or procedure block
nameA user defined name for the function

If there is an argument with name (say alpha) same as range variable (say alpha), we want to avoid it being printed as instance->alpha. And hence we disable variable name lookup during prototype declaration. Note that the name of procedure can be different in case of table statement.

Definition at line 1132 of file codegen_coreneuron_cpp_visitor.hpp.

◆ print_vector_elements()

template<typename T >
void nmodl::codegen::CodegenCppVisitor::print_vector_elements ( const std::vector< T > &  elements,
const std::string &  separator,
const std::string &  prefix = "" 
)
protected

Print the items in a vector as a list.

This function prints a given vector of elements as a list with given separator onto the current printer. Elements are expected to be of type nmodl::ast::Ast and are printed by being visited. Care is taken to omit the separator after the the last element.

Template Parameters
TThe element type in the vector, which must be of type nmodl::ast::Ast
Parameters
elementsThe vector of elements to be printed
separatorThe separator string to print between all elements
prefixA prefix string to print before each element

Definition at line 1350 of file codegen_cpp_visitor.hpp.