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

cw_re_node_builder.cc

Go to the documentation of this file.
00001 /*
00002  *  File:       cw_re_node_builder.cc
00003  *              $Id: cw_re_node_builder.cc,v 1.1 2002/04/29 17:57:35 alec Exp $
00004  *
00005  *  Author:     Alec Panoviciu (alecu@email.com)
00006  * 
00007  *  Comments:
00008  *
00009  *  Revision history:
00010  *
00011  *  $Log: cw_re_node_builder.cc,v $
00012  *  Revision 1.1  2002/04/29 17:57:35  alec
00013  *  *** empty log message ***
00014  *
00015  */
00016 
00017 /*
00018   Copyright (C) 2002 Alexandru Panoviciu (alecu@email.com)
00019 
00020   This program is free software; you can redistribute it and/or modify
00021   it under the terms of the GNU General Public License as published by
00022   the Free Software Foundation; either version 2 of the License, or
00023   (at your option) any later version.
00024 
00025   This program is distributed in the hope that it will be useful,
00026   but WITHOUT ANY WARRANTY; without even the implied warranty of
00027   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00028   GNU General Public License for more details.
00029 
00030   You should have received a copy of the GNU General Public License
00031   along with this program; if not, write to the Free Software
00032   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00033 
00034  */
00035 
00036 #include "debug.h"
00037 #include "cw_re_node_builder.h"
00038 #include "ire_node_builder.hh"
00039 
00040 IReNodeBuilder *cw_reNodeBuilder = NULL;
00041 
00042 CLINK void* IReNodeBuilder_createOrNode (void *pre, void *post)
00043 {
00044   ASSERT(((pre != NULL) && (post != NULL)),
00045          "NULL arguments in call to IReNodeBuilder_createOrNode");
00046   return cw_reNodeBuilder->createOrNode(static_cast<ReNode*>(pre),
00047                                         static_cast<ReNode*>(post),
00048                                         Position(yylineno));
00049 }
00050 
00051 CLINK void* IReNodeBuilder_createCatNode (void *pre, void *post)
00052 {
00053   ASSERT(((pre != NULL) && (post != NULL)),
00054          "NULL arguments in call to IReNodeBuilder_createCatNode");
00055   return cw_reNodeBuilder->createCatNode(static_cast<ReNode*>(pre),
00056                                          static_cast<ReNode*>(post),
00057                                          Position(yylineno));
00058 }
00059 
00060 CLINK void* IReNodeBuilder_createPlusNode (void *in)
00061 {
00062   ASSERT((in != NULL), "NULL arguments in call to IReNodeBuilder_createPlusNode");
00063   return cw_reNodeBuilder->createPlusNode(static_cast<ReNode*>(in),
00064                                           Position(yylineno));
00065 
00066 }
00067 
00068 CLINK void* IReNodeBuilder_createOptionalNode (void *in)
00069 {
00070   ASSERT((in != NULL), "NULL arguments in call to IReNodeBuilder_createOptionalNode");
00071   return cw_reNodeBuilder->createOptionalNode(static_cast<ReNode*>(in),
00072                                               Position(yylineno));
00073 
00074 }
00075 
00076 CLINK void* IReNodeBuilder_createStarNode (void *in)
00077 {
00078   ASSERT((in != NULL), "NULL arguments in call to IReNodeBuilder_createStarNode");
00079   return cw_reNodeBuilder->createStarNode(static_cast<ReNode*>(in),
00080                                           Position(yylineno));
00081 
00082 }
00083 
00084 CLINK void* IReNodeBuilder_createStringLiteralNode (char *s)
00085 {
00086   ASSERT((s != NULL),
00087          "NULL arguments in call to IReNodeBuilder_createStringLiteralNode");
00088   string ss(s);
00089   ss.erase(0,1);                // remove
00090   ss.erase(ss.length()-1, 1);    // quotes from ss
00091   return cw_reNodeBuilder->createStringLiteralNode(ss, Position(yylineno));
00092 }
00093 
00094 CLINK void* IReNodeBuilder_createCharListNode (int negated, CwCharClassList chars)
00095 {
00096   ASSERT((chars != NULL),
00097          "NULL arguments in call to IReNodeBuilder_createStringLiteralNode");
00098 
00099   vector<CharClassDescriptor> *v = CwCharClassList2vector (chars);
00100 
00101   ReNode *res = cw_reNodeBuilder->createCharListNode(negated != 0, *v,
00102                                                      Position(yylineno));
00103 
00104   delete v;
00105   return res;
00106 }

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