"All afternoon" in the sentence "Our cat has lain on the sofa all afternoon" is functioning as an adverbial phrase, specifically indicating the duration or extent of time during which the cat has been lying on the sofa.
In this sentence, the phrase "all afternoon" serves as an adverbial phrase modifying the verb "has lain." It provides additional information about the duration of the cat's action. Adverbial phrases often answer questions such as "when," "where," or "how long." In this case, "all afternoon" answers the question "how long?" and gives us more context about the time frame in which the cat has been on the sofa.
Understanding the function of different parts of a sentence is crucial for effective communication. Adverbial phrases, like "all afternoon," enhance the clarity and precision of our expressions. They offer details about the circumstances or conditions surrounding an action. This particular phrase, "all afternoon," gives a temporal dimension to the cat's lounging on the sofa, conveying that it has been happening for the entire afternoon. The mastery of such grammatical nuances contributes to the precision and richness of our written and spoken language.