AUTOMATIC GENERATION OF VISUAL PROGRAMMING ENVIRONMENTS A workflow Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009.

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Introduction to XHTML Programming the World Wide Web Fourth edition.
Advertisements

Feichter_DPG-SYKL03_Bild-01. Feichter_DPG-SYKL03_Bild-02.
1 Vorlesung Informatik 2 Algorithmen und Datenstrukturen (Parallel Algorithms) Robin Pomplun.
1 Copyright © 2002 Pearson Education, Inc.. 2 Chapter 2 Getting Started.
Chapter 7 System Models.
Chapter 7 Constructors and Other Tools. Copyright © 2006 Pearson Addison-Wesley. All rights reserved. 7-2 Learning Objectives Constructors Definitions.
© 2008 Pearson Addison Wesley. All rights reserved Chapter Seven Costs.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Copyright © 2003 Pearson Education, Inc. Slide 1.
Chapter 1 The Study of Body Function Image PowerPoint
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 1 Embedded Computing.
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 3 CPUs.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
UNITED NATIONS Shipment Details Report – January 2006.
8 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: JavaServer Pages.
10 Copyright © 2005, Oracle. All rights reserved. Reusing Code with Inheritance and Polymorphism.
1 RA I Sub-Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Casablanca, Morocco, 20 – 22 December 2005 Status of observing programmes in RA I.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Exit a Customer Chapter 8. Exit a Customer 8-2 Objectives Perform exit summary process consisting of the following steps: Review service records Close.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Year 6 mental test 5 second questions
Year 6 mental test 10 second questions
Programming Language Concepts
Excel Functions. Part 1. Introduction 2 An Excel function is a formula or a procedure that is performed in the Visual Basic environment, outside the.
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
Intel VTune Yukai Hong Department of Mathematics National Taiwan University July 24, 2008.
NI LabVIEW Object-Oriented Programming
ABC Technology Project
Semantic Analysis and Symbol Tables
Microsoft Access.
Universidade do Minho, Departamento de Informática Nuno Oliveira, 2008.
2 |SharePoint Saturday New York City
VOORBLAD.
Name Convolutional codes Tomashevich Victor. Name- 2 - Introduction Convolutional codes map information to code bits sequentially by convolving a sequence.
1 RA III - Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Buenos Aires, Argentina, 25 – 27 October 2006 Status of observing programmes in RA.
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
8 VM code generation Aspects of code generation Address allocation
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
© 2012 National Heart Foundation of Australia. Slide 2.
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
Macromedia Dreamweaver MX 2004 – Design Professional Dreamweaver GETTING STARTED WITH.
25 seconds left…...
H to shape fully developed personality to shape fully developed personality for successful application in life for successful.
Januar MDMDFSSMDMDFSSS
Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do.
Chapter 10: The Traditional Approach to Design
Analyzing Genes and Genomes
Systems Analysis and Design in a Changing World, Fifth Edition
Lilian Blot CORE ELEMENTS SELECTION & FUNCTIONS Lecture 3 Autumn 2014 TPOP 1.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Essential Cell Biology
Intracellular Compartments and Transport
PSSA Preparation.
Essential Cell Biology
Energy Generation in Mitochondria and Chlorplasts
From Model-based to Model-driven Design of User Interfaces.
1 Programming Languages (CS 550) Mini Language Interpreter Jeremy R. Johnson.
VisualLISA A Quick and Simple Demonstration. The default aspect of an attribute grammar specification on VisualLISA. In this view we can add a new production.
Author Context Institution Presentation. The Problem Conception of a Visual Language; Development of a Processor for the Language; Idealization of the.
Presentation transcript:

AUTOMATIC GENERATION OF VISUAL PROGRAMMING ENVIRONMENTS A workflow Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009

Context Textual Programming Languages: Require fine knowledge about their syntax; Small errors can make programming activity boring; Comprehension is very hard. Visual Programming Languages: Are intended to have a much simpler syntax, easier to recall and understand; Comprehesion should be easier; Require a sophisticated programming Env. 2 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009

Context Visual Programming Environments Usually are developed from scratch, without systematization ; Code written for their development is (most of the times) hard to maintain/evolve; But the environments are efficient and support large scale specifications. 3 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009

MOTIVATION Systematize the development of Visual Programming Environments, using Generators based on the Attribute Grammar of the underlying Visual Language. (work developed as a 2nd year MSc project (UCE-15)) 4 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009

OUTLINE The Generator Chosen: DEViL (an overview) The Case-Study: VisualLISA VPE Development: Workflow Attribute Grammar Specification Interaction Definition Semantic Analyzer Implementation Code Generation Generated Environment Conclusion 5 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009

DEViL OVERVIEW Visual Programming Environment generator ; AG-based; The AG spec is modular and symbol-oriented rather then production-oriented; Generates a simple and intuitive interface. 6 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009

DEViL – DEVELOPMENT ENVIRONMENT FOR VISUAL LANGUAGES Complex Installation; Disperse documen- tation and written in German; Generated Editor is only compatible with the SO where it was developed; Very good support; Many examples, addressing several DEViL features; Exists for MacOS, Windows and Linux; Allows programmers to extend capabilities. ConsPros 7 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009

Is a graphical front-end for LISA (an AG-based compiler generator). Used to visually edit LISA specifications: AGs; Aims at reducing mental effort when specifying AGs. 8 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009 Case-Study: VisualLISA

Should verify syntactical and semantically the visual specification of the AG; Should translate the same specification into one of: Simple BNF notation; Textual LISA specification; An XML notation designed to support AG specifications; 9 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009 VisualLISA – The Environment

VisualLISA – The Visual Language Language should be production-oriented and incremental; LHS symbols shape should be highlighted; Connection between LHS and RHS symbols should exist; Attributes should connect to LHS and RHS symbols; 10 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009

VisualLISA – The Visual Language (2) Semantic rules should be declared: over derivation rules (productions); separated from each others; reusing the productions structure; Functions, Lexemes and other base definitions should be allowed; The VL must hold all the generic AGs semantic constraints. 11 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009

12 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009

WORKFLOW 13 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009 Attribute Grammar Specification

ATTRIBUTE GRAMMAR Modular definition of symbols; Object Oriented Approach: Grammar symbols can be seen as classes; Symbol attributes can be seen as class attributes. Syntax is defined by relations between the classes; 14 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009

15 CLASS Root { name: VAL VLString; semprods: SUB Semprod*; definitions: SUB Definitions!; library: SUB Library?; } CLASS Root { name: VAL VLString; semprods: SUB Semprod*; definitions: SUB Definitions!; library: SUB Library?; }

ATTRIBUTE GRAMMAR Abstract classes are used to group symbols and refine syntactic aspects; Coupling of grammar symbols used to replicate structures. 16 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009

WORKFLOW 17 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009 Interaction Definition ButtonsSymbols L&F Attribute Grammar Specification

INTERACTION DEFINITION Development of several files where: Views of the VL are defined; Dock Buttons are created; L&F of buttons is declared (p.e. using images); The behavior of a button is defined; Tooltips can be added; Events can be programmed to add extra behavior to the buttons actions. 18 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009

19 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009 VIEW rootView ROOT Root { BUTTON IMAGE "img::btnSemprod" INSERTS Semprod INFO "Inserts a new Grammar Production"; } VIEW rootView ROOT Root { BUTTON IMAGE "img::btnSemprod" INSERTS Semprod INFO "Inserts a new Grammar Production"; } INTERACTION DEFINITION A VIEW DECLARATION

INTERACTION DEFINITION Definition of canvas L&F: Visual Patterns are associated to tree-grammar symbols to define their basic appearence; Computations are declared to implement the VPs; Icons are associated to symbols (SYNT.drawing) ; Semantic rules can be declare to assign values to the attributes of the symbols. 20 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009

INTERACTION DEFINITION A VIEW SYNTHESIS 21 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009 SYMBOL rootView_Root INHERITS VPRootElement, VPForm COMPUTE SYNT.drawing = ADDROF(rootViewDrawing); END; SYMBOL rootView_Root_semprods INHERITS VPFormElement, VPSimpleList COMPUTE SYNT.formElementName = "productions"; END; SYMBOL rootView_Root INHERITS VPRootElement, VPForm COMPUTE SYNT.drawing = ADDROF(rootViewDrawing); END; SYMBOL rootView_Root_semprods INHERITS VPFormElement, VPSimpleList COMPUTE SYNT.formElementName = "productions"; END;

WORKFLOW 22 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009 Semantic Analyzer Implementation Interaction Definition ButtonsSymbols L&F Attribute Grammar Specification

SEMANTIC ANALYZER IMPLEMENTATION DEViL offers tree-walker (function) named addCheck; Tree-walker executes in a given context; A tree-context is a symbol or attribute in the tree-grammar; Id-Tables, Lists, etc. can be implemented with ease; 23 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009

SEMANTIC ANALYZER IMPLEMENTATION 24 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009 Contextual Condition: A production must have one and only one root symbol checkutil::addCheck Semprod { set n [llength [c::getList {$obj.grammarElements.CHILDREN[LeftSymbol]}]] set symbName [c::get {$obj.name.VALUE}] if { $n == 0 } { eturn "Production '$symbName' must have one Root symbol! } elseif {$n > 1} { return "Production '$symbName' must have only one Root symbol! } return } checkutil::addCheck Semprod { set n [llength [c::getList {$obj.grammarElements.CHILDREN[LeftSymbol]}]] set symbName [c::get {$obj.name.VALUE}] if { $n == 0 } { eturn "Production '$symbName' must have one Root symbol! } elseif {$n > 1} { return "Production '$symbName' must have only one Root symbol! } return }

WORKFLOW 25 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009 Code Generation Semantic Analyzer Implementation Interaction Definition ButtonsSymbols L&F Attribute Grammar Specification

CODE GENERATION 26 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009 Templates for structuring the output are used ( IPTG/PTG Files ); Typical AG approach: Attributes can be associated to symbols of the tree- grammar; Semantic rules are declared to compute value for these attributes; Attributes can be referenced outside the context of the symbol; Auxiliary functions can be defined to aid the computations;

27 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009 bnfProd(lhs, rhs): [lhs] -> [rhs] bnfProd(lhs, rhs): [lhs] -> [rhs] SYMBOL bnfgen_Semprod: bnfLHS : PTGNode; SYMBOL bnfgen_Semprod: bnfRHS : PTGNode; SYMBOL bnfgen_Semprod: bnfCode : PTGNode; SYMBOL bnfgen_Semprod COMPUTE SYNT.bnfLHS = CONSTITUENTS bnfgen_LeftSymbol.pers_symbolName WITH(PTGNode, PTGNewLineSeq, PTGAsIs, PTGNull); SYNT.bnfRHS = PTGAsIs(VLString(SELECT(vlList( "printBNFOrderedRHSElements",THIS.objId),eval()))); SYNT.bnfCode = PTGbnfProd(THIS.bnfLHS, THIS.bnfRHS); END; SYMBOL bnfgen_Semprod: bnfLHS : PTGNode; SYMBOL bnfgen_Semprod: bnfRHS : PTGNode; SYMBOL bnfgen_Semprod: bnfCode : PTGNode; SYMBOL bnfgen_Semprod COMPUTE SYNT.bnfLHS = CONSTITUENTS bnfgen_LeftSymbol.pers_symbolName WITH(PTGNode, PTGNewLineSeq, PTGAsIs, PTGNull); SYNT.bnfRHS = PTGAsIs(VLString(SELECT(vlList( "printBNFOrderedRHSElements",THIS.objId),eval()))); SYNT.bnfCode = PTGbnfProd(THIS.bnfLHS, THIS.bnfRHS); END;

28

29

FILE REPRESENTATION OF THE WORKFLOW 30

31 Viag.XMODEL View.MODEL Code.HEAD Code.SPECS images.GDR Aux.TCL Code.LIDO Code.IPTG Code.MODEL View.LIDO Buttons.PNG Viag.DEFS Semantics.TCL Symbols.GIF Sync.TCL Edit.TCL Template.RES

THE GENERATED ENVIRONMENT 32

THE GENERATED ENVIRONMENT 33

34 Universidade do Minho, Departamento de Informática Nuno Oliveira, 2009 CONCLUSIONS Systematization is achieved using generators; Separation of concerns (with DEViL): Syntax; Interaction; Semantics; Code Generation; Less code produced; Ease on maintaining or evolving the code;

VisualLISA 35