1. Lexer and grammar
Core C++ has an LL(1) grammar over tokens. Three lexical and syntactic conventions remove the ambiguities of C++.
Type identifiers start with an uppercase letter and variable identifiers with a lowercase letter or _. The lexer classifies an identifier by its initial, and the parser uses the class to tell whether < opens a template argument or compares. Template instantiation occurs only in type position. Methods are defined inside the class.
The lexer is a hand written finite automaton with the longest match rule, and the parser is recursive descent.