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

Array in Xtext without square brackets

I want to implement an array inside a rule in Xtext and use Xtend templates to generate code. I've already checked this Post but the problem is, that the generator automaticaly adds square brackets to the generated output. My Xtext rule look like…
John
  • 795
  • 3
  • 15
  • 38
0
votes
1 answer

Use of the "filter" method

My intention is to use filter method in an expression within the for loop. Now, the code looks like this: «FOR interf : delegates.getInterf(delegate)» «IF !bridgeInterfaces.contains(interf)» ... …
0
votes
1 answer

XTEND/JAVA automatic eclipse project generation

I have a XText project within Eclipse, with my own grammar file implemented. Using the doGenerate function I generate several .java files. So far everything works like a charm. My problem is that every time I generate my files I need to do the…
Glugstar
  • 45
  • 1
  • 3
0
votes
1 answer

xtext inferrer: multiple entities

I am very new to Xtext/Xtend, therefore apologies in advance if the answer is obvious. I would like to allow the end-users of my DSL to define a 'filter', that when applied and 'returns' true it means that they want to 'filter out' the given entity…
V P
  • 845
  • 10
  • 28
0
votes
2 answers

Java xtend funny compile error : This expression is not allowed in this context, since it doesn't cause any side effects

I have an error that does not make sense: This expression is not allowed in this context, since it doesn't cause any side effects. Here is the scenario in which the compile error is risen. for (var i = 0; i < result.length; i++) { …
David Laberge
  • 15,435
  • 14
  • 53
  • 83
0
votes
1 answer

MyDSL code Validation is not working when cleaning the project

In my DSL validator code, it's not working when i clean the project or when i change in one file. Then i used google, came to know like have to register EPackage in Evalidator but in my ecore model don't have like that. So please let me know the…
Saran
  • 167
  • 2
  • 3
  • 11
0
votes
1 answer

Compilation error : Changing Depricated @Data in package "org.eclipse.xtend.lib" to "org.eclipse.xtend.lib.annotations.Data" - Xtend 2.7.2

I migrated xtext from 2.6.0 to 2.7.2 . After migration we had compilation errors related to @Data in package org.eclipse.xtend.lib . This annotation was depreciated and it was pointing to new annotations from 'org.eclipse.xtend.lib.annotations.Data'…
Srinivas M.V.
  • 6,508
  • 5
  • 33
  • 49
0
votes
1 answer

Defining a dsl (Domain Specific Language) using XText in Eclipse

I need your help concerning xtext programmation ! I have a diagramme (sysml model "xmi file") I want to use its elements (name of elements actions ...) to build a new editor using xtext. I'm a beginner I wonder how to start and how to import the…
abdozmeir
  • 11
  • 2
0
votes
1 answer

Set annotation value with xtend 2.7.3?

all I was migrating my project from xtend 2.4.3 to 2.7.3 I got some problems. Here is the code works on 2.4.3 val AttrType = findTypeGlobally(typeof(Attr)); val fld = Cls.addField(Pkt::getMemberName(m)) [ val annot = addAnnotation(AttrType ) …
Chi Shin Hsu
  • 261
  • 1
  • 2
  • 12
0
votes
1 answer

Mixing java, scala and xtend files in one project?

Since all languages are finally compiled to JVM, can I freely mix all filetypes in one project? For example, can I put all types of files in Eclipse project interchangeably? If I do so, how can I be sure that all files are compiled when I run some…
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385
0
votes
2 answers

How can I return a list based on a condition on the referencing elements of the list

I want to return a list of elements of 'ListOfObjects' that are being referenced by 'SomeOtherObject' with it's(SomeOtherObject's) attribute satisfying the condition. I'm trying this…
Sujju
  • 97
  • 8
0
votes
0 answers

Xtend: Why isn't compiler generated public Java constructor visible from Xtend code?

I have a an Xtend subclass PubnubMessage that inherits one field and has a constructor generated via active annotation. I can see the public constructor in the generated Java code, and it correctly accepts one argument for the field, but when I try…
rmm
  • 119
  • 1
  • 5
0
votes
1 answer

Inverse reference lookup

For some reasons my JvmModelInferrer needs to search for all elements of a special type which fulfill a criterion. These elements are necessary to infer the model completely. But all these elements can be spread over all source code files of the…
Joko
  • 600
  • 3
  • 15
0
votes
1 answer

Generate files with multiple columns and compute spacing with Xtend

How can I generate columns with spacing using xtend? Is there a way, without computing by myself the length of the columns? Are there any utility classes for generating columns? The generated output, that I want to achieve is: { AA, -1, XX, FFXXXYY,…
aphex
  • 3,372
  • 2
  • 28
  • 56
0
votes
1 answer

Using unique variable names in Xtend loop (Code Generation)

I've created a custom DSL with Xtext which is useful to describe hierarchies (fixed height of 2 in this example). Want I want to do now is to generate a simple Java Swing App that can display such an hierarchy using a JTree. I did this by extending…
ceran
  • 1,392
  • 1
  • 17
  • 43