Index: src/Actions/Makefile.am
===================================================================
--- src/Actions/Makefile.am	(revision e4fe8d6bab9cf4dd5525442cf6174806c453318a)
+++ src/Actions/Makefile.am	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
@@ -96,6 +96,8 @@
   MoleculeAction/FillVoidWithMoleculeAction.cpp \
   MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp \
+  MoleculeAction/LoadAction.cpp \
   MoleculeAction/RotateAroundSelfByAngleAction.cpp \
   MoleculeAction/RotateToPrincipalAxisSystemAction.cpp \
+  MoleculeAction/SaveAction.cpp \
   MoleculeAction/SaveAdjacencyAction.cpp \
   MoleculeAction/SaveBondsAction.cpp \
@@ -110,6 +112,8 @@
   MoleculeAction/FillVoidWithMoleculeAction.hpp \
   MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp \
+  MoleculeAction/LoadAction.cpp \
   MoleculeAction/RotateAroundSelfByAngleAction.hpp \
   MoleculeAction/RotateToPrincipalAxisSystemAction.hpp \
+  MoleculeAction/SaveAction.hpp \
   MoleculeAction/SaveAdjacencyAction.hpp \
   MoleculeAction/SaveBondsAction.hpp \
@@ -118,11 +122,4 @@
   MoleculeAction/VerletIntegrationAction.hpp
                  
-PARSERACTIONSOURCE = \
-  ParserAction/LoadXyzAction.cpp \
-  ParserAction/SaveXyzAction.cpp       
-PARSERACTIONHEADER = \
-  ParserAction/LoadXyzAction.hpp \
-  ParserAction/SaveXyzAction.hpp
-
 SELECTIONACTIONSOURCE = \
 	SelectionAction/AllAtomsAction.cpp \
Index: src/Actions/MoleculeAction/LoadAction.cpp
===================================================================
--- src/Actions/MoleculeAction/LoadAction.cpp	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
+++ src/Actions/MoleculeAction/LoadAction.cpp	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
@@ -0,0 +1,97 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * LoadAction.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "Parser/FormatParserStorage.hpp"
+#include "molecule.hpp"
+#include "World.hpp"
+
+#include <iostream>
+
+#include <boost/filesystem/fstream.hpp>
+
+using namespace std;
+
+#include "LoadAction.hpp"
+
+// and construct the stuff
+#include "LoadAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr MoleculeLoadAction::performCall() {
+  // obtain information
+  getParametersfromValueStorage();
+
+  // parsing file if present
+  if (!boost::filesystem::exists(params.filename)) {
+    DoLog(1) && (Log() << Verbose(1) << "Specified input file " << params.filename << " not found." << endl);
+    // DONT FAIL: it's just empty and we use the name. // return Action::failure;
+  } else {
+    DoLog(1) && (Log() << Verbose(1) << "Specified input file found, parsing ... ");
+
+    // extract suffix
+    std::string FilenameSuffix;
+    std::string FilenamePrefix;
+    if (params.filename.has_filename()) {
+      // get suffix
+      FilenameSuffix = params.filename.extension().substr(1); // remove the prefixed "."
+      FilenamePrefix = params.filename.stem();
+    } else {
+      DoeLog(1) && (eLog() << Verbose(1) << "Input file does not have a suffix, cannot recognize format." << endl);
+      return Action::failure;
+    }
+
+    // parse the file
+    boost::filesystem::ifstream input;
+    input.open(params.filename);
+    FormatParserStorage::getInstance().get(input, FilenameSuffix);
+    input.close();
+
+    // set file name of last molecule
+    MoleculeList::const_reverse_iterator iter = World::getInstance().getMolecules()->ListOfMolecules.rbegin();
+    (*iter)->SetNameFromFilename(FilenamePrefix.c_str());
+  }
+  return Action::success;
+}
+
+Action::state_ptr MoleculeLoadAction::performUndo(Action::state_ptr _state) {
+//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+}
+
+Action::state_ptr MoleculeLoadAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+}
+
+bool MoleculeLoadAction::canUndo() {
+  return false;
+}
+
+bool MoleculeLoadAction::shouldUndo() {
+  return false;
+}
+/** =========== end of function ====================== */
Index: src/Actions/MoleculeAction/LoadAction.def
===================================================================
--- src/Actions/MoleculeAction/LoadAction.def	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
+++ src/Actions/MoleculeAction/LoadAction.def	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
@@ -0,0 +1,33 @@
+/*
+ * LoadAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required, use (NODEFAULT) for each (undefined) default value
+#define paramtypes (boost::filesystem::path)
+#define paramtokens ("load")
+#define paramdescriptions ("name of molecule file")
+#undef paramdefaults
+#define paramreferences (filename)
+
+#undef statetypes
+#undef statereferences
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Molecule
+#define MENUNAME "molecule"
+#define MENUPOSITION 1
+#define ACTIONNAME Load
+#define TOKEN "load"
+
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "parse file with molecule into World"
+#define SHORTFORM "l"
Index: src/Actions/MoleculeAction/LoadAction.hpp
===================================================================
--- src/Actions/MoleculeAction/LoadAction.hpp	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
+++ src/Actions/MoleculeAction/LoadAction.hpp	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
@@ -0,0 +1,16 @@
+/*
+ * LoadXyzAction.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef LOADXYZACTION_HPP_
+#define LOADXYZACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+#include "LoadAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* LOADXYZACTION_HPP_ */
Index: src/Actions/MoleculeAction/SaveAction.cpp
===================================================================
--- src/Actions/MoleculeAction/SaveAction.cpp	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
+++ src/Actions/MoleculeAction/SaveAction.cpp	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
@@ -0,0 +1,94 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * SaveAction.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "Parser/FormatParserStorage.hpp"
+
+#include <iostream>
+#include <string>
+
+#include <boost/filesystem/fstream.hpp>
+
+using namespace std;
+
+#include "SaveAction.hpp"
+
+// and construct the stuff
+#include "SaveAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr MoleculeSaveAction::performCall() {
+  // obtain information
+  getParametersfromValueStorage();
+
+  DoLog(1) && (Log() << Verbose(1) << "Storing world to file " << params.filename << "." << endl);
+
+  // extract suffix
+  std::string FilenameSuffix;
+  std::string FilenamePrefix;
+  if (params.filename.has_filename()) {
+    // get suffix
+    FilenameSuffix = params.filename.extension().substr(1); // remove the prefixed "."
+    FilenamePrefix = params.filename.stem();
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "Output file does not have a suffix, cannot recognize format." << endl);
+    return Action::failure;
+  }
+
+  // store file
+  // parse the file
+  boost::filesystem::ofstream output;
+  output.open(params.filename);
+  if (!output.fail()) {
+    FormatParserStorage::getInstance().put(output, FilenameSuffix);
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "Could not open file " << params.filename << "." << endl);
+  }
+  output.close();
+
+  return Action::failure;
+}
+
+Action::state_ptr MoleculeSaveAction::performUndo(Action::state_ptr _state) {
+//  ParserSaveXyzState *state = assert_cast<ParserSaveXyzState*>(_state.get());
+
+  return Action::failure;
+//  string newName = state->mol->getName();
+//  state->mol->setName(state->lastName);
+//
+//  return Action::state_ptr(new ParserSaveXyzState(state->mol,newName));
+}
+
+Action::state_ptr MoleculeSaveAction::performRedo(Action::state_ptr _state){
+  return Action::failure;
+//  // Undo and redo have to do the same for this action
+//  return performUndo(_state);
+}
+
+bool MoleculeSaveAction::canUndo() {
+  return false;
+}
+
+bool MoleculeSaveAction::shouldUndo() {
+  return false;
+}
+/** =========== end of function ====================== */
Index: src/Actions/MoleculeAction/SaveAction.def
===================================================================
--- src/Actions/MoleculeAction/SaveAction.def	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
+++ src/Actions/MoleculeAction/SaveAction.def	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
@@ -0,0 +1,33 @@
+/*
+ * SaveAction.def
+ *
+ *  Created on: Aug 26, 2010
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required, use (NODEFAULT) for each (undefined) default value
+#define paramtypes (boost::filesystem::path)
+#define paramtokens ("save")
+#define paramdescriptions ("file name of file")
+#undef paramdefaults
+#define paramreferences (filename)
+
+#undef statetypes
+#undef statereferences
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Molecule
+#define MENUNAME "molecule"
+#define MENUPOSITION 2
+#define ACTIONNAME Save
+#define TOKEN "save"
+
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "save world as file of certain type"
+#define SHORTFORM "s"
Index: src/Actions/MoleculeAction/SaveAction.hpp
===================================================================
--- src/Actions/MoleculeAction/SaveAction.hpp	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
+++ src/Actions/MoleculeAction/SaveAction.hpp	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
@@ -0,0 +1,16 @@
+/*
+ * SaveXyzAction.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef SAVEXYZACTION_HPP_
+#define SAVEXYZACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+#include "SaveAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* SAVEXYZACTION_HPP_ */
Index: src/Actions/ParserAction/LoadXyzAction.cpp
===================================================================
--- src/Actions/ParserAction/LoadXyzAction.cpp	(revision e4fe8d6bab9cf4dd5525442cf6174806c453318a)
+++ 	(revision )
@@ -1,75 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2010 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * LoadXyzAction.cpp
- *
- *  Created on: May 8, 2010
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "Helpers/MemDebug.hpp"
-
-#include "Helpers/Log.hpp"
-#include "Helpers/Verbose.hpp"
-#include "Parser/XyzParser.hpp"
-
-#include <iostream>
-
-using namespace std;
-
-#include "Actions/ParserAction/LoadXyzAction.hpp"
-
-// and construct the stuff
-#include "LoadXyzAction.def"
-#include "Action_impl_pre.hpp"
-/** =========== define the function ====================== */
-Action::state_ptr ParserLoadXyzAction::performCall() {
-  // obtain information
-  getParametersfromValueStorage();
-
-  DoLog(1) && (Log() << Verbose(1) << "Parsing xyz file " << params.filename << " for new atoms." << endl);
-  // parse xyz file
-  ifstream input;
-  input.open(params.filename.string().c_str());
-  if (!input.fail()) {
-    XyzParser parser; // briefly instantiate a parser which is removed at end of focus
-    parser.load(&input);
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "Could not open file " << params.filename << "." << endl);
-  }
-  input.close();
-  return Action::success;
-}
-
-Action::state_ptr ParserLoadXyzAction::performUndo(Action::state_ptr _state) {
-//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
-
-  return Action::failure;
-//  string newName = state->mol->getName();
-//  state->mol->setName(state->lastName);
-//
-//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
-}
-
-Action::state_ptr ParserLoadXyzAction::performRedo(Action::state_ptr _state){
-  return Action::failure;
-}
-
-bool ParserLoadXyzAction::canUndo() {
-  return false;
-}
-
-bool ParserLoadXyzAction::shouldUndo() {
-  return false;
-}
-/** =========== end of function ====================== */
Index: src/Actions/ParserAction/LoadXyzAction.def
===================================================================
--- src/Actions/ParserAction/LoadXyzAction.def	(revision e4fe8d6bab9cf4dd5525442cf6174806c453318a)
+++ 	(revision )
@@ -1,33 +1,0 @@
-/*
- * LoadXyzAction.def
- *
- *  Created on: Aug 26, 2010
- *      Author: heber
- */
-
-// all includes and forward declarations necessary for non-integral types below
-
-
-// i.e. there is an integer with variable name Z that can be found in
-// ValueStorage by the token "Z" -> first column: int, Z, "Z"
-// "undefine" if no parameters are required, use (NODEFAULT) for each (undefined) default value
-#define paramtypes (boost::filesystem::path)
-#define paramtokens ("parse-xyz")
-#define paramdescriptions ("name of xyz file")
-#undef paramdefaults
-#define paramreferences (filename)
-
-#undef statetypes
-#undef statereferences
-
-// some defines for all the names, you may use ACTION, STATE and PARAMS
-#define CATEGORY Parser
-#define MENUNAME "parser"
-#define MENUPOSITION 1
-#define ACTIONNAME LoadXyz
-#define TOKEN "parse-xyz"
-
-
-// finally the information stored in the ActionTrait specialization
-#define DESCRIPTION "parse xyz file into World"
-#define SHORTFORM "p"
Index: src/Actions/ParserAction/LoadXyzAction.hpp
===================================================================
--- src/Actions/ParserAction/LoadXyzAction.hpp	(revision e4fe8d6bab9cf4dd5525442cf6174806c453318a)
+++ 	(revision )
@@ -1,16 +1,0 @@
-/*
- * LoadXyzAction.hpp
- *
- *  Created on: May 8, 2010
- *      Author: heber
- */
-
-#ifndef LOADXYZACTION_HPP_
-#define LOADXYZACTION_HPP_
-
-#include "Actions/Action.hpp"
-
-#include "LoadXyzAction.def"
-#include "Action_impl_header.hpp"
-
-#endif /* LOADXYZACTION_HPP_ */
Index: src/Actions/ParserAction/SaveXyzAction.cpp
===================================================================
--- src/Actions/ParserAction/SaveXyzAction.cpp	(revision e4fe8d6bab9cf4dd5525442cf6174806c453318a)
+++ 	(revision )
@@ -1,79 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2010 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * SaveXyzAction.cpp
- *
- *  Created on: May 8, 2010
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "Helpers/MemDebug.hpp"
-
-#include "Helpers/Log.hpp"
-#include "Helpers/Verbose.hpp"
-#include "Parser/XyzParser.hpp"
-
-#include <iostream>
-#include <string>
-
-using namespace std;
-
-#include "Actions/ParserAction/SaveXyzAction.hpp"
-
-// and construct the stuff
-#include "SaveXyzAction.def"
-#include "Action_impl_pre.hpp"
-/** =========== define the function ====================== */
-Action::state_ptr ParserSaveXyzAction::performCall() {
-  XyzParser parser;
-
-  // obtain information
-  getParametersfromValueStorage();
-
-  DoLog(1) && (Log() << Verbose(1) << "Storing xyz file " << params.filename << "." << endl);
-  // store xyz file
-  ofstream output;
-  output.open(params.filename.string().c_str());
-  if (!output.fail()) {
-    parser.save(&output);
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "Could not open file " << params.filename << "." << endl);
-  }
-  output.close();
-  return Action::failure;
-}
-
-Action::state_ptr ParserSaveXyzAction::performUndo(Action::state_ptr _state) {
-//  ParserSaveXyzState *state = assert_cast<ParserSaveXyzState*>(_state.get());
-
-  return Action::failure;
-//  string newName = state->mol->getName();
-//  state->mol->setName(state->lastName);
-//
-//  return Action::state_ptr(new ParserSaveXyzState(state->mol,newName));
-}
-
-Action::state_ptr ParserSaveXyzAction::performRedo(Action::state_ptr _state){
-  return Action::failure;
-//  // Undo and redo have to do the same for this action
-//  return performUndo(_state);
-}
-
-bool ParserSaveXyzAction::canUndo() {
-  return false;
-}
-
-bool ParserSaveXyzAction::shouldUndo() {
-  return false;
-}
-/** =========== end of function ====================== */
Index: src/Actions/ParserAction/SaveXyzAction.def
===================================================================
--- src/Actions/ParserAction/SaveXyzAction.def	(revision e4fe8d6bab9cf4dd5525442cf6174806c453318a)
+++ 	(revision )
@@ -1,33 +1,0 @@
-/*
- * SaveXyzAction.def
- *
- *  Created on: Aug 26, 2010
- *      Author: heber
- */
-
-// all includes and forward declarations necessary for non-integral types below
-
-
-// i.e. there is an integer with variable name Z that can be found in
-// ValueStorage by the token "Z" -> first column: int, Z, "Z"
-// "undefine" if no parameters are required, use (NODEFAULT) for each (undefined) default value
-#define paramtypes (boost::filesystem::path)
-#define paramtokens ("store-xyz")
-#define paramdescriptions ("file name of xyz file")
-#undef paramdefaults
-#define paramreferences (filename)
-
-#undef statetypes
-#undef statereferences
-
-// some defines for all the names, you may use ACTION, STATE and PARAMS
-#define CATEGORY Parser
-#define MENUNAME "parser"
-#define MENUPOSITION 2
-#define ACTIONNAME SaveXyz
-#define TOKEN "store-xyz"
-
-
-// finally the information stored in the ActionTrait specialization
-#define DESCRIPTION "save world as xyz file"
-#undef SHORTFORM
Index: src/Actions/ParserAction/SaveXyzAction.hpp
===================================================================
--- src/Actions/ParserAction/SaveXyzAction.hpp	(revision e4fe8d6bab9cf4dd5525442cf6174806c453318a)
+++ 	(revision )
@@ -1,16 +1,0 @@
-/*
- * SaveXyzAction.hpp
- *
- *  Created on: May 8, 2010
- *      Author: heber
- */
-
-#ifndef SAVEXYZACTION_HPP_
-#define SAVEXYZACTION_HPP_
-
-#include "Actions/Action.hpp"
-
-#include "SaveXyzAction.def"
-#include "Action_impl_header.hpp"
-
-#endif /* SAVEXYZACTION_HPP_ */
Index: src/Actions/WorldAction/InputAction.cpp
===================================================================
--- src/Actions/WorldAction/InputAction.cpp	(revision e4fe8d6bab9cf4dd5525442cf6174806c453318a)
+++ src/Actions/WorldAction/InputAction.cpp	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
@@ -23,5 +23,4 @@
 #include "molecule.hpp"
 #include "Parser/FormatParserStorage.hpp"
-#include "Parser/PcpParser.hpp"
 #include "Helpers/Verbose.hpp"
 #include "World.hpp"
Index: src/Actions/WorldAction/ScaleBoxAction.def
===================================================================
--- src/Actions/WorldAction/ScaleBoxAction.def	(revision e4fe8d6bab9cf4dd5525442cf6174806c453318a)
+++ src/Actions/WorldAction/ScaleBoxAction.def	(revision cabb4679cb9a88d3965bf3c046c49ed900a21865)
@@ -32,3 +32,3 @@
 // finally the information stored in the ActionTrait specialization
 #define DESCRIPTION "scale box and atomic positions inside"
-#define SHORTFORM "s"
+#undef SHORTFORM
