Xtext - language development made easy

Xtext is a framework for development of programming languages and domain specific languages. It covers all aspects of a complete language infrastructure, from parsers, over linker, compiler or interpreter to fully-blown top-notch Eclipse IDE integration. It comes with good defaults for all these aspects and at the same time every single aspect can be tailored to your needs.

March 20, 2012 : Xtext 2.3 M6 is out.

Find out about all the enhancements in the Xtext 2.3 "New & Noteworthy" document.

Rich Eclipse-based Editors and IDE Integration

Syntax Coloring

Out of the box, the editor supports syntax coloring based on the lexical structure and the semantic data of your files. Users are free to customize the highlighting and configure their favorite styles.

Code Completion

An Xtext editor proposes valid code completions at any place in the document, helping your users with the syntactical details of your language.

Validation and Quick Fixes

Xtext has outstanding support for static analysis and validation of your models. It has never been so easy to define constraints to tackle errors and warnings in your code instantaneously. With custom quick fixes you can correct these with a single keystroke.


More Editor Features

You'll find all the editor features that you got used to in your favorite IDE in the editor for your very own language. There is bracket matching and auto-edit, an outline view that shows the semantic structure of your model, code formatting to properly indent the documents and much more.

Xbase - Expression Language Library

At your Finger Tips:

Software systems are not only made up of structure. At some point you'll have to define behavior and computations. These aspects are implemented using expressions. Defining domain-specific languages with Xtext is very easy and comparable with defining APIs but without any restrictions and much better tooling. However when it comes to defining expressions things used to become more complicated. That's a thing of the past!

Xbase is a predefined set of expressions, which can easily be embedded into any language developed with Xtext. It not only provides you with the necessary grammar, but also comes with a reusable compiler, an interpreter, and of course the top-notch Eclipse tooling you would expect form any language developed with Xtext.

Modern expressions ...

Xbase supports everything you'd expect from a modern expression language. Static typing, type inference, closures and operator overloading are just the tip of the ice berg. You can of course extend the language and add further expressions. E.g. date or color literals might be a good idea in your specific case. No Problem!

Have a look at the language reference to learn what's already there.

... right within your DSL

See what Xbase looks like when it is embedded in a DSL. It's seamless! This screencast shows the example domain model language, which is shipped as part of Xtext. You can materialize the respective projects it into your worksapce using the examples-wizard. In the documentation you can find a detailed description of what needs to be done to emebed Xbase into your DSL.

Xtend is a statically-typed functional and object-oriented programming language. IT translated to comprehensible Java source code and its syntax is similar to Java but is much less verbose. The language itself is developed with Xtext and is based on Xbase.

Find out more at xtend-lang.org.

Template Expressions

Code generators make heavy use of string concatenation. Therefore they are usually implemented using a template language. So far people tend to reuse a template language used in web development, which lack static typing and easy reuse of template snippets. Xtend's template expressions allow you to write readable and maintainable code generators. Find out more about expressions supported by Xtend.

Polymorphic Dispatch

When processing an in memory model in order to generate text out of it, you always have to do things based on the current models state or types. Traditionaly people either wrote long instance-of cascades or added a cumbersome and invasive visitor API to their model. Xtend's dispatch methods solve these problems. Find out more about dispatch methods.

Xtend comes with an Eclipse integration, supporting all the features you would expect from a modern statically-typed programming language.

Tight Integration with other Languages and Technologies

Integration with Java and JDT

DSLs are often used within a regular software development project. It's a good idea to have your languages integrated with the rest of the software artifacts. With Xtext a tight interaction between your DSLs and your programming language is possible. Xtext comes with exceptional support for integrating with the Java Development Tools of Eclipse.

Integration with EMF

Xtext implements the Resource API of EMF, which renders your language compatible to any other EMF-based editors out there. You could for instance open all your Xtext files with EMF's structural editor, or diff your files using EMF-Compare if you want to. Developing different graphical and structural editors in addition to the textual editor is made comparably easy.

Advanced Workbench Integration

Xtext's advanced Eclipse integration goes far beyond the editor. You will not feel any difference between your language and Java.

We are here to help you!

The fact that the source code of Open Source software is freely available to everyone does not necessarily mean that everyone is an expert in this code. The fact that licensing costs for Open Source software are zero does not necessarily mean that professional services for the software are irrelevant.

On the contrary, enterprise software built from Open Source components requires manpower that understands the internal dependencies of these components and can quickly and efficiently eliminate problems, should an error occur. Due to the fact that a great deal of the Xtext committers come from itemis, we can offer you competent and helpful support.

Headlines and Latest News

Latest Headlines in the Web (feed)

  • (about 2 years ago by Xtext team)
    The EclipseCon comittee accepted the Xtext tutorial by Moriz, Jan and Heiko as early pick. During the tutorial "Xtext meets e4: Developing an editor for the e4 workbench model" you will learn how to use Xtext to build tools for the upcoming Eclipse e4.

Main Features

Make sure, you have a look at the New & Noteworthy of the latest release, too!

Editor

  • Syntax Coloring
  • Content Assist
  • Template Proposals
  • Rich Hover
  • Rename Refactoring
  • Quick Fixes
  • Validation
  • Outline
  • Quick Outline
  • Folding
  • Hyperlinks for all Cross References
  • Find References
  • Toggle Comment
  • Mark Occurrences
  • Formatting

General IDE Features

  • Cross-language Indexing
  • Find Element Search Dialog
  • On Save Code Generation / Compilation
  • File Wizard

General

  • Antlr-based Parser and Lexer
  • Unparser (aka Serializer)
  • Linker
  • Reusable Expression Language Xbase
  • Xtend - Template Language

Extendability

  • Everything is Customizable!
  • Tight Integration of Multiple Languages
  • Tight Integration with Java and Eclipse's JDT
  • Works with any other EMF-Compatible Tool / Framework