source: src/dgp.old/symbol.cc @ d6a59ca

Last change on this file since d6a59ca was e7de6cc, checked in by Tomasz Obrebski <to@…>, 13 years ago

new version of dgp
added dgc, tre and compdic components
compiledic renamed to compdic_utf8
./configure updated

  • Property mode set to 100644
File size: 550 bytes
RevLine 
[e7de6cc]1#include "symbol.hh"
2
3// CLASS symbols
4
5//int Symbols::_no_of_spaces=0;
6
7Symbols::~Symbols()
8{
9  while(!table.empty())
10  {
11    free((void*)table.back());
12    table.pop_back();
13  }
14}
15
16void Symbols::load(const char* filename)
17{
18  ifstream f(filename);
19  char s[100];
20  while(f)
21  {
22    f >> s >> ws;
23    if(strlen(s)) add(s);
24  }
25} 
26
27void Symbols::add(const char* sym)
28{
29  if(hash.count(sym)==0)
30  {
31    char* symdup=strdup(sym);
32    hash[symdup]=table.size();
33    table.push_back(symdup);
34  }
35}
36
37
38//template<int space>
39//Symbols Symbol<space>::defs;
Note: See TracBrowser for help on using the repository browser.