nodebnf icon indicating copy to clipboard operation
nodebnf copied to clipboard

if possible to invoke function to calcute the result?

Open creatxrgithub opened this issue 4 years ago • 1 comments

base on the example calculator.

function doX(a,b) { return a * b }

e.g. expression is 1 x 2

i want to calculate 1 x 2 by call function doX(1,2)

thanks.

creatxrgithub avatar Jan 05 '22 03:01 creatxrgithub

You can write a function parser which would accept a token for (doX) and map that to an internal event of functions. Then set the ( ) tokens as part of an argument tree and through a set of parse rules allow access to the compiled tokens and pass them into the event methods.

daKuleMune avatar Nov 21 '22 19:11 daKuleMune