Lexical Analysis

Your answer
Answer & solution
Answer: C: III (no official key was published)
The characters begin may be followed by another identifier character, producing an identifier such as beginning rather than the keyword begin. The same issue applies to program. The lexer therefore needs to determine the word boundary before deciding those tokens. Pascal’s <> is a complete relational operator with no longer operator having it as a prefix, so it can be recognized immediately after the second character. This is the longest-token principle, not a claim that keywords cannot ever be recognized.