"从语法上讲" can be translated into English as "grammatically speaking" or "from a grammatical perspective".
Both expressions are commonly used to introduce a statement or analysis based on grammatical rules or principles. For example:
Grammatically speaking, this sentence is incorrect. (从语法上讲,这个句子是错误的。)
From a grammatical perspective, the structure of this clause is quite complex. (从语法上讲,这个从句的结构相当复杂。)