Last change
on this file since 0a58b3f was
5f4d9c3,
checked in by Maciej Prill <mprill@…>, 13 years ago
|
Rewritten the build system, added lem UTF-8 version.
|
-
Property mode set to
100644
|
File size:
550 bytes
|
Rev | Line | |
---|
[5f4d9c3] | 1 | #include "symbol.hh" |
---|
| 2 | |
---|
| 3 | // CLASS symbols |
---|
| 4 | |
---|
| 5 | //int Symbols::_no_of_spaces=0; |
---|
| 6 | |
---|
| 7 | Symbols::~Symbols() |
---|
| 8 | { |
---|
| 9 | while(!table.empty()) |
---|
| 10 | { |
---|
| 11 | free((void*)table.back()); |
---|
| 12 | table.pop_back(); |
---|
| 13 | } |
---|
| 14 | } |
---|
| 15 | |
---|
| 16 | void 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 | |
---|
| 27 | void 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.