8 #include <catch2/catch_test_macros.hpp>
16 using namespace nmodl;
17 using namespace visitor;
18 using namespace test_utils;
34 return v.analyze(*ast);
41 EXTERNAL gbl_foo, param_bar
53 std::vector<std::string> actual;
54 for (
const auto&
var:
info.external_variables) {
55 actual.push_back(
var->get_name());
57 std::sort(actual.begin(), actual.end());
59 std::vector<std::string> expected{
"gbl_foo",
"param_bar"};
61 REQUIRE(actual == expected);
Helper visitor to gather AST information to help code generation.
Class that binds all pieces together for parsing nmodl file.
Concrete visitor for constructing symbol table from AST.
void visit_program(ast::Program &node) override
visit node of type ast::Program
Helper visitor to gather AST information to help code generation.
TEST_CASE("EXTERNAL variables")
CodegenInfo compute_code_info(const std::string &text)
AstNodeType
Enum type for every AST node type.
bool parse_string(const std::string &input)
parser Units provided as string (used for testing)
double var(InputIterator begin, InputIterator end)
encapsulates code generation backend implementations
Auto generated AST classes declaration.
Represent information collected from AST for code generation.
THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.
nmodl::parser::UnitDriver driver