Skip to main content

ktu 2019 Cse Complier programing Lab Syllabus

 1Design 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. Implement a Lexical Analyzer for a given program using Lex Tool.

3. Write a lex program to display the number of lines, words and characters in an input text.

4. Write a LEX Program to convert the substring abc to ABC from the given input string.

5. Write a lex program to find out the total number of vowels and consonants from the given input string.

6. Generate a YACC specification to recognize a valid arithmetic expression that uses operators +, – , *,/ and parenthesis.

7. Generate a YACC specification to recognize a valid identifier which starts with a letter

 followed by any number of letters or digits. 

 8. Implementation of Calculator using LEX and YACC

 9. Convert the BNF rules into YACC form and write code to generate abstract

 syntax tree.

 10. Write a program to find ε – closure of all states of any given NFA with ε transition.

 11. Write a program to convert NFA with ε transition to NFA without ε transition.

 12. Write a program to convert NFA to DFA.

 13. Write a program to minimize any given DFA.

 14. Write a program to find the First and Follow of any given grammar.

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

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

 17. Write a program to perform constant propagation.

 18. Implement Intermediate code generation for simple expressions.

 19. Implement the back end of the compiler which takes the three address code and

 produces the 8086 assembly language instructions that can be assembled and run

 using an 8086 assembler. The target assembly instructions can be simple move, Add, sub, jump etc... 


Comments

Popular posts from this blog

12. Write a program to convert NFA to DFA.

Converting a Non-Deterministic Finite Automaton (NFA) to a Deterministic Finite Automaton (DFA) involves creating a new DFA where each state corresponds to a set of NFA states reachable under certain conditions. Below is a simple Python program to perform this conversion. I'll explain each line of code: ```python from collections import defaultdict def epsilon_closure(states, transitions, epsilon):     closure = set(states)     stack = list(states)          while stack:         state = stack.pop()         for next_state in transitions[state].get(epsilon, []):             if next_state not in closure:                 closure.add(next_state)                 stack.append(next_state)          return closure def nfa_to_dfa(nfa_states, nfa_transitions, alphabet, start_state, n...