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

ebnf_node.hh

Go to the documentation of this file.
00001 /*
00002  *  File:       ebnf_node.hh
00003  *              $Id: ebnf_node.hh,v 1.7 2002/05/27 03:00:31 alec Exp $
00004  *
00005  *  Author:     Alec Panovici (alecu@email.com)
00006  * 
00007  *  Comments:
00008  *
00009  *  Revision history:
00010  *
00011  *  $Log: ebnf_node.hh,v $
00012  *  Revision 1.7  2002/05/27 03:00:31  alec
00013  *  doc update
00014  *
00015  *  Revision 1.6  2002/05/16 21:36:01  alec
00016  *  parser generation done
00017  *
00018  *  Revision 1.5  2002/05/10 18:08:36  alec
00019  *  *** empty log message ***
00020  *
00021  *  Revision 1.4  2002/05/08 18:18:06  alec
00022  *  *** empty log message ***
00023  *
00024  *  Revision 1.3  2002/04/29 09:34:10  alec
00025  *  scanner ptree building compiles
00026  *
00027  */
00028 
00029 
00030 /*
00031   Copyright (C) 2002 Alexandru Panoviciu (alecu@email.com)
00032 
00033   This program is free software; you can redistribute it and/or modify
00034   it under the terms of the GNU General Public License as published by
00035   the Free Software Foundation; either version 2 of the License, or
00036   (at your option) any later version.
00037 
00038   This program is distributed in the hope that it will be useful,
00039   but WITHOUT ANY WARRANTY; without even the implied warranty of
00040   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00041   GNU General Public License for more details.
00042 
00043   You should have received a copy of the GNU General Public License
00044   along with this program; if not, write to the Free Software
00045   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00046 
00047  */
00048 
00049 #ifndef __EBNF_NODE_HH__
00050 #define __EBNF_NODE_HH__
00051 
00052 #include "debug.h"
00053 #include "parse_util.hh"
00054 #include "ebnf_node_algo.hh"
00055 
00056 class EbnfNodeAlgo;
00057 class EbnfNodeAlgoException;
00058 
00059 
00065 class EbnfNode
00066 {
00067 public:
00068 
00069   EbnfNode (const Position &pos_) : pos(pos_)
00070   {}
00071 
00075   virtual EbnfNode* clone () = 0;
00076   
00080   virtual bool isLeaf () { return getChildCount() == 0; }
00081 
00082 
00086   virtual int getChildCount () = 0;
00087 
00093   virtual EbnfNode& operator [] (int index) = 0;
00094 
00104   virtual bool dfTraverse (EbnfNodeAlgo &algo) throw (EbnfNodeAlgoException);
00105 
00119   virtual bool rdfTraverse (EbnfNodeAlgo &algo) throw (EbnfNodeAlgoException);
00120 
00121   
00125   virtual ~EbnfNode () {}
00126 
00130   const Position& getPos () const { return pos; }
00131   
00132 #ifdef DEBUG
00133 
00134   virtual void dump (ostream &os) const = 0;
00135   
00136 #endif
00137 
00138 private:
00139 
00144   Position pos;
00145 };
00146 
00147 #endif /* #ifndef __EBNF_NODE_HH__ */

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