In our application users can enter custom expressions to calculate certain things. For instance they can specify an invoice and define a number of lines for cost calculation.
Example for a course with $400 price $10 transaction fee and a number of free people (say because of some credit)
- (?numberOfParticipants? - ?creditedtTickets?) * 400 + 10
We currently have custom code that parses and executes this. But we recently found a bug in it and need to spend some time on this.
We could improve the current hacky code, we could build a proper parser but I feel this is a very generic problem that lots of people have and there should be an off the shelf solution but I can't seem to find one.
Does anybody recognize this problem and how did you handle it?