OF
SYSTEM PROGRAMMING
B.tech
(H)-CSE
Section:
A1802
Roll No.:
RA1802B29
Expectations:
Analyzer is basically used for the creation or development of the descriptor i.e.
lexical. Token basically consist of two parts i.e. class code and number in class.
Class code is used to address the class to which a lexical unit belongs. Number in
the class is the entry number of the lexical unit in the relevant table.
According to the ques. All elements are divided into following categories:-
so ,here are all the identifiers and all the corresponding tokens used for them.
SR NO TOKEN
I.A id#1
II.B id#2
III.C id#3
IV.D id#4
V .E id#5
VI.F id#6
VII. G id#7
VIII .W id#8
IX .X id#9
X. Y id#10
XII . Z id#11
XIII .U id#12
XIV .V id#13
XV . I id#14
XVI .J id#15
XVII.K id#16
XVII.L id#17
b).keywords-it is a name that has a special meaning and functionality. It can be
also used to represent symbol or as an operator. In this the class code is a key.
SR NO TOKEN
I .if key#1
II .while key#2
SR NO TOKEN
I .< op#1
IV. OR op#4
V. + op#5
VI. - op#6
VII. * op#7
VIII.== op#8
4.special symbol-these are special notations like array parameter etc…the class
code is (ss)
SR NO TOKEN
I.( ss#1
II.) ss#2
III .[ ss#3
IV.] ss#4
V., ss#5
L.place = i
(1) E.place = i
(2) Elist.array = X
Elist.place= i
Elist.dim=1
(3) L.place = j
(4) E.place= j
(5) M=2 , t1 (newtemp) t1=i*d2
Elist.place = t1 t1=t1+j
Elist.dim =m
Elist.array = X
(8) L.place = i
(9) E.place = i
(10) L.place=j
(11) E.place = j
(13) Elist.array = Y
Elist.place = t4
Elist.dim =1
(14) L.place = k
(15) E.place = k
(16) m=2 , t5 (newtemp) t5=t4*d4
Elist.array = Y
Elist.place = t5 t5=t5 + k
Elist.dim=2
(19) L.place = z
L.offset= NULL
(20) L.place= z
(21) t9 (newtemp) t9 = t8 + z
(22) t2[t3] := t9
4) Assignment operator (=) , with (id # 1) to (id # 20) which -( id # 10)
7) Next step is of addition (id # 1) with (id # 11) which will give (id # 11)
8) Again there is unary operation (negation) from (id # 12) after (id # 18)
10) After this we multiply (id # 12) with (id # 13) giving (id # 13)
12) After doing all operations , we substrate (id # 12) from (id # 13)
Solution 5:-Its main concern is about proper usage or proper management of the
memory by the analyzer and to divide memory in order to get memory optimization.
Memory optimization can be done in different ways but before doing that we must
know how to allocate the memory and use it in our code.
So first we will concern about the memory allocation and after that steps to
reduce the memory used by us.
A real 2001
C real 2002
B real 2004
D real 2005
E real 2007
F real 2008
b1 real 2014
above we can see that we have used memory for variable, constant or any
operator. There are several Steps to reduce the memory that has been used for
temp allocation but we concern only about the result only.
1.first,we have to remove all the memory that has been used for temp allocation in
between the calculations.
2.secondly,memeory optimization has to be done for all the operators we have used
like :<,>,and,or,etc.
4.fourthly,by using dynamic memory instead of the of the static memory for the
allocations of variables.