(a) What is a token in the context of lexical analysis and what infor…

Previous year question for Compiler Design.

Question

(a) What is a token in the context of lexical analysis and what information does it typically contain? Explain the difference between a lexeme and a token. Provide an example.

(b) Why are finite automata (Deterministic Finite Automata- DFA or Non-deterministic Finite Automata- NFA) often used as the mathematical model for lexical analysis?

Related pages

Open on CachedInfo