Serializes the program.
@override Map<String, dynamic> serialize() { return {"root": root, "leaf": leaf, "index": index}; }