recategorized
3,868 views
2 votes
2 votes

Consider the following statements related to compiler construction:

  1. Lexical Analysis is specified by context-free grammars and implemented by pushdown automata.
  1. Syntax Analysis is specified by regular expressions and implemented by finite-state machine.

Which of the above statement(s) is/are correct?

  1. Only I
  2. Only II
  3. Both I and II
  4. Neither I nor II
recategorized

8 Answers

1 votes
1 votes
statement 1 is false because lexical analysis phase is specified by regular expression and implement by FA

statement 2 is false because syntax analysis is specified by context free grammar and implement by PDA

option D
0 votes
0 votes
answer:- (d)

lexical analysis is specified by regular expression and implemented on finite state automata.

syntax analysis is specified by context free grammar and implemented on push down automata.
0 votes
0 votes
answer:- (d)

both the statements are wrong.

reason:-

 lexical analysis uses reguler expression and it is based on finite state automata.

whereas

syntax analysis uses context free grammar and it is based on push down automata.
0 votes
0 votes
Option D) is correct , as Lexical analysis is implemented by Finite automata whereas Syntax analysis is implemented by Pushdown automata.
Answer:

Related questions

0 votes
0 votes
4 answers
3
go_editor asked Mar 24, 2020
992 views
Match the following :$\begin{array}{llll} & \textbf{List – I} & {} & \textbf{List – II} \\ \text{a.} & \text{Absurd} & \text{i.} & \text{Clearly impossible being con...