Lines Matching refs:self
21 def __init__(self, line='<line not provided>', reader=None): argument
23 BaseException.__init__(self,
27 BaseException.__init__(self, 'Error parsing line: %s' % line)
37 def __init__(self, proto='', desc='', ret=''): argument
38 self.proto = proto
39 self.desc = desc
40 self.ret = ret
50 def proto_break_down(self): argument
59 capture = proto_re.match(self.proto)
85 def __init__(self, filename): argument
86 self.reader = open(filename, 'r')
87 self.line = ''
88 self.helpers = []
89 self.commands = []
91 def parse_element(self): argument
92 proto = self.parse_symbol()
93 desc = self.parse_desc()
94 ret = self.parse_ret()
97 def parse_helper(self): argument
98 proto = self.parse_proto()
99 desc = self.parse_desc()
100 ret = self.parse_ret()
103 def parse_symbol(self): argument
105 capture = p.match(self.line)
109 end = end_re.match(self.line)
112 self.line = self.reader.readline()
115 def parse_proto(self): argument
124 capture = p.match(self.line)
127 self.line = self.reader.readline()
130 def parse_desc(self): argument
132 capture = p.match(self.line)
141 self.line = self.reader.readline()
142 if self.line == ' *\n':
146 capture = p.match(self.line)
153 def parse_ret(self): argument
155 capture = p.match(self.line)
164 self.line = self.reader.readline()
165 if self.line == ' *\n':
169 capture = p.match(self.line)
176 def seek_to(self, target, help_message): argument
177 self.reader.seek(0)
178 offset = self.reader.read().find(target)
181 self.reader.seek(offset)
182 self.reader.readline()
183 self.reader.readline()
184 self.line = self.reader.readline()
186 def parse_syscall(self): argument
187 self.seek_to('* DOC: eBPF Syscall Commands',
191 command = self.parse_element()
192 self.commands.append(command)
196 def parse_helpers(self): argument
197 self.seek_to('* Start of BPF helper function descriptions:',
201 helper = self.parse_helper()
202 self.helpers.append(helper)
206 def run(self): argument
207 self.parse_syscall()
208 self.parse_helpers()
209 self.reader.close()
219 def __init__(self, parser): argument
220 self.parser = parser
221 self.elements = []
223 def print_header(self): argument
226 def print_footer(self): argument
229 def print_one(self, helper): argument
232 def print_all(self): argument
233 self.print_header()
234 for elem in self.elements:
235 self.print_one(elem)
236 self.print_footer()
246 def __init__(self, parser): argument
247 self.parser = parser
249 def print_license(self): argument
283 def print_elem(self, elem): argument
306 def __init__(self, parser): argument
307 self.elements = parser.helpers
309 def print_header(self): argument
351 PrinterRST.print_license(self)
354 def print_footer(self): argument
440 def print_proto(self, helper): argument
466 def print_one(self, helper): argument
467 self.print_proto(helper)
468 self.print_elem(helper)
479 def __init__(self, parser): argument
480 self.elements = parser.commands
482 def print_header(self): argument
496 PrinterRST.print_license(self)
499 def print_one(self, command): argument
501 self.print_elem(command)
510 def __init__(self, parser): argument
511 self.elements = parser.helpers
624 def print_header(self): argument
631 for fwd in self.type_fwds:
635 def print_footer(self): argument
639 def map_type(self, t): argument
640 if t in self.known_types:
642 if t in self.mapped_types:
643 return self.mapped_types[t]
650 def print_one(self, helper): argument
653 if proto['name'] in self.seen_helpers:
655 self.seen_helpers.add(proto['name'])
673 print('static %s %s(*%s)(' % (self.map_type(proto['ret_type']),
679 if proto['name'] in self.overloaded_helpers and i == 0:
682 one_arg = '{}{}'.format(comma, self.map_type(t))
692 print(') = (void *) %d;' % len(self.seen_helpers))