Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

robloader.h

Go to the documentation of this file.
00001 /*
00002  * robloader.h
00003  * 
00004  * Copyright (c) 2000-2004 by Florian Fischer (florianfischer@gmx.de)
00005  * and Martin Trautmann (martintrautmann@gmx.de) 
00006  * 
00007  * This file may be distributed and/or modified under the terms of the 
00008  * GNU General Public License version 2 as published by the Free Software 
00009  * Foundation. 
00010  * 
00011  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013  * 
00014  */
00015 
00020 #ifndef __RT_ROBLOADER__
00021 #define __RT_ROBLOADER__
00022 
00023 #include <rtstring.h>
00024 //#include <rtstreams.h>
00025 
00026 #include "robbase.h"
00027 #include "robvars.h"
00028 #include "robdefines.h"
00029 
00030 using namespace lrt;
00031 
00032 namespace rt {
00033 
00035 class RobLoader : public ProgramLoader {
00036 public:
00037         // example constructor
00038         RobLoader(const ErrorHandler* handler);
00039         virtual ~RobLoader();
00040 
00041         virtual ProgramLoader* create(const String& filename, const Globals& glob);
00042         virtual bool canLoad(const String& filename);
00043         virtual String getFormatName();
00044 
00045 protected:
00046         virtual LoadReturnType load();
00047         virtual LoadReturnType loadHeaders();
00048 
00049 private:
00050         // we'll use it so often...
00051         typedef Instr::Op Op;
00052 
00053         // concrete constructor
00054         RobLoader(const RobLoader* example, const String& filename, const Globals& glob);
00055         bool isExample;
00056 
00057         StringMap<rint> labels;
00058 
00059         // converts our error to the generic ProgramLoader error
00060         LoadReturnType error(RobLoadReturnType num, DefineInputStream* in);
00061 
00063         RobLoadReturnType doLoadHeaders(DefineInputStream* in);
00064         RobLoadReturnType mkOldHeader(DefineInputStream* in, const String& name);
00065         RobLoadReturnType mkNewHeader(DefineInputStream* in, HeaderType type);
00066 
00067         RobLoadReturnType doLoad(DefineInputStream* in);
00068         RobLoadReturnType getLabels(DefineInputStream* in);
00069         RobLoadReturnType readOps(DefineInputStream* in, Array<Op>& ops, bool* dest);
00070         RobLoadReturnType convertParamDest(const String& word, Op& op);
00071         RobLoadReturnType convertParamSrc(const String& word, Op& op);
00072 };
00073 
00074 
00075 
00076 } // namespace
00077 
00078 #endif
00079 

This is the RoboTour API documentation version 0.1 • Copyright (C) by Florian Fischer