Here you will find some experiments with Xtext and Xbase.
(The versions for Xtext 2.2.1 can be found in the branch xtext-2.2.1, the versions for Xtext 2.3.1 can be found in the branch xtext-2.3; the branch master deals with the current version of Xtext, or the latest version.)
You will find the following projects:
Some experiments accessing JVM Types from an Xtext DSL (without using Xbase). Blogged here: Using JVM Types in Xtext 2.1 and the ImportManager .
Some experiments using Xbase expressions in an Xtext DSL, while keeping control on the generation (and reusing XbaseCompiler for generating Java code corresponding to Xbase expressions). Blogged here: Xtext 2.1: using Xbase expressions .
Some experiments using Xbase variable declarations in an Xtext DSL, while keeping control on the generation (and reusing XbaseCompiler for generating Java code corresponding to Xbase variable declarations and initialization expressions). Blogged here: Xtext 2.1: using Xbase variables .
This DSL DOES not work on Xtext 2.4 (and it has not been ported since it was an experiment that made sense only in previous versions). Use xtext-2.3 branch if you want to use this DSL with Xtext 2.3.
Some experiments using Xbase in an Xtext DSL with non direct mapping to Java, using JvmModelInferrer (with custom scoping and validation) and debugging features. The blog post The JvmModelInferrer, the debugger and Xbase in Xtext 2.3 refers to the version in branch xtext-2.3.
An example using an imported Ecore model (after switching from the automatically inferred one). Blogged here Switching from an inferred Ecore model to an imported one in your Xtext grammar .