DEV Community


Discussion on: Pratt Parsing

jrop profile image
Jonathan Apodaca Author

Awesome. CYK parsing is a term I have run across, but I am not familiar with how they work. You should write an article on it!

palle profile image
Palle • Edited

As I have done some research on operator precedence parsing, I have found another way which is absolutely trivial to implement:

Just put a (( at the beginning of the equation, a )) at the end and replace every + with a ))+(( and every * with a )*(. By doing this your expression is correctly parenthesized without any complicated algorithms. (Found it on Wikipedia)

palle profile image

I have exams at the moment but if I have some time, I will do that.

Forem Open with the Forem app