Node Disj() { Node left = Conj(); while (true) { //Identify the operation Operation op = Operation.Null; if (splitter.current_sign == Sign.Or) { op = Operation.Or; } //If no plus or minus sign is found if (op == Operation.Null) { return(left); } splitter.Move_sign(); //move to the next sign Node right = Conj(); //Create a node with a correspondent binary operation left = new NodeBinary(left, right, op); } }
Node PlusMinus() { Node left = MultDiv(); while (true) { //Identify the operation Operation op = Operation.Null; if (splitter.current_sign == Sign.Plus) { op = Operation.Addition; } else if (splitter.current_sign == Sign.Minus) { op = Operation.Substraction; } //If no plus or minus sign is found if (op == Operation.Null) { return(left); } splitter.Move_sign(); //move to the next sign Node right = MultDiv(); //Create a node with a correspondent binary operation left = new NodeBinary(left, right, op); } }
Node Conj() { Node left = Part(); while (true) { //Identify the operation Operation op = Operation.Null; if (splitter.current_sign == Sign.And) { op = Operation.And; } //If no multiply or divide sign is found if (op == Operation.Null) { return(left); } splitter.Move_sign(); //move to the next sign Node right = Part(); //Create a node with a correspondent binary operation left = new NodeBinary(left, right, op); } }
Node MultDiv() { //Check whether the current node is a unary operator Node left = Unary(); while (true) { //Identify the operation Operation op = Operation.Null; if (splitter.current_sign == Sign.Divide) { op = Operation.Division; } else if (splitter.current_sign == Sign.Multiply) { op = Operation.Multiplication; } //If no multiply or divide sign is found if (op == Operation.Null) { return(left); } splitter.Move_sign(); //move to the next sign //Check whether the current node is a unary operator Node right = Unary(); //Create a node with a correspondent binary operation left = new NodeBinary(left, right, op); } }