Git Product home page Git Product logo

itse321-project-compiler's Introduction

ITSE121 Project - Simple Compiler with C

This project is aimed at creating a simple compiler using the C programming language. The compiler will be able to parse a given source code and generate executable machine code.

Table of Contents

Introduction

In this project, we will be implementing a basic compiler

Output files

  • The compiler will generate the following output files:
    • A log file containing compilation information and errors. Log
    • A symbol table containing information about the variables and functions in the source code. Log
    • A file containing the tokens extracted from the source code. Tokens
    • A file containing the source code without spaces, comments, and empty lines. Cleaned Code

Features

  • ( 0.1 ) the compiler can read a source text file and print it to a new text file.
  • ( 0.2 ) read char by char
  • ( 0.3 ) Lexial analysis
    • ( 0.3.1 ) symbol table

    • ( 0.3.2 ) find tokens: identifires, operators, keywords only in a basic way

            | Name | Type | Size | Dimension | Line of Declaration | Line of Use | Address |
      
    • ( 0.3.3 ) find tokens: identifires, operators, keywords, numbers, strings, comments, and special characters

    • ( 0.4 ) Show the tokens in a new text file

    • ( 0.5 ) Show symbol table in a new text file

    • ( 0.6 ) Show the errors in a new text file ( log file )

    • ( 0.7 ) Show compilation info in the log file and in the console

    • ( 0.8 ) Show the source code without spaces, comments and empty lines in a new text file

    • ( 0.9 ) Solve spacing errors: the compiler should ignore spaces, tabs, and new lines

Todo

Getting Started

To get started with this project, follow these steps:

  1. Clone the repository: git clone https://github.com/your-username/itse121-compiler.git
  2. Install the required dependencies.
  3. Build the project using the provided build script.
  4. Run the compiler on a sample source code file.

Usage

To use the compiler, run the following command:

```bash
$ make compiler
$ ./compiler
```

Contributing

To contribute to this project, follow these steps:

  1. Fork this repository.
  2. Create a branch: git checkout -b <branch-name>
  3. Make your changes and commit them: git commit -m '<commit-message>'
  4. Push to the original branch: git push origin <project-name>/<location>
  5. Create the pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

itse321-project-compiler's People

Contributors

abdullah-arab avatar

Stargazers

Taha Alfoghi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.