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

Discussion

A context free grammar consists of

  • A.a table of tokens and the attribute values that accompany them
  • B.terminals, nonterminals, a start symbol and a set of productions
  • C.a set of regular expressions together with their semantic actions
  • D.a finite automaton and the alphabet over which it operates

Answer: B

Correct answer: terminals, nonterminals, a start symbol and a set of productions

These four are the whole definition. The terminals are the tokens the scanner supplies, the nonterminals name the syntactic categories, the productions say how each nonterminal may be expanded, and the start symbol names the category a whole program belongs to. Nothing else is needed to define the language.

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

Post your comment

Please log in or register to post a comment.