23#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || \
24 defined(__MINGW32__) || defined(_WIN64) || defined(__MINGW64__)
68 file_rec(
const char *my_name,
int line_num,
bool is_temp,
int loop_cnt)
120 static const std::string &
version();
133 bool parse_stream(std::istream &in,
const std::string &in_name =
"stream input");
140 bool parse_string(
const std::string &input,
const std::string &sname =
"string stream");
147 bool parse_strings(
const std::vector<std::string> &input,
const std::string &sname);
168 void statistics(std::ostream *out =
nullptr)
const;
180 void add_variable(
const std::string &sym_name,
const std::string &sym_value,
181 bool immutable =
false,
bool internal =
false);
182 void add_variable(
const std::string &sym_name,
double sym_value,
bool immutable =
false,
183 bool internal =
false);
189 int set_option(
const std::string &option,
const std::string &optional_value = std::string(
""));
191 std::fstream *
open_file(
const std::string &file,
const char *mode);
192 std::fstream *
check_open_file(
const std::string &file,
const char *mode);
207 void error(
const std::string &msg,
bool line_info =
true,
bool prefix =
true)
const;
208 void warning(
const std::string &msg,
bool line_info =
true,
bool prefix =
true)
const;
209 void info(
const std::string &msg,
bool line_info =
false,
bool prefix =
true)
const;
216 void set_error_streams(std::ostream *c_error, std::ostream *c_warning, std::ostream *c_info);
217 void set_error_streams(std::ostream *c_error, std::ostream *c_warning, std::ostream *c_info,
218 bool close_error,
bool close_warning,
bool close_info);
220 void dumpsym(
const char *type,
bool doInternal)
const;
221 void dumpsym(
int type,
bool doInternal)
const;
223 void dumpsym(
int type,
const char *pre,
bool doInternal)
const;
275 void add_history(
const std::string &original,
const std::string &substitution);
bool closeError
Definition aprepro.h:245
bool closeWarning
Definition aprepro.h:246
std::unique_ptr< Symtable > sym_table
Definition aprepro.h:230
void error(const std::string &msg, bool line_info=true, bool prefix=true) const
Definition apr_aprepro.cc:223
~Aprepro()
Definition apr_aprepro.cc:101
class Scanner * lexer
Definition aprepro.h:196
std::string long_version() const
Definition apr_aprepro.cc:138
std::stack< file_rec > ap_file_list
Definition aprepro.h:171
bool stringInteractive
Definition aprepro.h:239
bool stateImmutable
Definition aprepro.h:258
const std::vector< history_data > & get_history()
Definition apr_aprepro.cc:921
std::ostream * errorStream
Definition aprepro.h:243
std::ostream * infoStream
Definition aprepro.h:214
SYMBOL_TYPE get_symbol_type(const SEAMS::symrec *symbol) const
Definition apr_aprepro.cc:368
void clear_history()
Definition apr_aprepro.cc:923
void dumpsym_json() const
Definition apr_aprepro.cc:777
std::vector< history_data > history
Definition aprepro.h:249
void warning(const std::string &msg, bool line_info=true, bool prefix=true) const
Definition apr_aprepro.cc:241
int parseErrorCount
Definition aprepro.h:254
void add_history(const std::string &original, const std::string &substitution)
Definition apr_aprepro.cc:905
std::stack< std::ostream * > outputStream
Definition aprepro.h:173
bool state_is_immutable() const
Definition aprepro.h:111
bool parse_strings(const std::vector< std::string > &input, const std::string &sname)
Definition apr_aprepro.cc:184
bool parse_stream(std::istream &in, const std::string &in_name="stream input")
Definition apr_aprepro.cc:150
array * make_array(size_t r, size_t c)
Definition apr_aprepro.cc:635
void statistics(std::ostream *out=nullptr) const
Definition apr_aprepro.cc:900
int set_option(const std::string &option, const std::string &optional_value=std::string(""))
Definition apr_aprepro.cc:472
Aprepro()
construct a new parser aprepro context
Definition apr_aprepro.cc:92
bool string_interactive() const
Definition aprepro.h:159
SEAMS::symrec * getsym(const char *sym_name) const
Definition apr_aprepro.cc:761
Aprepro(const Aprepro &)=delete
static const std::string & version()
Definition apr_aprepro.cc:135
bool inIfdefGetvar
Definition aprepro.h:278
void set_error_streams(std::ostream *c_error, std::ostream *c_warning, std::ostream *c_info)
Definition apr_aprepro.cc:302
std::vector< array * > array_allocations
Definition aprepro.h:233
void clear_results()
Definition apr_aprepro.cc:144
int get_error_count() const
Definition aprepro.h:199
const std::ostringstream & parsing_results() const
Definition aprepro.h:116
SYMBOL_TYPE
Definition aprepro.h:98
@ IMMUTABLE_STRING_VARIABLE
std::istringstream stringInput
Definition aprepro.h:237
std::vector< std::string > get_variable_names(bool doInternal=false)
Definition apr_aprepro.cc:715
std::ostringstream parsingResults
Definition aprepro.h:234
SEAMS::symrec * putsym(const std::string &sym_name, SYMBOL_TYPE sym_type, bool is_internal)
Definition apr_aprepro.cc:384
bool doLoopSubstitution
Definition aprepro.h:262
int parseWarningCount
Definition aprepro.h:255
void init_table(const char *comment)
Definition apr_init.cc:392
void add_variable(const std::string &sym_name, const std::string &sym_value, bool immutable=false, bool internal=false)
Definition apr_aprepro.cc:658
void redefine_array(array *data)
Definition apr_aprepro.cc:649
bool parse_string_interactive(const std::string &input)
Definition apr_aprepro.cc:193
bool closeInfo
Definition aprepro.h:213
bool isCollectingLoop
Definition aprepro.h:271
std::fstream * check_open_file(const std::string &file, const char *mode)
Definition apr_aprepro.cc:348
bool parse_file(const std::string &filename)
Definition apr_aprepro.cc:169
class Scanner * stringScanner
Definition aprepro.h:240
bool doIncludeSubstitution
Definition aprepro.h:267
aprepro_options ap_options
Definition aprepro.h:170
std::ostream * warningStream
Definition aprepro.h:244
static const std::string & short_version()
Definition apr_aprepro.cc:136
std::fstream * open_file(const std::string &file, const char *mode)
Definition apr_aprepro.cc:316
bool parse_string(const std::string &input, const std::string &sname="string stream")
Definition apr_aprepro.cc:178
void remove_variable(const std::string &sym_name)
Definition apr_aprepro.cc:743
Aprepro & operator=(const Aprepro &)=delete
std::vector< SEAMS::symrec * > get_sorted_sym_table() const
Definition apr_aprepro.cc:930
int get_warning_count() const
Definition aprepro.h:203
void dumpsym(const char *type, bool doInternal) const
Definition apr_aprepro.cc:765
void info(const std::string &msg, bool line_info=false, bool prefix=true) const
Definition apr_aprepro.cc:264
Definition apr_scanner.h:34
Definition apr_aprepro.cc:57
bool trace_parsing
Definition aprepro.h:51
bool dumpvars
Definition aprepro.h:47
bool one_based_index
Definition aprepro.h:52
aprepro_options()=default
bool info_msg
Definition aprepro.h:45
std::string include_path
Definition aprepro.h:38
bool keep_history
Definition aprepro.h:53
bool end_on_exit
Definition aprepro.h:40
bool errors_fatal
Definition aprepro.h:41
bool errors_and_warnings_fatal
Definition aprepro.h:42
bool immutable
Definition aprepro.h:50
bool debugging
Definition aprepro.h:46
bool warning_msg
Definition aprepro.h:44
bool require_defined
Definition aprepro.h:43
std::string include_file
Definition aprepro.h:39
bool dumpvars_json
Definition aprepro.h:48
bool interactive
Definition aprepro.h:49
Definition apr_symrec.h:17
symrec * loop_index
Definition aprepro.h:61
int loop_count
Definition aprepro.h:64
std::string name
Definition aprepro.h:60
double loop_increment
Definition aprepro.h:62
int lineno
Definition aprepro.h:63
bool tmp_file
Definition aprepro.h:66
int loop_level
Definition aprepro.h:65
file_rec(const char *my_name, int line_num, bool is_temp, int loop_cnt)
Definition aprepro.h:68
std::streampos index
Definition aprepro.h:80
std::string substitution
Definition aprepro.h:79
std::string original
Definition aprepro.h:78
Definition apr_symrec.h:26