Code Monkey home page Code Monkey logo

msdscript's Introduction

MSDScript

MSDScript is a simple interpreter written in C++.

What does it do?

It takes user input and then parse and interpret the result. It not only supports basic arithmetic expressions but also if-else statements and user-defined functions, etc., just like most programming languages do.

How is it implemented?

Data type

Everything in the interpreter is an expression. A single number 2 is an expression, 2 + 3 + 4 is an expression, even a if-else statement is an expression.

Interpreter

The interpreter consists of two parts: the parsing part and interpreting part. The program first parse the user input as an expression, and then interpret the expression.

  • parsing part: the parsing part is constructed by the order of operation specifically defined in the program, and most of the order of operation is the same as that in a normal mathematical expression.

  • interpreting part: the interpreting part is not only about how to calculate the right result, but also how to make it fast and safe. Two key implementations are the continuation and the garbage collector.

Documentation

The documentation: MSDScript doc

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.