ymlloader.h

Go to the documentation of this file.
00001 /*******************************************************************\
00002 
00003                    SESAME project software license
00004 
00005               Copyright (C) 2002 University of Amsterdam
00006 
00007     This program is free software; you can redistribute it and/or
00008      modify it under the terms of the GNU General Public License
00009     as published by the Free Software Foundation; either version 2
00010         of the License, or (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015              GNU General Public License for more details.
00016 
00017   You should have received a copy of the GNU General Public License
00018      along with this program; if not, write to the Free Software
00019       Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00020                            02111-1307, USA.
00021 
00022       For information regarding the SESAME software project see
00023               http://sesamesim.sourceforge.net or email
00024                     jcofflan@users.sourceforge.net
00025 
00026 \*******************************************************************/
00038 #ifndef YMLLOADER_H
00039 #define YMLLOADER_H
00040 
00041 #include "ymlsaxparser.h"
00042 
00043 #include <unistd.h>
00044 #include <fstream>
00045 #include <list>
00046 #include <stack>
00047 
00048 // Forward Declarations
00049 class Interpreter;
00050 class YMLEntityFactory;
00051 class YMLEntity;
00052 class YMLNetwork;
00053 class YMLNode;
00054 class YMLPort;
00055 class YMLLink;
00056 class TraceContext;
00057 
00058 namespace XERCES_CPP_NAMESPACE {
00059   class InputSource;
00060 };
00061 
00062 class YMLLoader : public YMLSAXParser {
00063   // Attributes
00065   YMLEntityFactory *factory;
00067   Interpreter *interpreter;
00068 
00069   typedef std::stack<YMLEntity *> entity_stack_t;
00071   entity_stack_t entity_stack;
00072 
00074   YMLNetwork *root;
00075 
00076   TraceContext *rootTraceContext;
00077 
00078   // Operations
00079 public:
00080   YMLLoader(YMLEntityFactory *factory, Interpreter *interpreter);
00081   virtual ~YMLLoader();
00082 
00083   virtual void parseCall(call_t type, int argc, const char * const *args);
00084 
00085   YMLNetwork *parse(std::istream &stream, TraceContext *traceContext = 0);
00086   YMLNetwork *parse(const char *filename, TraceContext *traceContext = 0);;
00087   YMLNetwork *parse(XERCES_CPP_NAMESPACE::InputSource *input,
00088                     TraceContext *traceContext = 0);
00089 
00090 protected:
00091   YMLNetwork *topNetwork();
00092   YMLNode *topNode();
00093   YMLLink *topLink();
00094   YMLPort *topPort();
00095   YMLEntity *topEntity();
00096 };
00097 
00098 #endif

Generated on Wed Apr 5 20:57:46 2006 for Sesame by  doxygen 1.4.6