-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathoexpl-data-structures.html
175 lines (150 loc) · 9.2 KB
/
oexpl-data-structures.html
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!Doctype html>
<html lang="en">
<head>
<title>OExpL Compile Time Data Structures</title>
<meta charset="UTF-8">
<!--<link rel="stylesheet" href="css/bootstrap.min.css">-->
<link rel="stylesheet" href="css/style_new.css">
<link rel="stylesheet" href="js/embed-2cd369fa1c0830bd3aa06c21d4f14a13e060d2d31bbaae740f4af4.css"><div id="gist28627206" class="gist">
<link rel="stylesheet" href="js/embed-cbe5b40fa72b0964f90d4919c2da8f8f94d7c9f6c2aa49c07f6fa3.css"><div id="gist28627206" class="gist">
<script src="js/jquery-1.12.1.min.js" charset="utf-8"></script>
<script src="js/bootstrap.min.js" charset="utf-8"></script>
<script src="js/sticky_sidebar.js" charset="utf-8"></script>
</head>
<div class="container">
<header id="navtop">
<a href="index.html" class="logo fleft"><img src="img/logo.png" alt=""></a>
<nav class="fright">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<!-- <li><a href="help.html">Help</a></li> -->
<li><a href="roadmap.html">Roadmap</a></li>
<li><a href="documentation.html" class="navactive">Documentation</a></li>
</ul>
</nav>
</header>
<body>
<div class="Services-page main grid-wrap">
<header class="grid col-full">
<hr/>
<p class="fleft">Compile Time Data Structure for OExpL</p>
<br>
<br>
</header>
<aside class="grid col-one-quarter mq2-col-full sticky_sidebar">
<menu>
<ul>
<li><a class="sec" href="#nav-class-table">Class Table</a></li>
<li><a class="sec" href="#nav-structure">Structure</a></li>
<li><a class="sec" href="#nav-associated-methods">Associated methods</a></li>
<li><a class="sec" href="#nav-illustration">Illustration</a></li>
</ul>
</menu>
</aside>
<section class="grid col-three-quarters mq2-col-full">
<div class="grid-wrap">
<!--<header class="grid col-full">
<p class="fleft">Class Table</p>
</header>-->
<!--<article class="grid col-one-half mq3-col-full">
<div class="sepmini"></div>
<h4>CLASS TABLE</h4>
<div class="sepmini"></div>
<p>The Class Table carries information about members and methods of the class in Object oriented extension of ExpL....</p>
<a href="oexpl_data_structures/class-table.html" target="_blank" class="arrow fright">Read more</a>
</article> -->
<article class="grid col-full" id="nav-class-table">
<h2>Class Table</h2>
<p>
OExpL compilation requires only one additional data structure - the class table.
The class table stores information pertaining to all the classes declared in an OExpL program. For a class it
stores member fields, member functions, name of the class and parent class pointer.
</p>
</article>
<article class="grid col-full" id="nav-structure">
<h2>Structure</h2>
<p>
The structure of Class Table(CT) is as follows:
</p>
<script src="/js/930c933aa9c06c7effdacb5ba3fad13e.js"></script>
<p>
<span style="color:red;font-size:12px;">✛</span><b>NOTE</b>:
</p>
<p>
Memberfield list is used to store the information regarding the type, name, fieldindex and type of class of all the member fields
of that class.
</p>
<script src="/js/1b636208fe1f6f61b3fd700053f185c6.js"></script>
<p>
Memberfunc list is used to store the information regarding the type, name of the function, argument list, it's flabel and it's position.
</p>
<script src="/js/5d19a615add340158d5f11cb07a8fa6c.js"></script>
</article>
<article class="grid col-full" id="nav-associated-methods">
<h2>Associated Methods</h2>
<ul>
<li>struct Classtable* <b>CInstall</b>(char *name,char *parent_class_name) : Creates a class table entry of given 'name' and extends the fields and the methods of parent class and
returns a pointer to the newly created class entry.
</li>
<li>struct Classtable* <b>CLookup</b>(char *name) : Search for a class table entry with the given 'name', if exists, return pointer to class table entry else return NULL.</li>
<li>
void <b>Class_Finstall</b>(struct Classtable *cptr, char *typename, char *name) : Installs the field into the given class table entry which is given as an argument.
</li>
<li>
void <b>Class_Minstall</b>(struct Classtable *cptr, char *name, struct Typetable *type, struct Paramstruct *Paramlist) : Installs the method into the given class table entry which is given as an argument.
</li>
<li>
struct Memberfunclist* <b>Class_Mlookup </b>(struct Classtable* Ctype,char* Name) : Search through the VFunclist of the class using Ctype that is being parsed and return pointer to the entry in the list with function name as <i>Name</i>. Returns NULL if entry is not found.
</li>
<li>
struct Fieldlist* <b>Class_Flookup</b>(struct Classtable* Ctype,char* Name)) : Search through the Memberfield of the current class using Ctype that is being parsed and return pointer to the entry in the list with variable name as <i>Name</i>. Returns NULL if entry is not found.
</li>
</ul>
</article>
<article class="grid col-full" id="nav-illustration">
<h2>Illustration</h2>
<p>
Here is an example illustrating it.
</p>
<script src="/js/6a973317f3e10937b42981b2147be063.js"></script>
<ol>
<li>As soon as the compiler encounters the class name, it installs the class name and the parent class name if present into the class table.
Subsequently, If there is an extension to the parent class, all the member fields and methods of parent class are inherited. Following is how class table looks when class <i>Person</i> is installed.<br>
<a href="/img/class_table_1.png"> <img src="/img/class_table_1.png" style="height:90%"></img></a>
</li>
<li>
Following is how class table looks when class <i>Student</i> is installed.<br>
<!--Similarly for <i>rollno,average,findaverage(linkedlist marks)</i>, symbol table entries are formed and installed.-->
<br><a href="/img/class_table_2.png"> <img src="/img/class_table_2.png"></img></a>
</li>
</ol>
</article>
</div>
</section>
</div>
</div>
<footer class="center part clearfix">
<ul class="grid col-one-third social">
<li><a href="http://github.com/silcnitc">Github</a></li>
<li> <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">
<img alt="Creative Commons License" style="border-width:0" src="img/creativecommons.png" /></a></li>
</ul>
<div class="grid col-one-third" style="color:black;">
<p style="font-weight: bold;">Contributed By : <a href="#">J.Ritesh</a> <br>        <a href="#">J.Phani Koushik</a><br>         <a href="#">M.Jaya Prakash</a>
</p>
</div>
<nav class="grid col-one-third ">
<ul >
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<!-- <li><a href="uc.html">Contact</a></li> -->
</ul>
</nav>
<br>
</footer>
<script>window.jQuery || document.write('<script src="js/jquery-1.7.2.min.js"><\/script>')</script>
<script src="js/scripts.js"></script>
<script src="js/inject.js"></script>
</body>
</html>