This repository contains the solutions for the Compiler Design (CD) Lab assignments for the 7th Semester, as per the KTU S7 syllabus. The tasks are divided into four cycles, and the repository will be updated according to the completion deadlines for each cycle.
- Lexical Analyzer: Design and implement a lexical analyzer for a given language using C. The lexical analyzer should ignore redundant spaces, tabs, and newlines.
- ε-Closure: Write a program to find the ε-closure of all states of any given NFA with ε-transitions.
- NFA to NFA without ε-Transitions: Write a program to convert an NFA with ε-transitions to an NFA without ε-transitions.
- NFA to DFA: Write a program to convert an NFA to a DFA.
- DFA Minimization: Write a program to minimize a given DFA.
- Lex Program for Name Substring Check: Write a Lex program to recognize all strings that do not contain the first four characters of your name as a substring.
- YACC Program for Valid Variables: Write a YACC program to recognize a valid variable that starts with a letter followed by any number of letters or digits.
- Calculator using Lex and YACC: Implement a calculator using Lex and YACC.
- BNF to YACC with Abstract Syntax Tree: Convert the BNF rules into YACC form and write code to generate an abstract syntax tree.
- YACC Program for C FOR Statement Syntax Check: Write a YACC program to check the syntax of the FOR statement in C.
- Operator Precedence Parser: Develop an operator precedence parser for a given language.
- First and Follow Simulation: Write a program to simulate First and Follow of any given grammar.
- Recursive Descent Parser: Construct a recursive descent parser for an expression.
- Shift Reduce Parser: Construct a Shift Reduce Parser for a given language.
- Intermediate Code Generation: Implement intermediate code generation for simple expressions.
- Back-end of Compiler: Implement the back end of the compiler that takes the three-address code and produces 8086 assembly language instructions. The target assembly instructions can include simple operations like move, add, sub, jump, etc.