1 / 86

Precedence Graph Grammar for Hierarchical Program Diagram

Precedence Graph Grammar for Hierarchical Program Diagram. ○ Takaaki Goto (Toyo University) Kenji Ruise (Kirigaoka School for the Physically Challenged, University of Tsukuba ) Kensei Tsuchida (Toyo University) Takeo Yaku (Nihon University). Contents. Introduction Hichart/DXL

afya
Download Presentation

Precedence Graph Grammar for Hierarchical Program Diagram

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Precedence Graph Grammar for Hierarchical Program Diagram ○Takaaki Goto (Toyo University) Kenji Ruise (Kirigaoka School for the Physically Challenged, University of Tsukuba ) Kensei Tsuchida (Toyo University) Takeo Yaku (Nihon University)

  2. Contents • Introduction • Hichart/DXL • Preliminaries • Graph Grammar for Hichart/DXL • Parsing of precedence graph grammar for Hichart/DXL • Hichart Editor • Conclusion

  3. 1. Introduction 1.1 Background 1.2 Motivation 1.3 Purpose 1.4 Results

  4. 1.1 Background • Various researches have been done on graph grammars and their application • We have been developing a software development environment based on graph grammars • to formalize of diagram’s structure and layout information • to formalize of diagram processing method

  5. 1.1 Background (cont.) • The program diagram called Hichart (HIerachical flowCHART description language) in this environment is treated • We have already developed bidirectional translators that translate • Pascal, C, or DXL to Hichart • Hichartto Pascal, C, or DXL

  6. 1.2 Motivation • A parser plays a key role in our processing system and needs to be efficient as large-scale program diagrams are parsed

  7. 1.3 Purpose • To adopt a precedence relation of graph grammar for Hichart/DXL to parse Hichart diagram efficiently

  8. 1.4 Results • Adapted a precedence relation of graph grammar for Hichart/DXL • productions70 • semantic rules888 • precedence relations256 • Implemented graphical editor with parser in JAVA

  9. 2. Hichart/DXL

  10. 2. Hichart/DXL (cont.) • Characteristics of Hichart • Diagram is a tree-flowchartwiththe same flow control lines as a Neumann program flowchart • The hierarchy of the data structure and the control flow are displayed on a plane simultaneously

  11. 2. Hichart/DXL (cont.) • DXL (1) Diagram eXchange Language for tree-structure charts, DXL, was specified in the 1997 ISO (2) Purpose of DXL is to facilitate the interchange of different tree-structure charts between CASE tools

  12. 2. Hichart/DXL (cont.) • Data exchange between various tree-structure diagrams through DXL (Hitachi)

  13. 3. Preliminaries 3.1 edNCE Graph Grammar 3.2 Precedence Graph Grammar

  14. 3.1 edNCE Graph Grammar [Rozenberg, 1997]

  15.        (c) Result 3.1 edNCE Graph Grammar (cont.) • Example of production & derivation (a) Host X:= (b) Production

  16. 3.2 Precedence Graph Grammar A graph grammar that is ・confluent ・symmetric ・uniquely invertible ・has no reflexive nonterminals ・no precedence conflicts is called precedence graph grammar [Kaul, 1986].

  17. 3.2 Precedence Graph Grammar (cont.) • derivation specifications , where • is an isomorphic graph of the left hand side of a production • is an isomorphic graph of the right hand side of a production • is an isomorphism

  18. 3.2 Precedence Graph Grammar (cont.) • derivation sequences • precedes if • The reflexive and transitive closure of this relation is denoted • are incomparable if neither nor

  19. 3.2 Precedence Graph Grammar (cont.) • An ordering of the nodes in Gn is are the precedence relation between nodes • The precedence relations between labels is the set of all

  20. 4. Graph Grammar for Hichart/DXL 4.1 Attribute Graph Grammar for Hichart/DXL 4.2 Derivation of GGHD 4.3 Precedence Relation for GGHD

  21. 4.1 Attribute Graph Grammar for Hichart/DXL • GGHD (Graph Grammar for Hichart/DXL)

  22. 4.1 Attribute Graph Grammar for Hichart/DXL (cont.) Fig. Example of production and semantic rules of GGHD

  23. 4.2 Derivation of GGHD • We substitute (D’,C’) for a node X’ in H as follows. (1) Remove a mother node X’ , and edges that connect with X’ from host graph H, (2) Embed the daughter graph D’ into H- , and (3) Establish edges between the nodes of D’ and the nodes that were connected to the mother node in the H of H− using the connection instructions of C’.

  24. 4.2 Derivation of GGHD(cont.) Remove mother node and edges that connect with [profile_module_list]

  25. 4.2 Derivation of GGHD(cont.) Embed the daughter graph

  26. 4.2 Derivation of GGHD(cont.) Establish edges using the connection instructions

  27. 4.3 Precedence Relation for GGHD • We adopted a precedence relation of graph grammar for Hichart/DXL using Kaul’s definitions

  28. 4.3 Precedence Relation for GGHD (cont.)

  29. 4.3 Precedence Relation for GGHD (cont.)

  30. 4.3 Precedence Relation for GGHD (cont.) s1=(P1, [module_packet], D1, b) sD(2)=s1 sD(3)=s1

  31. 4.3 Precedence Relation for GGHD (cont.)

  32. 4.3 Precedence Relation for GGHD (cont.) s2=(P3, [profile_module_list], D2, b) sD(4)=s2 sD(5)=s2

  33. 4.3 Precedence Relation for GGHD (cont.)

  34. 4.3 Precedence Relation for GGHD (cont.) s3=(P4, [profile], D3, b) sD(6)=s3 sD(7)=s3

  35. 4.3 Precedence Relation for GGHD (cont.)

  36. 4.3 Precedence Relation for GGHD (cont.) s4=(P5, [module_list], D4, b) sD(8)=s4

  37. 4.3 Precedence Relation for GGHD (cont.) derivation sequence: [The precedence relation between 6 and 7 ] 6  7 ⇔ sD(6) D sD(7) sD(6)=s3, sD(7)=s3, s3 =D s3, 6 = 7 lab(6, 7) = ("profile", #, , "explanation") ∈R =

  38. 4.3 Precedence Relation for GGHD (cont.) • We defined all the precedence relations between labels for grammar GGHD • We call this grammar the Precedence Graph Grammar for Hichart/DXL (PGGHD) [Property 1] PGGHD is a precedence graph grammar

  39. 5. Parsing of Precedence Graph Grammar for Hichart/DXL 5.1 Algorithm for parsing 5.2 Example of Parsing

  40. 5.1 Algorithm for parsing • uses a stack for storing traversed nodes • Starts parsing from the root node of an input graph [parsing] • shift as long as possible • If there is no ascending node, the parser searches a production where the right-hand-side is isomorphic to the precedence handle. • reduce the precedence handle to lhs of the production

  41. “m_packet” “module_ algorithm” “identifier_ is” 0 M_Packet 5.2 Example of Parsing An input graph G < < “explanation” “profile” ※ < < “BoxEmpty1” K An ordered list of G

  42. “m_packet” “module_ algorithm” “identifier_ is” 0 “m_packet” 5.2 Example of Parsing (cont.) G < < “explanation” “profile” ※ < < “BoxEmpty1” K

  43. “m_packet” “module_ algorithm” “identifier_ is” 0 “m_packet” TOP(G,K) 5.2 Example of Parsing (cont.) G < < “explanation” “profile” ※ < < “BoxEmpty1” K

  44. “m_packet” “module_ algorithm” “identifier_ is” 0 1 “m_packet” “profile” 5.2 Example of Parsing (cont.) G < < “explanation” “profile” ※ < < “BoxEmpty1” K

  45. “m_packet” “module_ algorithm” “identifier_ is” 1 0 “profile” “m_packet” TOP(G,K) 5.2 Example of Parsing (cont.) G < < “explanation” “profile” ※ < < “BoxEmpty1” K

  46. “module_ algorithm” “m_packet” “identifier_ is” 0 1 2 “explanation” “profile” “m_packet” 5.2 Example of Parsing (cont.) G < < “explanation” “profile” ※ < < “BoxEmpty1” K

  47. “m_packet” “module_ algorithm” “identifier_ is” 2 0 1 “profile” “explanation” “m_packet” TOP(G,K) 5.2 Example of Parsing (cont.) G < < “explanation” “profile” ※ < < “BoxEmpty1” K

  48. “m_packet” “module_ algorithm” find_production P10 “identifier_ is” 1 2 0 “explanation” “profile” “m_packet” TOP(G,K) 5.2 Example of Parsing (cont.) G < < “explanation” “profile” ※ < < “BoxEmpty1” K

  49. “module_ algorithm” “m_packet” “identifier_ is” 0 1 2 [explanation] “profile” “m_packet” 5.2 Example of Parsing (cont.) G < = [explanation] “profile” ※ < < “BoxEmpty1” K

  50. “m_packet” “module_ algorithm” “identifier_ is” 2 0 1 “profile” [explanation] “m_packet” TOP(G,K) 5.2 Example of Parsing (cont.) G < = [explanation] “profile” ※ < < “BoxEmpty1” K

More Related