本文整理汇总了Python中grammar.Grammar.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Grammar.__init__方法的具体用法?Python Grammar.__init__怎么用?Python Grammar.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grammar.Grammar
的用法示例。
在下文中一共展示了Grammar.__init__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from grammar import Grammar [as 别名]
# 或者: from grammar.Grammar import __init__ [as 别名]
def __init__(self, canvas, namespace = None):
Grammar.__init__(self, canvas, namespace)
self._autoclosepath = True
self._path = None
self._canvas.size = None
self._frame = 1
self._set_initial_defaults() ### TODO Look at these
示例2: __init__
# 需要导入模块: from grammar import Grammar [as 别名]
# 或者: from grammar.Grammar import __init__ [as 别名]
def __init__(self, canvas, namespace = None, vars = None):
'''
:param canvas: Canvas implementation for output.
:param namespace: Optionally specify a dict to inject as namespace
:param vars: Optional dict containing initial values for variables
'''
Grammar.__init__(self, canvas, namespace = namespace, vars = vars)
canvas.set_bot(self)
self._autoclosepath = True
self._path = None
if self._input_device:
# Get constants like KEY_DOWN, KEY_LEFT
for key_name, value in self._input_device.get_key_map().items():
setattr(self, key_name, value)
self._canvas.size = None
self._frame = 1
self._set_initial_defaults() ### TODO Look at these
示例3: __init__
# 需要导入模块: from grammar import Grammar [as 别名]
# 或者: from grammar.Grammar import __init__ [as 别名]
def __init__(self, V=None, T=None, S=None, P=None):
'''specific grammar for ll parser, comes with first and follow set'''
Grammar.__init__(self, V, T, S, P)
self.first = {}
self.follow = {}