You can't allocate memory at the individual query level.
You are correct that there is no classifier for a t-sql DEFINITION of an adhoc query, but I COULD govern a specific query if it has properties that can be defined by a classifier function, such as a LOGIN_PROPERTY, SUSER_NAME, etc, and it was the ONLY query that ever used this classifier property. Then you could allocate memory for a specific query because the classifier property is used only by that query. Splitting hairs, I know, but still true. So you would create a specific login that was only used to run that one query.
Cannot is too broad. There are often many ways to do things which "cannot" be done.
"Those who say it cannot be done shouldn't interrupt the people doing it" --
Ancient Chinese Proverb... supposedly
Microsoft Certified ...(insert many literal strings here)
Microsoft Design Architect with Alexander Open Systems