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


/*
 *  File:       cw_iscanner_spec.h
 *              $Id: cw_iscanner_spec.h,v 1.6 2002/05/08 10:34:51 alec Exp $
 *
 *  Author:     Alec Panoviciu (alecu@email.com)
 *
 *  Comments: this is the IScannerSpec "C" wrapper 
 *
 *  Revision history:
 *
 *  $Log: cw_iscanner_spec.h,v $
 *  Revision 1.6  2002/05/08 10:34:51  alec
 *  added keyword tokens support
 *
 *  Revision 1.5  2002/05/07 10:02:18  alec
 *  fixed some bugs & mem leaks; added MORE tokens support
 *
 *  Revision 1.4  2002/04/29 17:55:41  alec
 *  regexps almost done
 *
 *  Revision 1.3  2002/04/29 09:34:10  alec
 *  scanner ptree building compiles
 *
 *  Revision 1.2  2002/04/27 05:18:05  alec
 *  PLAYING WITH cvs :)
 *
 *  Revision 1.1  2002/04/27 05:16:34  alec
 *  IScanner "C" wrapper
 *
 */


/* 
  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_ISCANNER_SPEC_H__
#define __CW_ISCANNER_SPEC_H__

#if defined __cplusplus

class IScannerSpec;

/**
 * \ingroup cw_iscanner_spec
 * This will point to the IScannerSpec object whose methods should actually be
 * called by the wrapper functions. It is initialized by the
 * LexYaccParser before parsing starts.
 */
extern IScannerSpec* cw_scannerSpec;

#define CLINK extern "C"

#else

#define CLINK

#endif


#include "cw_misc.h"

/**
 * \defgroup cw_iscanner_spec IScanner C Wrapper
 *
 * These are the wrapper functions that get called from the C parser
 * code. Each of these functions will call the corresponding method of the
 * IScannerSpec instance pointed to by cw_scannerSpec.
 *
 * Each parameter is transformed into its C++ correspondent. The Position
 * argument required by the IScannerSpec interface is created as
 * Position(yylineno, 0).
 *
 * @{
 */


CLINK void IScannerSpec_addRegToken (CstringList states_,
                                     char *name_, void *regexp_,
                                     char *tokenAction_);

CLINK void IScannerSpec_addSkipToken (CstringList states_,
                                      char *name_, void *regexp_,
                                      char *tokenAction_);

CLINK void IScannerSpec_addMoreToken (CstringList states_,
                                      char *name_, void *regexp_,
                                      char *tokenAction_);

CLINK void IScannerSpec_addKeywordToken (CstringList states_,
                                         char *name_, void *regexp_,
                                         char *tokenAction_);

CLINK void IScannerSpec_addSpecialToken (char *name_);

CLINK void IScannerSpec_setPreambleCode (char *block_);

CLINK void IScannerSpec_addCodeBlock (char *block_);

CLINK void IScannerSpec_setInheritance (char *inheritance_);

CLINK void IScannerSpec_setClassName (char *className_);
/* @} */

#endif /* #ifndef __CW_ISCANNER_SPEC_H__ */