anchor.diff:           ((((assigned(NodeA) and assigned(NodeB))) and
              (((NodeA^.NodeType=NodeB^.NodeType) and not (NodeB^.NodeType in [ntPAREN])) and
               ((NodeA^.Value=NodeB^.Value) and
  -             ((AreNodesEqualSafe(NodeA^.Left,NodeB^.Left) and
  -               AreNodesEqualSafe(NodeA^.Right,NodeB^.Right)) and
  -               AreNodesEqualSafe(NodeA^.Extra,NodeB^.Extra))))) or
  +             (AreNodesEqualSafe(NodeA^.Left,NodeB^.Left) and
  +              AreNodesEqualSafe(NodeA^.Right,NodeB^.Right))))) or
             not (assigned(NodeA) or assigned(NodeB)));
   end;
   
  
positive.code:       Group:longint;
        Left:PFLRENode;
        Right:PFLRENode;
        Extra:PFLRENode;
        Index:longint;
        Name:ansistring;
       end;
  
negative.code:   if assigned(Node^.Right) then begin
     result^.Right:=CopyNode(Node^.Right);
    end;
   end else begin
    result:=nil;
   end;
  end;
  
  // Mark-and-sweep garbage collector for freeing unused nodes
  procedure TFLRE.FreeUnusedNodes(RootNode:PFLRENode);
  var Index,Count:longint;
      Visited,Stack:TList;
      Node:PFLRENode;
  begin
   Visited:=TList.Create;
   try
    Count:=0;
    Stack:=TList.Create;
    try
     Stack.Add(RootNode);
     while Stack.Count>0 do begin
      Node:=Stack[Stack.Count-1];
      Stack.Delete(Stack.Count-1);
      if assigned(Node) then begin
       Visited.Add(Node);
       inc(Count);
       if assigned(Node^.Left) and (Visited.IndexOf(Node^.Left)<0) then begin
        Stack.Add(Node^.Left);
       end;
       if assigned(Node^.Right) and (Visited.IndexOf(Node^.Right)<0) then begin
        Stack.Add(Node^.Right);
       end;
      end;
     end;
    finally
     Stack.Free;
    end;
    if Count<>Nodes.Count then begin
     Index:=0;
     while Index<Nodes.Count do begin
      Node:=Nodes[Index];
      if Visited.IndexOf(Node)<0 then begin
       Node^.Name:='';
       Finalize(Node^);
       FreeMem(Node);
       Nodes.Delete(Index);
      end else begin
       inc(Index);
      end;
     end;
    end;
   finally
    Visited.Free;
   end;
  end;
  
  