www.pudn.com > cppcc.rar > cw_itoken_spec.cc


/*
 *  File:       cw_itoken_spec.cc
 *              $Id: cw_itoken_spec.cc,v 1.1 2002/05/04 17:46:53 alec Exp $
 *
 *  Author:     Alec Panoviciu (alecu@email.com)
 *
 *  Comments:
 *
 *  Revision history:
 *
 *  $Log: cw_itoken_spec.cc,v $
 *  Revision 1.1  2002/05/04 17:46:53  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

 */


#include "debug.h"
#include "cw_itoken_spec.h"
#include "itoken_spec.hh"

ITokenSpec *cw_tokenSpec = NULL;


CLINK void ITokenSpec_setClassName (char *className_)
{
  ASSERT((cw_tokenSpec != NULL) && (className_ != NULL),
         "Assertion failed in call to ITokenSpec_setClassName");
  cw_tokenSpec->setClassName(string(className_));
}

CLINK void ITokenSpec_setInheritance (char *inheritance_)
{
  ASSERT((cw_tokenSpec != NULL) && (inheritance_ != NULL),
         "Assertion failed in call to ITokenSpec_setInheritance");
  
  cw_tokenSpec->setInheritance(string(inheritance_), Position(yylineno));
}

CLINK void ITokenSpec_setPreambleCode (char *preambleCode_)
{
  ASSERT(cw_tokenSpec != NULL,
         "Assertion failed in call to ITokenSpec_setPreambleCode");
  if (preambleCode_ == NULL) preambleCode_ = "";
  
  cw_tokenSpec->setPreambleCode(string(preambleCode_), Position(yylineno));
}

CLINK void ITokenSpec_addCodeBlock (char *block_)
{
  ASSERT((cw_tokenSpec != NULL) && (block_ != NULL),
         "Assertion failed in call to ITokenSpec_addCodeBlock");
  
  cw_tokenSpec->addCodeBlock(string(block_), Position(yylineno));
}