Giter Site home page Giter Site logo

implement_mini_c's Introduction

An interpreter of the micro C

A interpreter for a programing language called Micro C, similar to C but simpler. The description of the language is : https://github.com/naot97/implement_mini_C/blob/master/specific_MC.pdf

Getting Started

Installing

Running

Type sbt in cmd or terminal

Compiling

Type compile in cmd or terminal

Testing

Type test in cmd or terminal

Steps of building the interpreter:

Step 1: Generating the parser tree.

  • The project uses the ANother Tool for Language Recognition(ANTLR) to generate the parser tree from a regular expression language called CFG. ANTLR is a powerful parser generator that you can use to read, process, execute, or translate structured text or binary files. It’s widely used in academia and industry to build all sorts of languages, tools, and frameworks. Twitter search uses ANTLR for query parsing, with over 2 billion queries a day. The languages for Hive and Pig, the data warehouse and analysis systems for Hadoop, both use ANTLR. You can read more about ANTLR in !(https://www.antlr.org)[here].

  • This step can help to check the syntax of the language. When we create CFG regular expressions, we define the syntax of the elements of the language, like: statements(if, while, for, break, return, continue, expression, block), declarations(variable and function declarations), Datatypes and Values(interger, float, string, boolean), Token Set(Identifiers, Keywords, Operators) and Literals. This work can be found in !https://github.com/naot97/implement_mini_C/blob/master/ppl/src/main/mc/parser/MC.g4.

Step 2: Building AST tree

Step 3: Checking meaning

Step 4: Gen Assembly code

implement_mini_c's People

Contributors

naot97 avatar

Stargazers

An Ky Doan avatar  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.