| Solution | FortiAnalyzer's custom parser now supports arithmetic operations as part of its predefined functions. These functions are used in the custom parser as binary operations. Each function takes two arguments: 'l' and 'r'. 'l' represents the left-hand side of the expression, and 'r' represents the right-hand side. These arguments are used in the function calls as shown below. Newly Added Functions: add(l, r) minus(l, r) multiply(l, r) divide(l, r) For each function, the following examples demonstrate how to apply arithmetic operations when l = 20 and r = 4: l = 20, r = 4, <various> = add(l, r) //this result is <various> = 24 <various> = minus(l, r) //this result is <various> = 16 <various> = multiply(l, r) //this result is <various> = 80 <various> = divide(l, r) //this result is <various> = 5 - The variables l and r can be assigned real numbers as well as other variables.
- <various> can be replaced with any variable name, for example, 'calc-result'.
|