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

la_parser_writer.hh

Go to the documentation of this file.
00001 /*
00002  *  File:       la_parser_writer.hh
00003  *              $Id: la_parser_writer.hh,v 1.4 2002/05/31 12:11:08 alec Exp $
00004  *
00005  *  Author:     Alec Panoviciu (alecu@email.com)
00006  *
00007  *  Comments:
00008  *
00009  *  Revision history:
00010  *
00011  *  $Log: la_parser_writer.hh,v $
00012  *  Revision 1.4  2002/05/31 12:11:08  alec
00013  *  *** empty log message ***
00014  *
00015  *  Revision 1.3  2002/05/27 03:01:50  alec
00016  *  doc update
00017  *
00018  *  Revision 1.2  2002/05/22 01:37:18  alec
00019  *  LOOKAHEAD fixes
00020  *
00021  *  Revision 1.1  2002/05/16 22:04:46  alec
00022  *  parser generation done
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 __LA_PARSER_WRITER_HH__
00047 #define __LA_PARSER_WRITER_HH__
00048 
00049 #include <vector>
00050 
00051 #include "debug.h"
00052 #include "vbitset.hh"
00053 #include "writer.hh"
00054 
00055 class PropRegistry;
00056 class ParserSpec;
00057 class ITokenSpec;
00058 class ProductionSpec;
00059 class EbnfLaNode;
00060 class NumberedLaSpec;
00061 class LaEpDefWriter;
00062 
00066 class LaParserWriter : public Writer
00067 {
00068   friend class LaEpDefWriter;
00069   friend class LaEpDeclWriter;
00070   
00071 public:
00072 
00073   LaParserWriter (PropRegistry &registry_) : Writer(registry_)
00074   {}
00075 
00079   void writeParser (ParserSpec &pSpec, ITokenSpec &tSpec,
00080                     const string &scannerClass);
00081 
00082 protected:
00083 
00087   void writeProductionDecls (vector<ProductionSpec> &prods);
00088 
00093   void writeProductionLaDecls (vector<ProductionSpec> &prods);
00094 
00099   void writeLaEpDecls(vector<ProductionSpec> &prods);
00100 
00104   void writeProductionDefs (vector<ProductionSpec> &prods,
00105                             const string &parserClass,
00106                             ITokenSpec &tokens);
00107 
00113   ostream& makeLaCondition (vBitset &tMask, NumberedLaSpec *la,
00114                             ITokenSpec &tokens);
00115 
00119   void writeEbnf (EbnfLaNode &n, ITokenSpec &tokens);
00120 
00125   void writeEbnfLa (EbnfLaNode &n, ITokenSpec &tokens);
00126 
00131   void writeLaDefs (vector<ProductionSpec> &prods,
00132                     const string &parserClass,
00133                     ITokenSpec &tokens, PropRegistry &registry);
00134 
00135 };
00136 
00137 #endif /* #ifndef __LA_PARSER_WRITER_HH__ */

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