edited by
17,152 views

3 Answers

Best answer
62 votes
62 votes

Typically, the lexical analysis phase of compilation breaks the input text up into sequences of lexemes that each belongs to some particular token type that's useful in later analysis. Consequently, keywords are usually first recognized during lexical analysis in order to make parsing easier. Since parsers tend to be implemented by writing context-free grammars of tokens rather than of lexemes (that is, the category of the lexeme rather than the contents of the lexeme), it is significantly easier to build a parser when keywords are marked during lexing. Any identifier is also a token so it is recognized in lexical Analysis .
Hence, option C is True.
ref@ http://stackoverflow.com/questions/5202709/phases-of-a-compiler

edited by
3 votes
3 votes
In most modern languages, keywords (identifiers that have special meaning to the compiler)
are reserved (meaning user cannot redefine/remove/overload the predefined meaning).
Typically, the symbol table is preloaded with the keywords.

The lexical analyzer first
identifies keywords as identifiers and before inserting them into the symbol table, checks
against the preloaded keywords to correctly classify them as identifiers or keywords.

Therefore, option c is correct.
Answer:

Related questions

37 votes
37 votes
2 answers
1
14 votes
14 votes
2 answers
3
go_editor asked Sep 29, 2014
4,763 views
Choose the most appropriate word(s) from the options given below to complete the following sentence.I contemplated _________ Singapore for my vacation but decided against...
36 votes
36 votes
6 answers
4
go_editor asked Sep 29, 2014
10,713 views
A deterministic finite automaton ($\text{DFA}$) $D$ with alphabet $\Sigma = \{a, b\}$ is given below.Which of the following finite state machines is a valid minimal $\tex...