CFG.__init__(start, productions, calculate_leftcorners=True)[source]

Create a new context-free grammar, from the given start state and set of ``Production``s.

  • start (Nonterminal) – The start symbol
  • productions (list(Production)) – The list of productions that defines the grammar
  • calculate_leftcorners (bool) – False if we don’t want to calculate the leftcorner relation. In that case, some optimized chart parsers won’t work.