Skip to content

man-yadul/S7-CSL411-COMPILER-LAB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

S7-CSL411-COMPILER-LAB

RAJAGIRI SCHOOL OF ENGINEERING AND TECHNOLOGY

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

SEMESTER - VII

COMPILER LAB

LAB CYCLE

  1. Design and implement a lexical analyzer using C language to recognize all valid tokens in the input program. The lexical analyzer should ignore redundant spaces, tabs and newlines. It should also ignore comments.

  2. a) Write a lex program to display the number of lines, words and characters in an input text. b) Write a LEX Program to convert the substring abc to ABC from the given input string. c) Write a lex program to find out total number of vowels and consonants from the given input sting.

  3. a) Generate a YACC specification to recognize a valid arithmetic expression that uses operators +, – , *,/ and parenthesis. b) Generate a YACC specification to recognize a valid identifier which starts with a letter followed by any number of letters or digits.

  4. Implementation of Calculator using LEX and YACC

  5. Write a program to convert NFA to DFA.

  6. Write a program to find First of any given grammar.

  7. Design and implement a recursive descent parser for a given grammar.

  8. Construct a Shift Reduce Parser for a given language.

  9. Write a program to perform constant propagation.

  10. Implement Intermediate code generation for simple expressions.

  11. Implement the back end of the compiler which takes the three address code and produces the 8086 assembly language instructions. The target assembly instructions can be simple move, add, sub, jump etc.