The last lines of the song are "Remember what the Dormouse said. Feed your head. Feed your head." and do not explicitly quote the Dormouse as is often assumed. "Remembering what the Dormouse said" probably refers to "Alice's Adventures in Wonderland", Chapter XI 'Who Stole the Tarts', wherein a very nervous Mad Hatter is called to testify:
"'But what did the Dormouse say?' one of the jury asked."It is therefore better to say that the lyrics were inspired by the book, rather than referencing them directly.
"'That I can't remember', said the Hatter."