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
3 answers

Xtend: Add elements from two different ArrayList

I have an ArrayList of Integer. a = {1, 2, 3, 4, 5} b = {6, 7, 8, 9, 10} I want to add the elements of the 2 arrays. So, the new array will now be: c = {7, 9, 11, 13, 15} which is (1+6), (2+7), (3+8) and so on. Is there a way to do this without a…
chris yo
  • 1,187
  • 4
  • 13
  • 30
0
votes
1 answer

How to use Xtend Template with a C hello World?

I am a newbie Java Programmer. I am trying to understand the working of the Xtend template. I have read that these templates can be used to generate a java code from a simple C program. Could somebody kindly give me an idea how this simple C program…
Goldengirl
  • 957
  • 4
  • 10
  • 30
0
votes
1 answer

How to read template expression in Java Xtend and what is it used for?

I am trying to understand Xtend and was stuck at the 'template expression' part. This is the documentation of Xtend. Here I dont really understand what is the use of the 'Template expressions' and how to actually use/declare or read them. Could…
Goldengirl
  • 957
  • 4
  • 10
  • 30
0
votes
1 answer

Type mismatch while sorting a list in xtend

I try to sort a list using xtend. Here is the code: def String traverse (EObject obj) { var String output = switch (obj) { TextInput: "["+obj.eClass.name+ "] " + obj.fullyQualifiedName + " (label: "+obj.labelText+")\n" …
Fabian
  • 547
  • 1
  • 4
  • 17
0
votes
1 answer

How to Find Elements In Selenium Without Run Web Driver

I am currently working on automation project.Scripts are written in selenium and java language.Actually my question is an RnD type. Because we can find elements in selenium giving element id or xpath or etc...…
gihan-maduranga
  • 4,381
  • 5
  • 41
  • 74
0
votes
0 answers

efficient content proposal and referencing member references in Xtext

I used the newly introduced great feature of xtext 2.8.3, the synthetic tokens, but what I'm facing is a lag with the proposals a validation error Couldn't resolve reference to EStructuralFeature 'name'. the problem is that the proposal didn't…
unique_ptr
  • 586
  • 1
  • 8
  • 22
0
votes
1 answer

xtext generator how to prevent file override

How do I prevent Xtext generator from overriding custom modification I'm using the method doGenerate(Resource resource, IFileSystemAccess fsa) but each time the file gets overridden, I've tried @Generated NOT but this didn't work. thank you
unique_ptr
  • 586
  • 1
  • 8
  • 22
0
votes
2 answers

Xtext Custom DSL formatting

In my DSL I have () for a lot of stuff for example if conditions and some declarations such as block(a;b;c;d;); In my configureFormatting function I do this in the following order: for (Pair pair :…
Ayman Salah
  • 1,039
  • 14
  • 35
0
votes
1 answer

How to initialize a variable dynamically in Xtend 2

This is what I've written in a Xtend class: def getEntityList(String indct, String criterion) { var entities Switch(indct){ case "PAR": entities = obj.getParamList.filter[definition.contains(criterion)] case "REF": entities =…
Sujju
  • 97
  • 8
0
votes
1 answer

How to simulate a user's input (only internally)?

I need to parse something during the runtime of my eclipse plugin (created with Xtext) which would then be treated as if the user has typed it in but without actually popping up and beeing visible for the user as an input of himself. For exmample I…
Raven
  • 2,951
  • 2
  • 26
  • 42
0
votes
2 answers

Why does the error method return an error?

I want to validate input corresponding to the following grammar snippet: Declaration: name = ID "=" brCon=BracketContent ; BracketContent: decCon=DecContent (comp+=COMPARATOR content+=DecContent)* ; DecContent: …
Raven
  • 2,951
  • 2
  • 26
  • 42
0
votes
1 answer

Why does this warning testCase return an error?

I have written the following validation Rule: @Check def checkDeclarationIsNotReferenceToItself(Declaration dec) { if(dec.decCon.singleContent.reference == null && !dec.decCon.nextCon.isEmpty) { //only proceed if it is a…
Raven
  • 2,951
  • 2
  • 26
  • 42
0
votes
1 answer

How to refer to an underlying element for the error method

I am looking for a possibitlity to refer to an element which is a bit deeper in the grammar in the error function. My grammar snippet looks like that: Declaration: name = ID "=" decCon=DecContent ; DecContent: …
Raven
  • 2,951
  • 2
  • 26
  • 42
0
votes
1 answer

How to get the error marker on a specific array element

I have written a validation which works fine but I want to know how I can set the error marker(the red line drawn underneath the input) at the proper position. The Problem is that the part of my grammar looks like that: Declaration: name = ID "="…
Raven
  • 2,951
  • 2
  • 26
  • 42
0
votes
2 answers

Making for loop in xtend template, to print in same line

So if I have «FOR number: numbers» «number» «ENDFOR» It will print every number in new line, how do I make it print numbers in the same line?
Erndob
  • 2,512
  • 20
  • 32