%type statement, combined with
%token ones, permits the declaration of a lexical type and
associates it with patterns that define how to match lexical tokens of
The grammar construction process exploits that information to automagically generate the definition of a lexical rule (aka a single analyzer) for each explicitly declared lexical type.
It is then easy to put predefined and auto-generated lexical rules together to build ad-hoc lexical analyzers.
This chapter details the auto-generation process, and how you can control it to produce the lexical rules needed to scan your language.