The syntax is the grammar, the text structure and the order of the words of a sentence. Syntactic rules include punctuation, capitalization, spelling at the beginning of the sentence and the sign at the end of the sentence, etc. Applied to programming languages, syntax includes the commands, characters, and the character sequences for program formulations.
The syntax applies equally to natural languages and programming languages. Some programming languages are extremely inflexible in syntactic interpretation, while in others the order of commands is flexible.