The table below indicates the ways in which conditions and logical operators can be combined and parenthesized. There must be a one-to-one correspondence between left and right parentheses such that each left parenthesis is to the left of its corresponding right parenthesis.
|Element||Permitted location in conditional expression||Element can be preceded by only:||Element can be followed by only:|
|simple-condition||Any||OR, NOT, AND, (||OR, AND, )|
|OR or AND||Not first or last||simple-condition, )||simple-condition, NOT, (|
|NOT||Not last||OR, AND, (||simple-condition, (|
|(||Not last||OR, NOT, AND, (||simple-condition, NOT, (|
|)||Not first||simple-condition, )||OR, AND, )|
Thus, the element pair "OR NOT" is permissible while the pair "NOT OR" is not permissible; "NOT ( " is permissible while "NOT NOT" is not permissible.