Lines Matching refs:self
38 def __init__(self, filepath):
39 self.__filepath = filepath
40 self.__header = [LICENSE, ""]
41 self.__data = []
43 def complete_header(self, completion):
44 self.__header.append(completion)
45 self.__header.append("") # for an extra empty line
47 def add_table(self, table, table_name, table_type, table_descr):
48 self.__data.append(table_descr)
49 self.__data.append("static const %s lit_%s[] JERRY_ATTR_CONST_DATA =" % (table_type, table_name))
50 self.__data.append("{")
51 self.__data.append(format_code(table, 1))
52 self.__data.append("};")
53 self.__data.append("") # for an extra empty line
55 def generate(self):
56 with open(self.__filepath, 'w') as generated_source:
57 generated_source.write("\n".join(self.__header))
58 generated_source.write("\n".join(self.__data))
61 def __init__(self):
70 self._unicode_categories = {
76 self._categories = {
82 def _store_by_category(self, unicode_id, category):
86 for target_category in self._categories:
87 if category in self._unicode_categories[target_category + '_category']:
88 self._categories[target_category].append(unicode_id)
90 def read_categories(self, unicode_data_file):
111 self._store_by_category(range_start_id, category)
120 self._store_by_category(unicode_id, category)
123 separators = self._categories['separators']
141 non_letters = self._categories['non_letters']
148 return self._categories['letters'], self._categories['non_letters'], self._categories['separators']