Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 1a4654cdb333ad144ff9f7b2e16de416 > files > 30

cpp2html-1.2-3mdk.i586.rpm

<!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 &lt;lorenzo.bettini@penteres.it&gt;
**  
** 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-&gt;GetTag( name ) ;
}

<font color=#009900>void</font> Tag::Print() {
  cerr &lt;&lt; TagName &lt;&lt; <font color=#FF0000>" "</font> &lt;&lt; color &lt;&lt; <font color=#FF0000>" "</font> &lt;&lt; flags &lt;&lt; endl ;
}

<font color=#009900>void</font> createDefaultTags() {
  GlobalTags = <b><font color=#0000FF>new</font></b> Tags ;

  GlobalTags-&gt;AddTag( newDefaultTag( KEYWORD, KEYWORD_C ) ) ;
  GlobalTags-&gt;AddTag( newDefaultTag( COMMENT, COMMENT_C ) ) ;
  GlobalTags-&gt;AddTag( newDefaultTag( STRING, STRING_C ) ) ;
  GlobalTags-&gt;AddTag( newDefaultTag( TYPE, BASETYPE_C ) ) ;
  GlobalTags-&gt;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-&gt;SetColor( color ) ;

  <b><font color=#0000FF>return</font></b> tempTag ;
}
</tt>
</pre>
</body>
</html>