def createFile(self, data): """ Creates an instance of CheckerFile from provided info. Data format: ( [ <isa-feature>, ... ], [ ( <case-name>, [ ( <text>, <assert-variant> ), ... ] ), ... ] ) """ c1File = C1visualizerFile("<c1_file>") c1File.instructionSetFeatures = data[0] for passEntry in data[1]: passName = passEntry[0] passBody = passEntry[1] c1Pass = C1visualizerPass(c1File, passName, passBody, 0) return c1File
def parse_c1_visualizer_stream(filename, stream): c1_file = C1visualizerFile(filename) state = C1ParserState() def fn_process_line(line, line_no): return _parse_c1_line(c1_file, line, line_no, state, c1_file.base_file_name) def fn_line_outside_chunk(line, line_no): Logger.fail("C1visualizer line not inside a group", c1_file.base_file_name, line_no) for pass_name, pass_lines, start_line_no, test_arch in split_stream( stream, fn_process_line, fn_line_outside_chunk): C1visualizerPass(c1_file, pass_name, pass_lines, start_line_no + 1) return c1_file