NEURON
verbatim_driver.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 #include <iostream>
11 
12 
13 namespace nmodl {
14 namespace parser {
15 
16 /**
17  * @addtogroup parser
18  * @{
19  */
20 
21 /**
22  * \class VerbatimDriver
23  * \brief Class that binds lexer and parser together for parsing VERBATIM block
24  */
26  protected:
27  void init_scanner();
29 
30  public:
31  void* scanner = nullptr;
32  std::istream* is = nullptr;
33  std::string* result = nullptr;
34 
35  VerbatimDriver(std::istream* is = &std::cin) {
36  init_scanner();
37  this->is = is;
38  }
39 
40  virtual ~VerbatimDriver() {
42  if (result) {
43  delete result;
44  }
45  }
46 };
47 
48 /** @} */ // end of parser
49 
50 } // namespace parser
51 } // namespace nmodl
52 
53 
Class that binds lexer and parser together for parsing VERBATIM block.
VerbatimDriver(std::istream *is=&std::cin)
encapsulates code generation backend implementations
Definition: ast_common.hpp:26
int Verbatim_parse(nmodl::parser::VerbatimDriver *)