Index: demo/dim_to_lgf.cc
===================================================================
--- demo/dim_to_lgf.cc	(revision 1641)
+++ demo/dim_to_lgf.cc	(revision 1744)
@@ -162,5 +162,10 @@
     StringMap cost(graph), capacity(graph);
     readDimacs(is, graph, capacity, s, t, cost);
-    writeGraph(os, graph, capacity, s, t, cost);
+    GraphWriter<Graph>(os, graph).
+      writeEdgeMap("capacity", capacity).
+      writeNode("source", s).
+      writeNode("target", t).
+      writeEdgeMap("cost", cost).
+      run();
   } else if (typeName == "maxflow") {
     Graph graph;
@@ -168,5 +173,9 @@
     StringMap capacity(graph);
     readDimacs(is, graph, capacity, s, t);
-    writeGraph(os, graph, capacity, s, t);
+    GraphWriter<Graph>(os, graph).
+      writeEdgeMap("capacity", capacity).
+      writeNode("source", s).
+      writeNode("target", t).
+      run();
   } else if (typeName == "shortestpath") {
     Graph graph;
@@ -174,14 +183,19 @@
     StringMap capacity(graph);
     readDimacs(is, graph, capacity, s);
-    writeGraph(os, graph, capacity, s);
+    GraphWriter<Graph>(os, graph).
+      writeEdgeMap("capacity", capacity).
+      writeNode("source", s).
+      run();
   } else if (typeName == "capacitated") {
     Graph graph;
     StringMap capacity(graph);
     readDimacs(is, graph, capacity);
-    writeGraph(os, graph, capacity);
+    GraphWriter<Graph>(os, graph).
+      writeEdgeMap("capacity", capacity).
+      run();
   } else if (typeName == "plain") {
     Graph graph;
     readDimacs(is, graph);
-    writeGraph(os, graph);
+    GraphWriter<Graph>(os, graph).run();
   } else {
     cerr << "Invalid type error" << endl;
Index: lemon/bits/item_reader.h
===================================================================
--- lemon/bits/item_reader.h	(revision 1435)
+++ lemon/bits/item_reader.h	(revision 1744)
@@ -246,6 +246,7 @@
   /// \brief Reader for parsed string.
   ///
-  /// Reader for parsed strings. You can give the open and close
-  /// parse characters.
+  /// Reader for parsed strings. You can define the open and close
+  /// parse characters. It reads from the input a character sequence
+  /// which is right parsed.
   ///
   /// \author Balazs Dezso
@@ -358,6 +359,13 @@
 	ParsedStringReader().read(is, value);
 	break;
+      case '[':
+	ParsedStringReader('[', ']').read(is, value);
+	break;
+      case '/':
+	ParsedStringReader('/', '/').read(is, value);
+	break;
       default:
-	is >> value; 
+	if (!(is >> value)) 
+	  throw DataFormatError("DefaultReader format error");
 	break;
       }
Index: lemon/graph_reader.h
===================================================================
--- lemon/graph_reader.h	(revision 1705)
+++ lemon/graph_reader.h	(revision 1744)
@@ -340,95 +340,35 @@
 
 
-  ///\anchor readGraph()
-  ///
-  /// \brief Read a graph from an input stream.
-  ///
-  /// Read a graph from an input stream.
+  /// \brief Read a graph from the input.
+  ///
+  /// It is a helper function to read a graph from the given input
+  /// stream. It gives back an GraphReader object and this object
+  /// can read more maps, labeled nodes, edges and attributes.
+  ///
+  /// \warning Do not forget to call the \c run() function.
+  ///
   /// \param is The input stream.
   /// \param g The graph.
   template<typename Graph>
-  void readGraph(std::istream& is, Graph &g) {
-    GraphReader<Graph> reader(is, g);
-    reader.run();
+  GraphReader<Graph> graphReader(std::istream& is, Graph &g) {
+    return GraphReader<Graph>(is, g);
   }
 
-  /// \brief Read a capacitated graph instance from an input stream.
-  /// 
-  /// Read a capacitated graph (graph+capacity on the
-  /// edges) from an input stream.
-  /// \param is The input stream.
+  /// \brief Read a graph from the input.
+  ///
+  /// It is a helper function to read a graph from the given input
+  /// file. It gives back an GraphReader object and this object
+  /// can read more maps, labeled nodes, edges and attributes.
+  ///
+  /// \warning Do not forget to call the \c run() function.
+  ///
+  /// \param fn The input filename.
   /// \param g The graph.
-  /// \param capacity The capacity map.
-  template<typename Graph, typename CapacityMap>
-  void readGraph(std::istream& is, Graph &g, CapacityMap& capacity) {
-    GraphReader<Graph> reader(is, g);
-    reader.readEdgeMap("capacity", capacity);
-    reader.run();
+  template<typename Graph>
+  GraphReader<Graph> graphReader(const std::string& fn, Graph &g) {
+    return GraphReader<Graph>(fn, g);
   }
 
-  /// \brief Read a shortest path instance from an input stream.
-  /// 
-  /// Read a shortest path instance (graph+capacity on the
-  /// edges+designated source) from an input stream.
-  /// \param is The input stream.
-  /// \param g The graph.
-  /// \param capacity The capacity map.
-  /// \param s The source node.
-  template<typename Graph, typename CapacityMap>
-  void readGraph(std::istream& is, Graph &g, CapacityMap& capacity, 
-		  typename Graph::Node &s) {
-    GraphReader<Graph> reader(is, g);
-    reader.readEdgeMap("capacity", capacity);
-    reader.readNode("source", s);
-    reader.run();
-  }
-
-
-
-  /// \brief Read a max flow instance from an input stream.
-  ///
-  /// Read a max flow instance (graph+capacity on the
-  /// edges+designated source and target) from an input stream.
-  ///
-  /// \param is The input stream.
-  /// \param g The graph.
-  /// \param capacity The capacity map.
-  /// \param s The source node.
-  /// \param t The target node.
-  template<typename Graph, typename CapacityMap>
-  void readGraph(std::istream& is, Graph &g, CapacityMap& capacity, 
-		  typename Graph::Node &s, typename Graph::Node &t) {
-    GraphReader<Graph> reader(is, g);
-    reader.readEdgeMap("capacity", capacity);
-    reader.readNode("source", s);
-    reader.readNode("target", t);
-    reader.run();
-  }
-
-  /// \brief Read a min cost flow instance from an input stream.
-  ///
-  /// Read a min cost flow instance (graph+capacity on the edges+cost
-  /// function on the edges+designated source and target) from an input stream.
-  ///
-  /// \param is The input stream.
-  /// \param g The graph.
-  /// \param capacity The capacity map.
-  /// \param s The source node.
-  /// \param t The target node.
-  /// \param cost The cost map.
-  template<typename Graph, typename CapacityMap, typename CostMap>
-  void readGraph(std::istream& is, Graph &g, CapacityMap& capacity, 
-		  typename Graph::Node &s, typename Graph::Node &t, 
-		  CostMap& cost) {
-    GraphReader<Graph> reader(is, g);
-    reader.readEdgeMap("capacity", capacity);
-    reader.readEdgeMap("cost", cost);
-    reader.readNode("source", s);
-    reader.readNode("target", t);
-    reader.run();
-  }
-
-
-  /// \brief The undir graph reader class.
+  /// \brief The undirected graph reader class.
   ///
   /// The \c UndirGraphReader class provides the graph input. 
@@ -807,30 +747,35 @@
   };
 
-  /// \brief Read an undirected graph from an input stream.
-  ///
-  /// Read an undirected graph from an input stream.
+  /// \brief Read an undirected graph from the input.
+  ///
+  /// It is a helper function to read an undirected graph from the given input
+  /// stream. It gives back an UndirGraphReader object and this object
+  /// can read more maps, labeled nodes, edges, undirected edges and
+  /// attributes.
+  ///
+  /// \warning Do not forget to call the \c run() function.
+  ///
   /// \param is The input stream.
   /// \param g The graph.
   template<typename Graph>
-  void readUndirGraph(std::istream& is, Graph &g) {
-    UndirGraphReader<Graph> reader(is, g);
-    reader.run();
+  UndirGraphReader<Graph> undirGraphReader(std::istream& is, Graph &g) {
+    return GraphReader<Graph>(is, g);
   }
 
-  /// \brief Read an undirected multigraph (undirected graph + capacity
-  /// map on the edges) from an input stream.
-  ///
-  /// Read an undirected multigraph (undirected graph + capacity
-  /// map on the edges) from an input stream.
-  /// \param is The input stream.
+  /// \brief Read an undirected graph from the input.
+  ///
+  /// It is a helper function to read an undirected graph from the given input
+  /// file. It gives back an UndirGraphReader object and this object
+  /// can read more maps, labeled nodes, edges, undirected edges and 
+  /// attributes.
+  ///
+  /// \warning Do not forget to call the \c run() function.
+  ///
+  /// \param fn The input filename.
   /// \param g The graph.
-  /// \param capacity The capacity map.
-  template<typename Graph, typename CapacityMap>
-  void readUndirGraph(std::istream& is, Graph &g, CapacityMap& capacity) {
-    UndirGraphReader<Graph> reader(is, g);
-    reader.readUndirEdgeMap("capacity", capacity);
-    reader.run();
+  template<typename Graph>
+  UndirGraphReader<Graph> undirGraphReader(const std::string& fn, Graph &g) {
+    return GraphReader<Graph>(fn, g);
   }
-
 
   /// @}
Index: lemon/graph_writer.h
===================================================================
--- lemon/graph_writer.h	(revision 1540)
+++ lemon/graph_writer.h	(revision 1744)
@@ -285,112 +285,31 @@
 
 
-  ///\anchor writeGraph()
-  ///
+
   /// \brief Write a graph to the output.
   ///
-  /// Write a graph to the output.
+  /// It is a helper function to write a graph to the given output
+  /// stream. It gives back a GraphWriter object and this object
+  /// can write more maps, labeled nodes and edges and attributes.
+  /// \warning Do not forget to call the \c run() function.
+  ///
   /// \param os The output stream.
   /// \param g The graph.
-  template<typename Graph>
-  void writeGraph(std::ostream& os, const Graph &g) {
-    GraphWriter<Graph> writer(os, g);
-    IdMap<Graph, typename Graph::Node> nodeIdMap(g);
-    writer.writeNodeMap("id", nodeIdMap);
-    IdMap<Graph, typename Graph::Edge> edgeIdMap(g);
-    writer.writeEdgeMap("id", edgeIdMap);
-    writer.run();
+  template <typename Graph>
+  GraphWriter<Graph> graphWriter(std::ostream& os, const Graph &g) {
+    return GraphWriter<Graph>(os, g);
   }
 
-  /// \brief Write a capacitated graph instance to the output.
-  /// 
-  /// Write a capacitated graph (graph+capacity on the
-  /// edges) to the output.
-  /// \param os The output stream.
+  /// \brief Write a graph to the output.
+  ///
+  /// It is a helper function to write a graph to the given output
+  /// file. It gives back a GraphWriter object and this object
+  /// can write more maps, labeled nodes and edges and attributes.
+  /// \warning Do not forget to call the \c run() function.
+  ///
+  /// \param fn The filename.
   /// \param g The graph.
-  /// \param capacity The capacity map.
-  template<typename Graph, typename CapacityMap>
-  void writeGraph(std::ostream& os, const Graph &g, 
-		  const CapacityMap& capacity) {
-    GraphWriter<Graph> writer(os, g);
-    IdMap<Graph, typename Graph::Node> nodeIdMap(g);
-    writer.writeNodeMap("id", nodeIdMap);
-    IdMap<Graph, typename Graph::Edge> edgeIdMap(g);
-    writer.writeEdgeMap("id", edgeIdMap);
-    writer.writeEdgeMap("capacity", capacity);
-    writer.run();
-  }
-
-  /// \brief Write a shortest path instance to the output.
-  /// 
-  /// Write a shortest path instance (graph+capacity on the
-  /// edges+designated source) to the output.
-  /// \param os The output stream.
-  /// \param g The graph.
-  /// \param capacity The capacity map.
-  /// \param s The source node.
-  template<typename Graph, typename CapacityMap>
-  void writeGraph(std::ostream& os, const Graph &g, 
-		  const CapacityMap& capacity, const typename Graph::Node &s) {
-    GraphWriter<Graph> writer(os, g);
-    IdMap<Graph, typename Graph::Node> nodeIdMap(g);
-    writer.writeNodeMap("id", nodeIdMap);
-    IdMap<Graph, typename Graph::Edge> edgeIdMap(g);
-    writer.writeEdgeMap("id", edgeIdMap);
-    writer.writeEdgeMap("capacity", capacity);
-    writer.writeNode("source", s);
-    writer.run();
-  }
-
-
-  /// \brief Write a max flow instance to the output.
-  ///
-  /// Write a max flow instance (graph+capacity on the
-  /// edges+designated source and target) to the output.
-  ///
-  /// \param os The output stream.
-  /// \param g The graph.
-  /// \param capacity The capacity map.
-  /// \param s The source node.
-  /// \param t The target node.
-  template<typename Graph, typename CapacityMap>
-  void writeGraph(std::ostream& os, const Graph &g, 
-		  const CapacityMap& capacity, const typename Graph::Node &s,
-		  const typename Graph::Node &t) {
-    GraphWriter<Graph> writer(os, g);
-    IdMap<Graph, typename Graph::Node> nodeIdMap(g);
-    writer.writeNodeMap("id", nodeIdMap);
-    IdMap<Graph, typename Graph::Edge> edgeIdMap(g);
-    writer.writeEdgeMap("id", edgeIdMap);
-    writer.writeEdgeMap("capacity", capacity);
-    writer.writeNode("source", s);
-    writer.writeNode("target", t);
-    writer.run();
-  }
-
-  /// \brief Write a min cost flow instance to the output.
-  ///
-  /// Write a min cost flow instance (graph+capacity on the edges+cost
-  /// function on the edges+designated source and target) to the output.
-  ///
-  /// \param os The output stream.
-  /// \param g The graph.
-  /// \param capacity The capacity map.
-  /// \param s The source node.
-  /// \param t The target node.
-  /// \param cost The cost map.
-  template<typename Graph, typename CapacityMap, typename CostMap>
-  void writeGraph(std::ostream& os, const Graph &g, 
-		  const CapacityMap& capacity, const typename Graph::Node &s,
-		  const typename Graph::Node &t, const CostMap& cost) {
-    GraphWriter<Graph> writer(os, g);
-    IdMap<Graph, typename Graph::Node> nodeIdMap(g);
-    writer.writeNodeMap("id", nodeIdMap);
-    IdMap<Graph, typename Graph::Edge> edgeIdMap(g);
-    writer.writeEdgeMap("id", edgeIdMap);
-    writer.writeEdgeMap("capacity", capacity);
-    writer.writeEdgeMap("cost", cost);
-    writer.writeNode("source", s);
-    writer.writeNode("target", t);
-    writer.run();
+  template <typename Graph>
+  GraphWriter<Graph> graphWriter(const std::string& fn, const Graph &g) {
+    return GraphWriter<Graph>(fn, g);
   }
 
@@ -685,30 +604,33 @@
   /// \brief Write an undirected graph to the output.
   ///
-  /// Write an undirected graph to the output.
+  /// It is a helper function to write an undirected graph to the given output
+  /// stream. It gives back an UndirGraphWriter object and this object
+  /// can write more maps, labeled nodes and edges and attributes.
+  /// \warning Do not forget to call the \c run() function.
+  ///
   /// \param os The output stream.
   /// \param g The graph.
-  template<typename Graph>
-  void writeUndirGraph(std::ostream& os, const Graph &g) {
-    UndirGraphWriter<Graph> writer(os, g);
-    writer.run();
+  template <typename Graph>
+  UndirGraphWriter<Graph> undirGraphWriter(std::ostream& os, const Graph &g) {
+    return UndirGraphWriter<Graph>(os, g);
   }
 
-  /// \brief Write an undirected multigraph (undirected graph + capacity
-  /// map on the edges) to the output.
-  ///
-  /// Write an undirected multigraph (undirected graph + capacity
-  /// map on the edges) to the output.
-  /// \param os The output stream.
+  /// \brief Write an undirected graph to the output.
+  ///
+  /// It is a helper function to write an undirected graph to the given output
+  /// file. It gives back an UndirGraphWriter object and this object
+  /// can write more maps, labeled nodes, edges, undirected edges and 
+  /// attributes.
+  ///
+  /// \warning Do not forget to call the \c run() function.
+  ///
+  /// \param fn The output file.
   /// \param g The graph.
-  /// \param capacity The capacity undirected map.
-  template<typename Graph, typename CapacityMap>
-  void writeUndirGraph(std::ostream& os, const Graph &g, 
-		       const CapacityMap& capacity) {
-    UndirGraphWriter<Graph> writer(os, g);
-    writer.writeUndirEdgeMap("capacity", capacity);
-    writer.run();
+  template <typename Graph>
+  UndirGraphWriter<Graph> undirGraphWriter(const std::string& fn, 
+					   const Graph &g) {
+    return UndirGraphWriter<Graph>(fn, g);
   }
 
-
   /// @}
 
Index: test/heap_test.cc
===================================================================
--- test/heap_test.cc	(revision 1728)
+++ test/heap_test.cc	(revision 1744)
@@ -56,5 +56,8 @@
   std::ifstream input(f_name.c_str());
   check(input, "Input file '" << f_name << "' not found.");
-  readGraph(input, graph, length, start);  
+  GraphReader<Graph>(input, graph).
+    readEdgeMap("length", length).
+    readNode("source", start).
+    run();  
  
   {
