本文整理汇总了Python中simpleparse.dispatchprocessor.getString函数的典型用法代码示例。如果您正苦于以下问题:Python getString函数的具体用法?Python getString怎么用?Python getString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
开发者ID:knipknap,项目名称:Gelatin,代码行数:15,代码来源:SyntaxCompiler.py
示例2: alphanums
def alphanums(self, tags, buffer):
"""
>>> input = "foo"
>>> proc = ProcessessExpression()
>>> proc(parse('alphanums', input), input)
'foo'
"""
return getString(tags, buffer)
开发者ID:dummy3k,项目名称:logviewer,代码行数:8,代码来源:filter.py
示例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
开发者ID:knipknap,项目名称:Gelatin,代码行数:9,代码来源:SyntaxCompiler.py
示例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
开发者ID:knipknap,项目名称:Gelatin,代码行数:10,代码来源:SyntaxCompiler.py
示例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).
"""
开发者ID:smewp,项目名称:openPLM,代码行数:31,代码来源:part21_preparse.py
示例6: jahr
def jahr(self, tup, buffer):
return str(getString(tup, buffer))
开发者ID:Hexren,项目名称:haw2iCalendar,代码行数:2,代码来源:hawDispatchProcessor.py
示例7: wochentag
def wochentag(self, tup, buffer):
return str(getString(tup, buffer))
开发者ID:Hexren,项目名称:haw2iCalendar,代码行数:2,代码来源:hawDispatchProcessor.py
示例8: gebaeude
def gebaeude(self, tup, buffer):
return str(getString(tup, buffer))
开发者ID:Hexren,项目名称:haw2iCalendar,代码行数:2,代码来源:hawDispatchProcessor.py
示例9: gruppe
def gruppe(self, tup, buffer):
return getString(tup, buffer)
开发者ID:Hexren,项目名称:haw2iCalendar,代码行数:2,代码来源:hawDispatchProcessor.py
示例10: total
def total(self, *a, **kw):
self.armorclass.value = int(disp.getString(*a, **kw))
开发者ID:corydodt,项目名称:Playtools,代码行数:2,代码来源:armorclassparser.py
示例11: verbKuerzel
def verbKuerzel(self, tup, buffer):
return getString(tup, buffer)
开发者ID:Hexren,项目名称:haw2iCalendar,代码行数:2,代码来源:veranstaltungenDispatchProcessor.py
示例12: oe2
def oe2(self, tup, buffer):
return getString(tup, buffer)
开发者ID:Hexren,项目名称:haw2iCalendar,代码行数:2,代码来源:veranstaltungenDispatchProcessor.py
示例13: alphanumGruppe
def alphanumGruppe(self, tup, buffer):
return getString(tup, buffer)
开发者ID:Hexren,项目名称:haw2iCalendar,代码行数:2,代码来源:veranstaltungenDispatchProcessor.py
示例14: gruppe
def gruppe(self, tup, buffer):
return str(int(getString(tup, buffer)))
开发者ID:Hexren,项目名称:haw2iCalendar,代码行数:2,代码来源:veranstaltungenDispatchProcessor.py
示例15: no
def no(self, tup, buffer):
return getString(tup, buffer)
开发者ID:Hexren,项目名称:haw2iCalendar,代码行数:2,代码来源:veranstaltungenDispatchProcessor.py
示例16: Processor
class Processor(disp.DispatchProcessor):
def armorclassStat(self, (t,s1,s2,sub), buffer):
self.armorclass = ArmorClass()
disp.dispatchList(self, sub, buffer)
return self.armorclass
def splat(self, *a, **kw):
if self.armorclass.qualifier is None:
self.armorclass.qualifier = ''
self.armorclass.qualifier += '*'
def qualifier(self, (t,s1,s2,sub), buffer):
if self.armorclass.qualifier is None:
self.armorclass.qualifier = ''
self.armorclass.qualifier += disp.getString((t,s1+1, s2-1, sub),
buffer)
def total(self, *a, **kw):
self.armorclass.value = int(disp.getString(*a, **kw))
def size(self, (t,s1,s2,sub), buffer):
self.armorclass.size = disp.dispatchList(self, sub, buffer)[0]
def dex(self, (t,s1,s2,sub), buffer):
self.armorclass.dexBonus = disp.dispatchList(self, sub, buffer)[0]
def flatFooted(self, (t,s1,s2,sub), buffer):
s = disp.getString((t,s1,s2,sub), buffer)
self.armorclass.flatFooted = int(s.split()[-1])
def touch(self, (t,s1,s2,sub), buffer):
开发者ID:corydodt,项目名称:Playtools,代码行数:31,代码来源:armorclassparser.py
示例17: amount
def amount(self, *a, **kw):
return int(disp.getString(*a, **kw))
开发者ID:corydodt,项目名称:Playtools,代码行数:2,代码来源:armorclassparser.py
示例18: Processor
class Processor(disp.DispatchProcessor):
def alignmentStat(self, (t,s1,s2,sub), buffer):
self.alignments = []
self.qualifiers = None
self.currentAtom = None
disp.dispatchList(self, sub, buffer)
return [x.simplify() for x in self.alignments]
def oneAlignment(self, (t,s1,s2,sub), buffer):
self.qualifiers = []
disp.dispatchList(self, sub, buffer)
def atom(self, (t,s1,s2,sub), buffer):
atom = disp.getString((t,s1,s2,sub),buffer).lower().strip()
self.currentAtom = atomMap[ atom ]
def any(self, (t,s1,s2,sub), buffer):
if self.qualifiers is None:
self.qualifiers = []
disp.dispatchList(self, sub, buffer)
array = atomCross[self.currentAtom]
for id in array:
self.gotCompleteAlignment(id)
def gotCompleteAlignment(self, id):
"""
We have identified a complete alignment. add it to self.alignments
"""
part = AlignmentPart(id)
开发者ID:corydodt,项目名称:Playtools,代码行数:29,代码来源:alignmentparser.py
示例19: fach
def fach(self, tup, buffer):
subTree = multiMap(tup[-1], buffer=buffer)
gruppenKuerzel = dispatchList(self, subTree['gruppe'], buffer)[0]
fach = str(getString(tup, buffer))
return gruppenKuerzel, fach
开发者ID:Hexren,项目名称:haw2iCalendar,代码行数:5,代码来源:hawDispatchProcessor.py
示例20: string
"""PRODUCTION FUNCTIONS:
for parsing, must provide a function for each production name.
"""
def string(self, (tag,start,stop,subtags), buffer ):
"""Return a string, stripping leading and trailing markers"""
return buffer[start+1:stop-1]
def number(self, (tag,start,stop,subtags), buffer ):
"""return a number as a string"""
return buffer[start:stop]
def entry_type( self, (tag,start,stop,subtags), buffer ):
"""Return the entry type"""
return getString((tag,start,stop,subtags), buffer)
def citekey( self, (tag,start,stop,subtags), buffer ):
"""Return the entry's citekey"""
return getString((tag,start,stop,subtags), buffer)
# macro name
def name(self, (tag,start,stop,subtags), buffer ):
"""Return lookup on name or name if not in map."""
return self._macroMap.get(buffer[start:stop],buffer[start:stop])
def field(self, (tag,start,stop,subtags), buffer ):
"""Process a bibentry field and return tuple of name, value."""
str = ''
for t in subtags[1][3]:
if(t) :
开发者ID:dill,项目名称:bibstuff,代码行数:30,代码来源:bibfile.py
注:本文中的simpleparse.dispatchprocessor.getString函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论