Home | History | Annotate | Download | only in pyxelator

Lines Matching refs:toks

74 # XX toks: use a tree of tokens: a list that can be push'ed and pop'ed XX
75 def pyxstr(self,toks=None,indent=0,**kw):
79 if toks is None:
80 toks = []
83 x.pyxstr(toks, indent, **kw)
85 toks.insert(0,str(x)+' ')
86 s = ''.join(toks)
102 def pyxstr(self,toks=None,indent=0,**kw):
103 if toks is None:
104 toks = []
107 toks.insert(0,str(x)+' ')
108 s = ''.join(toks)
113 def pyxstr(self,toks=None,indent=0,**kw):
127 def pyxstr(self,toks=None,indent=0,**kw):
128 if toks is None:
129 toks=[]
131 toks.append( self.name )
132 return " ".join(toks)
138 def pyxstr(self,toks=None,indent=0,cprefix="",**kw):
139 if toks is None:
140 toks = []
143 x.pyxstr(toks, indent, cprefix=cprefix, **kw)
148 toks.insert(0,s)
149 s = ''.join(toks)
155 def pyxstr(self,toks,indent=0,**kw):
156 #print '%s.pyxstr(%s)'%(self,toks)
164 toks.append( '(%s)'% ', '.join(_toks) )
166 self[i].pyxstr(toks, indent=indent, **kw)
168 return " ".join(toks)
173 def pyxstr(self,toks,indent=0,**kw):
176 toks.insert(0,'*')
178 toks.insert(0,'(')
179 toks.append(')')
181 toks.insert(0,'(')
182 toks.append(')')
183 return Node.pyxstr(self,toks,indent, **kw)
188 def pyxstr(self,toks,indent=0,**kw):
190 toks.append('[]')
194 toks.append('[%s]'%self.size)
196 toks.append('[]')
197 return Node( *self[:-1] ).pyxstr( toks,indent, **kw )
234 toks = [ descr+' '+tag ] # struct foo
236 toks.append(':\n')
238 toks.append( decl.pyxstr(indent=indent+1, cprefix=cprefix, shadow_name=shadow_name, **kw)+"\n" ) # shadow_name = False ?
245 toks = [ ' '+tag+' ' ] # foo
246 while toks:
247 _toks.insert( 0, toks.pop() )
281 toks = [ descr+' '+tag ] # enum foo
282 toks.append(':\n')
289 toks.append( ' '+' '*indent + ident.pyxstr(**kw)+"\n" )
294 toks.append( ' '+' '*indent + "pass\n" )
296 toks = [ ' '+tag+' ' ] # foo
297 while toks:
298 _toks.insert( 0, toks.pop() )
326 def _pyxstr( self, toks, indent, cprefix, use_cdef, shadow_name, **kw ):
344 #toks.append( ' '*indent + 'ctypedef ' + node.pyxstr(indent=indent, cprefix=cprefix, shadow_name=shadow_name, **kw).strip() )
346 toks.append( ' '*indent + 'cdef ' + node.pyxstr(indent=indent, cprefix=cprefix, shadow_name=shadow_name, **kw).strip() )
349 #toks.append( ' '*indent + 'ctypedef long ' + node.pyxstr(indent=indent, **kw).strip() + ' # XX ??' ) # XX ??
350 toks.append( ' '*indent + 'struct __unknown_builtin ' )
351 toks.append( ' '*indent + 'ctypedef __unknown_builtin ' + node.pyxstr(indent=indent, **kw).strip() )
360 def pyxstr(self,toks=None,indent=0,cprefix="",use_cdef=True,shadow_name=True,**kw):
363 toks=[]
367 self._pyxstr( toks, indent, cprefix, use_cdef, shadow_name, **kw )
381 toks.append( ' '*indent + comment + cdef + Node.pyxstr(self,indent=indent, cprefix=cprefix, **kw).strip() ) # + "(cprefix=%s)"%cprefix)
383 return ' \n'.join(toks)
400 def pyxstr(self,toks=None,indent=0,cprefix="",use_cdef=True,shadow_name=True,**kw): # shadow_name=True
404 toks=[]
410 ## (to be emitted in the node loop below, and suppressed in the final toks.append)
414 self._pyxstr( toks, indent, cprefix, use_cdef, shadow_name, **kw )
428 toks.append( ' '*indent + comment + 'ctypedef ' + Node.pyxstr(self,indent=indent, cprefix=cprefix, **kw).strip() )
429 return ' \n'.join(toks)
434 def pyxstr(self,toks=None,indent=0,**kw):
438 #return ' '*indent + Node.pyxstr(self,toks,indent, **kw).strip()
439 return Node.pyxstr(self,toks,indent, **kw).strip()
445 def pyxstr(self,toks,indent,**kw):
452 def pyxstr(self,toks=None,indent=0,**kw):
456 return ' '*indent + comment + Node.pyxstr(self,toks,indent, **kw).strip()
520 #s = '\n'.join(toks)