EclipseCon 2010 Bernhard Merkle Textualmodelingtools penalty

Post on 11-May-2015

2.184 views 0 download

Tags:

description

EclipseCon2010 Textual Modeling Tools

Transcript of EclipseCon 2010 Bernhard Merkle Textualmodelingtools penalty

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 1

Bernhard Merkle

Research & Development

Software-Engineering

SICK-AG Waldkirch/DE

mailto: Bernhard.Merkle@gmail.com

contact on linkedin.com or xing.com

Textual Modeling Tools

overview &

penalty shoot-out

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 3

SICK

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 4

Traffic and Luggage Control

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 5

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 6

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 7

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 8

Traffic and Luggage Control

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 9

Traffic and Luggage Control

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 10

DARPA: Urban/Grand Challenge

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 11

Google Street View

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 12

Catchy title ☺☺☺☺

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 13

Outline of talk:

– DSL overview and classification

• textual, graphical, tabular, external, internal

• a real world DSL

• classification/feature model

– Language Workbenches

• Xtext, TEF, TCS, EMFText

• Others: Monticore, Codeworker, IMP

• MPS

• Others: DSL2JDT, ETMOP, CAL

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 14

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 15

Textual DSL

SELECT firstname, lastName from employeewhere age = 42;

([+-]?[0-9]*) | ([A-Z][a-z]+)

public Collection<Student> findByNameAge (String name, int age, {

return em.createNamedQuery("Student.findByNameAge") .setParameter("name", name) .setParameter("age", age).setFirstResult(1) .setMaxResults(30) .setHint("hintName", "hintValue") .getResultList();

}

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 16

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 17

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 18

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 19

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 21

DSL: Chess

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 22

DSL: Chess P e2 – e4

p g7 – g5

Knight at b2 moves to c3

pawn at f7 moves to f5

Q d1 – h5

# 1-0

Concrete Syntax

Constraints !!!

Abstract Syntax

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 25

DSL Language

classification

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 26

Feature model for DSL

DSL

Language Transformation Tool Process

Mandatory Feature

Optional Feature

Alternative Features

Inclusive-or Features

Notation (FODA)

[1] Langlois 2007

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 27

Language Features

Abstract Syntax

ASG AST Dependency

Metamodel Composition

Language

Concrete Syntax

Text Graphic

AS2CS Style

Wizard Table SpecificRepresentation

Imperative DeclarativeRepresentation

DSL

Language Transformation Tool Process

[1] Langlois 2007

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 28

Criteria…

Language (abstract and concrete syntax)

– LA-AS1. abstract syntax tree or abstract syntax graph

– LA-AS2. grammar or meta-model

– LA-AS3. can be composed

– LA-CS1. technique to map abstract syntax to concrete syntax

– LA-CS2. representation (text, graphic, ...) for concrete syntax

– LA-CS3. declarative or imperative style

[2] Pichler

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 29

Transformation: Target AssetDSL

Language Transformation Tool Process

Specification Target Asset OperationalTransformation

Target Asset

Representation

Model Text Graphic Binary SpecificRepresentation

Asset Update AssetIntegration

Destructive Incremental

Asset Lifecycle

Software Artifact, result of the transformation

Assembling and Packaging

Target Assets

Destroyed & created at each

generation

Synchronization source/target

[1] Langlois 2007

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 30

Transformation: Operational Trafo

Specification

DSL

Language Transformation Tool Process

Target Asset OperationalTransformation

External

OperationalTransformation

Environment

Internal

TransformationExecution

Mode

Compilation Interpretation

Form

Implicit Explicit

TransformationScheduling

Phasing

Location

Internal External

Automation Level

Manual Automated

Ordering Transformation

TransformationTechnique

M2M M2T T2T T2M

Model/TextTechnique

Techniques realizing the

AS2TA transformation

Variability

Stage Technique

Specification,Generation /

interpretation, Compilation, Integration,

Deployment, Execution

[1] Langlois 2007

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 31

Criteria…

Transformation (target asset/operational translation)

– TR-TA1. target asset (model, text, graphic, binary)

– TR-TA2. destructive or incremental update

– TR-TA3. kind of support for integration of target assets

– TR-OT1. transformation techniques (M→M, M→T, T→T, T→M)

– TR-OT2. transformation by compilation or interpretation

– TR-OT3. internal or external environment for transformation

– TR-OT4. implicit or explicit scheduling

– TR-OT5. internal or external location

– TR-OT6. automation level (manual or automated)

[2] Pichler

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 32

Tool FeaturesDSL

Language Transformation Tool Process

DSL Tool

Respect of Abstraction

Intrusivetransformation

Seamlesstransformation

Quality Factor

Functionality

Usability

Reliability

Efficiency

Maintainability

Portability

Assistance

Process Guidance

Step Workflow

Adaptive Checking

Completeness Consistency

Static

User has to be aware of internal transformation mechanisms & details

or/and solution

Transformation and solutions mechanisms &

details are completely encapsulated

Guiding the DSL Tool user during definition and

transformation of domain data

Non-Functional aspects of the DSL Tool

[1] Langlois 2007

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 33

Criteria…

Tool (respect of abstraction, assistance)

– TO-RA1. respect of abstraction (intrusive or seamless)

– TO-AS1. kind of assistance (static or adaptive)

– TO-AS2. process guidance (step or workflow)

– TO-AS3. checking (completeness or consistency)

Omitted

– Quality factors

– Process features

[2] Pichler

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 34

Language

Workbench

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 35

DSL Tools with textual modeling

Xtext

TEF (Textual Editing Framework)

TCS (Textual Concrete Syntax)

EMFText

JetBrains MPS

MontiCore, CodeWorker, IMP

DSL2JDT, ETMOP, CAL

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 36

DSL Tools with textual modeling

TMF Xtext (predessor oAW Xtext)

– http://xtext.org

– http://wiki.eclipse.org/TMF

TEF Textual Editing Framework

– http://www2.informatik.hu-berlin.de/sam/meta-tools/tef

– http://developer.berlios.de/projects/tef/

TCS Textual Concrete Syntax

– http://wiki.eclipse.org/index.php/TCS

– http://www.sciences.univ-nantes.fr/lina/atl/www/

EMFText

– http://emftext.org

– http://st.inf.tu-dresden.de/reuseware/index.php/EMFText

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 37

DSL Tools with textual modeling

JetBrains MPS

– http://www.jetbrains.com/mps

– Konstantin Solomatov

MontiCore

– http://www.monticore.de

– RWTH Aachen, Academic

CodeWorker

– http://www.codeworker.org/

– Cédric Lemaire

IMP

– http://eclipse-imp.sourceforge.net/

– Robert M. Fuhrer

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 38

White: “Mayfield”

Black: “Trinks”

P e2 – e4

p g7 – g5

Knight at b2 moves to c3

pawn at f7 moves to f5

Q d1 – h5

# 1-0

Chess for…

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 39

Xtext

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 40

Catchy title ☺☺☺☺

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 42

Xtext: Chess Language

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 43

Xtext + Demo

– TMF/Xtext precusor (oAW/Xtext)

– Itemis, 6 fulltime committers

– AS+CS in xtext file � ecore

– Import existing MM, (multiple)

– Used for buckminster, b3, …

– Editor for each language is MM aware

– Languages for

• Validation (java, chk)

• Template (xPand) (JET, Accello)

• Workflow (mwe)

– Generated Editor fully customizable

Grammar+Model

Xtext Grammarchess.xtext

MWE WorkflowGenerateChess.mwe

ASGchess.ecore

ANTRL gen Scanner+Parser

CSchess.xmi

Run workflow

Editor

Workflow generated:

Outline, contentassistLabeling, Extensions,

etc

Developer modifiable:

Outline, contentassistLabeling, Extensions,

etc

Generator

Workflow ChessGenerator.mwe

xPand TemplatesTemplate.xpt

Extensions.ext

Formatting, Scoping, validation

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 44

Xtext: Chess Editor + Demo

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 45

Xtext

– Several eclipse projects based on Xtext

• B3, buckminster, …

– Tons of useful features

• Language: Validation + Scoping

• Editor: Formatting, Syntax highlighting, Code completion,

Navigation, Reference, Decorators, Folding, Bracket maching,

Auto editing, Styled Label Providers, Find References, Open Xtext

Element, Error Tick, Quickfix support, Case-insensitive keywords

Duplicate name validation, Content Assist in Grammar (great !),

Splitting ANTLR generated parser, API adoptions to EMF style,

referencing java elements, etc…

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 46

Xtext

Technical properties

– Currently one of the leading Eclipse TMF

Documentation

– Newsgroup, mailing list

– Screencasts, Tutorials,

– Book forthcoming ?

Status

– Actively developed by itemis

– Commercial training and support available

– NO language Zoo (yet ;-)

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 47

TEF

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 49

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 52

TEF: Chess Language

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 53

TEF + Demo

– Humboldt University Berlin

– PhD. of Markus Scheidgen

– Low activity ATM

– AS in ecore, CS in etslt

– Import existing MM

– EMF Impl+Edit+Editor

– 3 extension points

– EMF VF

Grammar+Model

TEF Grammarchess.etslt

ASGChess.ecore

EMFChess ImplChess Edit

Chess Editor

RunCCScanner+Parser

(interpret RUNTIME)

EMF/genmodel

Editor

Extension Points:

Text Editor

Model EditorPopup Editor (embedded)

Generator

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 54

TEF: Chess Editor + (Text + Model)

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 55

TEF

Highlight (personal)

– The first with converging editors (graphical+textual)

– RunCC, parser generator at runtime

– 3 editors: textual, modelbased+embedded

Specification features

– syntax defintion language TSL

Editor:

– Syntax highlighting

– Context sensitive code assists

– Occurrences and navigation

– Context information

– Error annotation

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 56

TCS

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 57

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 60

TCS: Chess Language (AS)

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 61

TCS: Chess Language (CS)

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 62

TCS

– Univ. Nantes

– ATLAS project

– AS in km3, CS in tcs

– Import existing MM

– No EMF Impl+Edit+Editor

– Interpret as much aspossible, avoid CG

– Used in ATL2

Grammar+Model

TCS Grammarchess.tcs

ASGChess.km3

ASGChess.ecore

ANTLR Scanner+Parser

chess.g

“on save…”

Editor

Generic Editor TGE

Generator

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 63

TCS: Chess Editor + Demo

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 64

TCS

Highlight (personal)

– Avoid code generation if possible

– Very flexible, short turnaround as avoids codegen

– Abstract Syntax also textual (KM3)

Specification features

– KM3, TCS

– ATL is based on TCS

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 65

TCS

Documentation

– TCS User Manual

– Lots of papers (but no getting started)

Status

– Large Language Zoo (About 30)

– http://wiki.eclipse.org/TCS/Zoo

– Tool is selfhosting

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 66

EMFtext

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 67

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 69

EMFText: Chess Language (AS)

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 70

EMFText: Chess Language (CS)

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 71

EMFText

– Univ. Dresden

– reuse.org project

– AS in ecore3, CS in cs

– Import multiple existing AS

– Import multiple existing CS

– EMF Impl+Edit+Editor

– Valiation

Grammar+Model

EMFText Grammarchess.cs

ASGChess.ecore

ANTLR Scanner+Parser

chess.g

ANT, partially automated in cs

Editor

Generated Editor:Resolver,Analysis,MOPP,UI, Util

Generator

Developer can overwrite

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 72

EMFText: Chess Editor + Demo

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 73

EMFText

Highlight (personal)

– Generated code does not contain dependencies to EMFText

Specification features

– Automatic generation of default syntaxes

– Modular specification

(Support for abstract syntaxes and syntax imports)

– Default reference resolving mechanisms

– Comprehensive syntax analysis

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 74

EMFTextEditors:

– Outline View

– Customizable Syntax Highlighting

– Occurence Highlighting

– Code Completion

– Advanced bracket handling

– Hyperlinks

– Texthovers

– Instant error reporting

Documentation

– Mailing list

– Documentation, tutorials

Status

– Actively developed by Univ. Dresden

– Large language Zoo (about 50 syntax)

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 75

MPS

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 77

MPS

– “Language Oriented Programming”

– AS: specified by concepts

– CS: specified by editor

– No parsing problem: cell based editing

– Base Languages for Java, C#

– mpscmindstorms for NXT

– YouTrack (+other IntelliJ products)

Grammar+Model

CS“Editor”

AST“Structure”

Editor

Generated Editor:used in “solution”

Generator

Constraint,Typesystem

Etc.

Generated Generator:used in “solution”

CTRL-F9

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 78

MPS: Chess Editor + Demo

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 79

MPS

Tool:

– Cell based editor on AST, no parser errors ☺

– Higher learning curve, but once used to amazingly fast

Documentation

– Newsgroup

– Documentation, tutorials

Status

– Actively developed Jetbrains

– Future Jetbrains products based on, new Bugtracker

(YouTrack) based on

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 80

Others…

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 81

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 82

Additional: DSL2JDT

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 83

Additional: DSL2JDT

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 84

Additional: ETMOP

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 85

Additional: CAL

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 86

Compare…

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 87

Catchy title ☺☺☺☺

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 88

Language: AS/CS

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 89

Transformation: TA / OT

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 90

Additional Aspects…

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 91

(Generated) Language Editor

Note: additional features on roadmap ;-)

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 92

Open

Fast turnaround

Editor++

Combine views

(text/graph)

Workflow

Validation ! (EVF, OCL)

Proprietary but powerful

Debugging Interpreter is…

Large models

Distributed models

UUID vs. Names

Evolution

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 93

Catchy title ☺☺☺☺

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 98

Pictures under CC license from flickr:

1191285966_d701fcb1c3_b_flickr_bluemeat.jpg

3425532267_bd74526b23_b_flickr_tiwo.jpg

1813471845_5a4be999dc_o_flickr_thatcanadiangrrl.jpg

2401122677_c25dea1233_b_flickr_EnglishGirlAbroad.jpg

501709581_f3729ceaeb_b_flickr.jpg

and pictures from istockphoto.com

Bernhard Merkle Eclipse Textual Modeling Tools: Page: 99

Textual Modeling Tools

overview &

penalty shoot-out

Bernhard Merkle

Research & Development

Software-Engineering

SICK-AG Waldkirch/DE

mailto: Bernhard.Merkle@gmail.com

contact on linkedin.com or xing.com