CS3501 Set3
CS3501 Set3
1. (i)Write a program to recognize a valid arithmetic expression that uses operator +, - , * and /.
4. Write a program that uses the semantic rules of LEX and YACC tool to construct a calculator
that computes the supplied expression.
5. Create a Lex program to identify a valid C language control structure syntax for the following
(i) if-else-if
(ii) switch-case
Page 1 of 3
6. Write a Lex program to count the number of words, characters, blank spaces and lines in a C
program.
8. Write a program to implement the back end of the compiler for which the three-address code is
given as input and the 8086-assembly language code is produced as output.
10. Write a program to implement any one of the dynamic storage allocation strategies (Heap, Stack,
Static).
11. (i) Write a program to find whether a given string is keyword or not.
12. Write a program to implement the type checking for given expression.
13. Develop a program to generate tokens for the following input string
(12+23*34)
14. Write a LEX program to recognize a valid variable which starts with a letter followed by any
number of letters or digits.
Page 2 of 3
15. Write a program for implementing Three Address Code using LEX and YACC.
16. Create and print a symbol table of C language that contains name, type and size of identifier.
17. Write a program to implement the Lexical Analyzer using lex tool to recognize few patterns
(i)assignment expression
(ii)arithmetic expression
19. Write a program for implementing a Lexical analyzer using LEX tool in Linux platform.
Page 3 of 3