Pimpri Chinchwad College of Engineering
Sector 26, Pradhikaran, Nigdi, Pune – 411 044.
Department of Computer Engineering
Academic Year 2011-12 [Semester I]
Subject : Computer Laboratory -1
Date: 19-10-2011
a) Write a lex program to read a text file and to calculate no.of characters, no.of words , no of newline characters, no of white spaces in the file b) write a lex program to read a text file and to replace the given word in small case letters with the capital letters
Construct lexical analyzer for subset of 'C' language(5 keywords,5 operators, identifiers, constants and comments). Generate lexeme and token table. Do symbol table management for identifiers.
Write a YACC prog to convert an infix expression to its equivalent postfix expression
Design a calculator using YACC with symbol table management.
Generate three address code for Subset of ‘C’ using quadruples.
Generate the target code for the optimized code for above generated intermediate code using Sethi Ullman algorithm.
Write a lex program to read a text file and to count no.of vowels and consonants.
Write a YACC prog to convert an infix expression to its equivalent prefix expression
Write a lex program to read a text file and to calculate no. of numbers(constants/literals)
Write a lex program to convert all a’ s in small into capital letter when it is followed by ‘b’.
Write a lex program to convert all identifiers in small into capital letter when it is followed by comma.
Write a Lex program to convert floating point numbers into integers.
Generate three address code for assignment statements of ‘C’ programming language using YACC.
Prepared By
Mrs Sonal Gore
Mrs B Mahalaxmi