本文整理汇总了Python中simpleparse.dispatchprocessor.getString函数的典型用法代码示例。如果您正苦于以下问题:Python getString函数的具体用法?Python getString怎么用?Python getString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: define_stmt
def define_stmt(self, token, buffer):
tag, left, right, sublist = token
name_tup, value_tup = sublist
value_tag = value_tup[0]
name = getString(name_tup, buffer)
value = getString(value_tup, buffer)
if value_tag == 'regex':
value = self._regex(value_tup, buffer)
elif value_tag == 'varname':
if value not in self.context.lexicon:
_error(buffer, value_tup[1], 'no such variable')
value = self.context.lexicon[value]
else:
raise Exception('BUG: invalid token %s' % value_tag)
self.context.lexicon[name] = value
示例2: alphanums
def alphanums(self, tags, buffer):
"""
>>> input = "foo"
>>> proc = ProcessessExpression()
>>> proc(parse('alphanums', input), input)
'foo'
"""
return getString(tags, buffer)
示例3: grammar_stmt
def grammar_stmt(self, token, buffer):
tag, left, right, sublist = token
map = singleMap(sublist)
grammar = Grammar()
grammar.name = getString(map['varname'], buffer)
grammar.statements = self._suite(map['suite'], buffer)
if 'inherit' in map:
grammar.inherit = self._inherit(map['inherit'], buffer)
self.context.grammars[grammar.name] = grammar
示例4: _function
def _function(self, token, buffer):
tag, left, right, sublist = token
function = Function()
function.name = getString(sublist[0], buffer)
if len(sublist) == 1:
return function
for arg in sublist[1][3]:
expression = self._expression(arg, buffer)
function.args.append(expression)
return function
示例5: KEYWORD
# insttype: maps KEYWORD (i.e. type) (n) to entity inst nbr
self.res["contents"] = {}
self.res["insttype"] = {}
self.res["typeinst"] = defaultdict(list)
def ENTITY_INSTANCE_NAME(self, (tag, start, stop, subtags), buffer):
"""
Process C{ENTITY_INSTANCE_NAME} production.
"""
return dp.getString((tag, start, stop, subtags), buffer)[1:]
def KEYWORD(self, (tag, start, stop, subtags), buffer):
"""
Process C{KEYWORD} production.
"""
return dp.getString((tag, start, stop, subtags), buffer)
def parameter_list(self, (tag, start, stop, subtags), buffer):
"""
Process C{simple_content} production.
"""
return dp.getString((tag, start, stop, subtags), buffer)
def instance_list(self, (tag, start, stop, subtags), buffer):
"""
Process C{complex_content} production.
@return: a 2-tuple of (keywords, parameter lists), where keywords is
the list of KEYWORD occurrences and parameter lists is a list of
strings (each of which is an unparsed parameter list).
"""
示例6: jahr
def jahr(self, tup, buffer):
return str(getString(tup, buffer))
示例7: wochentag
def wochentag(self, tup, buffer):
return str(getString(tup, buffer))
示例8: gebaeude
def gebaeude(self, tup, buffer):
return str(getString(tup, buffer))
示例9: gruppe
def gruppe(self, tup, buffer):
return getString(tup, buffer)
示例10: total
def total(self, *a, **kw):
self.armorclass.value = int(disp.getString(*a, **kw))
示例11: verbKuerzel
def verbKuerzel(self, tup, buffer):
return getString(tup, buffer)
示例12: oe2
def oe2(self, tup, buffer):
return getString(tup, buffer)
示例13: alphanumGruppe
def alphanumGruppe(self, tup, buffer):
return getString(tup, buffer)
示例14: gruppe
def gruppe(self, tup, buffer):
return str(int(getString(tup, buffer)))
示例15: no
def no(self, tup, buffer):
return getString(tup, buffer)