|
|
1.1 root 1: /*ident "@(#)ctrans:demangler/nplist.c 1.2"*/
2: /*
3: * C++ Demangler Source Code
4: * @(#)master 1.5
5: * 7/27/88 13:54:37
6: */
7: #include "String.h"
8:
9: struct name_pair {
10: char *s1,*s2;
11: };
12: int oplen = 0;
13:
14: struct name_pair nplist[100] = {
15: {"lt","<"}, {"ls","<<"}, {"dv","/"},
16: {"gt",">"}, {"rs",">>"}, {"md","%"},
17: {"le","<="}, {"ml","*"}, {"pl","+"},
18: {"ge",">="}, {"ad","&"}, {"mi","-"},
19: {"ne","!="}, {"or","|"}, {"er","^"},
20: {"aa","&&"}, {"oo","||"}, {"as","="},
21: {"apl","+="}, {"ami","-="}, {"amu","*="},
22: {"adv","/="}, {"amd","%="}, {"aad","&="},
23: {"aor","|="},{"aer","^="}, {"als","<<="},
24: {"ars",">>="},{"pp","++"}, {"mm","--"},
25: {"vc","[]"}, {"cl","()"}, {"rf","->"},
26: {"eq","=="}, {"co","~"}, {"nt","!"},
27: {"nw"," new"},{"dl"," delete"}, {0,0} };
28:
29: /* This routine is designed to demangle */
30: char *
31: findop(c)
32: char *c;
33: {
34: register int i;
35: for(oplen=0;c[oplen] && c[oplen] != '_';oplen++)
36: ;
37: for(i=0;nplist[i].s1;i++) {
38: if(strncmp(nplist[i].s1,c,oplen) == 0)
39: return nplist[i].s2;
40: }
41: return 0;
42: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.