Xtext 2.1 Documentation

  1. Getting Started
    1. Installation
      1. Install Pre-Configured Eclipse With Xtext
      2. Install Xtext From Update Site
    2. 5 Minutes Tutorial
      1. Creating A New Xtext Project
      2. Generating The Language Infrastructure
      3. Try The Editor
      4. Conclusion
    3. 15 Minutes Tutorial
      1. Create A New Xtext Project
      2. Write Your Own Grammar
      3. Generate Language Artifacts
      4. Run the Generated IDE Plug-in
      5. Second Iteration : Adding Packages and Imports
    4. 15 Minutes Tutorial - Extended
      1. Writing a Code Generator With Xtend
      2. Unit Testing the Language
      3. Creating Custom Validation Rules
    5. Five simple steps to your JVM language
      1. Step One: Create A New Xtext Project
      2. Step Two: Write the Grammar
      3. Step Three: Generate Language Artifacts
      4. Step Four: Define the Mapping to JVM Concepts
      5. Step Five : Try the Editor!
  2. Reference 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 Namespace URIs to Import Existing EPackages
            2. Using Resource URIs to Import Existing EPackages - Deprecated
            3. Using Classpath URIs to Import Existing EPackages - Deprecated
          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. 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
    6. Xtext and Java
      1. Plug-in Setup
      2. Referring to Java Elements using JVM Types
        1. Customization Points
      3. Referring to Java Types Using Xbase
      4. Inferring a JVM Model
        1. Linking and Indexing
      5. Using Xbase Expressions
        1. Making Your Grammar Refer To Xbase
        2. Using the Xbase Interpreter
      6. Xbase Language Reference
        1. Lexical Syntax
          1. Identifiers
            1. Escaped Identifiers
            2. Syntax
            3. Examples
          2. String Literals
            1. Syntax
            2. Examples
          3. Integer Literals
            1. Syntax
          4. Comments
            1. Syntax
          5. White Space
          6. Reserved Keywords
        2. Types
          1. Arrays
          2. Simple Type References
            1. Syntax
            2. Examples
          3. Function Types
            1. Syntax
            2. Examples
          4. Parameterized Type References
            1. Syntax
            2. Examples
          5. Primitives
          6. Conformance and Conversion
          7. Common Super Type
        3. Expressions
          1. Literals
            1. String Literals
            2. Integer Literals
            3. Boolean Literals
            4. Null Literal
            5. Type Literals
          2. Type Casts
            1. Syntax
            2. Examples
          3. Infix Operators / Operator Overloading
            1. Short-Circuit Boolean Operators
            2. Examples
          4. Assignments
          5. Feature Calls
            1. Syntax
            2. Property Access
          6. Implicit variables 'this' and 'it'
            1. Null-Safe Feature Call
          7. Constructor Call
            1. Examples
            2. Syntax
          8. Closures
            1. Syntax
            2. Typing
            3. Function Mapping
            4. Implicit Parameter it
            5. Examples
          9. If Expression
            1. Syntax
            2. Typing
            3. Examples
          10. Switch Expression
            1. Type guards
            2. Typing
            3. Examples
            4. Syntax
          11. Variable Declarations
            1. Syntax
            2. Typing
          12. Blocks
            1. Examples
            2. Syntax
          13. For Loop
            1. Syntax
          14. While Loop
            1. Syntax
            2. Examples
          15. Do-While Loop
            1. Syntax
            2. Examples
          16. Return Expression
          17. Throwing Exceptions
          18. Try, Catch, Finally
        4. Extension Methods
          1. Examples
          2. Builder Syntax
    7. 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
    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)
  3. Appendix
    1. 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
    2. 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