Intermediate Representation Using Graph Visualization Software
- 1 Department of Computer Science, Adekunle Ajasin University, Akungba-Akoko, Nigeria
- 2 Department of Computer Science, Federal University of Technology, Akure, Nigeria
- 3 Department of Information Systems, Federal University of Technology, Akure, Nigeria
Abstract
In this paper, a method to initiate, develop and visualize an abstract syntax tree (AST) in C++ source code is presented. The approach is in chronological order starting with collection of program codes as a string and split into individual characters using regular expression. This will be followed by separating the token grammar using best first search (BFS) algorithm to determine node having lowest value, lastly followed by graph presentation of intermediate representation achieved with the help of graph visualization software (GraphViz) while former is implemented using python programming language version 3. The efficacy of our approach is used in analyzing C++ code and yielded a satisfactory result.
- Click, C. and Paleczny, M. (1995) A Simple Graph-Based Intermediate Representation. ACM SIGPLAN Workshop, San Francisco, CA, 35-49. https://doi.org/10.1145/202530.202534
- Sander, G. (1999) Graph Layout for Applications in Computer Construction. Theoretical Computer Science, Berkeley, CA, 175-214. https://doi.org/10.1016/S0304-3975(98)00270-9
- Walker, D. (2003) Intermediate Representation. Princeton University, Princeton, NJ, 1-21.
- Vaderna, R., Milosavljevic, G. and Dejanovic, I. (2015) Graph Layout Algorithms and Libararies: Overview and Improvements. Faulty of Technical Sciences, University of Novisad, Serbia.
- Strunk, E.A., Aiello, M.A. and Knight, J.C. (2006) A Survey of Tools for Model Checking and Model-Based Development. Technical Report, Department of Computer Science, University of Virginia, Charlottesville, VA.
- Braun, M., Buchwald, S. and Zwinkau, A. (2011) FIRM: A Graph-Based Intermediate Representation. Workshop on Intermediate Representations. Karlsruuhe Institute of Technology, Germany, 61-68.
- Moller, A. and Schwartzbach, M.I. (2019) Static Program Analysis. Computer Science, Aarhus University, Denmark.
- Visser, E. (2004) Program Transformation with Stratego/XT: Rules, Strategies, Tools and Systems. Technical Report, Institute of Information and Computing Sciences Utrecht University, Netherlands.
- Ade-Ibijola, A., Ewert, S. and Sanders, L. (2014) Abstracting and Narrating Novice Programs Using Regular Expressions. South Africa Institute of Computer Scientist and Information Technologist (SAICSIT), Centurion, South Africa. https://doi.org/10.1145/2664591.2664601
- Gansner, E.R., Koutsofios, E. and North, S. (2015) Drawing Graphs with Dot. https://graphiz.gitlab.io/_pages/pdf/dotguide.pdf
- Aliyu, E.O., Adewale, O.S., Adetunmbi, A.O. and Ojokoh, B.A. (2019) Requirement Formalization for Model Checking Using Extended Backus Naur Form. I-Manager’s Journal on Software Engineering, 13, 1-6.
- Stalmans, E.R. (2010) Visualisation of Abstract Syntax Trees for Coco/R. Computer Science of Rhodes University Grahamstowm, South Africa. https://pdfs.semanticscholar.org
- Kreb, N. and Schmitz, L. (2012) JACCIE: A Java-Based Compiler-Compiler for Generating, Visualizing and Debugging Compiler Components. Elsevier Science of Computer Programming, 79, 101-115. https://doi.org/10.1016/j.scico.2012.03.001