If you want to "evolve" source code you have to be able to manipulate it. This is most easily done with Abstract Syntax Trees. Tools that make ASTs easy to manipulate are called program transformation systems, and these can encode source-to-source transformation rules that can act as genetic mutations.
One such rule code for our DMS Software Reengineering Toolkit would look like:
swap_operators(x:product,y:term): sum-> sum
"\x + \y " -> "\x - \y" if somecondition();
This replaces "+" by "-", if it is applied. You'd ideally have a bunch of these "crossover" operators (switching operators, changing expresssion precedence, change variables mentioned, changing control structures, etc.) and "somecondition"s that control whether the crossover operator is applied as part of an evolution step.
You need other means to compile/run/evaluate the fitness of the evolved program.
To do something like this with DMS, you'd have DMS read (parse to AST) a baseline program ("initial generation"), apply a set of evolution transforms, emit code for the modified ASTs, compile and run them (DMS can invoke subprocesses like "compile" and execute), evaluate the result pick the top N of this generation, apply evolution operators again, repeat until nirvana or your electric bill overflows.