#include <stan/version.hpp>
#include <stan/lang/compiler.hpp>
#include <stan/lang/compile_functions.hpp>
#include <stan/io/cmd_line.hpp>
#include <exception>
#include <fstream>
#include <iostream>
#include <stdexcept>
#include <string>
#include <vector>
Go to the source code of this file.
Functions | |
void | print_version (std::ostream *out_stream) |
void | print_stanc_help (std::ostream *out_stream) |
void | delete_file (std::ostream *err_stream, const std::string &file_name) |
std::string | identifier_from_file_name (const std::string &in_file_name) |
bool | has_extension (const std::string &file_name, const std::string &extension) |
void | check_identifier (const std::string &identifier, const std::string &identifier_type) |
int | stanc_helper (int argc, const char *argv[], std::ostream *out_stream, std::ostream *err_stream) |
|
inline |
Test whether a given string is a valid C++ identifier and throw an exception when it is not.
[in] | identifier | the identifier to be checked |
[in] | identifier_type | the type of the identifier to be reported in error messages |
Definition at line 148 of file stanc_helper.hpp.
References stan::math::invalid_argument(), lem_server::msg, and string.
Referenced by stanc_helper().
|
inline |
Delte the file at the specified path, writing messages to error stream if not possible. Do nothing on zero size file name input. Only write to error stream if it is non-null.
[in,out] | err_stream | stream to which error messages are written |
[in] | file_name | path of file |
Definition at line 78 of file stanc_helper.hpp.
References allTimeWatchdog::endl, and makeTestPickles::return_code.
Referenced by stanc_helper(), and TEST().
|
inline |
Check whether a given file has the specified extension.
[in] | file_name | The name of the file |
[in] | extension | The extension (WITHOUT dot)- e.g. "stan". |
Definition at line 127 of file stanc_helper.hpp.
Referenced by stanc_helper().
|
inline |
Transform a provided input file name into a valid C++ identifier
[in] | in_file_name | the name of the input file |
Definition at line 94 of file stanc_helper.hpp.
References fillBadChanDBTables::result, and string.
Referenced by stanc_helper().
|
inline |
Prints the Stan compiler (stanc) help.
[in,out] | out_stream | stream to which help is written |
Definition at line 37 of file stanc_helper.hpp.
References allTimeWatchdog::endl, stan::io::print_help_option(), and print_version().
Referenced by stanc_helper(), and TEST().
|
inline |
Print the version of stanc with major, minor and patch.
[in,out] | out_stream | stream to which version is written. |
Definition at line 21 of file stanc_helper.hpp.
References allTimeWatchdog::endl, stan::MAJOR_VERSION, stan::MINOR_VERSION, and stan::PATCH_VERSION.
Referenced by print_stanc_help(), stanc_helper(), and TEST().
|
inline |
Invoke the stanc command on the specified argument list, writing output and error messages to the specified streams, return a return code.
The return codes are: 0 for success, -1 for an exception, -2 is parsing failed, and -3 if there are invalid arguments.
[in] | argc | number of arguments |
[in] | argv | arguments |
[in,out] | out_stream | stream to which output is written |
[in,out] | err_stream | stream to which error messages are written |
Definition at line 180 of file stanc_helper.hpp.
References ana::assert(), stan::io::cmd_line::bare(), stan::io::cmd_line::bare_size(), check_identifier(), run_hadd::cmd, stan::lang::compile(), stan::lang::compile_functions(), delete_file(), e, allTimeWatchdog::endl, has_extension(), stan::io::cmd_line::has_flag(), stan::io::cmd_line::has_key(), identifier_from_file_name(), in, stan::math::invalid_argument(), lem_server::msg, ns, confusionMatrixTree::out, print_stanc_help(), print_version(), string, and stan::io::cmd_line::val().
Referenced by main(), run_helper(), and TEST().