<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">JSEA</journal-id><journal-title-group><journal-title>Journal of Software Engineering and Applications</journal-title></journal-title-group><issn pub-type="epub">1945-3116</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/jsea.2020.135006</article-id><article-id pub-id-type="publisher-id">JSEA-100055</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Computer Science&amp;Communications</subject></subj-group></article-categories><title-group><article-title>
 
 
  Intermediate Representation Using Graph Visualization Software
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>E.</surname><given-names>O. Aliyu</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>A.</surname><given-names>O. Adetunmbi</given-names></name><xref ref-type="aff" rid="aff2"><sup>2</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>B.</surname><given-names>A. Ojokoh</given-names></name><xref ref-type="aff" rid="aff3"><sup>3</sup></xref></contrib></contrib-group><aff id="aff3"><addr-line>Department of Information Systems, Federal University of Technology, Akure, Nigeria</addr-line></aff><aff id="aff1"><addr-line>Department of Computer Science, Adekunle Ajasin University, Akungba-Akoko, Nigeria</addr-line></aff><aff id="aff2"><addr-line>Department of Computer Science, Federal University of Technology, Akure, Nigeria</addr-line></aff><pub-date pub-type="epub"><day>09</day><month>05</month><year>2020</year></pub-date><volume>13</volume><issue>05</issue><fpage>77</fpage><lpage>90</lpage><history><date date-type="received"><day>2,</day>	<month>April</month>	<year>2020</year></date><date date-type="rev-recd"><day>6,</day>	<month>May</month>	<year>2020</year>	</date><date date-type="accepted"><day>9,</day>	<month>May</month>	<year>2020</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  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.
 
</p></abstract><kwd-group><kwd>Recursive Descent Parser</kwd><kwd> Best First Search</kwd><kwd> Intermediate Representation</kwd><kwd> Abstract Syntax Tree</kwd><kwd> Graph Visualization Software</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Intermediate representations (IR) do not exist in a vacuum. They are the stepping stone from what the programmer wrote to what the machine understands [<xref ref-type="bibr" rid="scirp.100055-ref1">1</xref>]. Drawings of compiler data structures such as syntax trees, control flow graphs, dependency graphs [<xref ref-type="bibr" rid="scirp.100055-ref2">2</xref>] are used for demonstration, debugging and documentation of compilers. For instance, [<xref ref-type="bibr" rid="scirp.100055-ref3">3</xref>] demonstrated using <xref ref-type="fig" rid="fig1">Figure 1</xref> the importance of intermediate representation in terms of portability and modularity.</p><p>That is, compiler for five languages and four target machines (left) without an IR caused front-end becomes cluttered with machine specific details and</p><p>back-end becomes cluttered with source language specific details (that is, need separate compiler for each source language/target machine combination) while (right) with an IR need just “n” front-ends and “m” back-ends (meaning that, one can build a new front-end for an existing backend). In real-world compiler applications, such drawings cannot be produced manually because the graphs are automatically generated using graph layout algorithms such as JGraphX, JGraphT, JUNG, Prefuse and GraphViz [<xref ref-type="bibr" rid="scirp.100055-ref4">4</xref>]. In the area of debugging, compiler data structure has been used to overcome the problems faced by model checking in constructing a model for the system under consideration [<xref ref-type="bibr" rid="scirp.100055-ref5">5</xref>]. [<xref ref-type="bibr" rid="scirp.100055-ref6">6</xref>] stated that the main goal for the design of an intermediate representation is to support the optimizations using it. Therefore, this work is aimed at developing intermediate representation (that is, abstract syntax tree) at the level of parsing using graph visualization software. Abstract syntax trees (AST) can be used in program analysis and program transformation systems. [<xref ref-type="bibr" rid="scirp.100055-ref7">7</xref>] stated that AST has been known to provide a representation of programs suitable for flow-insensitive analysis such as type analysis, control flow analysis and pointer analysis because they ignore execution order of statements in a function or block. Program transformation on the other hand, is an automatic manipulation of source program [<xref ref-type="bibr" rid="scirp.100055-ref8">8</xref>]. It has been found useful in different applications including compiler construction, optimization, program synthesis, refactoring, software renovation and reverse engineering. Visualization tools provide a graphical description of a program [<xref ref-type="bibr" rid="scirp.100055-ref9">9</xref>]. Tools such as Dot draw directed graphs in a graphics format including Graphics Interchange Format (GIF), Portable Network Graphics (PNG), Scalable Vector Graphic (SVG), Portable Document Format (PDF) or PostScript [<xref ref-type="bibr" rid="scirp.100055-ref10">10</xref>]. However, when a program is parsed in C of Languages (CLANG), the result is either in a dump file or PDF.</p><p>This paper discusses how the grammar rule presented in [<xref ref-type="bibr" rid="scirp.100055-ref11">11</xref>] has been transformed into an intermediate representation (IR). Also, a parser using recursive descent parsing technique and best first search algorithm to generate an intermediate representation called abstract syntax tree (AST) with the help of graph visualization software to visualize the output of syntax analysis will be presented. [<xref ref-type="bibr" rid="scirp.100055-ref12">12</xref>] pointed out that visualization can be a useful teaching aid to examine the generated AST and gain a greater understanding of the underlying program. The contribution of this paper is as follows:</p><p>1) initiate a parser using recursive descent and best first search algorithm for generating abstract syntax trees dot file based on defined grammar rules,</p><p>2) produce abstract syntax tree using graph visualization software for interpreting the dot file into portable network graphics format.</p><p>The next section will introduce review of related works in this field of study. In section three, background of intermediate representation, graph visualization software, recursive descent parser and best first search algorithm, parsing process methodology in section four while section five highlights the conclusion and future research work.</p></sec><sec id="s2"><title>2. Related Works</title><p>Stalmans [<xref ref-type="bibr" rid="scirp.100055-ref12">12</xref>] presented visualization of abstract syntax trees for COCO/R. The idea is to help programmers with an integrated development environment (IDE) for COCO/R to understand the compiler generation process and visualize the output of syntax analysis.</p><p>A tool to support compiler process via java-based compiler-compiler in an interactive environment (JACCIE) was developed and presented by [<xref ref-type="bibr" rid="scirp.100055-ref13">13</xref>]. The idea is to aid automatic generation of compiler components in a visual debugging environment, displaying compiler components internal states which are hidden from users in conventional compilers.</p><p>To identify significant static analysis functionality provided in python program analyzer, [<xref ref-type="bibr" rid="scirp.100055-ref14">14</xref>] developed verification of program properties that automatically presents program flow and call graph using Graphviz. This visualization provides useful information to user extracting data such as macro definitions, variables, type definitions and function signatures from header files.</p><p>[<xref ref-type="bibr" rid="scirp.100055-ref15">15</xref>] introduced LLVM-based JIT compilation in genetic programming. Their intention was to improve the computational efficiency of genetic programming in understanding how just in time compilation (JIT) expressed in abstract syntax tree can be accomplished using the lower level virtual machine (LLVM) library.</p><p>A tool to secure Internet of Things (IoT) app or environment via static analysis system (SOTERIA) was developed and presented by [<xref ref-type="bibr" rid="scirp.100055-ref16">16</xref>]. The idea is to validate IoT app or environment for safety, security and functional properties by translating IoT source code into an intermediate representation using sensor-computation-actuator program structures.</p><p>However, in all the paper review, known of the paper clearly shows the process to explore the grammar structure as we have shown in this paper. The goal is to aid understanding of the underlying program in detecting assignment-in guard error including non-inclusion of brake and default in selective and iterative structures C++ codes.</p></sec><sec id="s3"><title>3. Central Concepts of Intermediate Representation</title><p>According to [<xref ref-type="bibr" rid="scirp.100055-ref17">17</xref>] intermediate languages (ILs) are typically used in compiler and compiler like applications (that is, static checkers). They are usually tree-like data types which represent some abstract syntax of a simple language. However, ILs generation system has been implemented in a number of tools such as java compiler compiler (JavaCC), another tool for language recognition (ANTLR), yet another compiler compiler (YACC), visible compiler compiler (VCOCO) respectively [<xref ref-type="bibr" rid="scirp.100055-ref12">12</xref>]. Although, there are several ways to generate an abstract syntax tree directly from the grammar, this paper discusses some of the techniques used in constructing an abstract syntax tree.</p><sec id="s3_1"><title>3.1. Abstract Syntax Tree</title><p>Quantitatively, an abstract syntax tree (AST) is a condensed version of parse trees. In the context of a compiler, the term AST is used interchangeably with syntax tree [<xref ref-type="bibr" rid="scirp.100055-ref18">18</xref>]. An abstract syntax tree on the other hand, ignores a significant amount of the syntactic information that a parse tree; which is a pictorial version of the grammatical structure of a sentence, would contain. <xref ref-type="fig" rid="fig2">Figure 2</xref> demonstrates graphically the parse tree and AST using arithmetic expression 2 + (2 + 2) relative to the grammar “expr = factor ((plus|minus) factor)) + while factor = int|(expr).</p><p>Each node of the tree denotes a construct occurring in the source code. [<xref ref-type="bibr" rid="scirp.100055-ref19">19</xref>] described formal notion of an abstract syntax tree (AST) as a labeled graph ( N , E , μ N ) over the alphabet Σ N ; is a finite and directed graph, where N is a set of nodes, E ⊆ N &#215; N is an edge relation between the nodes, and μ N : N → Σ N is a node labeling function. A labeled tree is a labeled graph T = ( N , E , μ N ) if it has a single root node root(T) for which we have the following: for each node l ∈ N there exists exactly one path from the root to the node, that is, exactly one sequence l 0 , ⋯ , l n , such that l 0 = root ( T ) , l n = l and ( l i − 1 , l i ) ∈ E for i = 1 , ⋯ , n .</p><p>However, the formal notion can be exemplified by the anatomy of an AST as presented by [<xref ref-type="bibr" rid="scirp.100055-ref18">18</xref>].</p><p>By considering a single node within an AST, <xref ref-type="fig" rid="fig3">Figure 3</xref> shows that every node contains the terminal (that is, the token value) and pointers to its next sibling as well as its first child node.</p></sec><sec id="s3_2"><title>3.2. Graph Visualization Software</title><p>Graphviz is an acronyms for Graph Visualization Software; a collection of libraries and utilities to manipulate and view graphs in a variety of output format such as simple text format (plain or plain-text), portable document format (PDF), jpeg, scalable vector graphic (SVG), portable network graphics (PNG) respectively [<xref ref-type="bibr" rid="scirp.100055-ref20">20</xref>] [<xref ref-type="bibr" rid="scirp.100055-ref21">21</xref>]. It can be used in a variety of contexts, such as software engineering, bio-informatics, internet and web structures and dynamic distributed communication services. [<xref ref-type="bibr" rid="scirp.100055-ref20">20</xref>] [<xref ref-type="bibr" rid="scirp.100055-ref21">21</xref>] [<xref ref-type="bibr" rid="scirp.100055-ref22">22</xref>] [<xref ref-type="bibr" rid="scirp.100055-ref23">23</xref>] stated that the algorithms of Graphviz concentrate on graph layout algorithm such as dot; a sugiyama-style hierarchical layout, neato; a symmetric layout algorithm based on stress reduction, osage; a layout algorithm for clustered graphs based on user specifications respectively, depending on the application type and the data being visualised. In this paper, Graphviz software was employed as a library, in particular, the dot algorithm, which produces a ranked layout of a graph, honoring the direction of the edges [<xref ref-type="bibr" rid="scirp.100055-ref21">21</xref>] [<xref ref-type="bibr" rid="scirp.100055-ref23">23</xref>]. The steps in dot layout comprises the following: initialize; initialization establish the data structures specific to the given algorithm, rank; after initialization, algorithm assigns each node to a discrete rank using an integer program to minimize the sum of the discrete edge lengths, mincross; rearranges nodes within ranks to reduce edge crossings, position; is the assignment of actual coordinates to the nodes, sameports is based on the edge attributes, by which certain edges sharing a node and all connect to the node at the same point, splines; edge representations are generated in this step while compoundEdges clipped to the bounding box of the specified clusters the spline generated in splines phase.</p><p>However, Graphviz model’s node ranking in terms of linear integer program is given by:</p><p>minimize ∑ ( u , v ) ∈ E ω ( u , v ) ( y u − y v ) (1)</p><p>Subject   to       y u − y v ≥ ∂ ( u , v )     ∀ ( u , v ) ∈ E (2)</p><p>where y u denotes the rank of node u and ∂ ( u , v ) is the minimum length of the edge. By default, ∂ is taken as 1, but the general case supports flat edges, when the nodes are placed on the same rank ( ∂ = 0 ), or the times when it is important to enforce a greater separation ( ∂ &gt; 1 ). The weight factor ω ( u , v ) allows one to specify the importance of having the rank separation of two nodes be as close to minimum as possible.</p></sec><sec id="s3_3"><title>3.3. Recursive Descent Parser (RDP)</title><p>Historically, there are two types of parsing: top-down parsing and bottom-up parsing. The former expands the non-terminals to match incoming tokens and directly construct a derivation (i.e. they construct derivations and parse tree from the root to the leaves) while the latter attempts to match an input with the right-hand sides of the grammar rules, when a match occurs, the right-hand side is replaced by, or reduced to, the nonterminal on the left. So, they construct derivations and parse tree from the leaves to the root. However, this paper would employ the use of top-down parsing techniques, to be precise, recursive-descent parsing (RDP) method for parser generator; an older method for constructing a parser by hand from a grammar that is very effective. By and large, it operates by turning the non-terminals into a group of mutually recursive procedures whose actions are based on the right-hand sides of the formal grammar while the right-hand sides are interpreted in the procedures as tokens are matched directly with input tokens as constructed by a lexer. This parsing technique may or may not require back-tracking. But the grammar associated with it (if not left factored) cannot avoid back-tracking. So, a form of recursive-descent parsing that does not require any back-tracking is known as predictive parsing which uses a stack and a parsing table to parse the input and generate a parse tree [<xref ref-type="bibr" rid="scirp.100055-ref24">24</xref>].</p><p>Supposing an interpreter needs to process an arithmetic expression to evaluate additions like 2 + (2 + 2), after tokenization, RDP can be used to construct a parser as shown in <xref ref-type="fig" rid="fig4">Figure 4</xref> using python compiler version 3 for the grammar defined in <xref ref-type="fig" rid="fig5">Figure 5</xref>.</p></sec><sec id="s3_4"><title>3.4. Best First Search (BFS) Algorithm</title><p>In deciding branch to follow by avoiding backtracking to the beginning of the parsing process in the parser development, BFS algorithm; a heuristic that ranks alternatives in search algorithm at each branching step based on available information [<xref ref-type="bibr" rid="scirp.100055-ref25">25</xref>] was adopted. To do this, nodes is expanded as follows:</p><p>1) Search will start at the root node of the phrase structure P s .</p><p>2) The node to be expanded next is selected on the basis of an evaluation function P r ( n ) where n = L x , L x is the valuation function specified for each syntactic domain as given in 3.</p><p>P r ( L x ) = ∑ T 1 T n     P r ( L x T 1 ) = lowest index_val (3)</p><p>3) The node having lowest value of P r ( n ) is selected first that is; min P r ( n ) .</p><p>4) Lowest value of P r ( n ) indicates that goal is nearest from this node. That is, the lower the value, the higher the priority as presented in 4.</p><p>P r ( P s ) = { H P       if   P r ( P s ) = lowest value of   L x L P       if   P r ( P s ) = highest value of   L x (4)</p><p>where HP and LP denotes highest and lowest priority respectively.</p><p>Hence, the algorithm goes thus as shown in <xref ref-type="fig" rid="fig6">Figure 6</xref>.</p><p>This algorithm is implemented using priority queue created during tokenization to develop abstract syntax tree dot file; a configuration showing how the nodes is being visited to generate a specific abstract syntax tree in a portable network graphics (PNG) format.</p></sec></sec><sec id="s4"><title>4. Parsing Process Methodology</title><p>In transforming the action, a parser would take into more efficient program, this research establishes the following rules based on the ideas of Recursive Descent Parser (RDP) as depicted in <xref ref-type="table" rid="table1">Table 1</xref>.</p><p>Quantitatively, Lexer and Parser are usually combined to analyze the syntax of computer languages. This paper employed: 1) Regular Expression (RE) within python to collect the program code shown in <xref ref-type="fig" rid="fig7">Figure 7</xref>, as a string and split into individual characters. 2) Declaration of token type variables to represent the token was carried out as depicted in <xref ref-type="fig" rid="fig8">Figure 8</xref>. 3) Matching a RE with a character type is obtained and presented in <xref ref-type="table" rid="table2">Table 2</xref>.</p><p>For the parsing, the use of BFS algorithm in parser development is solely determined using a grammar rule presented in [<xref ref-type="bibr" rid="scirp.100055-ref11">11</xref>] where different methods within the parser class were defined, interpreting grammar programmatically to</p><p>generate AST. For instance, to verify a given sets of tokens over a defined grammar, the BFS require the logic (Grammar/Phrase Structure) and pattern</p><table-wrap id="table1" ><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> Parsing rules for rapid coding</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Rule 1</th><th align="center" valign="middle" >Methods/Functions should be defined for all non-terminals</th></tr></thead><tr><td align="center" valign="middle" >Rule 2</td><td align="center" valign="middle" >All terminals should be handled by an “eat” method</td></tr><tr><td align="center" valign="middle" >Rule 3</td><td align="center" valign="middle" >All “or” conditions within the grammar should be programmed using the if, else if, else program conditional statements.</td></tr><tr><td align="center" valign="middle" >Rule 4</td><td align="center" valign="middle" >All “*” or “+” depicting 0 or more and 1 or more occurrence of an EBNF rule should be handled within a while loop.</td></tr></tbody></table></table-wrap><table-wrap id="table2" ><label><xref ref-type="table" rid="table2">Table 2</xref></label><caption><title> Formalized pattern matching</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Token Type</th><th align="center" valign="middle" >Token Value</th><th align="center" valign="middle" >Formalization</th></tr></thead><tr><td align="center" valign="middle" >DECLARATION</td><td align="center" valign="middle" >INT</td><td align="center" valign="middle" >TOKEN(DECLARATION, INT)</td></tr><tr><td align="center" valign="middle" >KEYWORD_ID</td><td align="center" valign="middle" >MAIN</td><td align="center" valign="middle" >TOKEN(KEYWORD_ID, MAIN)</td></tr><tr><td align="center" valign="middle" >LPAREN</td><td align="center" valign="middle" >(</td><td align="center" valign="middle" >TOKEN(LPAREN, ( )</td></tr><tr><td align="center" valign="middle" >RPAREN</td><td align="center" valign="middle" >)</td><td align="center" valign="middle" >TOKEN(RPAREN, ) )</td></tr><tr><td align="center" valign="middle" >LBRACE</td><td align="center" valign="middle" >{</td><td align="center" valign="middle" >TOKEN(LBRACE, { )</td></tr><tr><td align="center" valign="middle" >IF_KEYWORD</td><td align="center" valign="middle" >IF</td><td align="center" valign="middle" >TOKEN(IF_KEYWOR, IF )</td></tr><tr><td align="center" valign="middle" >LPAREN</td><td align="center" valign="middle" >(</td><td align="center" valign="middle" >TOKEN(LPAREN, ( )</td></tr><tr><td align="center" valign="middle" >ID</td><td align="center" valign="middle" >A</td><td align="center" valign="middle" >TOKEN(ID, a )</td></tr><tr><td align="center" valign="middle" >BOOL_OPRT</td><td align="center" valign="middle" >==</td><td align="center" valign="middle" >TOKEN(BOOL_OPRT, == )</td></tr><tr><td align="center" valign="middle" >INTEGER_CONST</td><td align="center" valign="middle" >2</td><td align="center" valign="middle" >TOKEN(INTEGER_CONST, 2 )</td></tr><tr><td align="center" valign="middle" >RPAREN</td><td align="center" valign="middle" >)</td><td align="center" valign="middle" >TOKEN(RPAREN, ) )</td></tr><tr><td align="center" valign="middle" >LBRACE</td><td align="center" valign="middle" >{</td><td align="center" valign="middle" >TOKEN(LBRACE, { )</td></tr><tr><td align="center" valign="middle" >ID</td><td align="center" valign="middle" >C</td><td align="center" valign="middle" >TOKEN(ID, c )</td></tr><tr><td align="center" valign="middle" >ASSIGN</td><td align="center" valign="middle" >=</td><td align="center" valign="middle" >TOKEN(ASSIGN, = )</td></tr><tr><td align="center" valign="middle" >ID</td><td align="center" valign="middle" >A</td><td align="center" valign="middle" >TOKEN(ID, a )</td></tr><tr><td align="center" valign="middle" >AE_OPRT</td><td align="center" valign="middle" >+</td><td align="center" valign="middle" >TOKEN(AE_OPRT, + )</td></tr><tr><td align="center" valign="middle" >ID</td><td align="center" valign="middle" >B</td><td align="center" valign="middle" >TOKEN(ID, b )</td></tr><tr><td align="center" valign="middle" >SEMI</td><td align="center" valign="middle" >;</td><td align="center" valign="middle" >TOKEN(SEMI, ; )</td></tr><tr><td align="center" valign="middle" >RBRACE</td><td align="center" valign="middle" >}</td><td align="center" valign="middle" >TOKEN(RBRACE, } )</td></tr><tr><td align="center" valign="middle" >RBRACE</td><td align="center" valign="middle" >}</td><td align="center" valign="middle" >TOKEN(RBRACE, } )</td></tr></tbody></table></table-wrap><p>(Tokens). Hence, when the tokens are passed into the grammar then, a best first process is initiated, the token is searched for within the grammar based on the node having lowest value, if the token is found, it returns match, then collects the next token, and if the token is not found, it returns not match. The process continues until all the strings has been verified and parsed. Shown in <xref ref-type="fig" rid="fig9">Figure 9</xref> is the parsing process for the program block 1in <xref ref-type="fig" rid="fig7">Figure 7</xref>.</p><p>Having automated the parsing process, AST class; a collection of several AST classes with each having a reference to each method of the parser class was implemented including AST visualizer parameters depicted in <xref ref-type="table" rid="table3">Table 3</xref>, while the nodegen command line that executes the process and in return, generates the dot file configuration and the picture format of the AST is given in <xref ref-type="fig" rid="fig1">Figure 1</xref>0.</p><p>The nodegen command line contains the instruction format to generate abstract syntax tree model for the system. Argparser is imported into the python environment in which the Arg is the text-file to parse which is added to the program (i.e. the file) to execute. The extension is a dot extension as shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>1 which define the layered drawing of directed graphs while—Tpng is a flag</p><table-wrap id="table3" ><label><xref ref-type="table" rid="table3">Table 3</xref></label><caption><title> AST visualizer parameters</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Specification Type</th><th align="center" valign="middle" >Parameter Set</th></tr></thead><tr><td align="center" valign="middle" >Node Shape</td><td align="center" valign="middle" >Rectangle</td></tr><tr><td align="center" valign="middle" >Font Size</td><td align="center" valign="middle" >10px</td></tr><tr><td align="center" valign="middle" >Font Name</td><td align="center" valign="middle" >Courier</td></tr><tr><td align="center" valign="middle" >Line Height</td><td align="center" valign="middle" >0.4dpx</td></tr><tr><td align="center" valign="middle" >Shape Padding</td><td align="center" valign="middle" >10px</td></tr><tr><td align="center" valign="middle" >Path Size</td><td align="center" valign="middle" >0.4px</td></tr><tr><td align="center" valign="middle" >Title</td><td align="center" valign="middle" >AST Dependent</td></tr></tbody></table></table-wrap><p>that transform the dot file into portable network graphics (png) format (that is, to see what format dot support), having invoked from a command shell and presented in <xref ref-type="fig" rid="fig1">Figure 1</xref>2.</p></sec><sec id="s5"><title>5. Conclusions and Future Work</title><p>This paper discusses an intermediate representation approach developed. A lexer for transforming input characters into a stream of tokens, initiates a parser for generating abstract syntax tree dot file based on defined grammar rules and produces abstract syntax visualizer interpreting the dot file into portable network graphics format.</p><p>This paper observed better result due to portable network graphics transparency instead of portable document format for document sharing. Hence, the efficacy of our approach was established for analyzing C++ code.</p><p>Although, the research goal is to develop a model checker for detecting assignment in-guard error including emphasis on break and default keyword in C++ codes. Further research will employ visualization presented as a modeling formalism to detect operator’s conformity error, non-inclusion of break and default keyword in selective and iterative structures. Second, different system performance to determine the reliability, validity of programs if optimal and mathematical model for calculating the schedule time for different program line of codes will be deduced.</p></sec><sec id="s6"><title>Conflicts of Interest</title><p>The authors declare no conflicts of interest regarding the publication of this paper.</p></sec><sec id="s7"><title>Cite this paper</title><p>Aliyu, E.O., Adetunmbi, A.O. and Ojokoh, B.A. (2020) Intermediate Representation Using Graph Visualization Software. Journal of Software Engineering and Applications, 13, 77-90. https://doi.org/10.4236/jsea.2020.135006</p></sec></body><back><ref-list><title>References</title><ref id="scirp.100055-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">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</mixed-citation></ref><ref id="scirp.100055-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">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</mixed-citation></ref><ref id="scirp.100055-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Walker, D. (2003) Intermediate Representation. Princeton University, Princeton, NJ, 1-21.</mixed-citation></ref><ref id="scirp.100055-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Vaderna, R., Milosavljevic, G. and Dejanovic, I. (2015) Graph Layout Algorithms and Libararies: Overview and Improvements. Faulty of Technical Sciences, University of Novisad, Serbia.</mixed-citation></ref><ref id="scirp.100055-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">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.</mixed-citation></ref><ref id="scirp.100055-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">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.</mixed-citation></ref><ref id="scirp.100055-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Moller, A. and Schwartzbach, M.I. (2019) Static Program Analysis. Computer Science, Aarhus University, Denmark.</mixed-citation></ref><ref id="scirp.100055-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Visser, E. (2004) Program Transformation with Stratego/XT: Rules, Strategies, Tools and Systems. Technical Report, Institute of Information and Computing Sciences Utrecht University, Netherlands.</mixed-citation></ref><ref id="scirp.100055-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">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</mixed-citation></ref><ref id="scirp.100055-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Gansner, E.R., Koutsofios, E. and North, S. (2015) Drawing Graphs with Dot.  
https://graphiz.gitlab.io/_pages/pdf/dotguide.pdf</mixed-citation></ref><ref id="scirp.100055-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">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.</mixed-citation></ref><ref id="scirp.100055-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Stalmans, E.R. (2010) Visualisation of Abstract Syntax Trees for Coco/R. Computer Science of Rhodes University Grahamstowm, South Africa. 
https://pdfs.semanticscholar.org</mixed-citation></ref><ref id="scirp.100055-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">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</mixed-citation></ref><ref id="scirp.100055-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Kulkarni, A.A. (2013) Verification of Program Properties with Graphviz. Master Dissertation, College of Engineering, Shivajinagar, Pune.</mixed-citation></ref><ref id="scirp.100055-ref15"><label>15</label><mixed-citation publication-type="other" xlink:type="simple">Gregor, M. and Spalek, J. (2017) Using LLVM-Based JIT Compilation in Genetic Programming. Department of Control and Information Systems, Faculty of Electrical Engineering, University of Zilina, Zilina, Slovak Republic. 
https://doi.org/10.1109/ELEKTRO.2016.7512108</mixed-citation></ref><ref id="scirp.100055-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">Celik, Z.B., McDaniel, Z.P. and Tan, G. (2018) SOTERIA: Automated IoT Safety and Security Analysis. USENIX Annual Technical Conference, 1-19</mixed-citation></ref><ref id="scirp.100055-ref17"><label>17</label><mixed-citation publication-type="other" xlink:type="simple">Mount, S. (2013) A Language-Independent Static Checking System for Coding Conventions. Ph.D. Thesis, University of Wolverhampton, England.</mixed-citation></ref><ref id="scirp.100055-ref18"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">Joshi, V. (2017) Leveling up one’s Parsing Game with ASTs.  
https://medium.com/basecs/leveling-up-onesparsing-game-with-asts-d7a6fc2400ff</mixed-citation></ref><ref id="scirp.100055-ref19"><label>19</label><mixed-citation publication-type="other" xlink:type="simple">Fehnker, A., Brauer, J., Huuck, R. and Seefried, S. (2008) Goanna: Syntactic Software Model Checking. 1-6.</mixed-citation></ref><ref id="scirp.100055-ref20"><label>20</label><mixed-citation publication-type="other" xlink:type="simple">Namratha, N. (2010) Visualization of Dataflow Models. A Dissertation in Eindhoven University of Technology, United Arab Emirates.</mixed-citation></ref><ref id="scirp.100055-ref21"><label>21</label><mixed-citation publication-type="other" xlink:type="simple">Gansner, E.R. (2014) Using Graphviz as a Library (Cgraph Version). Graphviz Library Manual.</mixed-citation></ref><ref id="scirp.100055-ref22"><label>22</label><mixed-citation publication-type="other" xlink:type="simple">Dogrosoz, U., Feng, Q., Madden, B., Doorly, M. and Frick, A. (2002) Graph Visualization Toolkits. IEEE Computer Graphics and Application, 22, 30-37. 
https://doi.org/10.1109/38.974516</mixed-citation></ref><ref id="scirp.100055-ref23"><label>23</label><mixed-citation publication-type="other" xlink:type="simple">Ellson, J., Gansner, E.R., Koutsofios, E., North, S.C. and Woodhull, G. (2003) GraphViz and Dynagraph-Static and Dynamic Graph Drawing Tools. Graph Drawing Software, AT and T Lab-Research, 127-148. 
https://doi.org/10.1007/978-3-642-18638-7_6</mixed-citation></ref><ref id="scirp.100055-ref24"><label>24</label><mixed-citation publication-type="other" xlink:type="simple">Louden, K.C. (1993) Compiler Construction (Principles and Practice).</mixed-citation></ref><ref id="scirp.100055-ref25"><label>25</label><mixed-citation publication-type="other" xlink:type="simple">Aliyu, E.O. (2019) Development of Model Checking Technique for Operators Conformity Error in Selective and Iterative Structures. PhD Thesis, Department of Computer Science, Federal University of Technology Akure, Ondo State, Nigeria.</mixed-citation></ref></ref-list></back></article>