Welcome to the Compiler Design Experiments repository! 🚀 This repository contains a series of experiments and programs related to compiler design. Each experiment explores fundamental concepts and techniques used in building compilers.
-
Simple Calculator
- This experiment involves creating a basic calculator using lex and yacc (or flex and bison), demonstrating lexical analysis and parsing.
-
Flex Program
- Implementation of a lexical analyzer using Flex (Fast Lexical Analyzer Generator), showcasing tokenization of input.
-
Scanner Program
- Development of a scanner (tokenizer) program, focusing on recognizing patterns in input strings.
-
Bison Program
- Creation of a parser using Bison (GNU Parser Generator), demonstrating syntax analysis and parsing techniques.
-
First and Follow Program
- Implementation of the First and Follow sets computation algorithm for a given grammar.
-
Left Factoring
- Experiment to eliminate left factoring from a grammar, addressing grammar ambiguity and efficiency.
-
Left Recursion
- Exploration of techniques to remove left recursion from a grammar, essential for avoiding infinite loops in parsing.
-
SLR Parsing
- Implementation of SLR (Simple LR) parsing for a grammar, demonstrating bottom-up parsing techniques.
-
Java Program
- Development of a Java-based compiler component, integrating concepts learned from previous experiments into a practical program.
Each experiment folder contains source code and possibly additional documentation or explanatory files to understand the concepts and implementations.
To explore these experiments:
- Clone this repository:
git clone https://github.com/your-username/compiler-design-experiments.git
- Requirements:
- For experiments involving Lex and Yacc (Flex and Bison), ensure you have these tools installed on your system.
- Java experiments may require a JDK (Java Development Kit) installed.