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

Xtext - The type com.google.inject.Inject is not on the classpath

I am using the following code in JvmModelInferrer.xtend to generate a Java class @Inject extension JvmTypesBuilder def dispatch void infer(Model element, IJvmDeclaredTypeAcceptor acceptor, boolean isPreIndexingPhase) { …
Philip John
  • 5,275
  • 10
  • 43
  • 68
1
vote
3 answers

xText and ANTLR

My current project is focusing on code generation from DSL ( i.e., high-level specification). More specifically, developers write high-level specifications and these specifications are parsed and generate code in Java and Android. For parser, I…
user-517752
  • 1,188
  • 5
  • 21
  • 54
1
vote
2 answers

Check type in Xtend validator

I want to check the type of an feature inside my Xtend validator. The Xtext grammar looks like the following: Element: 'Element' name=ID 'feature' feature=DOUBLE 'end' 'Element' ; This is how it is used: Element MyElement feature…
John
  • 795
  • 3
  • 15
  • 38
1
vote
1 answer

Xtext Validator creating Errors

I was wondering if there is a general strategy that can be applied to show errors (or warnings etc.) in the validator. I know there is the error function, that take arguments like: message source feature and others... Is it possible to call this…
Robin
  • 3,512
  • 10
  • 39
  • 73
1
vote
1 answer

What does Xtend in Eclipse actually do?

I was trying to understand the software Xtend in Eclipse. I wanted to understand what does it actually do? Is it a software to form a link between Java and other programming platforms? Could somebody give me a brief idea as to how is Xtend…
Goldengirl
  • 957
  • 4
  • 10
  • 30
1
vote
1 answer

Assignment Operator (=) overloading in xtend

I'm considering the use of xtend for a project that would benefit from its operator overloading, as that would greatly enhance readability of the code. However what I didn't seem to come accross is assignment operator overloading. Did I miss it or…
geert3
  • 7,086
  • 1
  • 33
  • 49
1
vote
1 answer

initializeError while Unit-testing Mock objects with Mockito in Xtend

I'm trying to run this unit test, I'm currently using Xtend over Java in order to read the code easily. The test consist on an admin who must verify a user in order to add it or not to the current repository. I want to make that admin a mock object…
1
vote
1 answer

Decide which rule to match (alternative for semantic predicates in Xtext)

In my grammar I have Variables and Objects (Objects are just a name (ID)). Now I want that a variable can be a reference to another declared variable or an object. So I want to parse the following input: var = 3; var2 = var; objVar =…
Raven
  • 2,951
  • 2
  • 26
  • 42
1
vote
1 answer

How to use GWTs JSNI with Xtend

I'm creating a GWT application and using Xtend. It seems that when Xtend compiles to Java, it removes comments, so when I try to use JSNI, it turns this: def native void publish() /*-{ // do some javascript stuff through JSNI }-*/; into…
phil-daniels
  • 574
  • 2
  • 10
  • 28
1
vote
0 answers

How to import .xtend files into Android Activity Class?

For one of my POC, I am using ClassName.xtend files for some functionality. Whenevenr I am tring to import that class(ClassName.xtend) into my activity it showing error and not importing that xtend files. Please any one help me to import the xtend…
Krishna
  • 4,892
  • 18
  • 63
  • 98
1
vote
1 answer

Xtext ScopeProvider: Accessing context object leads to errors

Every time I try to access the context object in the ScopeProvider , I'll get a "cyclic resolution of lazy links" error or my ScopeProvider will be fully ignored and the default scope is used. Heres a small example grammar: grammar…
tly
  • 1,202
  • 14
  • 17
1
vote
2 answers

Do I need to use Xtend/Acceleo?

I have created an Ecore metamodel and generated an editor through EMF. To generate my output code I parse the resource set (XMI) when a diagram is created and then map these resources to my own Java classes. These Java classes are responsible for…
ble
  • 29
  • 4
1
vote
2 answers

Automatic Interface Implementation via Xtend ActiveAnnotations

Let's say, I have a Java interface: public interface IMyInterface { void hello(String who); } I want to create an active annotation with Xtend that automatically (and generically) implements that interface for an Xtend class. So that, when I…
Stefan Winkler
  • 3,871
  • 1
  • 18
  • 35
1
vote
1 answer

xtext code generation, how to avoid the code generation of a line?

I'm using xtext to generate java code for a college assignment, my problem is that i need a counter while generating code so i'm doing this: «var i = 0» «fc.function.name» («FOR a: fc.arguments SEPARATOR ','» …
1
vote
1 answer

Xtend does not seem to recognize += -=

I am using the full eclipse package from the Xtend website. I am able to create Xtend classes and they compile just fine except that Xtend does not seem to recognize the operators += or -=. These operators result in a compilation error (such as: +=…