So I happened to watch 500 Days of Summer which was started by the narrator saying this is a story of boy meets girl. For a non-native speaker, I would rather say this is a story of boy meeting a girl as this is how the grammar becomes intuitive to me, but how does the former one can be grammatically correct too?
It is an idiomatic expression:
a typical romantic situation or story about two people falling in love.
- All the plots of this week’s new films are boy meets girl.
conventionally or trivially romantica boy-meets-girl story.
The expression boy meets girl originated in cinematographic plot summaries in which boy meets girl featured.
The earliest is from the column Behind the Scenes in Hollywood, by Harrison Carroll, published in The Shamokin Dispatch (Shamokin, Pennsylvania) of Tuesday 3rd March 1931:
- Harry Brand, who is a great time-saver, has invented a nine-word synopsis that will fit any film at any time. “Boy meets girl — tear ’em apart — together for finish.” How do they figure such things out?
This is related to the idea of what is known as a 'high concept' description of a plot. In this context 'high concept' does not mean 'philosophically lofty'. It is concerned with summarising a plot as simply as possible.
It is also important to note that you are referring to an instance of spoken English. This one gets considerably more complicated if you want to represent it in print.
To begin with, for the sake of your example, it might be helpful to have 'boy meets girl' in its own quotes.
Your example quotation is, 'This is a story of boy meets girl'. That makes seamless colloquial sense because 'boy meets girl' is such a well-known idiom in conventional English. The bit that actually makes the grammar challenging, however, is 'This is a story of...'.
The point would make more literal sense for non-native English speakers if it were rephrased as, 'The plot of 500 Days of Summer can be summarised as "boy meets girl".'
In normal usage, though, the original quotation is no more idiomatically odd than the pretty common (though also technically ungrammatical if unpunctuated) construction, 'It was a matter of kill or be killed.'
Advising writers in general, Glenda Baker provides a relatively recent example in Because It Works! (2008), p34.
Instinct still drives us all; and as long as it does, our stories will have the same basic plot lines. There are only four stories to tell: man against man, man against nature, man against himself, and man against society. The most basic of these and most often used, is:
Boy meets girl. Boy loses girl. Boy gets girl.
In your original quotation, therefore, the phrase 'Boy meets girl' works in effect as a noun phrase that is actually shorthand for the general shape of plot that Baker describes. She can use such terms with no explanation because the general idea is so well known in casual English.
With this in mind, then, and going back to the idea of 'high concept' summaries, one could also claim...
Die Hard is a story of 'determination beats bastards'.
Star Wars is a story of 'loyalty brings success'.
A Christmas Carol is a story of 'wealth makes you miserable'.
None of those would work grammatically without the quotation marks, but when spoken aloud they would all be easily comprehended (even if people might then argue with the intent). Generally, people would understand exactly what you mean and not require you to go back and punctuate laboriously.
There is a name for the process that they describe. It is called nominalizing—making a noun out of an expression. In speech it is accompanied, as they have pointed out, by a change of stress and juncture (gap, or lack of it, between words). It is not unique: whodunit, has-been. There are also the attributive modifiers would-be and wanna-be (and the latter is also noun). In writing the traditional punctuation is the hyphen, noting that the component words are closely joined into something new, a compound. I definitely would write "boy-meets-girl" to show that. (The failure to write hyphens when called for is something of a problem.) From the phrases of adverbial force "every day" and "on line" adjectives have been derived, "everyday" and "online" or "on-line", the difference in speech that the adjective is stressed on the first word, and the original phrase on the last word.