Questions tagged [xtend]

Xtend is a statically typed programming language that transcompiles to Java. It aims to produce more readable code than traditional Java.

Xtend is a programming language that transcompiles to Java. It aims to produce more readable code than traditional Java by reducing the amount of boilerplate code. It is developed by the Eclipse foundation.

415 questions
1
vote
1 answer

How can I configure the precedance of extension methods in name conflicts?

I would like to create an extension method named "map" to make inline mappings of single objects. For example, if you have some json datastructure: val json = getDataStructure() val String text = json.customers.findFirst[address.city=="Hamburg"] …
armin.miedl
  • 1,070
  • 1
  • 11
  • 16
1
vote
1 answer

How to get a terminal representing any character in xText

I'm using Xtext to develop a DSL. This DSL should accept code of any kind at a certain point. This means it should accept any character. Also, I need to record this code, without ignoring it. Does any one know a regular expression for this? I tried…
1
vote
0 answers

Gradle Sub Projects Builds Are Failed If Sub Projects Contains Same File Name In Same Package Structure

Here is my Project structure. Note:Project-B depends on Project-A Build I have following attributes in SamplePage.Java Project-A->SamplePage.Java public string name; public int age; Project-B->SamplePage.Java public string name; I have a Xtend…
gihan-maduranga
  • 4,381
  • 5
  • 41
  • 74
1
vote
0 answers

How to programmatically handle objects in Xtext

I have a grammar defined like: Key: name=ID; Step: name+=[Key]+; @Override terminal ID: ('a'..'z' | 'A'..'Z' | '_' | '-' | '0'..'9') ('a'..'z' | 'A'..'Z' | '_' | ' ' | '-' | '0'..'9')+; And my input is: When I open window Kitchen…
1
vote
0 answers

Xtend generation with Maven creates wrong String concatenation

When my maven script generates Java from Xtend files, , it generates files with wrong string concatenation. xtend: def writeImports(f){ ''' import "test.file" «getImports()» ''' } Generated Java public CharSequence…
Staalk
  • 235
  • 1
  • 4
  • 12
1
vote
1 answer

How to create an Xtext wildcard terminal rule for any combination of characters?

I want to write a rule for the following INTEGER X; IF GIBBERISH THEN X = 10; ELSE X = 15; END; In the above program I want to write a terminal rule for any character in GIBBERISH like code('Xfr) or ADEF==DCF+1 something like that. I wrote…
mrprofessor
  • 101
  • 1
  • 10
1
vote
1 answer

How to migrate code generation from xpand to xtend(2)?

We wanto to reimplement an old project, wich used code generation via xtext and xpand. Xpand should be replaced with Xtend(2) and the old fornax plugin workflow execution should be removed, replacey by xtext and xtend maven plugins. In the old…
gregor
  • 63
  • 6
1
vote
1 answer

How to compile Xtend + Java classes with Gradle

I tyr to migrate a project that contains both Java and Xtend classes to Gradle. Unfortunately, I could not find any possibility to achieve an automated compilation of the Xtend part. I am well aware of the Xtext Gradle Plugins…
ChrisR
  • 53
  • 5
1
vote
2 answers

Xtend: Removing Active Annotation during code generation

I've created an active annotation @Module, but I don't want the generated Java class to be annotated with @Module. When I try to remove the annotation during the transformation phase, it instead comments out the annotation (which would be fine), but…
phil-daniels
  • 574
  • 2
  • 10
  • 28
1
vote
1 answer

xtext, modify outline tree string

this is my xtext outline: I would like to name by my self the unnamed fields. this is my outline tree provider code, it's not a final version : class MyDslOutlineTreeProvider extends DefaultOutlineTreeProvider { def…
BR.Hamza
  • 99
  • 14
1
vote
1 answer

xtext, content assist unwanted suggestions

I have a Script language with content assist. but this content assists shows same unwanted suggestions. in this case I don't want the Value - ID and the . to be shown. the other suggestions are correct. this my method to implement the content…
BR.Hamza
  • 99
  • 14
1
vote
1 answer

Xtext Content assist configuration

I want that the content assist suggests the name of variables already declared in the script. this is the grammar: Script: includes+=(Include)* assignments+=(Assignment)* g=GetLog? clock=Clock? tests+=Test* ; Include: 'INCLUDE'…
BR.Hamza
  • 99
  • 14
1
vote
1 answer

Why should I version control all files generated by Xtext/Xtend?

The Xtext/Xtend examples do not exclude the generated files form version control (in .gitignore). This makes commits huge and sometimes hard to merge. What is the reason for adding all generated files to version control?
Michael_Scharf
  • 33,154
  • 22
  • 74
  • 95
1
vote
1 answer

XText : ML_COMMENT overrides own written comment

I am new to xtext. I want to add the following comments. ML_COMMENT (from org.eclipse.xtext.common.Terminals) own comment /* @var var1 @property property1 */ The following is my attempt code. grammar org.xtext.example.mydemo.MyDemo with…
user7377306
  • 21
  • 1
  • 4
1
vote
0 answers

The declared package does not match the expected package XTEND

I have written xtend code that generates java classes, but in the generated java classes, there is an error in the package. Error: "The declared package "systemunit.abstractsystemunit" does not match the expected package…
Davd
  • 113
  • 1
  • 2
  • 8