162306a36Sopenharmony_ci#!/usr/bin/env python3 262306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only 362306a36Sopenharmony_ci# 462306a36Sopenharmony_ci# Copyright (C) 2019-2022 Red Hat, Inc. Daniel Bristot de Oliveira <bristot@kernel.org> 562306a36Sopenharmony_ci# 662306a36Sopenharmony_ci# dot2c: parse an automata in dot file digraph format into a C 762306a36Sopenharmony_ci# 862306a36Sopenharmony_ci# This program was written in the development of this paper: 962306a36Sopenharmony_ci# de Oliveira, D. B. and Cucinotta, T. and de Oliveira, R. S. 1062306a36Sopenharmony_ci# "Efficient Formal Verification for the Linux Kernel." International 1162306a36Sopenharmony_ci# Conference on Software Engineering and Formal Methods. Springer, Cham, 2019. 1262306a36Sopenharmony_ci# 1362306a36Sopenharmony_ci# For further information, see: 1462306a36Sopenharmony_ci# Documentation/trace/rv/deterministic_automata.rst 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ciif __name__ == '__main__': 1762306a36Sopenharmony_ci from dot2 import dot2c 1862306a36Sopenharmony_ci import argparse 1962306a36Sopenharmony_ci import sys 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci parser = argparse.ArgumentParser(description='dot2c: converts a .dot file into a C structure') 2262306a36Sopenharmony_ci parser.add_argument('dot_file', help='The dot file to be converted') 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_ci args = parser.parse_args() 2562306a36Sopenharmony_ci d = dot2c.Dot2c(args.dot_file) 2662306a36Sopenharmony_ci d.print_model_classic() 27