code: RBBINode flattenVariables() {
          if (fType == varRef) {
              RBBINode retNode  = fLeftChild.cloneTree();
              retNode.fRuleRoot = this.fRuleRoot;
              retNode.fChainIn  = this.fChainIn;
              return retNode;
          }
  
          if (fLeftChild != null) {
              fLeftChild = fLeftChild.flattenVariables();
              fLeftChild.fParent = this;
          }
          if (fRightChild != null) {
              fRightChild = fRightChild.flattenVariables();
              fRightChild.fParent = this;
          }
          return this;
      }
docs: -------------------------------------------------------------------------