if __name__ == "__main__":

    args = parse()
    cfilename = args.cfilename
    cpath = UF.get_kendra_cpath(cfilename)

    if cpath is None:
        print("*" * 80)
        print("Unable to find the test set for file " + cfilename)
        print("*" * 80)
        exit(1)

    sempath = os.path.join(cpath, "semantics")
    cfapp = CApplication(sempath, cfilename)
    if cfapp.has_single_file():
        cfile = cfapp.get_cfile()

        if (args.table is None) or args.list:
            print(str(DT.list_file_tables()))

        else:
            print(str(DT.get_file_table(cfile, args.table)))

    else:
        print("*" * 80)
        print("File not found. Please make sure the test has been analyzed.")
        print("*" * 80)
        exit(1)
예제 #2
0
                        help='directory that holds the semantics directory')
    parser.add_argument('cfile', help='name of c file')
    parser.add_argument('tablename', help='name of the table to be shown')
    args = parser.parse_args()
    return args


if __name__ == '__main__':

    args = parse()

    cpath = os.path.abspath(args.path)
    try:
        UF.check_semantics(cpath)
    except UF.CHError as e:
        print(str(e.wrap()))
        exit(1)

    sempath = os.path.join(cpath, 'semantics')

    try:
        cfapp = CApplication(sempath, args.cfile)
        cfile = cfapp.get_cfile()
    except UF.CFileNotFoundException as e:
        print(str(e.wrap()))
        exit(1)

    cfile = cfapp.get_cfile()

    print(DT.get_file_table(cfile, args.tablename))
예제 #3
0
    parser.add_argument('tablename',help='name of table to be shown')
    args = parser.parse_args()
    return args

if __name__ == '__main__':

    args = parse()
    cpath = os.path.abspath(args.path)
    
    try:
        UF.check_semantics(cpath)
    except UF.CHError as e:
        print(str(e.wrap()))
        exit(1)

    sempath = os.path.join(cpath,'semantics')
    try:
        cfapp = CApplication(sempath,args.cfile)
        cfile = cfapp.get_cfile()
    except CFileNotFoundException as e:
        print(str(e))
        exit(1)

    try:
        cfun = cfile.get_function_by_name(args.cfunction)
    except UF.CHError as e:
        print(str(e.wrap()))
        exit(1)

    print(str(DT.get_function_table(cfile,args.cfunction,args.tablename)))
if __name__ == "__main__":

    args = parse()
    cfilename = args.cfilename
    cpath = UF.get_kendra_cpath(cfilename)

    if cpath is None:
        print("*" * 80)
        print("Unable to find the test set for file " + cfilename)
        print("*" * 80)
        exit(1)

    sempath = os.path.join(cpath, "semantics")
    cfapp = CApplication(sempath, cfilename)

    if cfapp.has_single_file():
        cfile = cfapp.get_cfile()

        if (args.table is None) or args.list:
            print(str(DT.list_function_tables()))

        else:
            print(str(DT.get_function_table(cfile, args.cfunction,
                                            args.table)))

    else:
        print("*" * 80)
        print("File not found. Please make sure the test has been analyzed.")
        print("*" * 80)
        exit(1)