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