Transform concrete grammar into abstract algebra

That's a simplification I lifted from our actual AST.