diff --git a/preprocessor/DynamicModel.cc b/preprocessor/DynamicModel.cc
index 49e8e82f95ef1b9172b9dc16693b605b8909279d..4241aab323af391ffa691b52bfca76575fe307ee 100644
--- a/preprocessor/DynamicModel.cc
+++ b/preprocessor/DynamicModel.cc
@@ -1923,6 +1923,14 @@ DynamicModel::writeOutput(ostream &output, const string &basename, bool block, b
       }
     output << "]';" << endl;
 
+    // Write equation tags
+    output << "M_.equations_tags = {" << endl;
+    for (int i = 0; i < equation_tags.size(); i++)
+      output << "  " << equation_tags[i].first + 1 << " , '"
+             << equation_tags[i].second.first << "' , '"
+             << equation_tags[i].second.second << "' ;" << endl;
+    output << "};" << endl;
+
     //In case of sparse model, writes the block structure of the model
     if (block)
       {
diff --git a/preprocessor/DynareBison.yy b/preprocessor/DynareBison.yy
index 827d961b5f8f265aeebdd4c8cc8175b5a43cbb48..7df8142b779536b8a45c16e10375f6ca216948e1 100644
--- a/preprocessor/DynareBison.yy
+++ b/preprocessor/DynareBison.yy
@@ -474,6 +474,18 @@ equation : hand_side EQUAL hand_side ';'
            { $$ = driver.add_model_equal($1, $3); }
          | hand_side ';'
            { $$ = driver.add_model_equal_with_zero_rhs($1); }
+         | '[' tags_list ']' hand_side EQUAL hand_side ';'
+           { $$ = driver.add_model_equal($4, $6); }
+         | '[' tags_list ']' hand_side ';'
+           { $$ = driver.add_model_equal_with_zero_rhs($4); }
+         ;
+
+tags_list : tags_list COMMA tag_pair
+          | tag_pair
+          ;
+
+tag_pair : NAME EQUAL QUOTED_STRING
+           { driver.add_equation_tags($1, $3); }
          ;
 
 hand_side : '(' hand_side ')'
diff --git a/preprocessor/ModelTree.cc b/preprocessor/ModelTree.cc
index e7dd0e8af5465ecd6822dd92fccb0b0c569a26fc..d2a88e30b2081edf1ec7c3cf299d47c2d5b7b30c 100644
--- a/preprocessor/ModelTree.cc
+++ b/preprocessor/ModelTree.cc
@@ -279,3 +279,9 @@ ModelTree::addEquation(NodeID eq)
 
   equations.push_back(beq);
 }
+
+void
+ModelTree::addEquationTags(int i, const string &key, const string &value)
+{
+  equation_tags.push_back(make_pair(i, make_pair(key, value)));
+}
diff --git a/preprocessor/ModelTree.hh b/preprocessor/ModelTree.hh
index 4293104da8a85d668f471b0f21fe772787a43402..29e10f765f0489f56e0e5154936cd92c3f505e94 100644
--- a/preprocessor/ModelTree.hh
+++ b/preprocessor/ModelTree.hh
@@ -36,6 +36,9 @@ protected:
   //! Stores declared equations
   vector<BinaryOpNode *> equations;
 
+  //! Stores equation tags
+  vector<pair<int, pair<string, string> > > equation_tags;
+
   //! Number of non-zero derivatives
   int NNZDerivatives[3];
 
@@ -47,7 +50,6 @@ protected:
   */
   first_derivatives_type first_derivatives;
 
-
   typedef map<pair<int, pair<int, int> >, NodeID> second_derivatives_type;
   //! Second order derivatives
   /*! First index is equation number, second and third are variables w.r. to which is computed the derivative.
@@ -98,6 +100,8 @@ public:
   ModelTree(SymbolTable &symbol_table_arg, NumericalConstants &num_constants);
   //! Declare a node as an equation of the model
   void addEquation(NodeID eq);
+  //! Adds tags to equation number i
+  void addEquationTags(int i, const string &key, const string &value);
   //! Returns the number of equations in the model
   int equation_number() const;
 };
diff --git a/preprocessor/ParsingDriver.cc b/preprocessor/ParsingDriver.cc
index 4fcce2916237cd9184df5ab2153518cd3f3014a4..3c32058bc99f1e4d907c4b7645734c565c773b11 100644
--- a/preprocessor/ParsingDriver.cc
+++ b/preprocessor/ParsingDriver.cc
@@ -144,6 +144,15 @@ ParsingDriver::declare_parameter(string *name, string *tex_name)
   declare_symbol(name, eParameter, tex_name);
 }
 
+void
+ParsingDriver::add_equation_tags(string *key, string *value)
+{
+  int n = model_tree->equation_number();
+  model_tree->addEquationTags(n, *key, *value);
+  delete key;
+  delete value;
+}
+
 NodeID
 ParsingDriver::add_constant(string *constant)
 {
diff --git a/preprocessor/ParsingDriver.hh b/preprocessor/ParsingDriver.hh
index 8d6b1f5847d35572faa528ce4ce529213f7d0aaa..8d4faefd658790902e2470304e32d08ebc46b034 100644
--- a/preprocessor/ParsingDriver.hh
+++ b/preprocessor/ParsingDriver.hh
@@ -193,6 +193,8 @@ public:
   void declare_and_init_model_local_variable(string *name, NodeID rhs);
   //! Changes type of a symbol
   void change_type(SymbolType new_type, vector<string *> *var_list);
+  //! Adds a list of tags for the current equation
+  void add_equation_tags(string *key, string *value); 
   //! Adds a constant to DataTree
   NodeID add_constant(string *constant);
   //! Adds a NaN constant to DataTree