The program processes a string and parses it to validate whether it is in the products of sum (PoS) format according to the following rules:
When matched with a ( it sets a boolean variable isopen to true.
While isopen is true, it matches singular (not multiplied) alphabetical characters that might be followed by the NOT operator ' and separated by a + all while ignoring whitespaces.
While isopen is false, the parser looks for the following an asterisk, empty-space, or a whitespace to ensure that the next opoeration is a product.
There is a code in the background that ensures the balance of parentheses.
The program processes a string and parses it to validate whether it is in the products of sum (PoS) format according to the following rules:
(
it sets a boolean variableisopen
totrue
.isopen
istrue
, it matches singular (not multiplied) alphabetical characters that might be followed by theNOT
operator'
and separated by a+
all while ignoring whitespaces.isopen
isfalse
, the parser looks for the following an asterisk, empty-space, or a whitespace to ensure that the next opoeration is a product.This PR resolves #5