31
1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset G rammars Jiro Tanaka University of Tsukuba [email protected]

1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

Embed Size (px)

DESCRIPTION

3 Visual systems and visual languages Visual systems are systems that process visual languages. Visual languages are two (or more) dimensional languages with have structures. ER-diagrams customergoodsorder No.name numberNo.nameprice Class diagrams text left width height cut select Box select deselect Link name add sheet next sheet save load Drawing Collection cut copy move Selection delete Sheet

Citation preview

Page 1: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

1

From Eviss to Viola:Visual Parser Generators based

on Extended Constraint Multiset Grammars

Jiro TanakaUniversity of [email protected]

Page 2: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

2

Contents

Visual Parsing Visual Parser Generators

EvissViola

Page 3: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

3

Visual systems and visual languages

Visual systems are systems that process visual languages.

Visual languages are two (or more) dimensional languages with have structures.

ER-diagrams

customer goodsorder

No. name number No.name price

Class diagrams

textleftwidthheightcutselect

Box

selectdeselect

Link

nameadd sheetnext sheetsaveload

Drawing

Collection

cutcopymove

Selection

delete

Sheet

Page 4: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

4

Visual parsing: motivation

⇒We would like to implement visual systems with less effort and time.

Page 5: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

5

What is Necessary

2D version of yacc (text -> visual)A visual parser generator such as yacc w

hich generates a parser if rules and actions are given.

Easy visual system builderMake visual systems with less efforts, onl

y by giving their rules.

Page 6: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

6

What is Necessary (2) Generated visual systems keep the semantic

relationships between figure elements, when moved.

3

+

4

3

+

4

3

+

4

3

+

4

Page 7: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

7

Visual Parser Generator:

GrammarExtended CMG (Constraint Multiset Gram

mars)

Page 8: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

8

Extended CMG Extended Constraint Multiset Grammar

CMG is used to describe the relationship between figures using constraints.

Extended CMG is obtained by adding various actions to CMG.

val

textTextvaluemidCirclemidand

midTextmidCirclewheretextmidTextmidCircle

valuemidList

.,...

),(),(::),(

Page 9: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

9

Actions Actions are arbitrary script such as

calculating valuescreating widgetsredrawing the figures in the execution window

alter the attributes of the figures move the figures create new figures delete the figures

Page 10: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

10

3

*

4 5

+

How the ListTree is Parsed1. ListTree consists of a circle with a text string in it. No arrow comes into the node.2. ListTree consists of a circle with a text string in it. There exist two arrows which come into the circle. Each arrow comes from another ListTree.

3

*

4 5

+

Page 11: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

11

Contents

Visual Parsing Visual Parser Generators

EvissViola

Page 12: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

12

Visual Parser Generators

We have implemented a series of visual parser generators based on Extended CMG.

Eviss [1997] is the first one. Implemented in Tcl/Tk

Viola [2004] is the latest one. Implemented in Java

Page 13: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

13

“Eviss” SystemDefinition windowDefinition window Grammars are defined here.

Execution windowExecution windowGenerated systems can be used here.Relationships between figure elements are preserved.

Page 14: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

14

Defining Rules

Rough Rules can bedefined visually.

Eviss translates theminto textual form.

The user modifies- attributes- actions- constraints

Page 15: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

15

Applications

VSH

calc tree stack STD VSH

GUI Builder HIVISUAL VISPATCH

5*

3 4+

Page 16: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

16

Calculation Tree

35

57

*

3 4

+

Calculation Tree

Page 17: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

17

Stack

a

b

c

a

b

c

Page 18: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

18

State Transition Diagram Editor

Page 19: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

19

VSH (Visual Shell)

Page 20: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

20

GUI Builder

Page 21: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

21

HIVISUAL

[I. Yoshimoto, 1986]

Page 22: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

22

VISPATCH [Harada,1997]

Page 23: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

23

More Application

Recursive Drawing of a Comic Character

Page 24: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

24

Problems with Eviss

Needed to define Extended CMG rules textually.

Difficult to the end users.

Page 25: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

25

Features of Viola

The user can define the rules by direct manipulation, without describing rules in text.

Implemented in Java (J2SE v1.4.1) As a constraint solver, Chorus [Hosobe 20

01] is used.

Page 26: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

26

Features of Viola (2) No distinction between the definition

window and the execution window. We can define the rules and execute the visual system dynamically.

Page 27: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

27

Demo: Network Structure Diagram

Page 28: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

28

Summary

Visual Parser Generators based on Extended CMG are described.

They generate the spatial parsers, if the rules for the visual languages are given.The grammars are based on the extended

CMG. In Viola, the user can define rules and execute

them dynamically.

Page 29: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

29

Future direction: Meta-GUI Write meta-interpreter of Viola in Viola

cf. Vispatch

Page 30: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

30

Free Software Packages EVISS is available from

http://www.iplab.cs.tsukuba.ac.jp/

More Info:[email protected]

Page 31: 1 From Eviss to Viola: Visual Parser Generators based on Extended Constraint Multiset Grammars Jiro…

31

From Eviss to Viola:Visual Parser Generators based

on Extended Constraint Multiset Grammars

Jiro TanakaUniversity of [email protected]