Questions tagged [xtext]

Use this tag to ask about Eclipse Xtext which is a framework for developing domain specific or general purpose programming languages.

The Xtext framework, which is part of the Eclipse project, is used to develop domain specific or general purpose languages. It provides rich capabilities for integrating a DSL with the Java programming language and the Eclipse IDE.

Using the Xbase expression language in a DSL, it can directly be mapped to Java types. Also accessing Java types in a DSL is easy with Xbase.

For any Xtext language Eclipse's IDE capabilities can be adapted easily by generating class stubs for automatic formatting patterns, scopes and cross references, static validation, content proposals, the outline view or providing quick fixes. Once a stub is implemented it is automatically used by the DSL editor in Eclipse.

1374 questions
3
votes
1 answer

Can I have individual Xtend files intermingled with my Java source files in a Spring project?

In the Xtext documentation I can only find how to set up an Xtend-only project. But I have a Spring MVC project that I want to incorporate Xtend into. Is it possible to have individual Xtend files intermingled with my Java source files in a Spring…
Gostrich
  • 31
  • 1
3
votes
1 answer

JVMTypes in Xtext

I am trying to create a DSL in the following syntax : alias date java.util.Date; so what I have in my grammar is something like this : import "http://www.eclipse.org/xtext/common/JavaVMTypes" as jvmTypes Model: (types+= Type)*; Type: …
Ajay George
  • 11,759
  • 1
  • 40
  • 48
3
votes
1 answer

Maven builds multi module project succesfully, Eclipse shows errors

Note: this question is similar to this one, but the answers there did not work for me. I have an odd problem: using Maven in the command line, my build is succesful, but imported in Eclipse it still shows errors. In particular, I'm trying to build…
Safron
  • 802
  • 1
  • 11
  • 23
3
votes
1 answer

Terminating blocks of multiline text in Xtext/ANTLR

I am starting to get a handle on Xtext, but I am still having a bit of trouble seperating semantic sections by multiple newlines. grammar org.example.dsl.MyDsl hidden(WS) import "http://www.eclipse.org/emf/2002/Ecore" as ecore generate words…
drkstr101
  • 760
  • 1
  • 6
  • 23
3
votes
1 answer

Translate ANTLR grammar into XText grammar: how to remove syntactic predicates

I'm new to both Xtext and ANTLR. I need to translate an ANTLR (.g) grammar into an XTEXT (.xtext) grammar. In the ANTLR grammar there are syntactic predicates which are not supported by Xtext. Is there a way to remove/translate these…
hara
  • 3,274
  • 4
  • 37
  • 55
3
votes
1 answer

XText: use custom terminals definitions

I'm totally new to XText. When you define a grammar using XText you could specify a second grammar and use the definitions it declares as it is said here: grammar org.eclipse.xtext.example.Domainmodel with org.eclipse.xtext.common.Terminals In…
hara
  • 3,274
  • 4
  • 37
  • 55
3
votes
1 answer

Is it possible to embed Java compiler into an application?

With Xtext and Xtend, I have written a DSL grammar as well as its associated code generator which creates a bunch of Java source files making up a Java application. I would like to provide my colleagues with a program which lets them select a file…
Georgie
  • 77
  • 6
3
votes
2 answers

How to measure Xtend translation time for each input file

I'm building a DSL application in XTend and I need to measure the time it takes to translate each document that I run through it. I use the DSL capabilities to translate one data format (IFC) into another (TTL). I tried to measure it using…
Henry
  • 333
  • 1
  • 3
  • 10
3
votes
1 answer

How to use xtext language services from Angular

I'm working on a DSL developed using xtext. I am using autocomplete using orion editor. It works great with the auto generated web editor. But, we want to integrate it with another web app developed using Angular 4. I got to configure the editor,…
Rumit Parakhiya
  • 2,674
  • 3
  • 24
  • 33
3
votes
0 answers

How to release Xtext 2.13 project to Maven Central

I have created an Xtext Language and I want to release it to Maven central. I have already prepared the release with: mvn release:prepare My first try to release with mvn release:perform failed due to the strict Javadoc checking (Xtext generates…
Hristo Vrigazov
  • 1,357
  • 2
  • 12
  • 20
3
votes
1 answer

Make either a reference or a terminal accessible through the same element name in Xtext/Xpand?

I have an Xtext grammar that describes statemachines, and I have been using references to previously declared events and states to describe transitions: Event: 'event' name=ID ; State: 'state' name=ID ; Transition: event=[Event] '=>'…
weltraumpirat
  • 22,544
  • 5
  • 40
  • 54
3
votes
1 answer

Xtext standalone and validation

Building a standalone program parsing a file, I used the first option of http://www.davehofmann.de/?p=101 A validation is defined that give an error (red under line in eclipse) if text does not start with a capital letter. The standalone parser…
Johan
  • 575
  • 5
  • 21
3
votes
1 answer

How we can port existing Eclipse Editor Plugin to Eclipse Che?

We have our domain specific language based on xtext. For representation of language, we have our own editor in Eclipse. This editor is basically Eclipse plugin. Is there any way to port this eclipse editor plugin to Che? As this is eclipse plugin,…
Chetan Laddha
  • 993
  • 8
  • 22
3
votes
1 answer

Collection of Xtext Grammars as a library?

I am wondering if there is a library containing different grammar languages defined using Xtext, similar to the one available for Antlr v4 Antlr v4 Grammars. This would enable reuse and help reinventing the wheel.
DerFaizio
  • 148
  • 7
3
votes
1 answer

How to use different object injections in Xtext tests than in productive environment?

I try to start unit testing a mid size Xtext project. The generator currently relies on some external resources that I would like to mock inside my test. Thus, I inject the needed object via @Inject into the Generator class. e.g in…
lwi
  • 1,682
  • 12
  • 21