Xtext + Sirius = ? / EclipseCon Europe 2014Cédric Brun
?
The document discusses the integration of Xtext and Sirius, two frameworks that allow rapid development of domain-specific editors, with both textual and graphical capabilities. It highlights the advantages and caveats of each, emphasizing the importance of serialization, reference consistency, and user feedback in managing models and their representations. The document concludes with insights on upcoming features and improvements in Sirius 2.0 and invites involvement from the community.
Xtext Grammar Language describes how to define grammars for the Xtext language development framework. Key points include:
- Grammars define the structure and elements of a language through rules like Statemachine, Event, and Transition.
- Terminals split text into tokens while hidden terminals are ignored by the parser. Datatype rules return values instead of objects.
- The parser creates EObjects when rules assign to the current pointer. Actions ensure object creation when no assignment occurs.
- Issues like ambiguities, left recursion, and left factoring can be resolved through techniques like keywords, predicates, and assigned actions.
- The grammar maps language structures to Ecore classes and features through rule return types
Recipes to build Code Generators for Non-Xtext Models with XtendKarsten Thoms
?
This document discusses code generators for non-Xtext models using Xtend. It provides an overview of creating minimal generators using JSON and Xtend templates, and more full-featured generators using the Xtext framework and EMF models. Key aspects covered include model navigation in Xtend templates, extensions, dynamic dispatch, IDE support, modularization, dependency injection, and incremental generation.
The document discusses the Eclipse Modeling Framework (EMF). It describes how EMF can be used to create Ecore models from Java, XML Schema, UML, or MOF. EMF provides a runtime library to process Ecore models and instances. It also allows generating Java code from Ecore models. The document provides examples of Ecore metamodels and model instances, and explains concepts like proxies, lazy loading, fragments, transactions and global singletons in EMF.
This document provides tips and best practices for using the Eclipse Modeling Framework (EMF). It discusses designing a model provider API, using item providers, working with the common command framework, reloading working models, finding EMF references, why notifications are called adapters, resource proxies, on-demand loading, useful commands, the role of the editing domain, optimizing Ecore models, defining custom data types, maintaining in-memory lists, creating unique lists, suppressing object creation, controlling command appearance, using custom adapter factories, refreshing viewers and selections, using item providers for labels and content, registering custom resource factories, encrypting/decrypting streams, querying XML data using EMF, serializing QNames, loading resources
This document introduces Xtend, a programming language created for Java developers. Xtend aims to improve on Java by incorporating features from other JVM languages while maintaining 100% Java interoperability. Key features include Java's type system and libraries, IDE support, functional programming capabilities, extension methods, and exceptional domain-specific language support through the use of active annotations that can participate in compilation and enhance derived Java code. The document concludes with a thank you and information about the creators of Xtend.
FXDiagram is a diagramming framework based on Eclipse Graphiti that focuses on user experience by providing flawless graphics, smooth behavior, self-explaining interactions, and easy content selection with good defaults and little customization. It integrates with Xtext and adds a thin diagram layer on top with a high-level mapping API to enable bi-directional mapping between diagrams and models without the quirks of other frameworks.
Das Dokument beschreibt die Installation und Nutzung der Xtext-Entwicklungsumgebung für die Erstellung dom?nenspezifischer Sprachen (DSLs) in Java. Es enth?lt Anleitungen zur Erstellung einer DSL, zur Integration in Java-Anwendungen und zur Verwendung von Xtend zur Verknüpfung von DSLs mit Java. Zudem wird auf Best Practices und unterschiedliche Pr?sentationen von Fachleuten eingegangen.
The document discusses serializing EMF models with Xtext. It covers:
- The new Xtext serializer is better than the old one in terms of errors, performance and deprecation.
- Serialization is used for quickfixes, refactoring, persistence, generators and more. It guarantees syntactical correctness and handles comments/whitespace.
- The serializer must parse a serialized model back to the original, and serialize modifications with minimal textual diffs. Ambiguities can cause parsing/serialization mismatches.
- The architecture uses state machines and observer pattern. Hooks allow customizing cross-references, keywords, values and more during serialization.
Jazoon 2010 - Building DSLs with EclipsePeter Friese
?
The document discusses building domain-specific languages (DSLs) with Eclipse. It introduces DSLs and their benefits, including raising the level of abstraction and focusing on solving specific problems. It then presents Xtext, an Eclipse framework for defining grammars and generating languages, parsers, and editors. Xtext allows defining a DSL using a grammar, which is then used to generate a meta-model, parser, and base editor infrastructure for the language.
This document discusses options for creating graphical views for Xtext models. It recommends using unidirectional mapping from models to diagrams to keep views read-only and simple. Graphviz is recommended for its simplicity and powerful layout algorithms. Zest provides views based on GEF with additional configuration options. Building custom GEF views allows maximum freedom but has rendering limitations. JavaFX overcomes GEF limitations and has an intuitive API. The conclusion recommends focusing on usability, using graphical views to avoid editor issues, and leveraging modern frameworks with custom behavior.
Xtext + Sirius = ? / EclipseCon Europe 2014Cédric Brun
?
The document discusses the integration of Xtext and Sirius, two frameworks that allow rapid development of domain-specific editors, with both textual and graphical capabilities. It highlights the advantages and caveats of each, emphasizing the importance of serialization, reference consistency, and user feedback in managing models and their representations. The document concludes with insights on upcoming features and improvements in Sirius 2.0 and invites involvement from the community.
Xtext Grammar Language describes how to define grammars for the Xtext language development framework. Key points include:
- Grammars define the structure and elements of a language through rules like Statemachine, Event, and Transition.
- Terminals split text into tokens while hidden terminals are ignored by the parser. Datatype rules return values instead of objects.
- The parser creates EObjects when rules assign to the current pointer. Actions ensure object creation when no assignment occurs.
- Issues like ambiguities, left recursion, and left factoring can be resolved through techniques like keywords, predicates, and assigned actions.
- The grammar maps language structures to Ecore classes and features through rule return types
Recipes to build Code Generators for Non-Xtext Models with XtendKarsten Thoms
?
This document discusses code generators for non-Xtext models using Xtend. It provides an overview of creating minimal generators using JSON and Xtend templates, and more full-featured generators using the Xtext framework and EMF models. Key aspects covered include model navigation in Xtend templates, extensions, dynamic dispatch, IDE support, modularization, dependency injection, and incremental generation.
The document discusses the Eclipse Modeling Framework (EMF). It describes how EMF can be used to create Ecore models from Java, XML Schema, UML, or MOF. EMF provides a runtime library to process Ecore models and instances. It also allows generating Java code from Ecore models. The document provides examples of Ecore metamodels and model instances, and explains concepts like proxies, lazy loading, fragments, transactions and global singletons in EMF.
This document provides tips and best practices for using the Eclipse Modeling Framework (EMF). It discusses designing a model provider API, using item providers, working with the common command framework, reloading working models, finding EMF references, why notifications are called adapters, resource proxies, on-demand loading, useful commands, the role of the editing domain, optimizing Ecore models, defining custom data types, maintaining in-memory lists, creating unique lists, suppressing object creation, controlling command appearance, using custom adapter factories, refreshing viewers and selections, using item providers for labels and content, registering custom resource factories, encrypting/decrypting streams, querying XML data using EMF, serializing QNames, loading resources
This document introduces Xtend, a programming language created for Java developers. Xtend aims to improve on Java by incorporating features from other JVM languages while maintaining 100% Java interoperability. Key features include Java's type system and libraries, IDE support, functional programming capabilities, extension methods, and exceptional domain-specific language support through the use of active annotations that can participate in compilation and enhance derived Java code. The document concludes with a thank you and information about the creators of Xtend.
FXDiagram is a diagramming framework based on Eclipse Graphiti that focuses on user experience by providing flawless graphics, smooth behavior, self-explaining interactions, and easy content selection with good defaults and little customization. It integrates with Xtext and adds a thin diagram layer on top with a high-level mapping API to enable bi-directional mapping between diagrams and models without the quirks of other frameworks.
Das Dokument beschreibt die Installation und Nutzung der Xtext-Entwicklungsumgebung für die Erstellung dom?nenspezifischer Sprachen (DSLs) in Java. Es enth?lt Anleitungen zur Erstellung einer DSL, zur Integration in Java-Anwendungen und zur Verwendung von Xtend zur Verknüpfung von DSLs mit Java. Zudem wird auf Best Practices und unterschiedliche Pr?sentationen von Fachleuten eingegangen.
The document discusses serializing EMF models with Xtext. It covers:
- The new Xtext serializer is better than the old one in terms of errors, performance and deprecation.
- Serialization is used for quickfixes, refactoring, persistence, generators and more. It guarantees syntactical correctness and handles comments/whitespace.
- The serializer must parse a serialized model back to the original, and serialize modifications with minimal textual diffs. Ambiguities can cause parsing/serialization mismatches.
- The architecture uses state machines and observer pattern. Hooks allow customizing cross-references, keywords, values and more during serialization.
Jazoon 2010 - Building DSLs with EclipsePeter Friese
?
The document discusses building domain-specific languages (DSLs) with Eclipse. It introduces DSLs and their benefits, including raising the level of abstraction and focusing on solving specific problems. It then presents Xtext, an Eclipse framework for defining grammars and generating languages, parsers, and editors. Xtext allows defining a DSL using a grammar, which is then used to generate a meta-model, parser, and base editor infrastructure for the language.
This document discusses options for creating graphical views for Xtext models. It recommends using unidirectional mapping from models to diagrams to keep views read-only and simple. Graphviz is recommended for its simplicity and powerful layout algorithms. Zest provides views based on GEF with additional configuration options. Building custom GEF views allows maximum freedom but has rendering limitations. JavaFX overcomes GEF limitations and has an intuitive API. The conclusion recommends focusing on usability, using graphical views to avoid editor issues, and leveraging modern frameworks with custom behavior.
Eclipse DemoCamp in Paris: Language Development with XtextSebastian Zarnekow
?
This document provides an overview of the Programming Languages Framework, which includes infrastructure for language definition, editing, and code generation. It demonstrates how the framework can be used to define a sample programming language and develop tools like an editor and generator for it. Contact and resource information is also provided for learning more.
This document outlines an ENGd project focused on enhancing Xtext for general-purpose languages, primarily aiming to reduce the reliance on handwritten code for QVT and other languages through improved grammar enhancements. It discusses the current challenges such as name resolution and syntax rewrites, along with future research directions and evaluation methods. The project aims to refine source code generators and develop higher-level DSLs while acknowledging contributions from various academic and research collaborators.
The document discusses using Xtext to develop a textual modeling language for AUTOSAR systems. It describes how Xtext allows creating a scalable language that can efficiently model large AUTOSAR projects. Xtext's extensibility, via the Guice framework, enables non-trivial customizations to support different AUTOSAR releases. Benchmark tests showed the Xtext-based language parsed a large model over 10 times faster than other tools.
From Stairway to Heaven onto the Highway to Hell with XtextKarsten Thoms
?
The document discusses best practices and design considerations in developing Domain-Specific Languages (DSLs) using Xtext, emphasizing the importance of flexibility, documentation, and avoiding over-engineering. It highlights common design smells related to grammar, scoping, and validation, and offers advice on how to effectively address these issues. Additionally, it suggests keeping informed through resources and collaboration with experts to enhance the quality and usability of DSL projects.
This document discusses user experience (UX) in the context of Xtext and diagram editors. It outlines some of the key ingredients of good UX, like usability and consistency. When using diagram frameworks with Xtext, quirks can arise which impact the UX. However, by taking control over UX with tools like FXDiagram, these quirks can be avoided and the user experience improved. The document promotes UX as important for why users like products and advocates taking back control over UX.
This document discusses domain-specific languages (DSLs) and the Xtext framework for developing DSLs. It provides an overview of what is needed to build a DSL, including a parser, type checker, code generator, and IDE features. The document also summarizes the history and key features of Xtext, such as its grammar-driven and proven compiler architecture, and demonstrates Xtext through examples.
The document discusses a language IDE framework called Xtext that allows users to define their own domain-specific languages. Xtext can generate a full IDE for a custom language, including features like syntax highlighting, code completion, and validation. It also discusses how Xtext supports building IDEs for existing languages and new features of Xtext like hover support and improved build performance.
This document discusses scoping, linking, and indexing in Xtext. It provides an overview of containment references versus cross references, and how cross references are implemented in DSL grammars and Xtext editors through features like hyperlinking, validation, content assist, and find references. It then covers the three main uses of scopes in Xtext: linking, content assist, and serializing. Details are given on the default scoping configuration and how scopes are implemented, including name qualification, imports, and cross-file references using the index.
The document discusses computer programming scopes. It defines scope as the part of a program where a name binding is valid, where the name can be used to refer to an entity. Outside of the scope, the name may refer to a different entity or nothing at all. Scope is also known as visibility, from the perspective of the referenced entity. Scope refers to the set of all visible entities or valid names within a portion of a program.
7. ?2014 Shintaro Hosoai
Step0-5: DSLを書いてみる
? 右図のような信号のステートマシンを書いてみましょう.DSL構
成は以下の通り
event
event名 EventID
...
end
commands
command名 CommadID
...
end
state state名
actions { command名 }
event名 => 次state名
end
...
72014/3/31 SEA関西プロセス分科会
DSLイメージ
blue
entry/lightBlue
yellow
entry/lightYellow
red
entry/lightRed
toBlue
toYellow
toRed
EventID, CommandIDは任意
8. ?2014 Shintaro Hosoai
Step0-6: 記述例
events
toRed E001
toBlue E002
toYellow E003
end
commands
lightRed C001
lightYellow C002
lightBlue C003
end
state blue
actions { lightBlue }
toYellow => yellow
end
state yellow
actions { lightYellow }
toRed=>red
end
state red
actions { lightRed }
toBlue => blue
end
82014/3/31 SEA関西プロセス分科会
9. ?2014 Shintaro Hosoai
Step0-7 : 生成コードの確認と実行
? src-genフォルダ下に入力したDSLからJavaコー
ドが生成されています.
? src-genフォルダを右クリック>Build Path >
Use as Source Folder
? 生成されたJavaコードを右クリック>Run As >
Java Application
? コマンドラインからイベントを入力し,ステー
トマシンの動作を確認できます.
92014/3/31 SEA関西プロセス分科会
11. ?2014 Shintaro Hosoai
Step1-0:どんなDSL?
? TDDするときに,クラスのひな形とテストクラ
ス作るのめんどいよね!→ DSLで作ってみよう
112014/3/31 SEA関西プロセス分科会
UnitDSL
Mock
Class
Mock
Class
Mock
Class
Test
Class
Test
Class
Test
Class
クラス定義
メソッド定義
テスト定義
12. ?2014 Shintaro Hosoai
Step1-1:Projectの作成
? New > Project > Xtext Project
? Dialog
project name : jp.sea.kansai.example.unitdsl
?Use default location
Language
Name : jp.sea.kansai.example.UnitDsl
Extensions : unit
Layout
□Create SDK feature project
Working sets
□Add Project to working sets
122014/3/31 SEA関西プロセス分科会
今回は利用しない
任意
DSLのファイル拡張子
(任意)
言語名,Project名と合
わせておくのが無難.
クラスになるのでCamel
で
プロジェクト名(任
意)