This repository contains a collection of programs for the Compiler Lab course, designed specifically for Kerala Technological University (KTU) students. Each program aligns with the lab experiments outlined in the KTU syllabus, covering key concepts in compiler design.
- Design and Implement a Lexical Analyzer (C Language)
- Lexical Analyzer Using Lex Tool
- Count Lines, Words, and Characters (Lex Program)
- Convert Lowercase to Uppercase (Lex Program)
- Count Vowels and Consonants (Lex Program)
- Arithmetic Expression Recognition (Yacc)
- Identifier Recognition (Yacc)
- Calculator Using Lex and Yacc
- E-Closure of All States
- First and Follow of Given Grammar
- Shift-Reduce Parser Implementation
- Code Optimization Simulation
- Intermediate Code Generation
- 8086 Assembly Code Backend Implementation
- Date: 26/07/24
- Description: A C program to implement a basic lexical analyzer that identifies tokens in a given input.
- Date: 09/08/24
- Description: Using Lex, this program builds a lexical analyzer for a specific programming language.
- Date: 16/08/24
- Description: Lex program that counts lines, words, and characters in an input file.
- Date: 16/08/24
- Description: A simple Lex program to convert all lowercase characters to uppercase.
- Date: 16/08/24
- Description: This Lex program counts the number of vowels and consonants in the given input.
- Date: 23/08/24
- Description: Yacc specification to recognize and validate arithmetic expressions.
- Date: 23/08/24
- Description: Yacc specification to recognize identifiers within a code.
- Date: 23/08/24
- Description: A calculator program built using Lex and Yacc, supporting basic arithmetic operations.
- Date: 09/10/24
- Description: Program to compute the epsilon-closure of all states in an NFA.
- Date: 09/10/24
- Description: This program calculates the first and follow sets of a given grammar.
- Date: 16/10/24
- Description: Implements a shift-reduce parser for parsing a given input.
- Date: 16/10/24
- Description: Simulates basic code optimization techniques to improve efficiency.
- Date: 18/10/24
- Description: Generates intermediate code for simple expressions.
- Date: 19/10/24
- Description: Implements the backend of a compiler that converts three-address code into 8086 assembly language.
- Install Lex and Yacc tools.
- Clone the repository:
git clone https://github.com/yourusername/KTU-Compiler-Lab-Programs.git
2.Navigate to the desired program directory. 3.Compile and run the program using appropriate commands.