bgv.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * Copyright 2021
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. *
  17. * These are the four essential freedoms with GNU GPL software:
  18. * 1: freedom to run the program, for any purpose
  19. * 2: freedom to study how the program works, and change it to make it do what you wish
  20. * 3: freedom to redistribute copies to help your Free Software friends
  21. * 4: freedom to distribute copies of your modified versions to your Free Software friends
  22. * , ,
  23. * / \
  24. * ((__-^^-,-^^-__))
  25. * `-_---' `---_-'
  26. * `--|o` 'o|--'
  27. * \ ` /
  28. * ): :(
  29. * :o_o:
  30. * "-"
  31. *
  32. * SPDX-License-Identifier: GPL-3.0+
  33. * License-Filename: LICENSE
  34. */
  35. /* parse bgv graph data generated by graalvm and other software from oracle */
  36. #include "config.h"
  37. #include <stdio.h>
  38. #include <stdlib.h>
  39. #include <string.h>
  40. #include <zlib.h>
  41. #include "splay-tree.h"
  42. #include "main.h"
  43. #include "bgv.h"
  44. #include "bgvparser.h"
  45. #include "dpmem.h"
  46. #include "dot.tab.h"
  47. static char *curfname = NULL;
  48. static int bgverror = 0;
  49. static int bgvdebug = 0;
  50. /* */
  51. int bgvparse(struct gml_graph *g, gzFile f, char *fname, char *argv0)
  52. {
  53. int status = 0;
  54. if (argv0) {
  55. }
  56. if (g == NULL || 1 /* test only */ ) {
  57. return (0);
  58. }
  59. curfname = fname;
  60. /* no errors */
  61. bgverror = 0;
  62. bgvdebug = yydebug;
  63. status = runbgvparse(f, bgvdebug);
  64. if (bgvdebug) {
  65. printf("%s(): status=%d\n", __func__, status);
  66. }
  67. return (0);
  68. }
  69. /* end */