diff --git a/preprocessor/ComputingTasks.cc b/preprocessor/ComputingTasks.cc
index a5c6ffa779ab769683eb9c070fe0c7d6a3609592..18f3f092ed9bce0a3cb0dad9e1d11e3a84b251eb 100644
--- a/preprocessor/ComputingTasks.cc
+++ b/preprocessor/ComputingTasks.cc
@@ -1210,6 +1210,7 @@ void
 SvarStatement::writeOutput(ostream &output, const string &basename) const
 {
   OptionsList::num_options_type::const_iterator it0, it1, it2;
+  OptionsList::vec_int_options_type::const_iterator itv;
 
   it0 = options_list.num_options.find("ms.chain");
   if (it0 != options_list.num_options.end())
@@ -1223,11 +1224,17 @@ SvarStatement::writeOutput(ostream &output, const string &basename) const
   it0 = options_list.string_options.find("ms.coefficients");
   it1 = options_list.string_options.find("ms.variances");
   it2 = options_list.string_options.find("ms.constants");
-  if (it0 != options_list.string_options.end() && it1 == options_list.string_options.end() && it2 == options_list.string_options.end())
+  if (it0 != options_list.string_options.end() &&
+      it1 == options_list.string_options.end() &&
+      it2 == options_list.string_options.end())
     output << "." << it0->second;
-  else if (it0 == options_list.string_options.end() && it1 != options_list.string_options.end() && it2 == options_list.string_options.end())
+  else if (it0 == options_list.string_options.end() &&
+           it1 != options_list.string_options.end() &&
+           it2 == options_list.string_options.end())
     output << "." << it1->second;
-  else if (it0 == options_list.string_options.end() && it1 == options_list.string_options.end() && it2 != options_list.string_options.end())
+  else if (it0 == options_list.string_options.end() &&
+           it1 == options_list.string_options.end() &&
+           it2 != options_list.string_options.end())
     output << "." << it2->second;
   else
     {
@@ -1235,12 +1242,27 @@ SvarStatement::writeOutput(ostream &output, const string &basename) const
       exit(EXIT_FAILURE);
     }
 
-  it0 = options_list.num_options.find("ms.equations");
-  if (it0 != options_list.num_options.end())
-    if (it0->second.find("[")!=string::npos)
-      output << ".equations = " << it0->second << "';" << endl;
-    else
-      output << ".equations = " << it0->second << ";" << endl;
+  itv = options_list.vector_int_options.find("ms.equations");
+  output << ".equations = ";
+  if (itv != options_list.vector_int_options.end())
+    {
+      if (itv->second.size() > 1)
+        {
+          output << "[";
+          for (vector<int>::const_iterator viit=itv->second.begin();
+               viit!=itv->second.end(); viit++)
+            output << *viit << ";";
+          output.seekp((long)output.tellp()-1);
+          output << "];" << endl;
+        }
+      else if (itv->second.size() == 1)
+        output << itv->second.front() << ";" << endl;
+      else
+        {
+          cerr << "SvarStatement::writeOutput() Should not arrive here (3). Please report this to the Dynare Team." << endl;
+          exit(EXIT_FAILURE);
+        }
+    }
   else
-    output << ".equations = 'ALL';" << endl;
+    output << "'ALL';" << endl;
 }
diff --git a/preprocessor/DynareBison.yy b/preprocessor/DynareBison.yy
index 912cd898c06a2c43370e4bfb955f4644643e7a87..557197a705e3bb67f1bbf7d548c1a628ff85d99b 100644
--- a/preprocessor/DynareBison.yy
+++ b/preprocessor/DynareBison.yy
@@ -74,6 +74,7 @@ class ParsingDriver;
   NodeID node_val;
   SymbolType symbol_type_val;
   vector<string *> *vector_string_val;
+  vector<int> *vector_int_val;
 };
 
 %{
@@ -167,6 +168,7 @@ class ParsingDriver;
 %type <string_val> calib_arg2 range number
 %type <symbol_type_val> change_type_arg
 %type <vector_string_val> change_type_var_list
+%type <vector_int_val> vector_int_body vector_int
 
 %%
 
@@ -1871,11 +1873,41 @@ o_number_of_states : NUMBER_OF_STATES EQUAL INT_NUMBER { driver.option_num("ms.n
 o_coefficients : COEFFICIENTS { driver.option_str("ms.coefficients","svar_coefficients"); };
 o_variances : VARIANCES { driver.option_str("ms.variances","svar_variances"); };
 o_constants : CONSTANTS { driver.option_str("ms.constants","svar_constants"); };
-o_equations : EQUATIONS EQUAL vec_int
-              { driver.option_num("ms.equations",$3); }
+o_equations : EQUATIONS EQUAL vector_int
+              { driver.option_vec_int("ms.equations",$3); }
             | EQUATIONS EQUAL INT_NUMBER
-              { driver.option_num("ms.equations",$3); }
+              {
+                vector<int> *oneInt = new vector<int>();
+                oneInt->push_back(atoi((*$3).c_str()));
+                driver.option_vec_int("ms.equations",oneInt);
+                delete oneInt;
+              }
             ;
+
+vector_int_body : INT_NUMBER
+                  { $$ = new vector<int>(); $$->push_back(atoi((*$1).c_str())); }
+                | vector_int_body INT_NUMBER
+                  { $$ = $1; $1->push_back(atoi((*$2).c_str())); }
+                | vector_int_body COMMA INT_NUMBER
+                  { $$ = $1; $1->push_back(atoi((*$3).c_str())); }
+                ;
+
+vector_int : '[' vector_int_body ']'
+             { $$ = $2; }
+           | '[' vector_int_body COMMA ']'
+             { $$ = $2; }
+           | '[' COMMA vector_int_body ']'
+             { $$ = $3; }
+           | '[' COMMA vector_int_body COMMA ']'
+             { $$ = $3; }
+           | '[' INT_NUMBER ':' INT_NUMBER ']'
+             {
+               $$ = new vector<int>();
+               for(int i=atoi((*$2).c_str()); i<=atoi((*$4).c_str()); i++)
+                 $$->push_back(i);
+             }
+           ;
+
 o_instruments : INSTRUMENTS EQUAL '(' symbol_list ')' {driver.option_symbol_list("instruments"); };
 
 range : symbol ':' symbol
diff --git a/preprocessor/ParsingDriver.cc b/preprocessor/ParsingDriver.cc
index d379ec572c55bb37c3ae4f214c6b92ec73952c6e..142fbc224e5e24eac6fb1567c4f95a92da586848 100644
--- a/preprocessor/ParsingDriver.cc
+++ b/preprocessor/ParsingDriver.cc
@@ -761,6 +761,16 @@ ParsingDriver::option_symbol_list(const string &name_option)
   symbol_list.clear();
 }
 
+void
+ParsingDriver::option_vec_int(const string &name_option, const vector<int> *opt)
+{
+  if (options_list.vector_int_options.find(name_option)
+      != options_list.vector_int_options.end())
+    error("option " + name_option + " declared twice");
+
+  options_list.vector_int_options[name_option] = *opt;
+}
+
 void
 ParsingDriver::linear()
 {
@@ -1198,6 +1208,7 @@ void
 ParsingDriver::svar()
 {
   OptionsList::num_options_type::const_iterator it0, it1, it2;
+  OptionsList::vec_int_options_type::const_iterator itv;
 
   it0 = options_list.string_options.find("ms.coefficients");
   it1 = options_list.string_options.find("ms.variances");
@@ -1221,29 +1232,14 @@ ParsingDriver::svar()
   else if (atoi(it0->second.c_str()) <= 0)
     error("The value passed to the chain option must be greater than zero.");
 
-  it0 = options_list.num_options.find("ms.equations");
-  if (it0 != options_list.num_options.end())
+  itv = options_list.vector_int_options.find("ms.equations");
+  if (itv != options_list.vector_int_options.end())
     {
-      string strNextNumber;
-      for (string::const_iterator it=it0->second.begin(); it<it0->second.end(); it++)
-        {
-          if (*it == '[' ||
-              *it == ',' ||
-              *it == ' ' ||
-              *it == ':' ||
-              *it == ']')
-            {
-              if (!strNextNumber.empty())
-                if (atoi(strNextNumber.c_str()) <= 0)
-                  error("The value(s) passed to the equation option must be greater than zero.");
-              strNextNumber.clear();
-            }
-          else
-            strNextNumber += *it;
-        }
+      if (itv->second.empty())
+        error("There was an error in the integers passed to the equation option.");
 
-      if (!strNextNumber.empty())
-        if (atoi(strNextNumber.c_str()) <= 0)
+      for (vector<int>::const_iterator viit=itv->second.begin(); viit != itv->second.end(); viit++)
+        if (*viit <= 0)
           error("The value(s) passed to the equation option must be greater than zero.");
     }
 
diff --git a/preprocessor/ParsingDriver.hh b/preprocessor/ParsingDriver.hh
index 4498aaeee7c91eb88cb6bc89e7d2ad33b9c827e0..6e004895785322d691fe40ab755455284d31e79c 100644
--- a/preprocessor/ParsingDriver.hh
+++ b/preprocessor/ParsingDriver.hh
@@ -288,6 +288,8 @@ public:
   void option_str(const string &name_option, const string &opt);
   //! Sets an option to a list of symbols (used in conjunction with add_in_symbol_list())
   void option_symbol_list(const string &name_option);
+  //! Sets an option to a vector of integers
+  void option_vec_int(const string &name_option, const vector<int> *opt);
   //! Indicates that the model is linear
   void linear();
   //! Adds a variable to temporary symbol list
diff --git a/preprocessor/Statement.cc b/preprocessor/Statement.cc
index 3f16dc1e934fb486ce1ff1aab4228c7fee0aecce..6f1e56805e65e905d594a0d4d9846d4fa0ee934e 100644
--- a/preprocessor/Statement.cc
+++ b/preprocessor/Statement.cc
@@ -80,6 +80,23 @@ OptionsList::writeOutput(ostream &output) const
   for(symbol_list_options_type::const_iterator it = symbol_list_options.begin();
       it != symbol_list_options.end(); it++)
     it->second.writeOutput("options_." + it->first, output);
+
+  for(vec_int_options_type::const_iterator it = vector_int_options.begin();
+      it != vector_int_options.end(); it++)
+    {
+      output << "options_." << it->first << " = ";
+      if (it->second.size() > 1)
+        {
+          output << "[";
+          for (vector<int>::const_iterator viit=it->second.begin();
+               viit!=it->second.end(); viit++)
+            output << *viit << ";";
+          output.seekp((long)output.tellp()-1);
+          output << "];" << endl;
+        }
+      else
+        output << it->second.front() << ";" << endl;
+    }
 }
 
 void
@@ -103,6 +120,23 @@ OptionsList::writeOutput(ostream &output, const string &option_group) const
   for(symbol_list_options_type::const_iterator it = symbol_list_options.begin();
       it != symbol_list_options.end(); it++)
     it->second.writeOutput(option_group + "." + it->first, output);
+
+  for(vec_int_options_type::const_iterator it = vector_int_options.begin();
+      it != vector_int_options.end(); it++)
+    {
+      output << option_group << "." << it->first << " = ";
+      if (it->second.size() > 1)
+        {
+          output << "[";
+          for (vector<int>::const_iterator viit=it->second.begin();
+               viit!=it->second.end(); viit++)
+            output << *viit << ";";
+          output.seekp((long)output.tellp()-1);
+          output << "];" << endl;
+        }
+      else
+        output <<  it->second.front() << ";" << endl;
+    }
 }
 
 void
@@ -112,4 +146,5 @@ OptionsList::clear()
   paired_num_options.clear();
   string_options.clear();
   symbol_list_options.clear();
+  vector_int_options.clear();
 }
diff --git a/preprocessor/Statement.hh b/preprocessor/Statement.hh
index 277731ed7b64a4501f97ce625a8342b4ceec09e9..b745a16d5f63b0405631ab66b6e85fad3be4ce87 100644
--- a/preprocessor/Statement.hh
+++ b/preprocessor/Statement.hh
@@ -94,10 +94,12 @@ public:
   typedef map<string, pair<string, string> > paired_num_options_type;
   typedef map<string, string> string_options_type;
   typedef map<string, SymbolList> symbol_list_options_type;
+  typedef map<string, vector<int> > vec_int_options_type;
   num_options_type num_options;
   paired_num_options_type paired_num_options;
   string_options_type string_options;
   symbol_list_options_type symbol_list_options;
+  vec_int_options_type vector_int_options;
   void writeOutput(ostream &output) const;
   void writeOutput(ostream &output, const string &option_group) const;
   void clear();