Git Product home page Git Product logo

tinylanguagecompiler's Introduction

TinyLanguageCompiler

Compiler for Tiny programming language

tinylanguagecompiler's People

Contributors

zeyadetman avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

tinylanguagecompiler's Issues

function convert from string to int or float

make a C# function that converts from string to a number (integer or float):

public int cnvrt2num(string txt){
int num = 0 ;
//write code here
return num;
}

Input Output
"12" 12
"2.2" 2.2
"0.2" 0.2
"2.01" 2.01

Functions' rules

32) Function_Body: starts with curly bracket “{” then a set of Statements followed by Return_Statement and ends with “}”
33) Function_Statement: starts with Function_Declaration followed by Function_Body
34) Main_Function: starts with Datatype followed by reserved keyword “main” then “()” followed by Function_Body


15) Declaration_Statement: starts with Datatype then one or more identifiers (assignment statement might exist) separated by coma and ends with semi-colon. (e.g. int x; | float x1,x2:=1,xy:=3; | …)

Conditions

20) Condition_statement: Conditions OrOp ConditionTerm | ConditionTerm
21) ConditionTerm: ConditionTerm AndOp Condition | Condition
22) Condition: Expression Condition_Operator Expression
25) If_Statement: starts with reserved keyword “if” followed by Condition_Statement then reserved keyword “then” followed by set of Statements (i.e. any type of statement: write, read, assignment, declaration, …) then Else_If_Statment or Else_Statment or reserved keyword “end”
26) Else_If_Statement: same as if statement but starts with reserved keyword “elseif”
27) Else_Statement: starts with reserved keyword “else” followed by a set of Statements then ends with reserved keyword “end”
28) Repeat_Statement: starts with reserved keyword “repeat” followed by a set of Statements then reserved keyword “until” followed by Condition_Statement

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.