Added upstream from http://ftp.icm.edu.pl/pub/loglan/
[loglan.git] / loglan96 / loglan93 / tstsymbt.cc
1 #include <iostream.h>
2 #include <String.h>
3 #include "SymTable.h"
4
5 symboltable *table = new symboltable;
6
7 main()
8 {
9
10   node* temp1;
11   entry* temp;
12   entry* temp0;
13   node*  temp2;
14   struct find_result* temp3;
15   String t = "t", a = "a",
16          x = "x", y = "y",
17          u = "u", v = "v",
18          z = "z", b = "b",
19          o = "o";
20
21 //temp=table->insert(t,VARIABLE_S,new v_variable);
22 temp0=table->insert(a,CLASS_S,new c_class);
23 temp3=table->find(a);
24 cout << "test 1 " << temp3->found->id << '\n';
25
26 temp1=table->last->open_unit();
27 table->last->add_spec(CLOSE,x);
28 table->last->add_spec(CLOSE,y);
29 table->last->add_spec(HIDDEN,t);
30 table->last->add_spec(HIDDEN,u);
31 table->last->add_spec(CLOSE,t);
32 table->last->add_virt(temp0);
33
34 temp=table->insert(x,VARIABLE_S,new v_variable);
35 temp=table->insert(t,VARIABLE_S,new v_variable);
36 temp=table->insert(u,VARIABLE_S,new v_variable);
37 temp=table->insert(z,VARIABLE_S,new v_variable);
38 temp=table->insert(y,VARIABLE_S,new v_variable);
39
40
41 temp3=table->find_in_module(temp1,y,NOT_DOT);
42 cout << "test " << temp3->found->id << '\n';
43 temp3=temp1->local_find(x,ALL);
44 cout << "test " << temp3->found->id << '\n';
45 temp3=table->find(u);
46 cout << "test " << temp3->found->id << '\n';
47 table->last->close_unit();
48
49 temp3=table->find(a);
50 cout << "test " << temp3->found->id << '\n';
51
52 temp0=table->insert(b,CLASS_S,new c_class);
53 temp1=table->last->open_unit();
54
55 temp3=table->find(a);
56 cout << "test 2 " << temp3->found->id << 'n';
57
58 temp0=table->inherit(a);
59
60 temp3=table->find(o);
61 if (temp3->found == NULL) cout << "o nie jest widoczy \n";
62
63 temp3=table->find_in_module(temp1,t,NOT_DOT);
64 if (temp3->found == NULL) cout << "t nie jest widoczy z zewnatrz\n";
65
66 temp3=table->find_in_module(temp1,t,TRUE);
67 if (temp3->found == NULL) cout << "t nie jest widoczy przez kropke\n";
68
69 temp3=table->find_in_module(temp1,x,TRUE);
70 if (temp3->found == NULL) cout << "x nie jest widoczy \n";
71
72 temp3=table->find(a);
73 cout << "test " << temp3->found->id << '\n';
74
75
76 }