"从语法上讲" can be translated into English as "grammatically speaking" or "from a grammatical perspective".
Both expressions are commonly used to introduce a statement or analysis that focuses on the grammatical aspects of a language or sentence. For example:
Grammatically speaking, this sentence is correct.
From a grammatical perspective, the structure of this clause is a bit complex.