Stan  2.14.0
probability, sampling & optimization
compiler.hpp
Go to the documentation of this file.
1 #ifndef STAN_LANG_COMPILER_HPP
2 #define STAN_LANG_COMPILER_HPP
3 
4 #include <stan/lang/ast.hpp>
6 #include <stan/lang/parser.hpp>
7 
8 #include <iostream>
9 #include <string>
10 
11 namespace stan {
12  namespace lang {
13 
29  bool compile(std::ostream* msgs,
30  std::istream& stan_lang_in,
31  std::ostream& cpp_out,
32  const std::string& model_name,
33  const bool allow_undefined = false) {
34  program prog;
35  bool parsed_ok = parse(msgs, stan_lang_in,
36  model_name, prog, allow_undefined);
37  if (!parsed_ok)
38  return false; // syntax error in program
39  generate_cpp(prog, model_name, cpp_out);
40  return true;
41  }
42 
43 
44  }
45 }
46 #endif
Probability, optimization and sampling library.
bool compile(std::ostream *msgs, std::istream &stan_lang_in, std::ostream &cpp_out, const std::string &model_name, const bool allow_undefined=false)
Read a Stan model specification from the specified input, parse it, and write the C++ code for it to ...
Definition: compiler.hpp:29
bool parse(std::ostream *output_stream, std::istream &input, const std::string &model_name, program &result, const bool allow_undefined=false)
Definition: parser.hpp:59
void generate_cpp(const program &prog, const std::string &model_name, std::ostream &out)
Definition: generator.hpp:4933
AST node for a complete Stan program.
Definition: program.hpp:17

     [ Stan Home Page ] © 2011–2016, Stan Development Team.