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

Syntax coloring my DSL in Xtext

I'm doing a small academic assignment, in which I'm supposed to implement an eclipse plugin for the NuSMV language (a model checking language) using Xtext. The xtext grammar was provided (with some minor bugs). I've created an Xtext project and…
chainet
  • 11
  • 5
0
votes
1 answer

Working with parsed model in Xtend validator

I want to know how I can access the parsed model of my program. I have a validation check written in xtend which accepts a rule A as it parameter. however I want to search the entire parsed tree and make sure that any other reference to this…
user804723
  • 329
  • 1
  • 3
  • 9
0
votes
1 answer

Xtext Code Generation Value of an Entity and not the object

I am trying to generate code from my grammar. I would like to know how to get the final value e not the object. For example, I have: Interval: '[' lower_bound=Expr ',' upper_bound=Expr ']' | '[' lower_bound=Expr ','…
user2801023
  • 487
  • 1
  • 4
  • 8
0
votes
1 answer

String formatting options

I am porting a C code to xtend, and I have an 32bit integer. Since Java's Integer has a maximum value of 0x7FFFFFFF, I decided to use Long because I would need 0xFFFFFFFF. When I print it out, Long value =…
chris yo
  • 1,187
  • 4
  • 13
  • 30
0
votes
1 answer

Xtend: How to convert Integer to String?

What is the preferred way to convert an Integer into a String in Xtend? Is there a better way than this? var int port = 12345 var String portStr = "" + port
dokaspar
  • 8,186
  • 14
  • 70
  • 98
0
votes
1 answer

How do i diagnose and fix classpath problems?

I have a tycho project that includes xtend sources. One of my dependencies comes with an older version of JUnit that does not include all features that i need. I also have a dependency on JUnit 4.11. Tycho build is fine, but the xtend compiler…
kutschkem
  • 7,826
  • 3
  • 21
  • 56
0
votes
2 answers

Importing Xtend source file into Java project

I know that its possible to redefine operands with Xtend. My question is, can I redefine an operand using Xtend code and then import this source code into Java project to use it? For example I would redefine the operand + with Xtend, than I import…
user2976091
  • 233
  • 3
  • 4
  • 11
0
votes
2 answers

Xtend how to get full path of current working directory

I have written a grammar that allows the user to input a relative path. (e.g. "../../temp/out/path" May aim is to get the absolute path based on the input from the user, and the absolute path of the current working directory so that I can also check…
chris yo
  • 1,187
  • 4
  • 13
  • 30
0
votes
1 answer

Looping in xtend, convert from Java

How would this loop be done in Xtend? for (char character = '\0'; character != PacketConstants.STRING_TERMINATOR; character = (char) buffer.get()) I have read the documentation and tried several different things, I cannot get it to work.
johnathenwhiter94
  • 124
  • 1
  • 3
  • 11
0
votes
2 answers

XTEND For-Loop indexcontrol in DomainmodelGenerator.xtend (XTEXT codegeneration project)

I worked through the Tutorials at eclipse.org/Xtext/documentation and get into expanding these samples. Working with the Domainmodel.xtext sample I generate a Java-Classfile for each entity as stated in the Tut. The DSL specifies an arbitry number…
olippuner
  • 394
  • 4
  • 16
0
votes
1 answer

How to check whether an XFeatureCall actually refers to something

When I'm scanning the ast I want to check whether an element of the type XFeatureCall can be resolved. Concrete example: val x = 2 val y = x + z I know that val y = + But only the XFeatureCall "z" should give true…
tgoossens
  • 9,676
  • 2
  • 18
  • 23
0
votes
1 answer

How to set multiple properties of a java annotation with xtend (using xbase)

According to the JvmTypesBuilder documentation, I use need to use toAnnotation(EObject sourceElement, Class type, Object value) I do not understand what value I should put there? Because I have an annotation…
tgoossens
  • 9,676
  • 2
  • 18
  • 23
0
votes
1 answer

How to check return type in xtext using xbase

With xtext I'm trying to develop a small language. def sum(Integer a, Integer b):Integer { return (a+b) } This is the grammar I use for this: Function: 'def' name=ValidID '('(params+=FullJvmFormalParameter (','…
tgoossens
  • 9,676
  • 2
  • 18
  • 23
0
votes
1 answer

Xtend's _field naming and SpringData's repository naming conventions

It seems that the naming conventions between Xtend and Spring Data are incompatible. For example: // User.xtend class User { @Property var Long id; } interface UserRepository extends JpaRepository { public User findById(Long…
Marty Pitt
  • 28,822
  • 36
  • 122
  • 195
0
votes
1 answer

How to create a `String[]` field with active annotation of xtend?

I tried with active annotation of xtend, and I want to create a live annotation which can generate a String[] field to record the names of method parameters. @Target(ElementType::TYPE) @Active(typeof(ParameterRecorderProcessor)) annotation…
Freewind
  • 193,756
  • 157
  • 432
  • 708