DEV Community

Discussion on: Pratt Parsing

Collapse
 
kryptocrash profile image
KryptoCrash

That's pretty nice! I actually got around with just setting a var pLayer to 0. Incrementing it for every open parenthese and decrementing it for every closing parenthese. Then just applied a bias of pLayer*3 to the operator precedence. Would this run in faster time?

Thread Thread
 
jrop profile image
Jonathan Apodaca

It's hard to say without running some performance benchmarks.