It was coined by Lewis Carroll in his poem "Jabberwocky" from Through the Looking-Glass. While Carroll invented the word, he gives it the context of an adjective (describing the wood), so in the context of the poem, you could consider it an adjective.
However, because it's a fictional word, it doesn't have a fixed grammatical category outside the specific context of the poem.
