Stan  2.10.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 
28  bool compile(std::ostream* msgs,
29  std::istream& stan_lang_in,
30  std::ostream& cpp_out,
31  const std::string& model_name) {
32  program prog;
33  bool parsed_ok = parse(msgs, stan_lang_in,
34  model_name, prog);
35  if (!parsed_ok)
36  return false; // syntax error in program
37  generate_cpp(prog, model_name, cpp_out);
38  return true;
39  }
40 
41 
42  }
43 }
44 #endif
bool compile(std::ostream *msgs, std::istream &stan_lang_in, std::ostream &cpp_out, const std::string &model_name)
Read a Stan model specification from the specified input, parse it, and write the C++ code for it to ...
Definition: compiler.hpp:28
Probability, optimization and sampling library.
void generate_cpp(const program &prog, const std::string &model_name, std::ostream &out)
Definition: generator.hpp:4764
bool parse(std::ostream *output_stream, std::istream &input, const std::string &model_name, program &result)
Definition: parser.hpp:59

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