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

iscanner_spec.hh

Go to the documentation of this file.
00001 /*
00002  *  File:       iscanner_spec.hh
00003  *              $Id: iscanner_spec.hh,v 1.5 2002/06/26 20:47:49 alec Exp $
00004  *
00005  *  Author:     Alec Panoviciu (alecu@email.com)
00006  *
00007  *  Comments:
00008  *
00009  *  Revision history:
00010  *
00011  *  $Log: iscanner_spec.hh,v $
00012  *  Revision 1.5  2002/06/26 20:47:49  alec
00013  *  g++ 3.x happy
00014  *
00015  *  Revision 1.4  2002/05/08 10:35:09  alec
00016  *  added keyword tokens support
00017  *
00018  *  Revision 1.3  2002/05/07 10:02:18  alec
00019  *  fixed some bugs & mem leaks; added MORE tokens support
00020  *
00021  *  Revision 1.2  2002/04/29 09:34:10  alec
00022  *  scanner ptree building compiles
00023  *
00024  */
00025 
00026 
00027 /* 
00028   Copyright (C) 2002 Alexandru Panoviciu (alecu@email.com)
00029 
00030   This program is free software; you can redistribute it and/or modify
00031   it under the terms of the GNU General Public License as published by
00032   the Free Software Foundation; either version 2 of the License, or
00033   (at your option) any later version.
00034 
00035   This program is distributed in the hope that it will be useful,
00036   but WITHOUT ANY WARRANTY; without even the implied warranty of
00037   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00038   GNU General Public License for more details.
00039 
00040   You should have received a copy of the GNU General Public License
00041   along with this program; if not, write to the Free Software
00042   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00043 
00044  */
00045 
00046 #ifndef __ISCANNER_SPEC_HH__
00047 #define __ISCANNER_SPEC_HH__
00048 
00049 
00050 #include <string>
00051 #include <vector>
00052 using namespace std;
00053 
00054 #include "parse_util.hh"
00055 
00056 class IReNodeBuilder;
00057 class ReNode;
00058 
00070 class IScannerSpec
00071 {
00072 public:
00073 
00074   virtual ~IScannerSpec () {};
00075 
00081   virtual IReNodeBuilder& getReNodeBuilder () = 0;
00082 
00096   virtual void addRegToken (const vector<string> &states,
00097                             const string &name, ReNode *regexp,
00098                             const string &tokenAction,
00099                             const Position &pos)
00100     throw (ParseException) = 0;
00101 
00115   virtual void addSkipToken (const vector<string> &states,
00116                              const string &name, ReNode *regexp,
00117                              const string &tokenAction,
00118                              const Position &pos)
00119     throw (ParseException) = 0;
00120 
00121 
00135   virtual void addMoreToken (const vector<string> &states,
00136                              const string &name, ReNode *regexp,
00137                              const string &tokenAction,
00138                              const Position &pos)
00139     throw (ParseException) = 0;
00140 
00154   virtual void addKeywordToken (const vector<string> &states,
00155                                 const string &name, ReNode *regexp,
00156                                 const string &tokenAction,
00157                                 const Position &pos)
00158     throw (ParseException) = 0;
00159 
00160   
00168   virtual void addSpecialToken (const string &name, const Position &pos)
00169     throw (ParseException) = 0;
00170 
00176   virtual void setPreambleCode (const string &block, const Position &pos) = 0;
00177 
00183   virtual void addCodeBlock (const string &block, const Position &pos) = 0;
00184 
00190   virtual void setInheritance (const string &inheritance,
00191                                const Position &pos) = 0;
00192 
00196   virtual void setClassName (const string &className) = 0;
00197 
00198 #ifdef DEBUG
00199 
00204   virtual void dump (ostream &os) const = 0;
00205 #endif
00206 };
00207 
00208 #endif /* #ifndef __ISCANNER_SPEC_HH__ */

Generated at Tue Jul 9 21:05:44 2002 for CppCC by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001