User Guide
token_mapping.hpp
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 
8 #pragma once
9 
10 /**
11  * \file token_mapping.hpp
12  * \brief Map different tokens from lexer to token types
13  */
14 
15 #include <string>
16 
17 #include "parser/nmodl/nmodl_parser.hpp"
18 
19 namespace nmodl {
20 
21 bool is_keyword(const std::string& name);
22 bool is_method(const std::string& name);
23 
24 parser::NmodlParser::token_type token_type(const std::string& name);
25 std::vector<std::string> get_external_variables();
26 std::vector<std::string> get_external_functions();
27 
28 namespace details {
29 
30 bool needs_neuron_thread_first_arg(const std::string& token);
31 
32 } // namespace details
33 
34 } // namespace nmodl
nmodl::get_external_functions
std::vector< std::string > get_external_functions()
Return functions that can be used in the NMODL.
Definition: token_mapping.cpp:308
nmodl::details::needs_neuron_thread_first_arg
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...
Definition: token_mapping.cpp:235
nmodl
encapsulates code generation backend implementations
Definition: ast_common.hpp:26
nmodl::is_method
bool is_method(const std::string &name)
Check if given name is an integration method in NMODL.
Definition: token_mapping.cpp:274
nmodl::is_keyword
bool is_keyword(const std::string &name)
Check if given name is a keyword in NMODL.
Definition: token_mapping.cpp:264
nmodl::token_type
TokenType token_type(const std::string &name)
Return token type for given token name.
Definition: token_mapping.cpp:284
nmodl::get_external_variables
std::vector< std::string > get_external_variables()
Return variables declared in NEURON that are available to NMODL.
Definition: token_mapping.cpp:299