Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Xtext/Documentation

< Xtext
Revision as of 07:25, 16 September 2008 by Unnamed Poltroon (Talk) (New page: = What is Xtext? = The TMF Xtext project provides a domain-specific language (the grammar language) for description of textual programming languages and domain-specific languages. It is t...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

What is Xtext?

The TMF Xtext project provides a domain-specific language (the grammar language) for description of textual programming languages and domain-specific languages. It is tightly integrated with the Eclipse Modeling Framework (EMF) and leverages the Eclipse Platform in order to provide language-specific tool support. In contrast to common parser generators the grammar language is much simpler but is used to derive much more than just a parser and lexer. From a grammar the following is derived:

  • incremental, Antlr3-based parser and lexer
  • Ecore-based meta models (optional)
  • a serializer, used to serialize instances of such meta models back to a parseable textual representation
  • an implementation of the EMF Resource interface (using the concrete syntax defined in the grammar)
  • a full-fledged integration of the language into Eclipse IDE
    • syntax coloring
    • navigation (F3, etc.)
    • code completion
    • outline views
    • code templates
    • folding, etc.

The generated artifacts are wired up through a dependency injection framework, which makes it easy to exchange certain functionality in a non-invasive manner. For example if you don't like the default code assistant implementation, you need to come up with an alternative implementation of the corresponding service and configure it via exlipe extension point.

The Grammar Language

At the heart of Xtext there is the grammar language. The grammar language is defined in itself, of course. The grammar can be found here [[1]]

Rules

Parser Rules

Lexer Rules

Model Construction

Meta Models

Meta-Model Inference

Importing existing Meta Models

Language Inheritance

Service framework

Runtime Architecture

Value Converters

Linking

UI Architecture

Back to the top