Formal Syntax
There is a great deal of mathematical theory concerning the syntax of languages.
P=anini produced a context-free grammar for Sanskrit around 400-600 BCE. Modern grammatical theory is based on the work of Chomsky.
Formal syntax is better at describing artificial languages such as programming languages than natural languages.