Coder Social home page Coder Social logo

ahmedm-sallam / tinycompilermagic Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 287 KB

A simple compiler for the TINY language, written in C++. This compiler can parse and execute TINY language programs.

CMake 10.74% C 20.51% C++ 31.30% Makefile 37.36% TypeScript 0.09%
compiler cpp

tinycompilermagic's Introduction

Tiny Compiler

A simple compiler for the TINY language, written in C++. This compiler can parse and execute TINY language programs.

Introduction

This project implements a compiler for the TINY language, a minimal programming language designed for educational purposes. The compiler is written in C++ and includes a parser, analyzer, and interpreter for TINY language programs.

Features

  • Lexer and Parser: Tokenizes and parses TINY language programs.
  • Syntax Tree: Builds a syntax tree from parsed programs.
  • Symbol Table: Manages variables and their memory locations.
  • Semantic Analysis: Performs semantic analysis to check for type errors.
  • Interpreter: Executes TINY language programs.

Getting Started

Program Structure

The TINY language programs should adhere to the specified grammar. The main components include:

  • Lexer and Parser: Tokenizes the input and constructs a syntax tree.
  • Analyzer: Performs semantic analysis, builds the symbol table, and fills in type information.
  • Interpreter: Executes the TINY language program.

Analyzer

The analyzer is responsible for filling the symbol table, performing semantic analysis, and checking for type errors. It also calculates the memory locations for variables.

tinycompilermagic's People

Contributors

ahmedm-sallam 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.