Machine-translated by Google. Questions are authored in English.
Top

Discussion

The activity of scanning is another name for

  • A.semantic analysis performed on the constructed tree
  • B.the linking of separately compiled object modules
  • C.lexical analysis
  • D.syntax analysis performed on the stream of tokens

Answer: C

Correct answer: lexical analysis

Scanning and lexical analysis are the same activity under two names, which is why the component is called either a scanner or a lexer. It reads the character stream and produces tokens.

The names reflect the mechanism: it scans the input left to right, matching the longest lexeme against each token's pattern. Parsing is the term for syntax analysis, and semantic analysis and linking are quite separate stages later in the chain.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.