It did not exactly went away.
It is still possible to embed semantics inside an Antlr4 grammar.
For example see the Antlr4 EcmaScript grammar sample: https://github.com/antlr/grammars-v4/tree/master/ecmascript which uses embedded code to solve the RegExp vs division operator ambiguity.
Another scenario when embedding code could be preferred is optimizing for maximum performance as abstractions normally come at a performance overhead.
I do agree that the default approach should be to separate the semantics unless there is a very good reason why not to...
I stand corrected. I rewrote my grammar with ANTLR4 and gutted all the embedded semantics. That was a good day.
I'm going to hit reply now and then I'm going to take out my personal neuralyzer and forget that I ever found out that you can still embed.
Actually, the need for that went away with ANTLR4. The grammar is now all grammar (and lexer) and the semantic actions are listeners or walkers written separately calling or overriding methods and classes generated from the grammar.
Much cleaner that way.