Precedence%20Graph%20Grammar%20for%20Hierarchical%20Program%20Diagram - PowerPoint PPT Presentation

About This Presentation
Title:

Precedence%20Graph%20Grammar%20for%20Hierarchical%20Program%20Diagram

Description:

Kenji Ruise (Kirigaoka School for the Physically Challenged, University of Tsukuba ) ... confluent. symmetric. uniquely invertible. has no reflexive nonterminals ... – PowerPoint PPT presentation

Number of Views:102
Avg rating:3.0/5.0
Slides: 87
Provided by: waa5
Category:

less

Transcript and Presenter's Notes

Title: Precedence%20Graph%20Grammar%20for%20Hierarchical%20Program%20Diagram


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
  1. Introduction
  2. Hichart/DXL
  3. Preliminaries
  4. Graph Grammar for Hichart/DXL
  5. Parsing of precedence graph grammar for
    Hichart/DXL
  6. Hichart Editor
  7. 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 diagrams 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
  • Hichart to 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
  • productions 70
  • semantic rules 888
  • precedence relations 256
  • Implemented graphical editor with parser in JAVA

9
2. Hichart/DXL
10
2. Hichart/DXL (cont.)
  • Characteristics of Hichart
  • Diagram is a tree-flowchart with the 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
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)

GG Type Productions Semantic rules
GGHD Context-free 70 888
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 Kauls 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
5.2 Example of Parsing
An input graph
G
lt
lt
explanation
profile
?
lt
lt
BoxEmpty1
K
An ordered list of G
42
5.2 Example of Parsing (cont.)
G
lt
lt
explanation
profile
?
lt
lt
BoxEmpty1
K
43
5.2 Example of Parsing (cont.)
G
lt
lt
explanation
profile
?
lt
lt
BoxEmpty1
K
44
5.2 Example of Parsing (cont.)
G
lt
lt
explanation
profile
?
lt
lt
BoxEmpty1
K
45
5.2 Example of Parsing (cont.)
G
lt
lt
explanation
profile
?
lt
lt
BoxEmpty1
K
46
5.2 Example of Parsing (cont.)
G
lt
lt
explanation
profile
?
lt
lt
BoxEmpty1
K
47
5.2 Example of Parsing (cont.)
G
lt
lt
explanation
profile
?
lt
lt
BoxEmpty1
K
48
5.2 Example of Parsing (cont.)
G
lt
lt
explanation
profile
?
lt
lt
BoxEmpty1
K
49
5.2 Example of Parsing (cont.)
G
lt

explanation
profile
?
lt
lt
BoxEmpty1
K
50
5.2 Example of Parsing (cont.)
G
lt

explanation
profile
?
lt
lt
BoxEmpty1
K
51
5.2 Example of Parsing (cont.)
G
lt

explanation
profile
?
lt
lt
BoxEmpty1
K
52
5.2 Example of Parsing (cont.)
G
lt
profile
lt
lt
lt
BoxEmpty1
K
53
5.2 Example of Parsing (cont.)
G
lt
profile
lt
lt
lt
BoxEmpty1
K
54
5.2 Example of Parsing (cont.)
G
lt
profile
lt
lt
lt
BoxEmpty1
K
55
5.2 Example of Parsing (cont.)
G
lt
profile
lt
lt
lt
BoxEmpty1
K
56
5.2 Example of Parsing (cont.)
G
lt
profile
lt
lt
lt
BoxEmpty1
K
57
5.2 Example of Parsing (cont.)
G
lt
profile
lt
lt
lt
BoxEmpty1
K
58
5.2 Example of Parsing (cont.)
G
lt
profile
lt
lt
lt
BoxEmpty1
K
59
5.2 Example of Parsing (cont.)
G
lt
profile
lt
lt
lt
BoxEmpty1
K
60
5.2 Example of Parsing (cont.)
G
find_production P14
lt
profile
lt
lt
lt
BoxEmpty1
K
61
5.2 Example of Parsing (cont.)
G
lt
profile
lt
lt

statement_ list
K
62
5.2 Example of Parsing (cont.)
G
lt
profile
lt
lt

statement_ list
K
63
5.2 Example of Parsing (cont.)
G
find_production P11
lt
profile
lt
lt

statement_ list
K
64
5.2 Example of Parsing (cont.)
G
lt
profile
lt
lt
module_ algorithm
K
65
5.2 Example of Parsing (cont.)
G
lt
profile
lt
lt
module_ algorithm
K
66
5.2 Example of Parsing (cont.)
G
find_production P08
lt
profile
lt
lt
module_ algorithm
K
67
5.2 Example of Parsing (cont.)
G
lt
profile
lt

explanation_modue_ algorithm
K
68
5.2 Example of Parsing (cont.)
G
lt
profile
lt

explanation_modue_ algorithm
K
69
5.2 Example of Parsing (cont.)
G
find_production P07
lt
profile
lt

explanation_modue_ algorithm
K
70
5.2 Example of Parsing (cont.)
G
lt
profile
lt
module
K
71
5.2 Example of Parsing (cont.)
G
lt
profile
lt
module
K
72
5.2 Example of Parsing (cont.)
G
lt
profile
lt
find_production P05
module
K
73
5.2 Example of Parsing (cont.)
G
lt
profile

module_ list
K
74
5.2 Example of Parsing (cont.)
G
lt
profile

module_ list
K
75
5.2 Example of Parsing (cont.)
G
lt
profile
find_production P03

module_ list
K
76
5.2 Example of Parsing (cont.)
G

profile_module_ list
K
77
5.2 Example of Parsing (cont.)
G

profile_module_ list
K
78
5.2 Example of Parsing (cont.)
G

find_productionP01
profile_module_ list
K
79
5.2 Example of Parsing (cont.)
G
K
80
5.2 Example of Parsing (cont.)
G
K
finish parsing
81
6. Hichart Editor
  • ?Outline?
  • Hichart Editor
  • Supports non-syntax-directed editing
  • has parser
  • Java(10,000steps)
  • ?features?
  • To check the correctness of diagrams
  • To draw Hichart diagrams aesthetically
  • To generate an SVG file

82
6. Hichart Editor (cont.)
  • Input Hichart diagrams
  • Output Hichart code with derivation tree
  • SVG files with aesthetically drawing

83
DEMO
  • Parsing on Hichart Editor
  • Generating SVG file on Hichart Editor

84
7. Conclusion
  • Summary
  • Adapted a precedence relation of graph grammar
    for Hichart/DXL
  • productions 70
  • semantic rules 888
  • precedence relations 256
  • Implemented graphical editor with parser in JAVA

85
7. Conclusion (cont.)
  • Our graph grammar based method would be able to
    apply to other visual programming systems that
    treat tree-like graphs

86
7. Conclusion (cont.)
  • Future work
  • To apply our method of graph grammar to
    Object-Oriented Language
Write a Comment
User Comments (0)
About PowerShow.com