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

Discussion

Checking that a function is called with the right number of arguments is

  • A.a syntactic check performed by the parser during reduction
  • B.a lexical check performed by the scanner as it reads the call
  • C.something the linker settles once it joins the modules together
  • D.a semantic check, since the count depends on the declaration

Answer: D

The grammar can describe an argument list of any length but cannot tie its length to a declaration elsewhere. Semantic analysis consults the symbol table to make the comparison. The same applies to argument types, which the grammar likewise cannot constrain.

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

Post your comment

Please log in or register to post a comment.