Hm, this is an agnostic language, I would prefer to do it in C # or F #, but this time I'm more interested in the question "how it will work anyway."
What I want to do ist:
a) I want to LEARN it - this is about my ego this time, this is for a fun project where I want to show myself that I am really good at it.
b) I am a little versed in EBNF (although I do not yet know how the operator works in EBNF - Irony.NET does it right, I checked the examples, but it is a little sinister for me)
c) My analyzer should be able to take this: 5 * (3 + (2 - 9 * (5/7)) + 9), for example, and give me the correct results
d) To be honest, this is apparently the biggest problem when writing a compiler or even a translator for me. I would not have a problem generating even 64-bit assembler code (I CAN write the assembler manually), but the formula analyzer ...
e) Another thought: even simple computers (such as my old Sharp 1246S with about 2 KB of RAM) can do this ... it can't be YOU SAME, right? And even very, very old programming languages have an evaluation formula ... BASIC since 1964, and they could already calculate the form of the formula presented as an example
f) A few ideas, a little inspiration would really be enough - I just don't know how to prioritize the operator and parentheses - I, however, know that it includes AST and that many people use the stack
So what do you think?
compiler-construction language-agnostic parsing interpreter formula
StormianRootSolver
source share