Index: src/Parser/TremoloParser.cpp
===================================================================
--- src/Parser/TremoloParser.cpp	(revision d9005c16a207bbd7364238aaf6dfaa1afe18b7cb)
+++ src/Parser/TremoloParser.cpp	(revision a275b3f9d246781dcbb1eae64f444246f68aad00)
@@ -437,5 +437,13 @@
         ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!");
         LOG(4, "INFO: Parsing key " << keyName << " with next token " << *tok_iter);
-        std::string element(knownTypes[(*tok_iter)]);
+        std::string element;
+        try {
+          element = knownTypes.getType(*tok_iter);
+        } catch(IllegalParserKeyException) {
+          // clean up
+          World::getInstance().destroyAtom(newAtom);
+          // give an error
+          ELOG(0, "TremoloParser: I do not understand the element token " << *tok_iter << ".");
+        }
         // put type name into container for later use
         atomInfo->set(currentField, *tok_iter);
@@ -612,83 +620,2 @@
 }
 
-/** Creates knownTypes as the identity, e.g. H -> H, He -> He, ... .
- *
- */
-void FormatParser< tremolo >::createKnownTypesByIdentity()
-{
-  // remove old mapping
-  knownTypes.clear();
-  // make knownTypes the identity mapping
-  const periodentafel *periode = World::getInstance().getPeriode();
-  for (periodentafel::const_iterator iter = periode->begin();
-      iter != periode->end();
-      ++iter) {
-    knownTypes.insert( make_pair(iter->second->getSymbol(), iter->second->getSymbol()) );
-  }
-}
-
-/** Parses a .potentials file and creates from it the knownTypes file.
- *
- * @param file input stream of .potentials file
- */
-void FormatParser< tremolo >::parseKnownTypes(std::istream &file)
-{
-  const periodentafel *periode = World::getInstance().getPeriode();
-  // remove old mapping
-  knownTypes.clear();
-
-//  LOG(3, "INFO: additionalAtomData contains: " << additionalAtomData);
-
-  // parse in file
-  typedef boost::tokenizer<boost::char_separator<char> >
-      tokenizer;
-  boost::char_separator<char> tokensep(":\t ,;");
-  boost::char_separator<char> equalitysep("\t =");
-  std::string line;
-  while (file.good()) {
-    std::getline( file, line );
-    LOG(4, "INFO: full line of parameters is '" << line << "'");
-    if (line.find("particle:") != string::npos) {
-      LOG(3, "INFO: found line '" << line << "' containing keyword 'particle:'.");
-      tokenizer tokens(line, tokensep);
-      ASSERT(tokens.begin() != tokens.end(),
-          "FormatParser< tremolo >::parseKnownTypes() - line with 'particle:' but no particles separated by comma.");
-      // look for particle_type
-      std::string particle_type("NULL");
-      std::string element_type("NULL");
-      for (tokenizer::iterator tok_iter = tokens.begin();
-          tok_iter != tokens.end();
-          ++tok_iter) {
-        if ((*tok_iter).find("particle_type") != string::npos) {
-          LOG(3, "INFO: found token '" << *tok_iter << "' containing keyword 'particle_type'.");
-          tokenizer token((*tok_iter), equalitysep);
-          ASSERT(token.begin() != token.end(),
-                    "FormatParser< tremolo >::parseKnownTypes() - could not split particle_type by equality sign");
-          tokenizer::iterator particle_iter = token.begin();
-          particle_iter++;
-          particle_type = *particle_iter;
-        }
-        if ((*tok_iter).find("element_name") != string::npos) {
-          LOG(3, "INFO: found token '" << *tok_iter << "' containing keyword 'element_name'.");
-          tokenizer token((*tok_iter), equalitysep);
-          ASSERT(token.begin() != token.end(),
-                    "FormatParser< tremolo >::parseKnownTypes() - could not split particle_type by equality sign");
-          tokenizer::iterator element_iter = token.begin();
-          element_iter++;
-          element_type = *element_iter;
-        }
-      }
-      if ((particle_type != "NULL") && (element_type != "NULL")) {
-        if (periode->FindElement(element_type) != NULL) {
-          LOG(1, "INFO: Added Type " << particle_type << " as reference to element " << element_type << ".");
-          knownTypes.insert( make_pair (particle_type, element_type) );
-        } else {
-          ELOG(1, "INFO: Either Type " << particle_type << " or " << element_type << " could not be recognized." );
-        }
-      } else {
-        ELOG(3, "Line does not contain both 'particle_type' and 'element_name' as keys." );
-      }
-    }
-  }
-
-}
Index: src/Parser/TremoloParser.hpp
===================================================================
--- src/Parser/TremoloParser.hpp	(revision d9005c16a207bbd7364238aaf6dfaa1afe18b7cb)
+++ src/Parser/TremoloParser.hpp	(revision a275b3f9d246781dcbb1eae64f444246f68aad00)
@@ -22,4 +22,5 @@
 #include "ParserTypes.hpp"
 
+#include "TremoloParser_ElementKeys.hpp"
 #include "TremoloKey.hpp"
 #include "TremoloAtomInfoContainer.hpp"
@@ -51,8 +52,22 @@
   void save(std::ostream* file, const std::vector<atom *> &atoms);
   void setFieldsForSave(std::string atomDataLine);
+  void setAtomData(const std::string &atomdata_string);
 
-  void parseKnownTypes(std::istream &file);
-  void createKnownTypesByIdentity();
-  void setAtomData(const std::string &atomdata_string);
+private:
+  /**
+   * Map to associate element keys with the respective elements.
+   */
+  struct ElementKeys knownTypes;
+
+public:
+
+  void parseKnownTypes(std::istream &file)
+  {
+    knownTypes.parseKnownTypes(file);
+  }
+  void createKnownTypesByIdentity()
+  {
+    knownTypes.createKnownTypesByIdentity();
+  }
 
 protected:
@@ -72,9 +87,4 @@
   void writeNeighbors(std::ostream* file, int numberOfNeighbors, atom* currentAtom);
   void saveLine(std::ostream* file, atom* currentAtom);
-
-  /**
-   * Map to associate the elements with stuff in "type", e.g. OC2 -> O.
-   */
-  std::map<std::string, std::string> knownTypes;
 
   /**
