Exemplo n.º 1
0
    def createFile(self, passList):
        """ Creates an instance of CheckerFile from provided info.

    Data format: [ ( <case-name>, [ ( <text>, <assert-variant> ), ... ] ), ... ]
    """
        c1File = C1visualizerFile("<c1_file>")
        for passEntry in passList:
            passName = passEntry[0]
            passBody = passEntry[1]
            c1Pass = C1visualizerPass(c1File, passName, passBody, 0)
        return c1File
Exemplo n.º 2
0
def ParseC1visualizerStream(fileName, stream):
    c1File = C1visualizerFile(fileName)
    state = C1ParserState()
    fnProcessLine = lambda line, lineNo: __parseC1Line(c1File, line, lineNo,
                                                       state, fileName)
    fnLineOutsideChunk = lambda line, lineNo: \
        Logger.fail("C1visualizer line not inside a group", fileName, lineNo)
    for passName, passLines, startLineNo, testArch in \
        SplitStream(stream, fnProcessLine, fnLineOutsideChunk):
        C1visualizerPass(c1File, passName, passLines, startLineNo + 1)
    return c1File
Exemplo n.º 3
0
    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
Exemplo n.º 4
0
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