Programming language syntax and semantics are defined as follows:
Syntax,
which characterizes the structure of well-formed programs in that language and is a well-known subject.
Semantics,
which characterizes the effect of programs and the values they produce and the study of it remains a more challenging venture.
The following topics are related to programming language syntax:
Lexical analysis,
which is the process of converting a sequence of characters in a program into a sequence of tokens.
Context-free grammars,
in which every production rule is such that the left-hand side is exactly one nonterminal symbol and the right-hand side is zero or more terminal symbols and/or nonterminal symbols.
Abstract grammars,
which describe languages using abstract syntax.
Abstract syntax gives the component of each language construct, leaving out the representation details.
Syntax analysis,
which is the process of analyzing a sequence of tokens to determine grammatical structure with respect to a given grammar.
The following references will be used for this topic:
Compilers: Principles, Techniques, and Tools,
Alfred V. Aho, Monica S. Lam, Ravi Sethi, and Jeffrey D. Ullman, 2006
Formal Specification of Programming Languages: A Panoramic Primer,
Frank G. Pagan, 1981
Introduction to Automata Theory, Languages, and Computation,
John E. Hopcroft, Rajeev Motwani, and Jeffrey D. Ullman, 2006