Compiler 22

Download Compiler 22

Post on 11-Apr-2015

1.013 views

Category:

Documents

4 download

Embed Size (px)

TRANSCRIPT

<p>M. Sc. Part I [COMPUTER SCIENCE] Practical Journal [ Principles of Compiler Design ] Seat Number [ ]</p> <p>Department of Computer Science and Information Technology Deccan Education Societys Kirti College of Arts, Science and Commerce. [ NAAC Accredited : A Grade]</p> <p>Department of Computer Science and Information Technology Deccan Education Societys Kirti College of Arts, Science and Commerce. [ NAAC Accredited : A Grade]</p> <p>CERTIFICATEThis is to certify that Mr./Miss_________________ of M.Sc Part-I [COMPUTER SCIENCE] with Seat No._______has successfully completed the practical of Principles of Compiler Design under my supervision in this college during the year 2006 - 2007.</p> <p>Lecturer-in-charge ( Mrs.Akshata Nayak)</p> <p>Head of Department Dept of Com.Sc and I.T (Dr. Seema Purohit)</p> <p>NAAC Accreditation A Grade Deccan Education Societys Kirti M. Doongursee College, Dadar, Mumbai-28Dept. of Computer Science &amp; I.T.</p> <p>M.Sc. (Part-I) 2006 07 Compiler Construction ( Section-I )</p> <p>INDEXNo. Title 1 2 3 4 5 6 7 8 9 10 11 12 13 14Parsing using DFA NFA to DFA Removal of Empty State( / ) Removal of Left Recursion LL(1) Parsing Table Warshalls Algorithm LR(0) Parsing Right &amp; Left Linear Grammars Minimize the Automata Simple Precedence Matrix (SPM) Parsing using SPM Linearizing a given SPM Parsing using Simple Precedence Function Operator Precedence Matrix (OPM)</p> <p>Page No.</p> <p>Date</p> <p>Sign</p> <p>Roll No. 22 NAAC Accreditation A Grade Deccan Education Societys Kirti M. Doongursee College, Dadar, Mumbai-28Dept. of Computer Science &amp; I.T.</p> <p>M.Sc. (Part-I) 2006 07 Compiler Construction (Section-I)PRACTICAL 1</p> <p>Write a program for acceptance of a string using DFA Suppose the following transition table 0 1 2 a 1 1 0 B 0 2 2</p> <p>Find the string you are enter is accepted by above DFA or not?</p> <p>PROGRAM:</p> <p>#include #include #include #include class p_dfa { int n,n1,n2,final[10],fa[10][10]; char ch[10],*str; public: void accept(); void dfa(char*); }; void p_dfa::accept() { int i,j; cout n; cout n1; cout " ; couta","S-&gt;bU","S-&gt;bR","R-&gt;abaU","R-&gt;U","U-&gt;b","U-&gt;aS"); char left[10][10]={"","","","","","",""}; clrscr(); char ter[5]={'a','b'}; char nonter[10]={'S','U','R'}; char sym[10]={'e','e','o'}; int i,j,k,l,m; cout</p>