Lexical Analysis questions

Q11

GATE CS 2023 CSLexical AnalysisMCQ1 mark−1/3 if wrong
Consider the following statements regarding the front-end and back-end of a compiler.
S1: The front-end includes phases that are independent of the target hardware.
S2: The back-end includes phases that are specific to the target hardware.
S3: The back-end includes phases that are specific to the programming language used in the source code.

Identify the CORRECT option.
Show answer without attempting

Answer: B

Q19

GATE CS 2023 CSLexical AnalysisMCQ1 mark−1/3 if wrong
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)
Show answer without attempting

Answer: C

0/20 correct0 marks

Related topics in Compiler Design