This project has moved and is read-only. For the latest updates, please go here.

How to implement a custom function with ExpressionEvaluatorGrammar ?

Jun 12, 2013 at 4:32 PM
I am completely new to Irony. I need to implement integral calculus facility in my interpreter.I am using ExpressionEvaluatorGrammar and want to change it to support integral calculus by using following function :-


This function will accept a list of cordinate points and calculate the integral.

How will I register this custom function to ExpressionEvaluatorGrammar ? Please suggest steps.
Jun 12, 2013 at 5:20 PM
Look at expression evaluator itself - it imports all static functions from System.Math class. There's an arithm demo that shows some expression that uses functions from this class.
You can do the same - define static method Integrate somewhere and 'import' it into global namespace.
Jun 12, 2013 at 5:36 PM
Thank You.Will try it.