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

Discussion

The task of the syntax analyser is to

  • A.decide whether the token stream fits the rules the language lays down
  • B.group the characters of the source program into individual lexemes
  • C.check that the operands of each operator have compatible types
  • D.emit target machine instructions for each statement of the program

Answer: A

Correct answer: decide whether the token stream fits the rules the language lays down

The parser takes the token stream from the scanner and determines whether it forms a sentence of the language, building a parse tree or its equivalent as it goes. Grouping characters into lexemes is the scanner’s job, type compatibility belongs to semantic analysis, and instruction selection to the back end.

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

Post your comment

Please log in or register to post a comment.