Go to the documentation of this file.
11 #ifndef SEAMS_DRIVER_H
12 #define SEAMS_DRIVER_H
23 #ifndef math_errhandling
24 #define math_errhandling MATH_ERRNO
29 #define isatty _isatty
38 std::vector<double>
data{};
68 double (*
fnctptr_ddddc)(double, double, double, double,
char *){
nullptr};
69 double (*
fnctptr_dddddd)(double, double, double, double, double, double){
nullptr};
72 const char *(*strfnct)(){
nullptr};
73 const char *(*strfnct_c)(
char *){
nullptr};
74 const char *(*strfnct_d)(double){
nullptr};
75 const char *(*strfnct_a)(
const array *){
nullptr};
76 const char *(*strfnct_dd)(double, double){
nullptr};
77 const char *(*strfnct_cc)(
char *,
char *){
nullptr};
78 const char *(*strfnct_ccc)(
char *,
char *,
char *){
nullptr};
79 const char *(*strfnct_dcc)(double,
char *,
char *){
nullptr};
80 const char *(*strfnct_dcccc)(double,
char *,
char *,
char *,
char *){
nullptr};
82 array *(*arrfnct_c)(
const char *){
nullptr};
83 array *(*arrfnct_cc)(
const char *,
const char *){
nullptr};
84 array *(*arrfnct_cd)(
const char *, double){
nullptr};
85 array *(*arrfnct_ddd)(double, double, double){
nullptr};
86 array *(*arrfnct_dd)(double, double){
nullptr};
87 array *(*arrfnct_d)(double){
nullptr};
94 symrec(
const char *my_name,
int my_type,
bool is_internal =
false)
101 symrec(
const std::string &my_name,
int my_type,
bool is_internal =
false)
137 file_rec(
const char *my_name,
int line_num,
bool is_temp,
int loop_cnt)
193 bool parse_stream(std::istream &in,
const std::string &in_name =
"stream input");
200 bool parse_string(
const std::string &input,
const std::string &sname =
"string stream");
207 bool parse_strings(
const std::vector<std::string> &input,
const std::string &sname);
228 void statistics(std::ostream *out =
nullptr)
const;
239 void add_variable(
const std::string &sym_name,
const std::string &sym_value,
240 bool immutable =
false,
bool internal =
false);
241 void add_variable(
const std::string &sym_name,
double sym_value,
bool immutable =
false,
242 bool internal =
false);
248 int set_option(
const std::string &option,
const std::string &optional_value = std::string(
""));
250 std::fstream *
open_file(
const std::string &file,
const char *mode);
251 std::fstream *
check_open_file(
const std::string &file,
const char *mode);
266 void error(
const std::string &msg,
bool line_info =
true,
bool prefix =
true)
const;
267 void warning(
const std::string &msg,
bool line_info =
true,
bool prefix =
true)
const;
268 void info(
const std::string &msg,
bool line_info =
false,
bool prefix =
true)
const;
274 void set_error_streams(std::ostream *c_error, std::ostream *c_warning, std::ostream *c_info);
276 void dumpsym(
const char *type,
bool doInternal)
const;
277 void dumpsym(
int type,
bool doInternal)
const;
278 void dumpsym(
int type,
const char *pre,
bool doInternal)
const;
319 void add_history(
const std::string &original,
const std::string &substitution);
330 #endif // SEAMS_DRIVER_H
Definition: apr_aprepro.cc:41
void warning(const std::string &msg, bool line_info=true, bool prefix=true) const
Definition: apr_aprepro.cc:186
void dumpsym(const char *type, bool doInternal) const
Definition: apr_aprepro.cc:671
const std::ostringstream & parsing_results() const
Definition: aprepro.h:182
bool parse_stream(std::istream &in, const std::string &in_name="stream input")
Definition: apr_aprepro.cc:87
bool one_based_index
Definition: aprepro.h:124
aprepro_options()=default
int parseErrorCount
Definition: aprepro.h:298
void clear_history()
Definition: apr_aprepro.cc:861
void error(const std::string &msg, bool line_info=true, bool prefix=true) const
Definition: apr_aprepro.cc:160
class Scanner * stringScanner
Definition: aprepro.h:289
std::string version() const
Definition: apr_aprepro.cc:79
std::ostream * infoStream
Definition: aprepro.h:272
void add_history(const std::string &original, const std::string &substitution)
Definition: apr_aprepro.cc:843
std::vector< symrec * > sym_table
Definition: aprepro.h:282
bool dumpvars
Definition: aprepro.h:120
Definition: aprepro.h:131
std::stack< std::ostream * > outputStream
Definition: aprepro.h:233
std::stack< file_rec > ap_file_list
Definition: aprepro.h:231
void info(const std::string &msg, bool line_info=false, bool prefix=true) const
Definition: apr_aprepro.cc:217
double(* fnctptr_c)(char *)
Definition: aprepro.h:59
int loop_count
Definition: aprepro.h:134
double(* fnctptr_cc)(char *, char *)
Definition: aprepro.h:62
bool isInternal
Definition: aprepro.h:53
struct SEAMS::symrec::value value
bool debugging
Definition: aprepro.h:119
class Scanner * lexer
Definition: aprepro.h:255
double(* fnctptr_dddd)(double, double, double, double)
Definition: aprepro.h:67
void clear_results()
Definition: apr_aprepro.cc:81
double var
Definition: aprepro.h:56
SEAMS::symrec * getsym(const char *sym_name) const
Definition: apr_aprepro.cc:658
bool end_on_exit
Definition: aprepro.h:114
int type
Definition: aprepro.h:52
int parseWarningCount
Definition: aprepro.h:299
std::string include_file
Definition: aprepro.h:113
int rows
Definition: aprepro.h:39
double(* fnctptr_ccd)(char *, char *, double)
Definition: aprepro.h:66
void set_error_streams(std::ostream *c_error, std::ostream *c_warning, std::ostream *c_info)
Definition: apr_aprepro.cc:246
bool inIfdefGetvar
Definition: aprepro.h:322
double(* fnctptr_dd)(double, double)
Definition: aprepro.h:63
double(* fnctptr_ccc)(char *, char *, char *)
Definition: aprepro.h:65
double(* fnctptr_cd)(char *, double)
Definition: aprepro.h:61
bool parse_string_interactive(const std::string &input)
Definition: apr_aprepro.cc:130
Definition: aprepro.h:111
bool stringInteractive
Definition: aprepro.h:288
int get_error_count() const
Definition: aprepro.h:258
~Aprepro()
Definition: apr_aprepro.cc:53
double(* fnctptr)()
Definition: aprepro.h:57
bool immutable
Definition: aprepro.h:122
int set_option(const std::string &option, const std::string &optional_value=std::string(""))
Definition: apr_aprepro.cc:385
double(* fnctptr_dc)(double, char *)
Definition: aprepro.h:60
symrec(const char *my_name, int my_type, bool is_internal=false)
Definition: aprepro.h:94
int lineno
Definition: aprepro.h:133
std::string svar
Definition: aprepro.h:71
void statistics(std::ostream *out=nullptr) const
Definition: apr_aprepro.cc:788
std::fstream * open_file(const std::string &file, const char *mode)
Definition: apr_aprepro.cc:268
std::string info
Definition: aprepro.h:51
bool tmp_file
Definition: aprepro.h:135
SEAMS::symrec * putsym(const std::string &sym_name, SYMBOL_TYPE sym_type, bool is_internal)
Definition: apr_aprepro.cc:322
bool keep_history
Definition: aprepro.h:125
std::ostream * errorStream
Definition: aprepro.h:292
bool interactive
Definition: aprepro.h:121
bool parse_string(const std::string &input, const std::string &sname="string stream")
Definition: apr_aprepro.cc:115
std::vector< history_data > history
Definition: aprepro.h:296
std::string include_path
Definition: aprepro.h:112
bool isCollectingLoop
Definition: aprepro.h:315
array(int r, int c)
Definition: aprepro.h:42
symrec(const std::string &my_name, int my_type, bool is_internal=false)
Definition: aprepro.h:101
std::string & comment()
Definition: apr_units.cc:23
void add_variable(const std::string &sym_name, const std::string &sym_value, bool immutable=false, bool internal=false)
Definition: apr_aprepro.cc:525
int cols
Definition: aprepro.h:40
double(* fnctptr_ddddc)(double, double, double, double, char *)
Definition: aprepro.h:68
bool state_is_immutable() const
Definition: aprepro.h:177
std::streampos index
Definition: aprepro.h:149
bool info_msg
Definition: aprepro.h:118
bool warning_msg
Definition: aprepro.h:117
bool errors_fatal
Definition: aprepro.h:115
std::string syntax
Definition: aprepro.h:50
bool parse_strings(const std::vector< std::string > &input, const std::string &sname)
Definition: apr_aprepro.cc:121
symrec * next
Definition: aprepro.h:92
bool parse_file(const std::string &filename)
Definition: apr_aprepro.cc:106
std::istringstream stringInput
Definition: aprepro.h:286
aprepro_options ap_options
Definition: aprepro.h:230
file_rec(const char *my_name, int line_num, bool is_temp, int loop_cnt)
Definition: aprepro.h:137
double(* fnctptr_d)(double)
Definition: aprepro.h:58
bool doLoopSubstitution
Definition: aprepro.h:306
Definition: aprepro.h:146
@ IMMUTABLE_STRING_VARIABLE
std::vector< double > data
Definition: aprepro.h:38
const std::vector< history_data > & get_history()
Definition: apr_aprepro.cc:859
std::fstream * check_open_file(const std::string &file, const char *mode)
Definition: apr_aprepro.cc:301
SYMBOL_TYPE
Definition: aprepro.h:165
std::string name
Definition: aprepro.h:49
std::ostringstream parsingResults
Definition: aprepro.h:283
bool doIncludeSubstitution
Definition: aprepro.h:311
bool errors_and_warnings_fatal
Definition: aprepro.h:116
double(* fnctptr_a)(const array *)
Definition: aprepro.h:70
void remove_variable(const std::string &sym_name)
Definition: apr_aprepro.cc:612
bool trace_parsing
Definition: aprepro.h:123
Definition: apr_scanner.h:35
double(* fnctptr_dddddd)(double, double, double, double, double, double)
Definition: aprepro.h:69
Definition: aprepro.h:159
array * avar
Definition: aprepro.h:81
std::vector< std::string > get_variable_names(bool doInternal=false)
Definition: apr_aprepro.cc:582
std::ostream * warningStream
Definition: aprepro.h:293
int get_warning_count() const
Definition: aprepro.h:262
Aprepro()
construct a new parser aprepro context
Definition: apr_aprepro.cc:45
std::string name
Definition: aprepro.h:132
bool string_interactive()
Definition: aprepro.h:219
bool stateImmutable
Definition: aprepro.h:302
std::string original
Definition: aprepro.h:147
std::string substitution
Definition: aprepro.h:148
double(* fnctptr_ddd)(double, double, double)
Definition: aprepro.h:64
void init_table(const char *comment)
Definition: apr_init.cc:365