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
5
votes
1 answer

xtext dealing with left recursion grammar

I am using xtext 2.4 and want to support both map and set, my grammar looks like this ::- ::- | ::- '{' ( ':' (',' ':' )*)? '}' ::- '{' ( (',' )* )+…
Ray Wu
  • 993
  • 16
  • 34
5
votes
1 answer

Xtext - Content proposal match context indentation

Using XText, is there a way to have text added with a content proposal to match the formatting (current indentation) where it is being inserted? What I do now: 1) Create a model that will be used for content proposal 2) I get the content proposal…
Sheldon Warkentin
  • 1,706
  • 2
  • 14
  • 31
5
votes
1 answer

xtext comma separated variable declaration

I try to define some XText for specifiying variables according to following syntax variables MyVar1 : Bool at 0x020 value=true; MyVar2, MyVar3 : Int at 0x030 value 200; end-variables So each definition is syntactically VarName ["," VarName]*…
abs
  • 71
  • 6
5
votes
1 answer

How to resolve "generated package may not be empty" error

I have a grammar called leach.xtext and when I put this into Xtext in my file myDsl.xtext I'm getting the following error: Generated package 'leach' may not be empty. By looking at other examples, they all add some "rule" at the start of the xtext…
Force444
  • 3,321
  • 9
  • 39
  • 77
5
votes
1 answer

Xtext DSL embedded editor in a dialog

I am new to xtext, and i have created a DSL using xtext and i have generated the artifacts, which has generated the editor which has many features like content assist and syntax coloring now the problem is i want to embed the editor inside a…
5
votes
1 answer

remove fields in outline view of xtext eclipse

I have started working on eclipse recently. In eclipse xtext my grammar is: regGrp: reg_type=reg_type1 "{" reg_definition+=reg_definition1+ "}" ; reg_type1 : name="CONTROL_REGISTERS" ; reg_definition1: name=ID '[' regSize=INT…
ziga
  • 109
  • 10
5
votes
1 answer

Interpreter vs. Code Generator Xtext

I've a DSL written using Xtext. What I want is to execute that DSL to perform something good out of it. I wrote myDslGenerator class implementing the interface IGenerator in xtend to generate java code and it's working fine. I've two…
nommyravian
  • 1,316
  • 2
  • 12
  • 30
5
votes
1 answer

An error occurred while collecting items to be installed: osgi.bundle,org.eclipse.sdk,4.2.0.v201206081400

I am trying to export an Xtext project as an Eclipse Product. The launch configuration works flawlessly if launched from within Eclipse, but I am unable to export it to make a self-contained product. I get: An error occurred while collecting items…
Danilo Pianini
  • 966
  • 8
  • 19
5
votes
3 answers

Viewing the parse tree/node model/AST in xtext

I'm using xtext to generate an editor for a particular language. When using the editor for my new language, it has all the lovely xtext features like code-completation and coloring and so on. What I'd like to be able to do is visualise the…
Joe
  • 4,367
  • 7
  • 33
  • 52
5
votes
1 answer

How to integrate Xtext with an Eclipse plugin?

I have created a simple Xtext project and I want to generate some specification files. With ANTTLR tool I will generate some other files based on the specification files of Xtext project. I have created a plugin, that uses the specification files…
5
votes
2 answers

Convert Object to Xtext DSL

I've defined a simple Xtext grammar which looks like this (simplified): grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals generate myDsl "http://www.xtext.org/example/mydsl/MyDsl" import…
Michael
  • 3,982
  • 4
  • 30
  • 46
5
votes
2 answers

java.lang.NoClassDefFoundError when running JUnit plug-in test

When I run my JUnit Plug-in test I keep getting a java.lang.NoClassDefFoundError. Here are some missing bundles but I doubt that that's the problem since I also get these when running the plugin and everything works fine there. !ENTRY…
Tobias
  • 4,999
  • 7
  • 34
  • 40
4
votes
2 answers

How to solve ERROR Mwe2Launcher: Couldn't find EClass for name

I created a Xpand generator. In its src/ folder I've defined my model My.nn a template and a workflow. This is how my workflow.mwe2 file looks like: module workflow.NeuralNetworksGenerator import org.eclipse.emf.mwe.utils.* var targetDir =…
deedee
  • 311
  • 1
  • 3
  • 8
4
votes
1 answer

Left-factoring grammar of coffeescript expressions

I'm writing an Antlr/Xtext parser for coffeescript grammar. It's at the beginning yet, I just moved a subset of the original grammar, and I am stuck with expressions. It's the dreaded "rule expression has non-LL(*) decision" error. I found some…
Adam Schmideg
  • 10,590
  • 10
  • 53
  • 83
4
votes
4 answers

How to generate code using Xtext and Xtend?

This a grammar I wrote using Xtext to implement a DSL. grammar org.processing.pde.Pde with org.eclipse.xtext.common.Terminals generate pde "http://www.processing.org/pde/Pde" Pde: Active | Static; Active: method_1=Setup …
Harshani
  • 649
  • 2
  • 9
  • 22