What is the structure of 我吃饭的时候看了一本书?
I'm not sure if you are familiar with 的时候 but this translates approximately to 'while'.

So the sentence reads:

While I was eating I read a book.

You can see the English use "I" twice, so it may make more sense to you if you read it like this: 

我吃饭的时候(我)看了一本书