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
3
votes
2 answers

Hide Coolbar/Toolbar items/Preference pages in Eclipse RCP application (Eclipse e4)

In our Eclipse RCP application (using Eclipse 3.7) I had overridden WorkbenchWindowAdvisor.postWindowCreate() method, to hide the unwanted Coolbar/Toolbar items like File, Run etc. menus and Run Last Tool, Search etc. toolbar buttons and it was…
Kuldeep Jain
  • 8,409
  • 8
  • 48
  • 73
2
votes
1 answer

How can I override ML_COMMENT in Xtext?

In Xtext 2.0, ML_COMMENT is defined in org.eclipse.xtext.common.Terminals as hidden. I want to see comments in my grammar. How can I undo this?
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
2
votes
2 answers

xtext: how to use grammar besides Eclipse editor?

I am trying to use the example org.eclipse.xtext.example.arithmetics.Arithmetics with xtext. I can run the Eclipse Application as described in the 5-minute tutorial and 15-minute tutorial, so the editor will do syntax checking. But how do I actually…
Jason S
  • 184,598
  • 164
  • 608
  • 970
2
votes
1 answer

Scoping and imports in Xtext

I've got the following Xtext grammar: Model: 'model' name = ID imports += Import* items += Item* rules += Rule*; Import: 'import' importURI = STRING; Rule: 'rule' name = ID '(' items += [Item]* ')'; Item: 'item' name = ID; When…
Jorn
  • 20,612
  • 18
  • 79
  • 126
2
votes
2 answers

How to make Enum literal case insensitive in Xtext

I have defined an EnumRule like following in my Xtext grammar file: enum MySpec_directionEnum: left='"left"' | right='"right"' | none='"none"'; With this rule the allowed enum values are "left", "right" and "none" (all in lower case). I want to be…
Kuldeep Jain
  • 8,409
  • 8
  • 48
  • 73
2
votes
1 answer

Handle dynamic variable with Xtext grammar

In my DSL variables are dynamic, they are created the first time a value is assigned to them. So this is a valid code: a = 0 b = 2 // new variable created a = 3 // existing variable reassigned My naive approach is to have rules like…
Adam Schmideg
  • 10,590
  • 10
  • 53
  • 83
2
votes
2 answers

How do I attach some cached information to an Eclipse editor or resource?

I'm developing a DSL using Eclipse's Xtext framework. For the content assist/code completion, I have an expensive process which generates me a list of strings. How do I cache the result of that process? Long story: My DSL interfaces with Groovy…
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
2
votes
1 answer

Cannot open workspace-external file in Xtext-based plugin

I'm developing an Eclipse Plugin with support for my DSL using the Xtext framework. When I try to open a file on my system with the matching file extension .gf — but which is not in my workspace — I get the following: 0 [main] ERROR…
John J. Camilleri
  • 4,171
  • 5
  • 31
  • 41
2
votes
1 answer

How do I include files with no extension for my Xtext DSL?

By default Xtext allows to specify a single extension for DSL files when creating a new project. However, it is possible to add more extensions for a single DSL as described in Xtext FAQ. But I couldn't get it working with files with no extension at…
Eldar Abusalimov
  • 24,387
  • 4
  • 67
  • 71
2
votes
3 answers

Xtext 2.0 maven or ant project

I want to build my own xtext 2.0 project from command line. Could anybody share real working xtext 2.0 maven pom.xml or ant build.xml file?
kolchanov
  • 2,018
  • 2
  • 14
  • 32
2
votes
2 answers

Own DSL with XText. Problem with unlimited brackets ("(", ")")

I am developing my own DSL in XText. I want do something like this: 1 AND (2 OR (3 OR 4)) Here my current .xtext file: grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals generate myDsl…
SCBoy
  • 545
  • 8
  • 19
2
votes
1 answer

How does Semantic Highlighting work in VS Code with custom Xtext LS

I'm currently testing how to create a VS Code extension that would allow me to write files using my own DSL defined in Xtext (*.sample). So far I've been able to create the VS Code extension and use it: Open a file (*.sample) and load the…
2
votes
3 answers

XText2 adoption and migration

Does anyone here try to adopt xtext2 and migrate from xtext1.x to xtext2.0? It seems xtext2 brings many new atractive features. Such as A Reusable Expression Language and Xtend: A Code Generation Language . Many performance enhancement is made to…
Clark Bao
  • 1,743
  • 3
  • 21
  • 39
2
votes
1 answer

Remove jdt dependencies from XTEXT 2.0 project

how can i remove JDT deperndencies from an XTEXT 2.0 project? I tried to follow the hints here (comment 11) but i didn't success in removing JDT dependencies. When I try to validate the product Eclipse says that the plugin…
hara
  • 3,274
  • 4
  • 37
  • 55
2
votes
0 answers

How to validate terminal rule ID wtih Xtext IConcreteSyntaxValidator?

I would like to use Xtext's validation of the default terminal rule ID programmatically. Using the default example grammar: Model: greetings+=Greeting*; Greeting: 'Hello' name=ID '!'; and creating a Greeting entity with an invalid name…