Lexical Tokens, Buffer Pairs & Finite Automata Scanning
“Lexical analyzers strip whitespace and comments, group characters into tokens, and communicate with the symbol table using (token_name, attribute_pointer).”
- —Tokens per string literal = 1 (enclosed contents are treated as a single token attribute).
- —Operators like '++' or '>=' are single multi-character tokens, not pairs of individual symbols.
- —Buffer size 2N with sentinels reduces loop branches by half.
- —Do not count header files `#include <stdio.h>` as compiler tokens if the preprocessor runs before the lexer.
- —Lexer cannot detect undeclared variables or syntax errors.