Redirected
recategorized
3,858 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

Best answer
2 votes
2 votes
both statement are wrong becoz lexical analyser uses finite autometa so it uses regular grammer ,whose expression will be for example letter(letter + digit )*  , where as syntax tree uses context free grammer which uses pda
selected by
4 votes
4 votes

option D is ryt bcoz

1) Lexical Analysis is specified by regular expressions and implemented by finite-automata.

http://user.it.uu.se/~kostis/Teaching/KT1-11/Slides/handout03.pdf

for more info go above link

2) Syntax Analysis is specified by context-free grammars and implemented by pushdown automata.

https://www.tutorialspoint.com/compiler_design/compiler_design_syntax_analysis.htm

go for it.

2 votes
2 votes

And undoubtedly answer is option d) Mam. :).. Opposite takes place. Lexical Analysis is implemented by Regular Expressions and implemented by Finite State Machine. 

Syntax Analysis is specified by Context Free Grammar and implemented by Push Down Automata. 

Refer d link below for more information Mam. :)

https://www.tutorialspoint.com/compiler_design/compiler_design_quick_guide.htm

Mam read full length explanation and I hope the descp which is perfeclty given helps you. :)

1 votes
1 votes

Both statement are wrong because lexical analyser uses finite automata so it uses regular grammer.

Syntax Analysis is specified by context-free grammars and implemented by pushdown automata.

Option is D

Answer:

Related questions

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