Lines Matching refs:self

99   def __init__(self, lineno, message):  argument
100 self.lineno = lineno
101 self.message = message
103 def __str__(self): argument
104 return "On line %d: %s" % (self.lineno, self.message)
107 def __init__(self, name, structname, jclassname, package, javatype, ctype, jtype, defval): argument
108 self.name = name
109 self.structname = structname
110 self.jclassname = jclassname
111 self.package = package
112 self.javatype = javatype
113 self.ctype = ctype
114 self.jtype = jtype
115 self.defval = defval
117 def cString(self): argument
118 return " %s %s;" % (self.ctype, self.name)
120 def javaGetter(self): argument
124 " }" % (self.javatype, ToJavaName(self.name, 0), ToJavaName(self.name, 0))
126 def javaSetter(self): argument
130 " }" % (ToJavaName(self.name, 0), self.javatype, ToJavaName(self.name, 0))
132 def javaNativeGetter(self): argument
134 % (self.javatype, ToJavaName(self.name, 0))
136 def javaNativeSetter(self): argument
138 % (ToJavaName(self.name, 0), self.javatype)
140 def jniGetterDefString(self): argument
143 % (self.jtype, ToJNIPackage(self.package, self.jclassname), ToJavaName(self.name, 0))
145 def jniGetterImplString(self): argument
150 "}\n" % (self.jtype, ToJNIPackage(self.package, self.jclassname), ToJavaName(self.name, 0),\
151 self.structname, self.structname, self.name, self.defval)
153 def jniSetterDefString(self): argument
156 % (ToJNIPackage(self.package, self.jclassname), ToJavaName(self.name, 0), self.jtype)
158 def jniSetterImplString(self): argument
167 "}\n" % (ToJNIPackage(self.package, self.jclassname), ToJavaName(self.name, 0),\
168 self.jtype, self.structname, self.structname, self.name)
171 def __init__(self, name, structname, jclassname, package): argument
172 …FieldType_BasePOD.__init__(self, name, structname, jclassname, package, "float", "float", "jfloat"…
175 def __init__(self, name, structname, jclassname, package): argument
176 … FieldType_BasePOD.__init__(self, name, structname, jclassname, package, "int", "int", "jint", "0")
179 def __init__(self, name, structname, jclassname, package): argument
180 …FieldType_BasePOD.__init__(self, name, structname, jclassname, package, "long", "long long", "jlon…
184 def parseTextFile(self, filepath): argument
186 self.name = None
187 self.package = None
188 self.fields = []
189 self.structname = None
190 self.jclassname = None
191 self.libname = None
207 self.commandArgAssert(linecomps, 1, lineno)
208 self.name = linecomps[1]
209 if not self.structname:
210 self.structname = self.name
211 if not self.jclassname:
212 self.jclassname = self.name
214 self.commandArgAssert(linecomps, 1, lineno)
215 self.package = linecomps[1]
217 self.commandArgAssert(linecomps, 1, lineno)
218 self.libname = linecomps[1]
220 self.commandArgAssert(linecomps, 1, lineno)
221 self.structname = linecomps[1]
223 self.commandArgAssert(linecomps, 1, lineno)
224 self.jclassname = linecomps[1]
226 self.commandArgAssert(linecomps, 2, lineno)
229 fieldtype = FieldType_Int(linecomps[2], self.structname, self.jclassname, self.package)
231 fieldtype = FieldType_Long(linecomps[2], self.structname, self.jclassname, self.package)
233 fieldtype = FieldType_Float(linecomps[2], self.structname, self.jclassname, self.package)
236 self.fields.append(fieldtype)
243 if not self.name:
245 elif not self.package:
247 elif not self.libname:
251 if self.libname[:3] == "lib":
252 self.libname = self.libname[3:]
254 def commandArgAssert(self, linecomps, expectedcount, lineno): argument
264 def cStructString(self): argument
265 cfields = [f.cString() for f in self.fields]
266 return "typedef struct Struct%s {\n%s\n} %s;\n" % (self.structname,\
268 self.structname)
270 def javaClassString(self): argument
271 jgetters = [f.javaGetter() for f in self.fields]
272 jsetters = [f.javaSetter() for f in self.fields]
273 jnativesetters = [f.javaNativeSetter() for f in self.fields]
274 jnativegetters = [f.javaNativeGetter() for f in self.fields]
294 "};\n" % (self.jclassname,\
295 self.jclassname,\
296 self.jclassname,\
301 self.libname)
303 def jniDeclString(self): argument
304 jnigetters = [f.jniGetterDefString() for f in self.fields]
305 jnisetters = [f.jniSetterDefString() for f in self.fields]
308 def jniImplString(self): argument
309 jnigetters = [f.jniGetterImplString() for f in self.fields]
310 jnisetters = [f.jniSetterImplString() for f in self.fields]
313 def hFileString(self): argument
314 defname = ToMacroDefName(self.structname, self.package)
315 return hFileTemplate % (defname, defname, self.cStructString(), defname)
317 def javaFileString(self): argument
318 return javaFileTemplate % (self.package, self.javaClassString())
320 def jniFileString(self): argument
321 return jniFileTemplate % (self.structname.lower(),\
322 self.structname,\
323 self.structname,\
324 self.structname,\
325 self.structname,\
326 ToJNIPackage(self.package, self.jclassname),\
327 self.jniDeclString(),\
328 ToJNIPackage(self.package, self.jclassname),\
329 self.structname,
330 self.jniImplString())