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

No source code is available for type org.eclipse.xtext.xbase.lib.Conversions; did you forget to inherit a required module?

My Xtend/GWT app was working great until I tried to do a forEach on an array. Now I'm getting No source code is available for type org.eclipse.xtext.xbase.lib.Conversions; did you forget to inherit a required module? Code def…
phil-daniels
  • 574
  • 2
  • 10
  • 28
0
votes
1 answer

Xtext, multi-file Cross-reference

I want to call variables declared in another file. The include of the file is done using cross referencing. and the call of the declared too. this is the grammar: Script: includes+=(Include)* assignments+=(Assignment)* g=GetLog? clock=Clock?…
BR.Hamza
  • 99
  • 14
0
votes
1 answer

How to Add unimplemented methods from Interfaces with Xtend

Does anyone know, how to do the quickfix to add unimplemented methods from an Interface with Xtend code ?
Davd
  • 113
  • 1
  • 2
  • 8
0
votes
1 answer

Xtext, import my own mydsl file

In my grammar i have an include rule as follow : Script: includes+=(Include)* assignments+=(Assignment)* clock=Clock? tests+=Test* ; Include: 'INCLUDE' importURI=STRING ; what I want to do is to include files same as the "main" file. I'm…
BR.Hamza
  • 99
  • 14
0
votes
1 answer

Xtext, running plugin from selection

I have a DSL myDslthat i run with this code It's in Xtend class LaunchMydslShortcut implements ILaunchShortcut { @Inject private IResourceForEditorInputFactory resourceFactory; override launch(ISelection selection, String mode) { …
BR.Hamza
  • 99
  • 14
0
votes
2 answers

Comparator doesn't work for object types in a TreeSet

I'm trying to eliminate duplicate objects from a list with the help of a TreeSet with a custom Comparator. For this code: class ASDF { int i Pass ref new(Pass p, int i) { this.ref = p this.i=i } public static def…
Sujju
  • 11
  • 4
0
votes
2 answers

xtend code generation calling entities from an xtext grammar

I am working on a code generator for my grammar that I have created: Domainmodel: (elements+=AbstractElement)*; PackageDeclaration: 'package' name=QualifiedName '{' (elements+=AbstractElement)* '}'; AbstractElement: …
Eyad
  • 1
  • 5
0
votes
2 answers

Xtext, Declaring array and structure types

I want to make a Dsl that allow to declare Arrays and structures. I can do it with this grammar: Set: 'SET' '(' attribute=ID ',' value=AttributeValue ')'; SimpleValue: INT | STRING; Structure: '{' ID ':' AttributeValue (',' ID ':'…
BR.Hamza
  • 99
  • 14
0
votes
1 answer

Xtext, making the difference between ID and String at the interpreter

I'm writing a dsl in a text in which people can declare some variables. the grammar is as follows: Cosem: cosem+=ID '=' 'COSEM' '(' class=INT ',' version=INT ',' obis=STRING ')' ; Attributes : attribute+=ID '=' 'ATTRIBUTE' '(' object=ID ','…
BR.Hamza
  • 99
  • 14
0
votes
1 answer

Xtext, get Iselection Input in the LaunchMydslShortcut

I'm trying to make a simple DSL with Xtext and execute it with an interpreter, the grammar is the initial Hello Word project. I can can execute the .Text file successfully. In the org.xtext.example.mydsl.ui project I write this in the plugin.xml…
BR.Hamza
  • 99
  • 14
0
votes
1 answer

How to cancel progress monitor eclipse4.4

I have below code written in xtend : void doMyMethod(IProgressMonitor monitor, Collection myCollection) { val subMonitor = SubMonitor.convert(monitor, myCollection.size()); subMonitor.setTaskName("My Task Name..."); myCollection.forEach…
lifeline2
  • 69
  • 1
  • 15
0
votes
1 answer

Set import layout for xtend files in IntellJ

I want the set a specific layout for imports (for example, all java.* followed be com.google.* followed by everything else) for xtend files in IntellJ. For java files I can do this by setting the import layout under "Settings->Editor->Code…
Sumit
  • 1,934
  • 4
  • 17
  • 23
0
votes
1 answer

Xtext: Testing whitespace language - missing RULE_BEGIN in JUnit

I have this fancy white space language and I'm traing to test it. For now grammar is simple (base on Terminals) Model: {Model} BEGIN package=PackageDeclaration? class=ClassDeclaration? END methods+=MethodDeclaration* ; PackageDeclaration:…
0
votes
2 answers

Xtend force java 7 language level

I am using Xtend in intellij from the Xtend-plugin. My project language level is set to Java 8 and Xtend compiles fine to Java 8 (e.g. using lambda expressions). For specific reasons, I need Xtend to generate Java 7 code, without changing the…
fwind
  • 1,274
  • 4
  • 15
  • 32
0
votes
1 answer

Xtext Code Generation: Get raw String from XBlockExpression

Currently I am working on code generation based on an Xtext-DSL. Now I am facing the following problem: I'm generating an .xtend file with my own implementation of the IGenerator interface. Everything works flawless but I can't access the raw String…
p0wl
  • 658
  • 5
  • 10