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

Discussion

State whether the following is true or false.
Every property a programming language requires can be checked by its context free grammar.

  • A.False only at small scales
  • B.True
  • C.False
  • D.True only at large scales

Answer: C

Correct answer: False

A context free grammar can describe the shape of a program but not conditions that depend on what has been declared elsewhere: that a variable is declared before use, that the types of an assignment agree, that a function is called with the right number of arguments. All of these are checked by semantic analysis, using the symbol table.

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

Post your comment

Please log in or register to post a comment.