Git Product home page Git Product logo

customized-programming-language's Introduction

Customized-Programming-Language

Generating a parser for a customized (imaginary) programming language, I have made a grammar for that customized programming language and checked that with right and wrong input code.

Grammar overview

Terminal and non-terminal symbols are the lexical parts used in deciding the creation rules setting up a customary programming language. Terminal symbols are simple symbols described by an ordinary programming language. Grammar is not just used to portray the formulation of a programming language, it is furthermore used to compiler forming.

Description:

  1. Semicolon is mandatory to indicate the end of a line. Every expression should be in a particular block. Each block starts with opening curly-brace and ends with closing curly-brace.

  2. The Operators are:

    • binary operator: =, +, -, *, /, +=, -=, *=, /=, %=

    • logical operator: &&,||,!, AND, OR, NOT

    • relational operator: ==, !=, <, >, <=, >=

    • increment operator: ++

    • decrement operator: --

  3. Language begins with one or more header files with keyword include. There are at least one or more header files can be exist.

    1

  4. Many or no macros can exist in the program. If macros exist, it will begins with keyword define

    2

  5. Program execution starts in the main function.

    3

  6. We have various types of type specifiers in this language:

    • Integer, Float, Double, bool, String
  7. Without specifying type, User are also allowed to declare constant & variable. But before declaring a constant, user need to write the keyword constant.

    7

  8. User can take input as given below.

    8

  9. Using print command, user can print.

    9

  10. Function can be called also according to below syntax.

    6

  11. We can also add additional functions. Function parameters are optional to use. Function can be called recursively.

    4

    5

  12. User can write conditional statement with if, else if & else. There could be multiple else if and an optional else.

    10

    11

  13. User can run two types of loop, for and while with break and continue statement.

    13

    12

customized-programming-language's People

Contributors

nasimbahadur 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.