Index: code/branches/console/CMakeLists.txt
===================================================================
--- code/branches/console/CMakeLists.txt	(revision 1132)
+++ code/branches/console/CMakeLists.txt	(revision 1133)
@@ -32,6 +32,6 @@
 
 #set binary output directories
-SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
-SET(LIBRARY_OUTPUT_PATH    ${PROJECT_BINARY_DIR}/bin/lib)
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
+SET(LIBRARY_OUTPUT_PATH    ${PROJECT_SOURCE_DIR}/bin/lib)
 
 # global compiler/linker flags. force -O2!
@@ -43,6 +43,8 @@
 SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined")
 
-#Create verbose makefile output when compiling
-SET(CMAKE_VERBOSE_MAKEFILE TRUE)
+#use 'cmake -D make_verb:1 path' to get verbose make output when compiling
+IF (MAKE_VERB)
+ SET(CMAKE_VERBOSE_MAKEFILE TRUE)
+ENDIF (MAKE_VERB)
 
 
Index: code/branches/console/cmake/FindLua.cmake
===================================================================
--- code/branches/console/cmake/FindLua.cmake	(revision 1132)
+++ code/branches/console/cmake/FindLua.cmake	(revision 1133)
@@ -1,69 +1,74 @@
-# Find Lua includes and library
+#  Find Lua header and library files
 #
-# This module defines
-#  Lua_INCLUDE_DIR
-#  Lua_LIBRARIES, the libraries to link against to use Lua.
-#  Lua_LIB_DIR, the location of the libraries
-#  Lua_FOUND, If false, do not try to use Lua
+#  When called, this script tries to define:
+#  Lua_INCLUDE_DIR    Header files directory
+#  Lua_LIBRARIES      library files (or file when using lua 5.1)
+#  Lua_FOUND          defined (true) if lua was found
+#  Lua_VERSION        either 5.1 or 5.0 or undefined
 #
-# Copyright © 2007, Matt Williams
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
+#  authors: Benjamin Knecht, Reto Grieder
 
-MESSAGE(STATUS "lua libs in cache: ${Lua_LIBRARIES}")
 IF (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
-    SET(Lua_FIND_QUIETLY TRUE) # Already in cache, be silent
+
+  # Already in cache, be silent
+  SET(Lua_FOUND TRUE)
+  SET(Lua_FIND_QUIETLY TRUE) 
+  MESSAGE(STATUS "Lua was found.")
+
+ELSE (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
+
+  FIND_PATH(Lua_INCLUDE_DIR_51 lua.h
+    /usr/include/lua5.1
+    /usr/local/include/lua5.1
+    ../libs/lua-5.1.3/src)
+
+  FIND_PATH(Lua_INCLUDE_DIR_50 lua.h
+    /usr/include/lua50
+    /usr/local/include/lua50
+    /usr/pack/lua-5.0.3-sd/include)
+
+  FIND_LIBRARY(Lua_LIBRARY_51 lua5.1
+    /usr/lib
+    /usr/local/lib
+    ../libs/lua-5.1.3/lib)
+
+  FIND_LIBRARY(Lua_LIBRARY_1_50 NAMES lua50 lua PATHS
+	/usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib #tardis
+    /usr/lib
+    /usr/local/lib)
+
+  FIND_LIBRARY(Lua_LIBRARY_2_50 NAMES lualib50 lualib PATHS
+	/usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib #tardis
+    /usr/lib
+    /usr/local/lib)
+
+
+  IF (Lua_INCLUDE_DIR_51 AND Lua_LIBRARY_51)
+
+    # Found newer lua 5.1 libs
+    SET(Lua_FOUND TRUE)
+    SET(Lua_VERSION 5.1 CACHE STRING "")
+    SET(Lua_INCLUDE_DIR ${Lua_INCLUDE_DIR_51} CACHE PATH "")
+    SET(Lua_LIBRARIES ${Lua_LIBRARY_51} CACHE FILEPATH "")
+
+  ELSEIF(Lua_INCLUDE_DIR_50 AND Lua_LIBRARY_1_50 AND Lua_LIBRARY_2_50)
+
+    # Found older lua 5.0 libs
+    SET(Lua_FOUND TRUE)
+    SET(Lua_VERSION 5.0 CACHE STRING "")
+    SET(Lua_INCLUDE_DIR ${Lua_INCLUDE_DIR_50} CACHE PATH "")
+    SET(Lua_LIBRARIES ${Lua_LIBRARY_1_50} ${Lua_LIBRARY_2_50} CACHE FILEPATH "")
+
+  ENDIF (Lua_INCLUDE_DIR_51 AND Lua_LIBRARY_51)
+	
+
+  IF (Lua_FOUND)
+    MESSAGE(STATUS "Found Lua: ${Lua_LIBRARIES}")
+  ELSE (Lua_FOUND)
+    IF (Lua_FIND_REQUIRED)
+      MESSAGE(FATAL_ERROR "Could not find Lua")
+    ENDIF (Lua_FIND_REQUIRED)
+  ENDIF (Lua_FOUND)
+
 ENDIF (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
 
-FIND_PATH(Lua_INCLUDE_DIR lua.h
-	/usr/include/lua5.1
-	/usr/local/include/lua5.1
-	../libs/lua-5.1.3/src)
-
-FIND_LIBRARY(Lua_LIBRARIES lua5.1
-	/usr/lib
-	/usr/local/lib
-	../libs/lua-5.1.3/lib)
-
-IF (NOT Lua_INCLUDE_DIR)
- FIND_PATH(Lua_INCLUDE_DIR lua.h
-	/usr/include/lua50
-	/usr/local/include/lua50
-	/usr/pack/lua-5.0.3-sd/include)
-ENDIF (NOT Lua_INCLUDE_DIR)
-
-IF (NOT Lua_LIBRARIES)
- FIND_LIBRARY(Lua_LIBRARIES lua50
-	/usr/lib
-	/usr/local/lib)
-
- FIND_LIBRARY(Lua_LIBRARY lualib50
-	/usr/lib
-	/usr/local/lib)
-
-#SET(Lua_LIBRARIES ${Lua_LIBRARIES} ${Lua_LIBRARY})
-ENDIF (NOT Lua_LIBRARIES)
-
-#especially for tardis
-IF (NOT Lua_LIBRARIES)
- FIND_LIBRARY(Lua_LIBRARIES lua
-	/usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib)
-
- FIND_LIBRARY(Lua_LIBRARY lualib
-	/usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib)
-
-#SET(Lua_LIBRARIES ${Lua_LIBRARIES} ${Lua_LIBRARY})
-ENDIF (NOT Lua_LIBRARIES)
-
-IF (Lua_INCLUDE_DIR AND Lua_LIBRARIES)
-    SET(Lua_FOUND TRUE)
-ENDIF (Lua_INCLUDE_DIR AND Lua_LIBRARIES)
-
-IF (Lua_FOUND)
-    MESSAGE(STATUS "Found Lua: ${Lua_LIBRARIES}")
-    MESSAGE(STATUS "Found Lua: ${Lua_LIBRARY}")
-ELSE (Lua_FOUND)
-    IF (Lua_FIND_REQUIRED)
-        MESSAGE(FATAL_ERROR "Could not find Lua")
-    ENDIF (Lua_FIND_REQUIRED)
-ENDIF (Lua_FOUND)
Index: code/branches/console/src/core/CMakeLists.txt
===================================================================
--- code/branches/console/src/core/CMakeLists.txt	(revision 1132)
+++ code/branches/console/src/core/CMakeLists.txt	(revision 1133)
@@ -34,5 +34,4 @@
   tolualib
   ${Lua_LIBRARIES}
-  ${Lua_LIBRARY}
   ${OIS_LIBRARIES}
 )
Index: code/branches/console/src/orxonox/Orxonox.cc
===================================================================
--- code/branches/console/src/orxonox/Orxonox.cc	(revision 1132)
+++ code/branches/console/src/orxonox/Orxonox.cc	(revision 1133)
@@ -54,4 +54,5 @@
 //#include "util/Sleep.h"
 #include "util/ArgReader.h"
+#include "util/ExprParser.h"
 
 // core
@@ -123,4 +124,26 @@
       InputBuffer* ib_;
   };
+
+  class Calculator
+  {
+  public:
+    static void calculate(const std::string& calculation)
+    {
+      ExprParser expr(calculation);
+      if (expr.getSuccess())
+      {
+        if (expr.getResult() == 42.0)
+          std::cout << "Greetings from the restaurant at the end of the universe." << std::endl;
+        // FIXME: insert modifier to display in full precision
+        std::cout << "Result is: " << expr.getResult() << std::endl;
+        if (expr.getRemains() != "")
+          std::cout << "Warning: Expression could not be parsed to the end! Remains: '"
+              << expr.getRemains() << "'" << std::endl;
+      }
+      else
+        std::cout << "Cannot calculate expression: Parse error" << std::endl;
+    }
+  };
+  ConsoleCommandShortcut(Calculator, calculate, AccessLevel::None);
 
   /**
@@ -410,4 +433,6 @@
       return;
     }
+    Ogre::Root& ogreRoot = Ogre::Root::getSingleton();
+
 
     // Contains the times of recently fired events
@@ -429,4 +454,5 @@
 	  {
 		  // Pump messages in all registered RenderWindows
+      // This calls the WindowEventListener objects.
       Ogre::WindowEventUtilities::messagePump();
 
@@ -452,9 +478,9 @@
       // don't forget to call _fireFrameStarted in ogre to make sure
       // everything goes smoothly
-      Ogre::Root::getSingleton()._fireFrameStarted(evt);
+      ogreRoot._fireFrameStarted(evt);
 
       // server still renders at the moment
       //if (mode_ != SERVER)
-      Ogre::Root::getSingleton()._updateAllRenderTargets(); // only render in non-server mode
+      ogreRoot._updateAllRenderTargets(); // only render in non-server mode
 
       // get current time
@@ -466,5 +492,5 @@
 
       // again, just to be sure ogre works fine
-      Ogre::Root::getSingleton()._fireFrameEnded(evt);
+      ogreRoot._fireFrameEnded(evt);
 	  }
   }
Index: code/branches/console/src/tolua/CMakeLists.txt
===================================================================
--- code/branches/console/src/tolua/CMakeLists.txt	(revision 1132)
+++ code/branches/console/src/tolua/CMakeLists.txt	(revision 1133)
@@ -14,5 +14,4 @@
 TARGET_LINK_LIBRARIES(tolua
   ${Lua_LIBRARIES}
-  ${Lua_LIBRARY}
   m
 )
@@ -41,7 +40,7 @@
 ADD_CUSTOM_COMMAND(
   OUTPUT tolua_bind.h tolua_bind.cc
-  COMMAND ${TOLUA_EXE} -n orxonox -o ../../src/tolua/tolua_bind.cc -H ../../src/tolua/tolua_bind.h ../../src/tolua/tolua.pkg
+  COMMAND ${TOLUA_EXE} -n orxonox -o tolua/tolua_bind.cc -H tolua/tolua_bind.h tolua/tolua.pkg
   DEPENDS tolua
-  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin/lib
+  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src
 )
 
@@ -50,5 +49,4 @@
 TARGET_LINK_LIBRARIES(tolualib
   ${Lua_LIBRARIES}
-  ${Lua_LIBRARY}
 )
 
Index: code/branches/console/src/tolua/tolua.pkg
===================================================================
--- code/branches/console/src/tolua/tolua.pkg	(revision 1132)
+++ code/branches/console/src/tolua/tolua.pkg	(revision 1133)
@@ -1,1 +1,1 @@
-$cfile "../../src/core/Script_clean.h"
+$cfile "core/Script_clean.h"
Index: code/branches/console/src/util/CMakeLists.txt
===================================================================
--- code/branches/console/src/util/CMakeLists.txt	(revision 1132)
+++ code/branches/console/src/util/CMakeLists.txt	(revision 1133)
@@ -7,4 +7,5 @@
   Clipboard.cc
   SubString.cc
+  ExprParser.cc
   MultiTypePrimitive.cc
   MultiTypeString.cc
Index: code/branches/console/src/util/ExprParser.cc
===================================================================
--- code/branches/console/src/util/ExprParser.cc	(revision 1133)
+++ code/branches/console/src/util/ExprParser.cc	(revision 1133)
@@ -0,0 +1,451 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+  @file
+  @brief Declaration of FloatParser
+*/
+
+#include "ExprParser.h"
+#include <cmath>
+#include <cstring>
+
+// macros for easier if, else statements
+#define CASE_1(var) if (!strcmp(SWITCH,var))
+#define CASE(var) else if (!strcmp(SWITCH,var))
+#define CASE_ELSE else
+
+//! skip white spaces
+#define PARSE_BLANKS while (*reading_stream == ' ') ++reading_stream;
+
+ExprParser::ExprParser(const std::string& str)
+{
+  this->failed_ = false;
+  this->reading_stream = str.c_str();
+  if (str.size() == 0 || *reading_stream == '\0')
+  {
+    this->failed_ = true;
+    this->result_ = 0.0;
+  }
+  else
+  {
+    this->result_ = parse_expr_8();
+    this->remains_ = reading_stream;
+  }
+}
+
+//Private functions:
+/******************/
+double ExprParser::parse_argument()
+{
+   double value = parse_expr_8();
+   if (*reading_stream == ',')
+   {
+      ++reading_stream;
+      return value;
+   }
+   else
+   {
+     this->failed_ = true;
+     return 0;
+   }
+}
+
+double ExprParser::parse_last_argument()
+{
+   double value = parse_expr_8();
+   if (*reading_stream == ')')
+   {
+      ++reading_stream;
+      return value;
+   }
+   else
+   {
+     this->failed_ = true;
+     return 0;
+   }
+}
+
+double ExprParser::parse_expr_8()
+{
+   double value = parse_expr_7();
+   for(;;)
+   {
+      switch (op)
+      {
+         case oder:
+            value = parse_expr_7() || value;
+            break;
+         default: return value;
+      }
+   };
+}
+
+
+double ExprParser::parse_expr_7()
+{
+   double value = parse_expr_6();
+   for(;;)
+   {
+      switch (op)
+      {
+         case und:
+            value = value && parse_expr_6();
+            break;
+         default: return value;
+      }
+   };
+}
+
+double ExprParser::parse_expr_6()
+{
+   double value = parse_expr_5();
+   for(;;)
+   {
+      switch (op)
+      {
+         case gleich:
+            value = (value == parse_expr_5());
+            break;
+         case ungleich:
+            value = (value != parse_expr_5());
+            break;
+         default:
+            return value;
+      }
+   };
+}
+
+double ExprParser::parse_expr_5()
+{
+   double value = parse_expr_4();
+   for(;;)
+   {
+      switch (op)
+      {
+         case kleiner:
+            value = (value < parse_expr_4());
+            break;
+         case kleinergleich:
+            value = (value <= parse_expr_4());
+            break;
+         case groesser:
+            value = (value > parse_expr_4());
+            break;
+         case groessergleich:
+            value = (value >= parse_expr_4());
+            break;
+         default:
+            return value;
+      }
+   };
+}
+
+double ExprParser::parse_expr_4()
+{
+   double value = parse_expr_3();
+   for(;;)
+   {
+      switch (op)
+      {
+         case b_plus:
+            value += parse_expr_3();
+            break;
+         case b_minus:
+            value -= parse_expr_3();
+            break;
+         default:
+            return value;
+      }
+   };
+}
+
+double ExprParser::parse_expr_3()
+{
+   double value = parse_expr_2();
+   for(;;)
+   {
+      switch (op)
+      {
+         case mal:
+            value *= parse_expr_2();
+            break;
+         case durch:
+            value /= parse_expr_2();
+            break;
+         case modulo:
+         {
+            double temp = parse_expr_2();
+            value = value - floor(value/temp)*temp;
+            break;
+         }
+         default:
+            return value;
+      }
+   };
+}
+
+double ExprParser::parse_expr_2()
+{
+   double value = parse_expr_1();
+   while (*reading_stream != '\0')
+   {
+      op = parse_binary_operator();
+      switch (op)
+      {
+         case hoch:
+            value = pow(value,parse_expr_1());
+            break;
+         default:
+            return value;
+      }
+   };
+   op = undef;
+   return value;
+}
+
+double ExprParser::parse_expr_1()
+{
+   PARSE_BLANKS
+   double value;
+
+   unary_operator op = parse_unary_operator();
+   PARSE_BLANKS
+
+   if (*reading_stream == '\0')
+   {
+     // end of string
+     this->failed_ = true;
+     return 0;
+   }
+   else if (*reading_stream > 47 && *reading_stream < 59 || *reading_stream == 46)
+   {  // number
+      value = strtod(reading_stream, const_cast<char**>(&reading_stream));
+   }
+   else if (*reading_stream > 64 && *reading_stream < 91 || *reading_stream > 96 && *reading_stream < 123 || *reading_stream == 46)
+   {  // variable or function
+      char* word = new char[256];
+      parse_word(word);
+      PARSE_BLANKS
+      if (*reading_stream == '(')
+      {
+         ++reading_stream;
+#define SWITCH word
+         CASE_1("sin")
+            value = sin(parse_last_argument());
+         CASE("asin")
+            value = asin(parse_last_argument());
+         CASE("sinh")
+            value = sinh(parse_last_argument());
+         CASE("asinh")
+         {
+            value = parse_last_argument();
+            value = log(sqrt(pow(value, 2) + 1) + value);
+         }
+         CASE("cos")
+            value = cos(parse_last_argument());
+         CASE("acos")
+            value = acos(parse_last_argument());
+         CASE("cosh")
+            value = cosh(parse_last_argument());
+         CASE("acosh")
+         {
+            value = parse_last_argument();
+            value = log(sqrt(pow(value, 2) - 1) + value);
+         }
+         CASE("tan")
+            value = tan(parse_last_argument());
+         CASE("atan")
+            value = atan(parse_last_argument());
+         CASE("atan2")
+            value = atan2(parse_argument(),parse_last_argument());
+         CASE("tanh")
+            value = tanh(parse_last_argument());
+         CASE("atanh")
+         {
+            value = parse_last_argument();
+            value = 0.5*log((value + 1)/(value - 1));
+         }
+         CASE("int")
+            value = floor(parse_last_argument());
+         CASE("floor")
+            value = floor(parse_last_argument());
+         CASE("ceil")
+            value = ceil(parse_last_argument());
+         CASE("abs")
+            value = fabs(parse_last_argument());
+         CASE("exp")
+            value = exp(parse_last_argument());
+         CASE("log")
+            value = log10(parse_last_argument());
+         CASE("ln")
+            value = log(parse_last_argument());
+         CASE("sign")
+         {
+            value = parse_last_argument();
+            value = (value>0 ? 1 : (value<0 ? -1 : 0));
+         }
+         CASE("sqrt")
+            value = sqrt(parse_last_argument());
+         CASE("degrees")
+            value = parse_last_argument()*180/3.1415926535897932;
+         CASE("radians")
+            value = parse_last_argument()*3.1415926535897932/180;
+         CASE("mod")
+         {
+            value = parse_argument();
+            double value2 = parse_last_argument();
+            value = value - floor(value/value2)*value2;
+         }
+         CASE("pow")
+            value = pow(parse_argument(),parse_last_argument());
+         CASE("div")
+            value = floor(parse_argument()/parse_last_argument());
+         CASE("max")
+           value = std::max(parse_argument(),parse_last_argument());
+         CASE("min")
+           value = std::min(parse_argument(),parse_last_argument());
+         CASE_ELSE
+         {
+           this->failed_ = true;
+           delete[] word;
+           return 0;
+         }
+      }
+      else
+      {
+#define SWITCH word
+         CASE_1("pi")
+           value = 3.1415926535897932;
+         CASE("e")
+           value = 2.7182818284590452;
+         CASE_ELSE
+         {
+           this->failed_ = true;
+           delete[] word;
+           return 0;
+         }
+      }
+      delete[] word;
+   }
+   else if (*reading_stream == 40)
+   {  // expresion in paranthesis
+      ++reading_stream;
+      value = parse_last_argument();
+   }
+   else
+   {
+     this->failed_ = true;
+     return 0;
+   }
+
+   PARSE_BLANKS
+   switch (op)
+   {
+      case u_nicht: return !value;
+      case u_plus:  return  value;
+      case u_minus: return -value;
+      default:
+        {
+          this->failed_ = true;
+          return 0;
+        }
+   }
+}
+
+char* ExprParser::parse_word(char* str)
+{
+   char* word = str;
+   int counter = 0;
+   while (*reading_stream > 47 && *reading_stream < 58 || *reading_stream > 64 && *reading_stream < 91 || *reading_stream > 96 && *reading_stream < 123 || *reading_stream == 46)
+   {
+      *word++ = *reading_stream++;
+      counter++;
+      if (counter > 255)
+      {
+        this->failed_ = true;
+        return '\0';
+      }
+   };
+   *word = '\0';
+   return str;
+}
+
+ExprParser::binary_operator ExprParser::parse_binary_operator()
+{
+   binary_operator op;
+   switch (*reading_stream)
+   {
+      case '+': op = b_plus; break;
+      case '-': op = b_minus; break;
+      case '*': op = mal; break;
+      case '/': op = durch; break;
+      case '^': op = hoch; break;
+      case '%': op = modulo; break;
+      case '&': op = und; break;
+      case '|': op = oder; break;
+      case '=': op = gleich; break;
+      case '!': op = b_nicht; break;
+      case '<': op = kleiner; break;
+      case '>': op = groesser; break;
+      default: return undef;
+   }
+   if (*++reading_stream == '=')
+   {
+      if (op > 9)
+      {
+         ++reading_stream;
+         return (binary_operator)(op + 3);
+      }
+      else
+      {
+         --reading_stream;
+         return undef;
+      }
+   }
+   else
+      return op;
+}
+
+ExprParser::unary_operator ExprParser::parse_unary_operator()
+{
+   switch (*reading_stream)
+   {
+      case '!':
+         ++reading_stream;
+         return u_nicht;
+      case '+':
+         ++reading_stream;
+         return u_plus;
+      case '-':
+         ++reading_stream;
+         return u_minus;
+      default :
+         return u_plus;
+   }
+}
Index: code/branches/console/src/util/ExprParser.h
===================================================================
--- code/branches/console/src/util/ExprParser.h	(revision 1133)
+++ code/branches/console/src/util/ExprParser.h	(revision 1133)
@@ -0,0 +1,107 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+  @file
+  @brief Declaration of FloatParser
+*/
+
+#ifndef _FloatParser_H__
+#define _FloatParser_H__
+
+#include "UtilPrereqs.h"
+#include <string>
+
+class _UtilExport ExprParser
+{
+public:
+  enum binary_operator
+  {
+    b_plus,
+    b_minus,
+    mal,
+    durch,
+    modulo,
+    hoch,
+    undef,
+    oder,
+    und,
+    gleich,
+    b_nicht,
+    kleiner,
+    groesser,
+    ungleich,
+    kleinergleich,
+    groessergleich
+  };
+
+  enum unary_operator
+  {
+    u_plus,
+    u_minus,
+    u_nicht
+  };
+
+
+  ExprParser(const std::string& str);
+  std::string& getRemains() { return  this->remains_; }
+  double       getResult()  { return  this->result_; }
+  bool         getSuccess() { return !this->failed_; }
+
+private:
+  double parse_expr_1();
+  double parse_expr_2();
+  double parse_expr_3();
+  double parse_expr_4();
+  double parse_expr_5();
+  double parse_expr_6();
+  double parse_expr_7();
+  double parse_expr_8();
+  char* parse_word(char* str);
+  binary_operator parse_binary_operator();
+  unary_operator parse_unary_operator();
+
+  double parse_argument();
+  double parse_last_argument();
+
+  binary_operator op;
+  const char* reading_stream;
+  bool failed_;
+  double result_;
+  std::string remains_;
+
+};
+
+//Endzeichen für float expression: ')', '}', ']', ',', ';'
+_UtilExport bool parse_float(char* const, char**, double*);
+//Endzeichen angegeben
+_UtilExport bool parse_float(char* const, char**, char, double*);
+//Letzter Teil-float eines Vektors parsen (keine Vergleichs- und Logikoperationen)
+_UtilExport bool parse_vector_float(char* const, char**, bool, double*);
+
+#endif /* _FloatParser_H__ */
Index: code/branches/console/visual_studio/vc8/core.vcproj
===================================================================
--- code/branches/console/visual_studio/vc8/core.vcproj	(revision 1132)
+++ code/branches/console/visual_studio/vc8/core.vcproj	(revision 1133)
@@ -252,19 +252,4 @@
 				>
 			</File>
-			<Filter
-				Name="tolua"
-				>
-				<File
-					RelativePath="..\..\src\core\tolua\tolua_bind.cc"
-					>
-					<FileConfiguration
-						Name="Debug|Win32"
-						>
-						<Tool
-							Name="VCCLCompilerTool"
-						/>
-					</FileConfiguration>
-				</File>
-			</Filter>
 		</Filter>
 		<Filter
@@ -425,12 +410,4 @@
 				>
 			</File>
-			<Filter
-				Name="tolua"
-				>
-				<File
-					RelativePath="..\..\src\core\tolua\tolua_bind.h"
-					>
-				</File>
-			</Filter>
 		</Filter>
 	</Files>
Index: code/branches/console/visual_studio/vc8/tolua++.vcproj
===================================================================
--- code/branches/console/visual_studio/vc8/tolua++.vcproj	(revision 1132)
+++ code/branches/console/visual_studio/vc8/tolua++.vcproj	(revision 1133)
@@ -131,21 +131,25 @@
 			>
 			<File
-				RelativePath="..\..\src\util\tolua\tolua_event.c"
+				RelativePath="..\..\src\tolua\tolua_bind.cc"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\util\tolua\tolua_is.c"
+				RelativePath="..\..\src\tolua\tolua_event.c"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\util\tolua\tolua_map.c"
+				RelativePath="..\..\src\tolua\tolua_is.c"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\util\tolua\tolua_push.c"
+				RelativePath="..\..\src\tolua\tolua_map.c"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\util\tolua\tolua_to.c"
+				RelativePath="..\..\src\tolua\tolua_push.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\tolua\tolua_to.c"
 				>
 			</File>
@@ -157,9 +161,13 @@
 			>
 			<File
-				RelativePath="..\..\src\util\tolua\tolua++.h"
+				RelativePath="..\..\src\tolua\tolua++.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\util\tolua\tolua_event.h"
+				RelativePath="..\..\src\tolua\tolua_bind.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\tolua\tolua_event.h"
 				>
 			</File>
Index: code/branches/console/visual_studio/vc8/util.vcproj
===================================================================
--- code/branches/console/visual_studio/vc8/util.vcproj	(revision 1132)
+++ code/branches/console/visual_studio/vc8/util.vcproj	(revision 1133)
@@ -157,4 +157,8 @@
 			</File>
 			<File
+				RelativePath="..\..\src\util\ExprParser.cc"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\util\Math.cc"
 				>
@@ -199,4 +203,8 @@
 			</File>
 			<File
+				RelativePath="..\..\src\util\ExprParser.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\util\Math.h"
 				>
