COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Syntax analyzer
|
|
Lexical analyzer
|
|
code generation
|
|
semantic Analyzer
|
Detailed explanation-1: -The groups are token together into semantic structures is the Lexical analyzer.
Detailed explanation-2: -The SA groups the tokens together into syntactic structure called as expression. Expression may further be combined to form statements. The syntactic structure can be regarded as a tree whose leaves are the token called as parse trees.
Detailed explanation-3: -Explanation: Scanner is used for grouping characters into tokens.
Detailed explanation-4: -In programming language, keywords, constants, identifiers, strings, numbers, operators and punctuations symbols can be considered as tokens.
Detailed explanation-5: -Token: A token is a group of characters having collective meaning: typically a word or punctuation mark, separated by a lexical analyzer and passed to a parser. A lexeme is an actual character sequence forming a specific instance of a token, such as num.