def __init__(self, start, productions):
"""
Create a new feature-based grammar, from the given start
state and set of ``Productions``.
:param start: The start symbol
:type start: FeatStructNonterminal
:param productions: The list of productions that defines the grammar
:type productions: list(Production)
"""
CFG.__init__(self, start, productions)
# The difference with CFG is that the productions are
# indexed on the TYPE feature of the nonterminals.
# This is calculated by the method _get_type_if_possible().
评论列表
文章目录