Can chemical energy from food be stored in a battery? Suppose you built a machine that digested food in a similar way as humans do. Would it be possible, in principle, to extract the chemical energy from the digested food, turn it into electricity, and store it in a battery that powers the machine itself? Doesn't matter if it's practical or efficient, I just need to know if it's not something totally impossible. (I asked the same question on Electrical Engineering SE and someone suggested this SE would be more appropriate.)
Three ways to turn chemically stored energy into electricity:

a fuel cell: While that works fine for hydrogen or methanol, I'm not sure if sugars are possible, and general &quot;food&quot; won't work. Of course you can chemically convert food into hydrogen or alcohol, or into sth. very specially designed to power a biofuel cell.
dry, burn, run a turbine or steam engine with attached generator, very obvious and simple.
direct conversion into mechanical energy via an artificial muscle, which powers a generator. Horribly complicated (bio-)chemistry, theoretically possible, because our body does it, too.