Xtext Documentation

  1. Overview
    1. What is Xtext?
    2. How Does It Work?
    3. Xtext is Highly Configurable
    4. Who Uses Xtext?
    5. Who is Behind Xtext?
    6. What is a Domain-Specific Language
  2. The Grammar Language
    1. A First Example
    2. The Syntax
      1. Language Declaration
      2. EPackage Declarations
        1. EPackage Generation
        2. EPackage Import
          1. Using Resource URIs to Import Existing EPackages
          2. Using Classpath URIs to Import Existing EPackages
          3. Using Namespace URIs to Import Existing EPackages
        3. Ecore Model Aliases for EPackages
      3. Rules
        1. Terminal Rules
          1. Return Types
        2. Extended Backus-Naur Form Expressions
          1. Keywords / Characters
          2. Character Ranges
          3. Wildcard
          4. Until Token
          5. Negated Token
          6. Rule Calls
          7. Alternatives
          8. Groups
        3. Terminal Fragments
        4. EOF - End Of File
      4. Parser Rules
        1. Extended Backus-Naur Form Expressions
          1. Assignments
          2. Cross-References
          3. Unordered Groups
          4. Simple Actions
          5. Unassigned Rule Calls
          6. Assigned Actions
      5. Hidden Terminal Symbols
      6. Data Type Rules
      7. Enum Rules
      8. Syntactic Predicates
    3. Ecore Model Inference
      1. Type and Package Generation
      2. Feature and Type Hierarchy Generation
      3. Enum Literal Generation
      4. Feature Normalization
      5. Customized Post Processing
      6. Error Conditions
    4. Grammar Mixins
    5. Common Terminals
  3. Configuration
    1. The Language Generator
      1. A Short Introduction to MWE2
      2. General Architecture
        1. Generator Fragments
        2. Configuration
      3. Standard Generator Fragments
    2. Dependency Injection in Xtext with Google Guice
      1. The Module API
      2. Obtaining an Injector
  4. Runtime Concepts
    1. Runtime Setup (ISetup)
    2. Setup within Eclipse-Equinox (OSGi)
    3. Logging
    4. Validation
      1. Automatic Validation
        1. Lexer/Parser: Syntactical Validation
        2. Linker: Crosslink Validation
        3. Serializer: Concrete Syntax Validation
      2. Custom Validation
      3. Validating Manually
      4. Test Validators
    5. Linking
      1. Declaration of Crosslinks
      2. Default Runtime Behavior (Lazy Linking)
    6. Scoping
      1. Global Scopes and Resource Descriptions
        1. Resource and EObject Descriptions
        2. Global Scopes Based On Explicit Imports (ImportURI Mechanism)
        3. Global Scopes Based On External Configuration (e.g. Classpath-Based)
          1. About the Index, Containers and Their Manager
          2. JDT-Based Container Manager
          3. Eclipse Project-Based Containers
          4. ResourceSet-Based Containers
      2. Local Scoping
        1. Declarative Scoping
      3. Imported Namespace-Aware Scoping
        1. org.eclipse.xtext.naming.IQualifiedNameProvider
        2. Importing Namespaces
    7. Value Converter
    8. Serialization
      1. The Contract
      2. Roles of the Semantic Model and the Node Model During Serialization
      3. Parse Tree Constructor
      4. Options
      5. Preserving Comments from the Node Model
      6. Transient Values
      7. Unassigned Text
      8. Cross-Reference Serializer
      9. Merge White Space
      10. Token Stream
    9. Formatting (Pretty Printing)
      1. General FormattingConfig Settings
      2. FormattingConfig Instructions
      3. Grammar Element Finders
    10. Fragment Provider (Referencing Xtext Models From Other EMF Artifacts)
    11. Encoding in Xtext
      1. Encoding at Language Design Time
      2. Encoding at Language Runtime
      3. Encoding of an XtextResource
      4. Encoding in New Model Projects
      5. Encoding of Xtext Source Code
  5. MWE2
    1. Examples
      1. The Simplest Workflow
      2. A Simple Transformation
      3. A Stop-Watch
    2. Language Reference
      1. Mapping to Java Classes
      2. Module
      3. Properties
      4. Mandatory Properties
      5. Named Components
      6. Auto Injection
    3. Syntax Reference
      1. Module
      2. Property
      3. Component
      4. String Literals
      5. Boolean Literals
      6. References
  6. IDE Concepts
    1. Label Provider
      1. Label Providers For EObjects
        1. DefaultEObjectLabelProvider
      2. Label Providers For Index Entries
    2. Content Assist
    3. Quick Fixes
      1. Quickfixes for Linking Errors and Syntax Errors
    4. Template Proposals
      1. Cross Reference Template Variable Resolver
      2. Enumeration Template Variable Resolver
    5. Outline View
      1. Influencing the outline structure
      2. Styling the outline
      3. Filtering actions
      4. Sorting actions
      5. Quick Outline
    6. Hyperlinking
      1. Location Provider
      2. Customizing Available Hyperlinks
    7. Syntax Coloring
      1. Lexical Highlighting
      2. Semantic Highlighting
  7. Referring to Java Types
    1. How to Use Java Types
    2. Customization Points
  8. Integration with EMF and Other EMF Editors
    1. Model, Ecore Model, and Ecore
    2. EMF Code Generation
    3. XtextResource Implementation
    4. Integration with GMF Editors
      1. Stage 1: Make GMF Read and Write the Semantic Model As Text
        1. Stage 2: Calling the Xtext Parser to Parse GMF Labels
        2. Stage 3: A Popup Xtext Editor (experimental)
  9. Migrating from Xtext 1.0.x to 2.0
    1. Take the Shortcut
    2. Migrating Step By Step
      1. Update the Plug-in Dependencies and Import Statements
      2. Introduction of the Qualified Name
      3. Changes in the index and in find references
      4. Rewritten Node Model
      5. New Outline
      6. AutoEditStrategy
      7. Other Noteworthy API Changes
    3. Now go for then new features
  10. Migrating from Xtext 0.7.x to 1.0
    1. Migrating Step By Step
      1. Update the Plug-in Dependencies and Import Statements
      2. Rename the Packages in the dsl.ui-Plug-in
      3. Update the Workflow
      4. MANIFEST.MF and plugin.xml
      5. Noteworthy API Changes