NEURON

Helper routines/types for code generation. More...

Classes

class  nmodl::codegen::IndexVariableInfo
 Helper to represent information about index/int variables. More...
 
class  nmodl::codegen::ShadowUseStatement
 Represents ion write statement during code generation. More...
 
class  nmodl::codegen::CodegenHelperVisitor
 Helper visitor to gather AST information to help code generation. More...
 
class  nmodl::codegen::Conductance
 Represent conductance statements used in mod file. More...
 
class  nmodl::codegen::Ion
 Represent ions used in mod file. More...
 
class  nmodl::codegen::IndexSemantics
 Represent semantic information for index variable. More...
 
class  nmodl::codegen::LongitudinalDiffusionInfo
 Information required to print LONGITUDINAL_DIFFUSION callbacks. More...
 
class  nmodl::codegen::CodegenInfo
 Represent information collected from AST for code generation. More...
 
class  nmodl::CodegenTransformVisitor
 Visitor to make last transformation to AST before codegen. More...
 

Enumerations

enum class  nmodl::codegen::BlockType {
  nmodl::codegen::Initial , nmodl::codegen::Constructor , nmodl::codegen::Destructor , nmodl::codegen::Equation ,
  nmodl::codegen::State , nmodl::codegen::Watch , nmodl::codegen::NetReceive , nmodl::codegen::BeforeAfter ,
  nmodl::codegen::BlockTypeEnd
}
 Helper to represent various block types. More...
 
enum class  nmodl::codegen::MemberType { nmodl::codegen::index , nmodl::codegen::range , nmodl::codegen::global , nmodl::codegen::thread }
 Helper to represent various variables types. More...
 
enum class  nmodl::codegen::CppObjectSpecifier {
  nmodl::codegen::Inline , nmodl::codegen::Static , nmodl::codegen::Virtual , nmodl::codegen::Explicit ,
  nmodl::codegen::Friend , nmodl::codegen::Constexpr , nmodl::codegen::Extern , nmodl::codegen::ExternC ,
  nmodl::codegen::ThreadLocal , nmodl::codegen::Const , nmodl::codegen::Volatile
}
 various specifiers (mostly for function codegen) More...
 

Functions

std::string nmodl::codegen::get_name (ast::Ast const *sym)
 
std::string nmodl::codegen::get_name (const std::shared_ptr< symtab::Symbol > &sym)
 
std::string nmodl::codegen::get_name (const IndexVariableInfo &var)
 
template<class T >
int nmodl::codegen::get_index_from_name (const std::vector< T > &variables, const std::string &name)
 
int nmodl::codegen::get_length (const std::shared_ptr< symtab::Symbol > &sym)
 
int nmodl::codegen::get_length (const IndexVariableInfo &var)
 
template<class T >
int nmodl::codegen::get_prefixsum_from_name (const std::vector< T > &variables, const std::string &name)
 

Detailed Description

Helper routines/types for code generation.

Enumeration Type Documentation

◆ BlockType

Helper to represent various block types.

Note: do not assign integers to these enums

Enumerator
Initial 

initial block

Constructor 

constructor block

Destructor 

destructor block

Equation 

breakpoint block

State 

derivative block

Watch 

watch block

NetReceive 

net_receive block

BeforeAfter 

before / after block

BlockTypeEnd 

fake ending block type for loops on the enums. Keep it at the end

Definition at line 56 of file codegen_cpp_visitor.hpp.

◆ CppObjectSpecifier

various specifiers (mostly for function codegen)

Enumerator
Inline 
Static 
Virtual 
Explicit 
Friend 
Constexpr 
Extern 
ExternC 
ThreadLocal 
Const 
Volatile 

Definition at line 107 of file codegen_cpp_visitor.hpp.

◆ MemberType

Helper to represent various variables types.

Enumerator
index 

index / int variables

range 

range / double variables

global 

global variables

thread 

thread variables

Definition at line 91 of file codegen_cpp_visitor.hpp.

Function Documentation

◆ get_index_from_name()

template<class T >
int nmodl::codegen::get_index_from_name ( const std::vector< T > &  variables,
const std::string &  name 
)

Definition at line 185 of file codegen_cpp_visitor.hpp.

◆ get_length() [1/2]

int nmodl::codegen::get_length ( const IndexVariableInfo var)
inline

Definition at line 201 of file codegen_cpp_visitor.hpp.

◆ get_length() [2/2]

int nmodl::codegen::get_length ( const std::shared_ptr< symtab::Symbol > &  sym)
inline

Definition at line 197 of file codegen_cpp_visitor.hpp.

◆ get_name() [1/3]

std::string nmodl::codegen::get_name ( ast::Ast const *  sym)
inline

Definition at line 172 of file codegen_cpp_visitor.hpp.

◆ get_name() [2/3]

std::string nmodl::codegen::get_name ( const IndexVariableInfo var)
inline

Definition at line 180 of file codegen_cpp_visitor.hpp.

◆ get_name() [3/3]

std::string nmodl::codegen::get_name ( const std::shared_ptr< symtab::Symbol > &  sym)
inline

Definition at line 176 of file codegen_cpp_visitor.hpp.

◆ get_prefixsum_from_name()

template<class T >
int nmodl::codegen::get_prefixsum_from_name ( const std::vector< T > &  variables,
const std::string &  name 
)

Definition at line 206 of file codegen_cpp_visitor.hpp.