I want to build an expression and evaluate it in python. Basically I will have Rule ID for which I need to build a Trigger condition (T), LHS (L), RHS (R) in the form of expression.
All the data required to build the above 3 expression will be stored in a form of three tables in database. Let say,
1) Constant table - stores rule Id and constants along with their order
2) Operator table - stores rule Id and operators, prior operator along with their order
3) Variable table - stores rule Id and variables, prior operator along with their order
Tables data will be in form of
so based on the equation order id, I need to build T, L, R expression for the given RuleId. For example: expression for the RuleId =3, T,L,R will be as follows
T : ( ! 2204) and ( ! 2204)
L : 2204
R : 2204 * 2.00000
Tried by building the expressions using stack, queue in C#, it worked fine. Is there any other easy way exists in python to achieve this?