closed by
926 views
1 votes
1 votes
closed as a duplicate of: Question on lexical analyzer

what lexical analysis phase use. regular expression , regular grammar , ??

closed by

1 Answer

2 votes
2 votes

lexical analyzer can identify tokens with the help of regular expressions and pattern rules. But a lexical analyzer cannot check the syntax of a given sentence due to the limitations of the regular expressions. Regular expressions cannot check balancing tokens, such as parenthesis. Therefore,Syntax Analysis phase uses context-free grammar (CFG), which is recognized by push-down Automata.

Answer : D

Related questions

6 votes
6 votes
7 answers
2
Na462 asked Oct 5, 2018
3,409 views
1 votes
1 votes
3 answers
3
shikharV asked Nov 19, 2015
2,392 views
Given answer: DPlease explain
0 votes
0 votes
1 answer
4
shikharV asked Nov 19, 2015
542 views
Given answer: CBut I believe that syntax analyzer is just for checking the form of the source code. The meaning of the program is interpreted in semantic analyzer phase o...