I would like to create my own programming language and I would like to implement the operators (and,or) with parentheses like that for example.
x = 1
x2 = 2
x3 = 0
x4 = 0
// tmpMap = {x = 1 , x2 = 2, x3 = 0 , x4 = 0}
r1 = ((x and x2) or x3) and x4 // System.out.println("false");
r2 = ((x and x2) or x3) or x4 // System.out.println("true");
My problem is how I can define this rule and how I can evaluate it in my listener to display (true | false). Can someone give me a simple prototype for this problem ?. Thank you in advance.