www.pudn.com > cppcc.rar > cw_macro_token_expander.h


/*
 *  File:       cw_macro_token_expander.h
 *              $Id: cw_macro_token_expander.h,v 1.1 2002/04/29 17:57:35 alec Exp $
 *
 *  Author:     Alec Panovici (alecu@email.com)
 * 
 *  Comments:
 *
 *  Revision history:
 *
 *  $Log: cw_macro_token_expander.h,v $
 *  Revision 1.1  2002/04/29 17:57:35  alec
 *  *** empty log message ***
 *
 */


/*
  Copyright (C) 2002 Alexandru Panoviciu (alecu@email.com)

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

 */

#ifndef __CW_MACRO_TOKEN_EXPANDER_H__
#define __CW_MACRO_TOKEN_EXPANDER_H__


#if defined __cplusplus

class MacroTokenExpander;

/**
 * \ingroup cw_macro_token_expander
 *
 * This will point to the instance of the MacroTokenExpander class whose methods
 * should actually be called from the parser's C code. It is initialized by the
 * LexYaccParser before the parsing process starts.
 */
extern MacroTokenExpander* cw_macroTokenExpander;

#define CLINK extern "C"

#else

#define CLINK

#endif

#include "cw_misc.h"

/**
 * \defgroup cw_macro_token_expander MacroTokenExpander C Wrapper
 *
 * These are the wrapper functions that get called from the C parser code. Each
 * of them will call the corresponding method of the MacroTokenExpander instance
 * pointed to by cw_MacroTokenExpander.
 *
 * Each parameter will be transformed into its C++ counterpart.
 *
 * @{
 */

CLINK void MacroTokenExpander_addMacro (char *name_, void *regexp_);

CLINK void* MacroTokenExpander_getMacro (char *name_);

/* @} */

#endif /* #ifndef __CW_MACRO_TOKEN_EXPANDER_H__ */