Compiler for Tiny programming language
zeyadetman / tinylanguagecompiler Goto Github PK
View Code? Open in Web Editor NEWCompiler for Tiny programming language
Compiler for Tiny programming language
if a>b && b>c || c>d then
write a;
end
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 |
line ends with number.
if z1>2;
int x := 3|;
the program will ignore the pipe '|', this is wrong, the program should save the pipe to lexemes.
NOTE take care of space ' '.
And &&
Or ||
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; | …)
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.