Software usually exists in multiple versions. All these versions must evolve in parallel. We propose a program-merging system that helps programmers to manage the evolution of all versions, which is much needed in software development and maintenance environments. The system can either combine two programs or it can combine changes to a base program. The system consists of three stages: a syntax-based comparator, a synchronous printer and a merging editor. Based on the differences between the two programs identified by the syntax-based comparator, the synchronous printer combines the texts of two programs. Because there may be conflicts between the two programs, a merging editor provides the user with commands to resolve the conflicts. Another distinct feature of the merging system is the generator approach to producing syntactic program comparators for new programming languages.