Skip to content
Official PYQ · 2023

GATE CS 2023 Q9 — Regular Expressions and Finite Automata

Explain with AI

Consider the following definition of a lexical token id\textbf{id} for an identifier in a programming language, using extended regular expressions:
 letter →[A−Za−z] digit →[0−9] id → letter ( letter ∣ digit )∗\begin{array}{ll} \textbf{ letter } & \rightarrow[\mathrm{A}-\mathrm{Za}-\mathrm{z}] \\ \textbf{ digit } & \rightarrow[0-9] \\ \textbf{ id } & \rightarrow \textbf{ letter }(\textbf{ letter } \mid \textbf{ digit })^{*} \end{array}
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)

Choose one option
View answer

Answer: C

Worked explanation not available yet.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Regular Expressions and Finite Automata questions