MCQ · 1 mark · Lexical Analysis

GATE CS 2023 CS — Q19

Consider the following definition of a lexical token id for an identifier in a programming language, using extended regular expressions:
<br>letter→[A-Za-z]<br>digit→[0-9]<br>id→letter (letter ∣ digit)∗<br>\begin{align*}<br>\text{letter} & \to \text{[A-Za-z]} \\<br>\text{digit} & \to \text{[0-9]} \\<br>\text{id} & \to \text{letter (letter } | \text{ digit)}^*<br>\end{align*}

Which one of the following Non-deterministic Finite-state Automata with ϵ\epsilon-transitions accepts the set of valid identifiers? (A double-circle denotes a final state)
Select one option