protected PExp makeOr ( PExp root , PExp e ) { if ( root != null ) { AOrBooleanBinaryExp o = new AOrBooleanBinaryExp ( ) ; o . setLeft ( root . clone ( ) ) ; o . setOp ( new LexKeywordToken ( VDMToken . OR , null ) ) ; o . setType ( new ABooleanBasicType ( ) ) ; o . setRight ( e . clone ( ) ) ; return o ; } else { return e ; } }
Chain an OR expression onto a root or just return the new expression if the root is null . Called in a loop this left - associates an OR tree .