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

Correctly initializing and retrieving preferences in a Xtext-based Eclipse Plugin

I am writing an Eclipse plugin using Xtext 2. I have provided my own preferences by writing my own RootPreferencePage class: package org.grammaticalframework.eclipse.ui.editor.preferences; import…
John J. Camilleri
  • 4,171
  • 5
  • 31
  • 41
6
votes
1 answer

XText in a RCP product

we want to provide the users of our RCP product with a textual editor for our model. Accordingly, we created an EMF model and a XText grammar. The problem is that our RCP app does not the Eclipse IDE's project structure (i.e., we do not have any…
Matteo
  • 1,367
  • 7
  • 25
6
votes
1 answer

Xtext 2.9 scope provider

Xtext 2.9 changed the way scope providers work and I don't understand how they work now. Let's say I have the following grammar: grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals generate myDsl…
J Burns
  • 63
  • 3
6
votes
1 answer

How do Syntactic Predicates Work?

The Xtext documentation, such as here: http://www.eclipse.org/Xtext/documentation.html#syntax just seems explain syntactic predicates by giving one example 'dangling else problem'. My naive interpretation of this would be: If you have ambiguous…
6
votes
1 answer

How can I distinguish between Xtext, Xtend and similar Eclipse technologies?

What are the characteristics, differences and similarities of all these Eclipse-based technologies starting with X (Xtext, Xtend)? Are there any more to learn about?
thSoft
  • 21,755
  • 5
  • 88
  • 103
6
votes
1 answer

Xtext get project root directory from validator

I need to get to validate existence of specific file in Xtext project. The file has similar path as validated object but other root directory, for…
Hersh
  • 630
  • 4
  • 16
6
votes
1 answer

Xtext multiple generators

I use Xtext plugin for eclipse to define my language and generate some files from it. The project is big and I would like to use multiple generators to generate my files, in addition to default generator, generated by the plugin. I tried this…
Hersh
  • 630
  • 4
  • 16
6
votes
3 answers

Is there a java grammar file for Xtext?

I want to create certain files from Java-source files (input: *.java files; output: something). Xtext seems like a good tool for this. Of course, you have to define the grammar (in this case: Java) first. But Xtext should be able to parse Java files…
Usul
  • 237
  • 3
  • 12
5
votes
4 answers

Does boxing cause performance issues?

I'm working on a project in which we are producing a language which compiles to java. The framework we are using (xtext) makes prolific use of boxing in its generated code. Specifically, if you have a statement like: int i = 1; int j = 2; int k = i…
Jeff
  • 12,555
  • 5
  • 33
  • 60
5
votes
0 answers

DSLs - groovy versus xtext

I an well versed with Java. I have few usecases that benefit from a DSL. Before I start on building them, I would like to take input from people who already built them. Can someone help me understand what are pros and cons of writing DSL's in…
Aravind Yarram
  • 78,777
  • 46
  • 231
  • 327
5
votes
1 answer

Advantages Jetbrains MPS has over Xtext

I want to ask the advantages mps and xtext have over each other and the main features when writing a language. I know when working with mps you are directly editing the AST and xtext uses a parser. I have read an advantage of using a AST allows for…
MMM
  • 77
  • 3
5
votes
1 answer

Xtext based language within Intellij Idea

I want to make a plugin for a language for the Intellij Idea IDE. The language has been developped using Eclipse Xtext and is open source. A plugin already exists for Eclipse. My goal is to port this language to Intellij Idea. I want to be able to…
Fitz
  • 570
  • 1
  • 5
  • 23
5
votes
2 answers

Problems finding a csv grammar where cells have a special meaning

I'm trying to find a grammar for the following example csv: a; test;test ; ;a; test;test ; ; ;test a; test;test a; this is test ;test The semicolon is used as the separator. Cells containing only the text have a…
SpaceTrucker
  • 13,377
  • 6
  • 60
  • 99
5
votes
3 answers

How can I traverse the EMF object tree generated by Xtext?

I'm using Xtext to define my DSL. Xtext generates a parser that lets me traverse the EMF model of my input DSL. I'd like to translate this EMF model into some other tree. To do this translation, I need to traverse the tree. But, I couldn't find a…
reprogrammer
  • 14,298
  • 16
  • 57
  • 93
5
votes
2 answers

how to get location (#-th line) of EObject in original document?

The followings are my grammar rules: Stmts: (stmts += Stmt ';')* ; Stmt: Stmt1 | Stmt2 | Stmt3 ... ; I want to know each Stmt# is #-th stmt in stmts and their exactly location (#-th line in original document). Such that I could point out the…
Ray Wu
  • 993
  • 16
  • 34
1 2
3
91 92