-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathcompstructs.cc
More file actions
70 lines (65 loc) · 2.1 KB
/
compstructs.cc
File metadata and controls
70 lines (65 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* This file contains instantiation statements to create complex
* support structures. The structures will be used in the SCL to
* validate user requests to instantiate complex entities.
*/
#include "complexSupport.h"
ComplexCollect * gencomplex()
/*
* This function contains instantiation statments for all the
* ComplexLists and EntLists in a ComplexCollect. The instan-
* stiation statements were generated in order of lower to
* higher, and last to first to simplify creating some of the
* links between structures. Because of this, the code is not
* very readable, but does the trick.
*/
{
ComplexCollect * cc;
ComplexList * cl;
EntList * node, *child, *next1, *next2, *next3, *next4,
*next5, *next6, *next7, *next8, *next9, *next10,
*next11, *next12, *next13, *next14, *next15,
*next16, *next17, *next18, *next19, *next20,
*next21, *next22, *next23, *next24, *next25,
*next26, *next27, *next28, *next29, *next30;
cc = new ComplexCollect;
// ComplexList with supertype "shape":
node = new SimpleList( "square" );
next4 = node;
node = new SimpleList( "rectangle" );
next4->prev = node;
node->next = next4;
child = node;
node = new AndList;
( ( MultList * )node )->appendList( child );
next3 = node;
node = new SimpleList( "rectangle" );
next3->prev = node;
node->next = next3;
child = node;
node = new OrList;
( ( MultList * )node )->appendList( child );
next2 = node;
node = new SimpleList( "triangle" );
next2->prev = node;
node->next = next2;
next2 = node;
node = new SimpleList( "circle" );
next2->prev = node;
node->next = next2;
child = node;
node = new OrList;
( ( MultList * )node )->appendList( child );
next1 = node;
node = new SimpleList( "shape" );
next1->prev = node;
node->next = next1;
child = node;
node = new AndList;
( ( MultList * )node )->appendList( child );
cl = new ComplexList( ( AndList * )node );
cl->buildList();
cl->head->setLevel( 0 );
cc->insert( cl );
return cc;
}