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
2
votes
1 answer

Upgrading JUnit4 to JUnit5 in a xtext environment

I'm working on a complex project which uses xtext. My job is to upgrade the testing from JUnit4 to JUnit5. The problem is, for the JUnit tests there are 2 "InjectorProvider" classes generated by a *.mwe2 file and i cannot figure out how to upgrade…
simon
  • 73
  • 6
2
votes
1 answer

How to find out in Xtend if an optional feature from an Xtext grammar is used or not?

I have the following xtext fragments: LongDmxColor: intensity=DmxValue red=DmxValue green=DmxValue blue=DmxValue (white=DmxValue)?; and DmxValue returns INT: value=INT; In the generated LongDmxColor.java class, there are the following…
Michel Keijzers
  • 15,025
  • 28
  • 93
  • 119
2
votes
1 answer

How to fix error occuring while executing EValidator

i want to create a parser of obj files with xtext. I already wrote a part of the grammar, now i was writing the validator, but while testing my grammar and validator an error occured. Can anyone helps me? Here is my grammar code: grammar…
Brandon
  • 33
  • 6
2
votes
0 answers

Maven Tycho fails as it tries to unzip a signature file (tycho-packaging-plugin)

I am building an Xtext project with Maven+Tycho. mvn clean install completes successfully, mvn deploy completes successfully as well, but mvn clean install deploy fails with: [ERROR] Failed to execute…
Danilo Pianini
  • 966
  • 8
  • 19
2
votes
1 answer

Is it somehow possible to create VS Code extension using Xtext Fat Jar language server?

I'm trying to create VS Code extension out of the FatJar language server created by Xtext. I saw the example project also (https://github.com/itemis/xtext-languageserver-example) but there is just an example using reference to parent xtext project…
2
votes
1 answer

How to add custom import statements in the generated java file in xtext using jvmmodelInferrer?

I have written a grammar for my domain specific language in xtext and I am using jvmmodelInferrer to generate java code. I can generate fields and custom methods but how can I add custom import statements like 'import java.util.*' in the generated…
2
votes
1 answer

XText - Multiple grammars and example web editor

I have an XText project setup with multiple grammars and am able to edit each grammar with cross-linking within the IDE generated by the mwe2 workflow. When I run the example web editor, the first grammar defined in the mwe2 workflow functions…
ppadovani
  • 41
  • 3
2
votes
1 answer

Xtext how to reference variables by qualified name through an instance?

I am having trouble with this concept in building a dsl. I am not sure if it is a simple thing I am missing or something that is not an intended feature of xtext. Hopefully someone can explain it to me in the context of this example. Given the…
Zannith
  • 429
  • 4
  • 21
2
votes
1 answer

Formatting string content xtext 2.14

Given a grammar (simplified version below) where I can enter arbitrary text in a section of the grammar, is it possible to format the content of the arbitrary text? I understand how to format the position of the arbitrary text in relation to the…
user2455157
  • 137
  • 1
  • 2
  • 11
2
votes
0 answers

How to expand field initializers in xtend annotation processor

I am using Active Annotations to generate fields in my classes and am having difficulty discovering how to expand field initializer expressions. Without initializers the code looks like this class JavaFxPropertyProcessor implements…
systemcpro
  • 856
  • 1
  • 7
  • 15
2
votes
1 answer

Xbase - How to add tags on top on inferrer generated methods

I have figured out how to create methods and add to the bodies of the method. What I need to also do is add annotations to the generated method such as @Test etc, how would I accomplish this?
J. Doe
  • 33
  • 3
2
votes
2 answers

Xtext - Multiline String like in YAML

I'm trying to model a YAML-like DSL in Xtext. In this DSL, I need some Multiline String as in YAML. description: | Line 1 line 2 ... My first try was this: terminal BEGIN: 'synthetic:BEGIN'; // increase indentation terminal END: …
2
votes
1 answer

xtext maven build fails under Jenkins/docker

I'm working on an xtext DSL project using xtext2.13/java8. It all builds and executes regression tests under maven, and now I want to move the build to run under CI with Jenkins. The Jenkins job runs maven in a docker image. I'm specifically using…
user2000974
  • 193
  • 1
  • 2
  • 10
2
votes
1 answer

how to add jar dependency to xtext maven build

What is the correct way to use a maven jar file in my xtext dsl project? What I have tried is this: use the maven-dependency-plugin in the pom.xml file of the *.dsl project to download the .jar file from a maven repository into the ./lib/…
TmTron
  • 17,012
  • 10
  • 94
  • 142
2
votes
0 answers

Validate xtext editor content which is generated by Grammar file

This I know Suppose we have to validate we have to write @check method inside ".xtend" get data from model then we can validate. But content which we printed from grammar how can we validate that consider following grammar IniDCommand: …
shreeram banne
  • 526
  • 4
  • 12