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

How to get and modify Xtend AST

Hy all, I would like to write an Eclipse plugin to process and modify the AST of the current xtend editor. How can I get the AST of the xtend editor? Thanks!
Engee
  • 63
  • 7
0
votes
0 answers

Can we do template based generation using only Xtend2

I've been trying to do some template based C code generation with Xpand/Xtend. Using Template.xpt which uses some xtend code like Utils.ext to do some processing. My problem is that instead of writing methods like this: cached…
Sujju
  • 97
  • 8
0
votes
1 answer

Xtend: filter an ArrayList of Strings

I have an array list declared like this: val aName = new ArrayList I add names in this array via the add(). When I print them, I only want to print specific names (e.g. all with names "Charlie" and working at the department Finance). In my for loop,…
chris yo
  • 1,187
  • 4
  • 13
  • 30
0
votes
1 answer

code generation with Xtend

I am implementing my own DSL and using Xtend to generate C code. I have developed small prototype using XPand/Xtend but now I need to convert prototype into XTend. In Xpand, I used to define "Generate" function to generate C file but I don't know…
0
votes
1 answer

Recursive indentation in XTend

Is it possible to control the indentation of recursive called methods in xtend? I have the following case: def generateField(Field field) ''' field «field.name» { description '«field.description»' label '«field.label»' …
aphex
  • 3,372
  • 2
  • 28
  • 56
0
votes
1 answer

How to compile Xtend sources, with the Standalone Compiler?

This is my first question. I created the standalone compiler of Xtend with instructions below. Built with Ant and Ivy Directories are: lib/, build/ "xtend-compiler.jar" will be output on build/ Libraries are downloaded on lib/ the Jar-file contains…
fumiya.f
  • 255
  • 3
  • 13
0
votes
1 answer

Comma separated variable list in Xtext

I have a grammar for a specific DSL. Here is a snippet (written in Xtext): Vars: 'var' (vars += Var) Var: ID (',' ID) * ':' Type ';' And here is an example input: var a,b,c : int; d,e: bool; I'm really interested in Xtend automatic code…
ye9ane
  • 1,959
  • 3
  • 18
  • 31
0
votes
1 answer

Xtend Error on overriding method that is returning an ArrayList

I have an interface called AbstractFactory.java. public interface AbstractFactory { public ArrayList getListOfStruct(); } This interface is implemented in ExcelTester.xtend class. class ExcelTester implements AbstractFactory { …
chris yo
  • 1,187
  • 4
  • 13
  • 30
0
votes
3 answers

Identifying identical parts in xtend (based on xtext grammar)

Part of my xText grammar is as follows: Transition: 'Transition' from=TransitionTerminal; TransitionTerminal: StateTerminal|SubStateTerminal; StateTerminal: 'st' state=[State|ID]; State: 'state' name=ID; Now, I want to identify Transitions with…
0
votes
1 answer

xtend method implementation with Annotations for the parameter

How can I implement this method with Xtend? private void myListenerMethod(@Observes(notifyObserver=IF_EXISTS) @MyAnnotation Boolean value) { ... Do somehting ... } I have here an example for a normal method implementation: var…
nik the lion
  • 458
  • 1
  • 9
  • 22
0
votes
2 answers

How to create an instance of an ecore file programmatically

I am trying to create an instance of an ecore file so I can store data in it. I will serialize it and store it as XMI (and then load it if it exist). In my case I cannot use genmodel and "create dynamic instance". I found this tutorial which create…
Fhl
  • 1,079
  • 1
  • 12
  • 26
0
votes
1 answer

conflicting dependency error on installing new software in Ecllipse

I am trying to start work with Xtend language using Eclipse IDE, and when i am installing new software in it by adding below url http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/ Then i am getting these…
Abhishek
  • 1,337
  • 10
  • 29
0
votes
1 answer

Best way to validate semantics with xtext

i'm new at Xtext validation system, and can't figure out how to validade my expressions. I have something like: VAR ::= ; END_VAR What i need to do is ensure that <'TYPE'> is the same type as <'VALUE'>. My grammar…
keysuke
  • 97
  • 1
  • 1
  • 9
0
votes
1 answer

Eclipse - xtend Template

I tried to create a xtend template from here: Preferences>Xtend>Templates ${imp:import(foo.Bar)} @Test def ${name}() throws Exception { ${cursor} } Even though this is working as Java Template, xtend class will generate following code for…
Tharaka Deshan
  • 1,349
  • 3
  • 15
  • 30
0
votes
1 answer

Xtend Code Generator How to Copy Files

I am implementing my own DSL and using Xtend to generate codes. I need some static resources to be copied to my generate code. I was trying to use commons-io, but I couldn't get anywhere with that! What is the best way to do so? I am trying to avoid…
AmirMV
  • 215
  • 1
  • 11