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

ebnf_node_builder.hh

Go to the documentation of this file.
00001 /*
00002  *  File:       ebnf_node_builder.hh
00003  *              $Id: ebnf_node_builder.hh,v 1.5 2002/06/23 23:32:22 alec Exp $
00004  *
00005  *  Author:     Alec Panovici (alecu@email.com)
00006  * 
00007  *  Comments:
00008  *
00009  *  Revision history:
00010  *
00011  *  $Log: ebnf_node_builder.hh,v $
00012  *  Revision 1.5  2002/06/23 23:32:22  alec
00013  *  la-time usercode (force)
00014  *
00015  *  Revision 1.4  2002/06/13 11:37:26  alec
00016  *  added #line stuff
00017  *
00018  *  Revision 1.3  2002/05/16 21:35:28  alec
00019  *  parser generation done
00020  *
00021  *  Revision 1.2  2002/05/10 07:15:10  alec
00022  *  parser parse tree ok
00023  *
00024  *  Revision 1.1  2002/05/08 18:17:51  alec
00025  *  *** empty log message ***
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_BUILDER_HH__
00050 #define __EBNF_NODE_BUILDER_HH__
00051 
00052 #include "iebnf_node_builder.hh"
00053 #include "token_spec.hh"
00054 
00055 class PropRegistry;
00056 
00057 class EbnfNodeBuilder : public IEbnfNodeBuilder
00058 {
00059 public:
00060   
00061   EbnfNodeBuilder (PropRegistry &registry_, ITokenSpec &tokens_) :
00062     registry(registry_), tokens(tokens_)
00063   {}
00064                    
00065   virtual EbnfNode* createOrNode (EbnfNode *pre, EbnfNode *post,
00066                                   const Position &pos);
00067 
00068   virtual EbnfNode* createCatNode (EbnfNode *pre, EbnfNode *post,
00069                                    const Position &pos);
00070 
00071   virtual EbnfNode* createPlusNode (EbnfNode *in,
00072                                     const Position &pos);
00073 
00074   virtual EbnfNode* createStarNode (EbnfNode *in,
00075                                     const Position &pos);
00076 
00077   virtual EbnfNode* createOptionalNode (EbnfNode *in,
00078                                         const Position &pos);
00079 
00080   virtual EbnfNode* createNonterminalNode (const string &targetVar,
00081                                            const Position &targetVarPos,
00082                                            const string &nontermId,
00083                                            const string &actualArgs,
00084                                            const Position &actualArgsPos,
00085                                            const Position &pos);
00086 
00087   virtual EbnfNode* createTerminalNode (const string &termId,
00088                                         const Position &pos)
00089     throw (ParseException);
00090 
00091   virtual LaSpec* createLaSpec (int fixedla, EbnfNode *synLa,
00092                                 const string &semLa,
00093                                 const Position &pos);
00094 
00095   virtual CatchClause* createCatchClause (const string &exceptionDecl,
00096                                           const Position &edPos,
00097                                           const string &code,
00098                                           const Position &codePos);
00099 
00100   virtual void setLookahead (EbnfNode* node, LaSpec* la);
00101 
00102   virtual void setStartCode (EbnfNode *node,
00103                              const string &code, bool force,
00104                              const Position &pos);
00105 
00106   virtual void setEndCode (EbnfNode *node,
00107                            const string &code, bool force,
00108                            const Position &pos);
00109 
00110   virtual void setCatchClauses (EbnfNode *node,
00111                                 vector<CatchClause> &catchList);
00112 
00113 private:
00114   
00115   PropRegistry &registry;
00116 
00117   ITokenSpec &tokens;
00118 };
00119 
00120 #endif /* #ifndef __EBNF_NODE_BUILDER_HH__ */

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