Home » Compiler Design » Compiler design miscellaneous » Question

Compiler design miscellaneous

  1. The lexical analysis for a modern computer language such as Java needs the power of which one of the following machine models in a necessary and sufficient sense?
    1. Finite state automata
    2. Deterministic push down automata
    3. Non-deterministic push down automata
    4. Turing machine
Correct Option: A

Lexical analysis is the first step in compilation. In lexical analysis, program is divided into tokens. Lexical analyzers are typically based on finite state automata. Tokens can typically be expressed as different regular expressions: An identifier is given by [a-zA-Z][a-zA-Z0-9]*
The keyword if is given by if. Integers are given by [+-]?[0-9]+.



Your comments will be displayed only after manual approval.