My request is to make a compiler that transforms an expression like "add(5, mul(3, sub(10, pow(6, 4))))", in a equivalent mathematical expression, "5 + 3 * (10 - 6^4)" in this case.
Functions: add(x, y) (addition), sub(x, y) (subtraction), mul(x, y) (multiplication), div(x, y) (division), mod(x, y) (modulo), pow (x, y) (power), where x, y are operands
Operand: a number conforming to the following grammar:
<number> ::= <optional-sign> <digit-sequence> <optional-fraction> <optional-exponent>
<optional-sign> ::= "" | "+" | "-"
<optional-fraction> ::= "" | "." <digit-sequence>
<optional-exponent> ::= "" | "e" <optional-sign> <digit-sequence>
<digit-sequence> ::= <digit> | <digit> <digit-sequence>
<digit> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
Other elements: brackets ( and ) and whitespace (in the evaluated expression, there can be any number of whitespace characters, like spaces)
Desired result: A mathematical expression equivalent to the specified composition of functions. Make sure the order of operation application stays the same. Unnecessary brackets should be omitted.
The operator precedence has three levels, from lowest to highest:
1: +, -
2: *, /, %
The ^ operator is right associative, other operators are left associative.
Implementation language: C, C++ or Java
For lexical analysis, use regular expressions and finite automata; for syntax analysis, use context-free grammars and precedence-based parsing
ALL PARTS OF THE CODE MUST BE LARGELY COMMENTED!
Thank u for posting your project. I'm a expert in C ++, C#, I 've taken part in the National ACM Contest in 2016(that was Algorithm contest with C++ ) and win a gold medal. I have 8 years of experiences with C, C#, Un Daha Fazla
Hello, I have just read your job post and very interested in this project. I can complete your project in short time Please contact me and let's discuss more details Hope reply. Thanks.
Bu iş için 14 freelancer ortalamada €79 teklif veriyor
Hello. How are you. I'm going to usd tree for your project. I'm software engineer and algorithm expert. I have many experiences in c, c++, c#, java, python, node.js. I can complete your project successfully. Thanks.
Hello, sir. I have read your project details and thinking about the solution. I can do the project for u. I will finish it ASAP once you chose me. I will do it using C or C++. Thanks.
Hi, I have developed my own language called Drew with JVM. I am pretty sure I can get your task done. I can use either C or C++ as well. You want a transpiled langauge or a machine compile language?
Hello, I have just read your requirement very careful and I am sure that I can finish it for 1 hours because I am a professional C/C++ expert with strong algorithm. So I think it is a important opportunity for me to pr Daha Fazla
Hello! I am very interested in your post project. While I read your description carefully, I was excited with feeling that I would be able to satisfy for your requirements in this job. We can negotiate on price/Budget Daha Fazla