zaach / jison

Bison in JavaScript.
http://jison.org
4.35k stars 448 forks source link

Please help to parser IF function in excel formula #384

Open ericnature opened 5 years ago

ericnature commented 5 years ago

For example, IF(A1<>"",A1-1,""). So I want to skip parsing expression 'A1-1' if A1 is empty. How can I do this in jison?

Sluchik commented 4 years ago

Hi, @ericnature

I am trying to find the solution with the "IF" statement too. Do you have any updates?

ericnature commented 4 years ago

No. Someone suggested that parser from top to bottom be good to solve it. But Jison is from bottom to top parser.

Sluchik commented 4 years ago

Thank @ericnature for respond. Do you know some parser from top to bottom which will be suitable for the current case? Currently, I am looking for the best one.

ericnature commented 4 years ago

It is said that mid-rule in bison would help. But I did test it. Please refer: https://stackoverflow.com/questions/27160831/how-to-create-a-short-circuit-evaluation-in-bison-using-mid-rules-action