Commit db480787 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Preprocessor interface for multiple graph formats

parent 6001763a
......@@ -3032,10 +3032,11 @@ used).
(unless @code{nograph} is used).
@item graph_format = @var{FORMAT}
@itemx graph_format = ( @var{FORMAT}, @var{FORMAT}@dots{} )
@anchor{graph_format}
Specify the file format for graphs saved to disk. Possible values are
@code{eps} (the default), @code{pdf} and @code{fig} (the latter is not
available under Octave).
Specify the file format(s) for graphs saved to disk. Possible values are
@code{eps} (the default), @code{pdf} and @code{fig} (under Octave,
only @code{eps} is available).
@item noprint
Don't print anything. Useful for loops.
......@@ -3959,6 +3960,7 @@ Default value is @code{1}.
@xref{nodisplay}.
@item graph_format = @var{FORMAT}
@itemx graph_format = ( @var{FORMAT}, @var{FORMAT}@dots{} )
@xref{graph_format}.
@item lik_init = @var{INTEGER}
......@@ -4775,6 +4777,7 @@ interval. Default: @code{0.90}
@xref{nodisplay}.
@item graph_format = @var{FORMAT}
@itemx graph_format = ( @var{FORMAT}, @var{FORMAT}@dots{} )
@xref{graph_format}.
@end table
......@@ -5711,6 +5714,7 @@ Critical value for correlation @math{\rho}: plot couples of parmaters with
@xref{nodisplay}.
@item graph_format = @var{FORMAT}
@itemx graph_format = ( @var{FORMAT}, @var{FORMAT}@dots{} )
@xref{graph_format}.
@item conf_sig = @var{DOUBLE}
......@@ -5832,6 +5836,7 @@ Specify the parameter set to use. Default: @code{prior_mean}
@xref{nodisplay}.
@item graph_format = @var{FORMAT}
@itemx graph_format = ( @var{FORMAT}, @var{FORMAT}@dots{} )
@xref{graph_format}.
@end table
......
......@@ -2250,13 +2250,22 @@ o_nograph : NOGRAPH
{ driver.option_num("nograph", "0"); }
;
o_nodisplay : NODISPLAY { driver.option_num("nodisplay","1"); };
o_graph_format : GRAPH_FORMAT EQUAL EPS
{ driver.option_str("graph_format", "eps"); }
| GRAPH_FORMAT EQUAL FIG
{ driver.option_str("graph_format", "fig"); }
| GRAPH_FORMAT EQUAL PDF
{ driver.option_str("graph_format", "pdf"); }
o_graph_format : GRAPH_FORMAT EQUAL allowed_graph_formats
{ driver.process_graph_format_option(); }
| GRAPH_FORMAT EQUAL '(' list_allowed_graph_formats ')'
{ driver.process_graph_format_option(); }
;
allowed_graph_formats : EPS
{ driver.add_graph_format("eps"); }
| FIG
{ driver.add_graph_format("fig"); }
| PDF
{ driver.add_graph_format("pdf"); }
;
list_allowed_graph_formats : allowed_graph_formats
| list_allowed_graph_formats COMMA allowed_graph_formats
;
o_subsample_name : symbol EQUAL date_number ':' date_number
{ driver.set_subsample_name_equal_to_date_range($1, $3, $5); }
;
......
......@@ -2479,3 +2479,17 @@ ParsingDriver::add_steady_state_model_equal_multiple(expr_t expr)
symbol_list.clear();
}
void
ParsingDriver::add_graph_format(const string &name)
{
graph_formats.addSymbol(name);
}
void
ParsingDriver::process_graph_format_option()
{
options_list.symbol_list_options["graph_format"] = graph_formats;
graph_formats.clear();
}
......@@ -197,6 +197,8 @@ private:
void reset_current_external_function_options();
//! Adds a model lagged variable to ModelTree and VariableTable
expr_t add_model_variable(int symb_id, int lag);
//! For parsing the graph_format option
SymbolList graph_formats;
//! The mod file representation constructed by this ParsingDriver
ModFile *mod_file;
......@@ -628,6 +630,10 @@ public:
void declare_nonstationary_var(string *name, string *tex_name = NULL);
//! Ends declaration of nonstationary variable
void end_nonstationary_var(expr_t deflator);
//! Add a graph format to the list of formats requested
void add_graph_format(const string &name);
//! Add the graph_format option to the OptionsList structure
void process_graph_format_option();
};
#endif // ! PARSING_DRIVER_HH
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment