Back to index

texmacs  1.0.7.15
translator.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : translator.hpp
00004 * DESCRIPTION: used for the translation of tokens, mainly to name symbols
00005 * COPYRIGHT  : (C) 1999  Joris van der Hoeven
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef TRANSLATOR_H
00013 #define TRANSLATOR_H
00014 #include "resource.hpp"
00015 #include "tree.hpp"
00016 
00017 RESOURCE(translator);
00018 
00019 /******************************************************************************
00020 * The translator structure
00021 ******************************************************************************/
00022 
00023 struct translator_rep: rep<translator> {
00024   int                  cur_c;
00025   hashmap<string,int>  dict;
00026   array<tree>          virt_def;
00027 
00028   inline translator_rep (string s);
00029 };
00030 
00031 inline translator_rep::translator_rep (string s):
00032   rep<translator> (s), cur_c (0), dict (-1), virt_def (0) {}
00033 
00034 translator& operator << (translator& trl, int i);
00035 translator& operator << (translator& trl, string s);
00036 translator& operator << (translator& trl, translator trm);
00037 
00038 translator load_translator (string name);
00039 translator load_virtual (string name);
00040 
00041 #endif // defined TRANSLATOR_H