source: trunk/src/symtab.h @ 135

Last change on this file since 135 was 135, checked in by lindanl, 11 years ago

SymbolTable? class and end tag checking.

File size: 820 bytes
Line 
1/*  symtab.h - XML Symbol Table Module
2    Copyright (c) 2008 Robert D. Cameron
3    Licensed to the public under the Open Software License 3.0.
4    Licensed to International Characters, Inc., under the Academic
5    Free License 3.0.
6*/
7
8#ifndef SYMTAB_H
9#define SYMTAB_H
10
11#include "namechars.h"
12
13struct eqstr
14{
15  bool operator()(const char* s1, const char* s2) const
16  {
17    return strcmp(s1, s2) == 0;
18  }
19};
20       
21char * predefined[] = {"lt", "gt", "amp", "quot", "apos"};
22
23class Symbol_Table{
24public:
25        Symbol_Table();
26        int UTF8_Lookup_or_Insert_XML10_Name(char * name, int lgth);
27        int UTF8_Lookup_or_Insert_XML11_Name(char * name, int lgth);
28        char * Get_UTF8_name(int nameID);
29private:
30        hash_map<const char *, int, hash<const char *>, eqstr > UTF8NameMap;
31        int globalNameCount;
32        vector<char *> UTF8NameTable;
33};
34
35
36#endif
Note: See TracBrowser for help on using the repository browser.