<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="GENERATOR" content="cpp2html 1.2 by Lorenzo Bettini, bettini@gnu.org http://w3.newnet.it/bettini http://www.gnu.org/software/cpp2html/cpp2html.html"> <title>tags.cc</title> </head> <body bgcolor="#FFFFFF" text="#000000" link="#0000EE" vlink="#551A8B" alink="#FF0000"> <pre> <tt> <i><font color=#9A1900>/* ** Copyright (C) 1999, 2000, Lorenzo Bettini <lorenzo.bettini@penteres.it> ** ** 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. ** */</font></i> <i><font color=#9A1900>// tags.cc </font></i> <b><font color=#0000FF>#include</font></b> <font color=#FF0000>"tags.h"</font> <b><font color=#0000FF>#include</font></b> <font color=#FF0000>"colors.h"</font> <b><font color=#0000FF>#include</font></b> <font color=#FF0000>"keys.h"</font> Tags *GlobalTags = NULL ; <font color=#009900>void</font> setTags( Tags *t ) { GlobalTags = t ; } Tag *getTag( <font color=#009900>char</font> *name ) { <b><font color=#0000FF>if</font></b> ( ! GlobalTags ) createDefaultTags() ; <b><font color=#0000FF>return</font></b> GlobalTags->GetTag( name ) ; } <font color=#009900>void</font> Tag::Print() { cerr << TagName << <font color=#FF0000>" "</font> << color << <font color=#FF0000>" "</font> << flags << endl ; } <font color=#009900>void</font> createDefaultTags() { GlobalTags = <b><font color=#0000FF>new</font></b> Tags ; GlobalTags->AddTag( newDefaultTag( KEYWORD, KEYWORD_C ) ) ; GlobalTags->AddTag( newDefaultTag( COMMENT, COMMENT_C ) ) ; GlobalTags->AddTag( newDefaultTag( STRING, STRING_C ) ) ; GlobalTags->AddTag( newDefaultTag( TYPE, BASETYPE_C ) ) ; GlobalTags->AddTag( newDefaultTag( NUMBER, NUMBER_C ) ) ; } Tag *newDefaultTag( <font color=#009900>char</font> *tag, <font color=#009900>char</font> *color ) { Tag *tempTag = <b><font color=#0000FF>new</font></b> Tag( tag ) ; tempTag->SetColor( color ) ; <b><font color=#0000FF>return</font></b> tempTag ; } </tt> </pre> </body> </html>