Questions tagged [xtext]

Use this tag to ask about Eclipse Xtext which is a framework for developing domain specific or general purpose programming languages.

The Xtext framework, which is part of the Eclipse project, is used to develop domain specific or general purpose languages. It provides rich capabilities for integrating a DSL with the Java programming language and the Eclipse IDE.

Using the Xbase expression language in a DSL, it can directly be mapped to Java types. Also accessing Java types in a DSL is easy with Xbase.

For any Xtext language Eclipse's IDE capabilities can be adapted easily by generating class stubs for automatic formatting patterns, scopes and cross references, static validation, content proposals, the outline view or providing quick fixes. Once a stub is implemented it is automatically used by the DSL editor in Eclipse.

1374 questions
0
votes
1 answer

Keyboard shortcut for Xtext MWE2 workflow

is there any possibility to start/run the MWE2 Workflow for generating the Xtext artifacts by a keyboard shortcut, especially under Mac OS X ? The only action I can see is via context menu / right mouse click on the mwe2 file. This action is listed…
Dominik
  • 1,332
  • 1
  • 15
  • 28
0
votes
1 answer

XText: first and last character truncated in custom STRING terminals

I have redefined the STRING terminal this way terminal STRING : ('.'|'+'|'('|')'|'a'..'z'|'A'..'Z'|'_'|'0'..'9')*; because I have to recognize STRING not delimited by " or ' the problem is that, though the generated parser works, it truncates the…
Andrea Sindico
  • 7,358
  • 6
  • 47
  • 84
0
votes
2 answers

How to scan a folder containing an EMF resource for sibling resources

I have developed a DSL with xText and recently add somme enhanced completion. In a xText-generated editor when calling completion by Ctrl-Space, the completion handler has to perform a folder scanning to look for symbols in another text file of the…
Aubin
  • 14,617
  • 9
  • 61
  • 84
0
votes
1 answer

Getting "java.lang.NoClassDefFoundError: org/eclipse/xtext/xbase/lib/Pair" with Eclipse Xtend

I have no idea why I keep getting errors like these but I've been banging my head on the issues for a while now. Basically, I can't use the Xtend Library when I execute a project. Eclipse builds just fine, but during runtime if I execute a class…
0
votes
1 answer

How to generate code using values of declared variables with JvmModelInferrer in xtext?

So I have the following XText grammar: grammar org.xtext.example.hyrule.HyRule with org.eclipse.xtext.xbase.Xbase generate hyRule "http://www.xtext.org/example/hyrule/HyRule" Start: rules+=Rule+; Rule: constantDecs+=…
Marcus Mathioudakis
  • 837
  • 1
  • 6
  • 19
0
votes
2 answers

Accessing class definition in xtext

I'm trying to write an DSL for doing typesafe conversions from one object to another. src classA dst classB map valueA to valueB with ConverterX map valueC to valueD with ConverterY the result should be something like: class Converter { public…
Robert Franz
  • 418
  • 4
  • 14
0
votes
2 answers

Parse file in Xtext MWE2 workflow

I would like to parse a file within an MWE2 workflow, e.g. by giving the org.eclipse.emf.mwe.utils.Reader component a file written in my DSL rather than the XMI representation of it.
Mathias Soeken
  • 1,293
  • 2
  • 8
  • 22
0
votes
1 answer

Xtext - providing scope with a list of string literals

In scope provider class, I want to return an instance of 'Elist'. However 'scopedFor' is not accepting it as 'String' does not extend 'EObject'. I think I am missing something fundamental. Any help will be appreciated.
ronak.patel
  • 273
  • 1
  • 2
  • 9
0
votes
2 answers

Xtext auto-suggest value

I am working on Xtext project. I need feature for my variable declaration. Assume I am using my DSL like one below LifeEra:Teenage Age:(while cursor is here) I wonder if I can get pop-up down here and suggesting 16 since LifeEra entered Teenage. Is…
Semih Korkmaz
  • 1,125
  • 13
  • 26
0
votes
1 answer

How can I create cross-reference when a sigil is required for referring but not for defining?

In my DSL, I have something similar to: x = 14 y = $x + 1 So an element is defined with just its name, but when referred to, some sigil must be added. Any whitespace between the sigil and the name is forbidden when referencing the element. How can…
Oak
  • 26,231
  • 8
  • 93
  • 152
0
votes
1 answer

Custom Highlighting/Markers of java annotations using xtext (Extending java syntax highlighting)

I need to highlight or create markers on some annotations using meta information, which I'm reading from a database. I've already implemented a solution using markers, but I need to take care by myself about the whole marker lifecycle and it doesn't…
aphex
  • 3,372
  • 2
  • 28
  • 56
0
votes
1 answer

OutOfMemoryError when trying to generate a language infrastructure for a tiny XText project

I've created a new XText project with a single xtext file defining the grammar, and without changing any other files in the project. The grammar I defined took about 150 lines and when trying to "generate language infrastructure" everything went…
Oak
  • 26,231
  • 8
  • 93
  • 152
0
votes
2 answers

How can I write a reference to one of two things?

I'm writing an Xtext grammar and I want to support cross-reference for usage of variables or parameters in my target language. So the target language looks something like: function(p1) { x1 = eat(p1) // line 1 x2 = eat(x1) // line 2 } And for…
Oak
  • 26,231
  • 8
  • 93
  • 152
0
votes
1 answer

How do I parse a pseudo float number in Xtext grammar?

I need to filter a 'reference number' of the form XX.XX, where X is any upper or lower-case letter or number (0-9). This is what I have came up with: SCR_REF: 'Scr_Ref' ':' value=PROFILE ; terminal PROFILE : …
A.R.
  • 1,888
  • 2
  • 14
  • 22
0
votes
1 answer

Strip quotes from rule outcome in Xtext2

I have the following Xtext2 grammar: Bibliography: macros += Macro* ; Macro: "@string{" name = ID "=" value = LATEXSTRING "}" ; terminal LATEXSTRING: '"' (!('"'))* '"' ; When parsing a the string @string{ABBREV = "Some Long Text"} and…
Mathias Soeken
  • 1,293
  • 2
  • 8
  • 22