Skip to content

Latest commit

 

History

History
90 lines (58 loc) · 2.19 KB

README.md

File metadata and controls

90 lines (58 loc) · 2.19 KB

Phases of Compiler

A Simple Implementation of Compiler Phases

This project demonstrates a basic implementation of several phases of a compiler: lexical analysis, syntax analysis, and translation from infix to postfix notation.

Introduction

This project showcases a simplified version of a compiler that processes an input expression, validates its syntax, constructs a parse tree, and converts the expression from infix to postfix notation. The implementation covers:

  • Lexical Analysis: Tokenizing the input.
  • Syntax Analysis: Validating and parsing the expression into a parse tree.
  • Infix to Postfix Conversion: Translating infix expressions to postfix notation.

Demonstration

Compiler Phases

Installation and Usage Instructions (For End-Users)

  1. Clone the repository:
git clone https://github.com/yourusername/Phases-of-Compiler.git
cd Phases-of-Compiler
  1. Compile the code:
g++ -o compiler compiler.cpp lexical_analyzer.cpp syntax_analyzer.cpp
  1. Run the compiler:
./compiler
  1. Enter an expression when prompted.

Installation and Usage Instructions (For Contributors)

  1. Clone the repository:
git clone https://github.com/yourusername/Phases-of-Compiler.git
cd Phases-of-Compiler
  1. Set up your development environment:

Ensure you have g++ installed. You can install it using:

  • For Debian-based systems:

    sudo apt-get install g++
  • For Red Hat-based systems:

    sudo yum install g++
  1. Compile the code:
g++ -o compiler compiler.cpp lexical_analyzer.cpp syntax_analyzer.cpp
  1. Run the compiler:
./compiler
  1. Make your changes and create a pull request.

Contributor Expectations

  • Fork the repository and clone it to your local machine.
  • Create a new branch for your feature or bugfix.
  • Make your changes and commit them with descriptive messages.
  • Push your changes to your fork and create a pull request.
  • Ensure your code follows the project's style guidelines.
  • Include tests for any new functionality.

Feel free to contribute to this project. Happy coding!