Commit 8fc3d7bf authored by sebastien's avatar sebastien
Browse files

v4 preprocessor:

* fixed bug in InitValFile statement (typo in Matlab option name)
* various cosmetic changes


git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1798 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 67838217
......@@ -673,7 +673,11 @@ symbol_list : symbol_list NAME
;
symbol_list_ext : symbol_list
| ':' {std::string* colon=new std::string(":");driver.add_in_symbol_list(colon);}
| ':'
{
string *colon = new string(":");
driver.add_in_symbol_list(colon);
}
;
signed_integer : PLUS INT_NUMBER
......
......@@ -153,17 +153,18 @@ HistValStatement::writeOutput(ostream &output, const string &basename) const
}
}
InitvalFileStatement::InitvalFileStatement(const string* const filename_arg):
filename(*filename_arg)
InitvalFileStatement::InitvalFileStatement(const string &filename_arg) :
filename(filename_arg)
{
}
void InitvalFileStatement::writeOutput(ostream &output, const string &basename) const
void
InitvalFileStatement::writeOutput(ostream &output, const string &basename) const
{
output << interfaces::comment() << endl
<< interfaces::comment() << "INITVAL_FILE statement" << endl
<< interfaces::comment() << endl
<< "options_.intival_file = 1;" << endl;
<< "options_.initval_file = 1;" << endl;
output << "initvalf('" << filename << "');" << endl;
}
......
......@@ -307,7 +307,7 @@ ParsingDriver::init_val(string *name, NodeID rhs)
void
ParsingDriver::initval_file(string *filename)
{
mod_file->addStatement(new InitvalFileStatement(filename));
mod_file->addStatement(new InitvalFileStatement(*filename));
delete filename;
}
......
......@@ -95,9 +95,9 @@ public:
class InitvalFileStatement : public Statement
{
private:
string filename;
const string filename;
public:
InitvalFileStatement(const string* const filename);
InitvalFileStatement(const string &filename_arg);
virtual void writeOutput(ostream &output, const string &basename) const;
};
......
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