4 ms·
Nicely done. did you using shunting yard algorithm for parsing the expressions? I also developed developers calculator, but I didn't add support for float as y
by stdcall83 7y ago
Nicely done. did you using shunting yard algorithm for parsing the expressions?
I also developed developers calculator, but I didn't add support for float as you did.
https://www.github.com/mellowcandle/bitwise https://www.github.com/mellowcandle/bitwise
- codr7 7y agoThank you :) Sorry, no. I used to be really into parsing algorithms and tools, and I still consider them useful for more mundane tasks. But the last thing I need when exploring the syntax of a new language is someone else's arbitrary limitations. My language parsers [0] tend to be rather messy recursive-decentish creations. But I think that's fine; since in a new language the syntax should be allowed to move around freely, and prematurely nailing it to the floor to check a box isn't really going to help anyone. What usually happens is I'll tighten the parser as needed along the way when I feel confident enough. Which brings us to the issue with parsing tools, they're all in from the start rather than gradual. https://github.com/codr7/g-fu/blob/master/v1/src/gfu/read.go https://github.com/codr7/g-fu/blob/master/v1/src/gfu/read.go https://github.com/codr7/cidk/blob/master/src/cidk/read.cpp https://github.com/codr7/cidk/blob/master/src/cidk/read.cpp