1-d languagesmulti-d languagehp visualisationsstructure templatesrecord declarationseasy-draw...

28
1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

Upload: hubert-warren

Post on 13-Dec-2015

214 views

Category:

Documents


1 download

TRANSCRIPT

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

Programming in Several DimensionsProgramming in Several Dimensions

Paul Lyons

Massey University

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

Textual Languages are One-Textual Languages are One-dimensionaldimensional

Computers are sequential.

Input devices

Output devices

Memory addresses

Accumulator

Buses

Parsers

Flow of controlSequential syntax

Tree-structured semantics

DeclarationsTree-structured

Inverted w.r.t. procedures

I/OAsynchronous

How about programs?

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

Computers Support Multi-Computers Support Multi-dimensionalitydimensionality

Power

Easy 2-D input

High-res 2-D and 3-D graphic output

Multiple window support

Synchronous updating

Hyperlinks

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

A Multi-dimensional LanguageA Multi-dimensional Language

Desiderata

Multiple viewsNon-sequential access

Easy editingEfficient space use

High-level

Mid-levelControl relationships

Text where appropriateGraphics where appropriate

Low-levelGroup related concepts

Purge brackets

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

HyperPascalHyperPascal

VisualisationsAction Tree Scope Treehyperlinks

Subprog

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

HyperPascalHyperPascal

VisualisationsAction Tree Scope Treehyperlinks

Subprog

main progsubprog2subprog3

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

HyperPascalHyperPascal

VisualisationsScope Treehyperlinks

Subprog

Action Treemain progsubprog2subprog3

in1 realin2 real

out1 out2 out3

stringstringboolean

Subprog

var1var2

stringinteger

Action Tree

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

HyperPascalHyperPascal

VisualisationsScope Treehyperlinks

Subprog

Action Tree

A<3

average

sum/9X+7 B

names“John”

“, ”& &

“Jenna”

Main prog

subprog1

subprog3 subprog3

subprog1

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

HyperPascalHyperPascal

Structure Template VisualisationPictorial notationDot-and-caret notation

new(newNode);newNode^.data := x;if L = nil then begin L := newNode^.next := L; newNode; endelse begin parent := nil; thisNode := L; status := running; while status = running do begin if (thisNode^.data > x) or (thisNode = nil)_then begin newNode^.next := thisNode; if parent = nil then L := newNode else parent^.next := newNode; status = finished; end {then clause} else begin parent := thisNode; thisNode := thisNode^.next; end {if}; end;

end;

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

new(newNode);newNode^.data := x;if L = nil then begin L := newNode^.next := L; newNode; endelse begin parent := nil; thisNode := L; status := running; while status = running do begin if (thisNode^.data > x) or (thisNode = nil)_then begin newNode^.next := thisNode; if parent = nil then L := newNode else parent^.next := newNode; status = finished; end {then clause} else begin parent := thisNode; thisNode := thisNode^.next; end {if}; end;

end;

HyperPascalHyperPascal

Structure Template VisualisationPictorial notationDot-and-caret notation

new(newNode);newNode^.data := x;if L = nil then begin newNode^.next := L; L := newNode; endelse begin {L isn’t nil} parent := nil; thisNode := L; status := running; while status = running do begin if (thisNode^.data > x) or (thisNode = nil)_then begin newNode^.next := thisNode; if parent = nil then L := newNode else parent^.next := newNode; status = finished; end {then clause} else begin {the node goes somewhere else} parent := thisNode; thisNode := thisNode^.next; end {if}; end;end;

thisNode := L;parent := nil;

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

new(newNode);newNode^.data := x;if L = nil then begin newNode^.next := L; L := newNode; endelse begin {L isn’t nil} parent := nil; thisNode := L; status := running; while status = running do begin if (thisNode^.data > x) or (thisNode = nil)_then begin newNode^.next := thisNode; if parent = nil then L := newNode else parent^.next := newNode; status = finished; end {then clause} else begin {the node goes somewhere else} parent := thisNode; thisNode := thisNode^.next; end {if}; end;end;

parent := thisNode; thisNode := thisNode^.next;

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

Ltop

Ltop

HyperPascalHyperPascal

Structure Template VisualisationPictorial notationDot-and-caret notation

new(newNode);newNode^.data := x;if L = nil then begin L := newNode^.next := L; newNode; endelse begin parent := nil; thisNode := L; status := running; while status = running do begin if (thisNode^.data > x) or (thisNode = nil) then begin newNode^.next := thisNode; if parent = nil then L := newNode else parent^.next := newNode; status = finished; end {then clause} else begin parent := thisNode; thisNode := thisNode^.next; end {if}; end;

end;

>x

L L

x

L

x

top top

L

top top

<=x

L

toptop

<=x

L

top toptopL

x

>x

L

top top

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

HyperPascalHyperPascal

Pictorial declarations

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

HyperPascalHyperPascal

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

LL

HyperPascalHyperPascal

Easy-to-draw pictures

LL

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

HyperPascalHyperPascal

Easy-to-draw pictures

LL

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

HyperPascalHyperPascal

Easy-to-draw pictures

LL

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

HyperPascalHyperPascal

Easy-to-draw pictures

LL

>x

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

HyperPascalHyperPascal

Easy-to-draw pictures

LL

>x

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

HyperPascalHyperPascal

Easy-to-draw pictures

LL

>x

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

HyperPascalHyperPascal

Easy-to-draw pictures

LL

>x

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

HyperPascalHyperPascal

Easy-to-draw pictures

LL

>x

x

toptop

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

Ltop

Ltoptoptop

HyperPascalHyperPascal

Easy-to-draw pictures

L

x

>x

L

top topif thisNode <> nil then

if thisNode^.data > x then {generate after-picture1}

top

<=x

L

toptop

<=x

L

top

else {thisNode <> nil and thisNode^.data <=x}

{generate after-picture 2}else {thisNode = nil}

L

x

toptop

L

top

{generate after-picture 3}

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

HyperPascalHyperPascal

Three-layer architectureConcrete

(distorted) view

abstract (undistorted)

view

Semantic (parse tree)

view

Concrete (distorted)

view

Concrete (distorted)

view

Draw commands User actions

Object association informationRedraw messages

(undistorted coordinates) (undistorted coordinates)

(coordinate-free)(coordinate-free)

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

HyperPascalHyperPascal

FIN

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

names

“John”

“Jenna”

“, ”&

&

1-D languages Multi-D language HP Visualisations Structure Templates Record declarations Easy-draw pics Active templates 3-layer architecture

L

x

top

HyperPascalHyperPascal

top

L

top

if L <> nil then

if L^.data > x then {generate after-picture1}

else {L^.data <=x} {generate after-picture 2}

if L <> nil then

if L^.data > x then {generate after-picture1}

else {L^.data <=x} {generate after-picture 2}

else {L = nil}

if thisNode <> nil then

if thisNode^.data > x then {generate after-picture1}

else {thisNode^.data <=x} {generate after-picture 2}

else {thisNode = nil} {generate after-picture 3}

Easy-to-draw pictures