Used_in The definition of C++ [ c++.syntax.html ]. Used_in The definition of Java [ java.syntax.html ] Notation This uses my XBNF Extended BNF Notation where | indicates or, (...) indicates priority. For more information see [ intro_ebnf.html ].
To look at it in another way: Thymine(uracil in RNA) and cytosine are pyrimidines. Pyrimidines are single-ringed organic base that will only attach to purines, or adenine and guanine by hydrogen bond. Because cytosine and thymine are both pyrimidines, it cannot form a hydrogen bond with each other.
1 Cytosine is found in both DNA and RNA, but thymine is only found in DNA and uracil is only found in RNA.  A nucleotide is formed when a phosphate attahes to the 5' carbon of the sugar and one of the nitrogenous baseses attaches to the 1' carbon of the sugar.