Index: java/Framclipse/com.framsticks.framclipse/META-INF/MANIFEST.MF
===================================================================
--- java/Framclipse/com.framsticks.framclipse/META-INF/MANIFEST.MF	(revision 437)
+++ java/Framclipse/com.framsticks.framclipse/META-INF/MANIFEST.MF	(revision 438)
@@ -14,25 +14,24 @@
  org.eclipse.emf.mwe2.launch;resolution:=optional,
  com.ibm.icu;resolution:=optional,
- org.eclipse.xtext.xtend;resolution:=optional,
  org.eclipse.xtext.util,
  org.eclipse.emf.ecore,
  org.eclipse.emf.common,
  org.antlr.runtime,
- org.eclipse.core.runtime
+ org.eclipse.core.runtime,
+ org.eclipse.xtext.xbase.lib
 Import-Package: org.apache.log4j
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Export-Package: com.framsticks.framclipse,
+ com.framsticks.framclipse.formatting,
  com.framsticks.framclipse.framScript,
  com.framsticks.framclipse.framScript.impl,
  com.framsticks.framclipse.framScript.util,
- com.framsticks.framclipse.parseTreeConstruction,
  com.framsticks.framclipse.parser.antlr,
  com.framsticks.framclipse.parser.antlr.internal,
+ com.framsticks.framclipse.scoping,
  com.framsticks.framclipse.script,
  com.framsticks.framclipse.script.model,
+ com.framsticks.framclipse.serializer,
  com.framsticks.framclipse.services,
  com.framsticks.framclipse.validation
-Bundle-ClassPath: lib/commons-io-1.4.jar,
- lib/xpp3_min-1.1.4c.jar,
- lib/xstream-1.3.1.jar,
- .
+Bundle-ClassPath: lib/commons-io-1.4.jar,lib/xpp3_min-1.1.4c.jar,lib/xstream-1.3.1.jar,.
Index: java/Framclipse/com.framsticks.framclipse/build.properties
===================================================================
--- java/Framclipse/com.framsticks.framclipse/build.properties	(revision 437)
+++ java/Framclipse/com.framsticks.framclipse/build.properties	(revision 438)
@@ -2,5 +2,6 @@
            res/,\
            src-gen/
-bin.includes = META-INF/,\
+bin.includes = model/,\
+               META-INF/,\
                plugin.xml,\
                lib/commons-io-1.4.jar,\
Index: java/Framclipse/com.framsticks.framclipse/plugin.xml
===================================================================
--- java/Framclipse/com.framsticks.framclipse/plugin.xml	(revision 437)
+++ java/Framclipse/com.framsticks.framclipse/plugin.xml	(revision 438)
@@ -8,5 +8,5 @@
        uri = "http://www.framsticks.com/framclipse/FramScript" 
        class = "com.framsticks.framclipse.framScript.FramScriptPackage"
-       genModel = "com/framsticks/framclipse/FramScript.genmodel" /> 
+       genModel = "model/generated/FramScript.genmodel" /> 
 	
   </extension>
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/FramScript.properties
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/FramScript.properties	(revision 437)
+++ 	(revision )
@@ -1,1 +1,0 @@
-file.extensions=neuro,expdef,style,show,script,inc
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/FramScriptValueConverterService.java
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/FramScriptValueConverterService.java	(revision 437)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/FramScriptValueConverterService.java	(revision 438)
@@ -6,5 +6,5 @@
 import org.eclipse.xtext.conversion.ValueConverterException;
 import org.eclipse.xtext.conversion.impl.AbstractToStringConverter;
-import org.eclipse.xtext.parsetree.AbstractNode;
+import org.eclipse.xtext.nodemodel.INode;
 
 public class FramScriptValueConverterService extends DefaultTerminalConverters {
@@ -16,5 +16,5 @@
 
 			@Override
-			protected String internalToValue(String s, AbstractNode node)
+			protected String internalToValue(String s, INode node)
 					throws ValueConverterException {
 				if (s.startsWith(":~")) {
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/GenerateFramScript.mwe2
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/GenerateFramScript.mwe2	(revision 437)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/GenerateFramScript.mwe2	(revision 438)
@@ -6,11 +6,17 @@
 
 var grammarURI = "classpath:/com/framsticks/framclipse/FramScript.xtext"
-var file.extensions = "neuro, expdef, style, show, script, inc"
+var fileExtensions = "neuro, expdef, style, show, script, inc"
 var projectName = "com.framsticks.framclipse"
 var runtimeProject = "../${projectName}"
+//var generateXtendStub = true
+var encoding = "UTF-8"
 
 Workflow {
     bean = StandaloneSetup {
+		scanClassPath = true
 		platformUri = "${runtimeProject}/.."
+		// The following two lines can be removed, if Xbase is not used.
+//		registerGeneratedEPackage = "org.eclipse.xtext.xbase.XbasePackage"
+//		registerGenModelFile = "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel"
 	}
 	
@@ -20,87 +26,118 @@
 	
 	component = DirectoryCleaner {
+		directory = "${runtimeProject}/model/generated"
+	}
+	
+	component = DirectoryCleaner {
 		directory = "${runtimeProject}.ui/src-gen"
 	}
-	
+/*
+	component = DirectoryCleaner {
+		directory = "${runtimeProject}.tests/src-gen"
+	}
+*/
 	component = Generator {
 		pathRtProject = runtimeProject
 		pathUiProject = "${runtimeProject}.ui"
+//		pathTestProject = "${runtimeProject}.tests"
 		projectNameRt = projectName
 		projectNameUi = "${projectName}.ui"
-		
-		language = {
+		encoding = encoding
+		language = auto-inject {
 			uri = grammarURI
-			fileExtensions = file.extensions
 			
 			// Java API to access grammar elements (required by several other fragments)
-			fragment = grammarAccess.GrammarAccessFragment {}
+			fragment = grammarAccess.GrammarAccessFragment auto-inject {}
 			
-			// generates Java API for the generated EPackages 
-			fragment = ecore.EcoreGeneratorFragment {
+			// generates Java API for the generated EPackages
+			fragment = ecore.EMFGeneratorFragment auto-inject {}
+/*			fragment = ecore.EcoreGeneratorFragment {
 			// referencedGenModels = "uri to genmodel, uri to next genmodel"
 			}
+*/
 			
-			// the serialization component
-			fragment = parseTreeConstructor.ParseTreeConstructorFragment {}
+			// the old serialization component
+			// fragment = parseTreeConstructor.ParseTreeConstructorFragment auto-inject {}
 			
-			// a custom ResourceFactory for use with EMF 
-			fragment = resourceFactory.ResourceFactoryFragment {
-				fileExtensions = file.extensions
-			}
-				
-			// the following fragment tries to use the Antlr Generator fragment which can be installed via update manager from http://download.itemis.com/updates/
-			fragment = AntlrDelegatingFragment {}
-			
-			// java-based API for validation 
-			fragment = validation.JavaValidatorFragment {
-                composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
-                composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
-                // registerForImportedPackages = true
-            }
-            
-			// scoping and exporting API
-			/*
-			fragment = scoping.ImportURIScopingFragment {}
-			fragment = exporting.SimpleNamesFragment {}
-			*/
-			
-			// scoping and exporting API 
-			fragment = scoping.ImportURIScopingFragment {}
-			fragment = exporting.QualifiedNamesFragment {}
-			
-			// formatter API 
-			fragment = formatting.FormatterFragment {}
-
-			// labeling API 
-			fragment = labeling.LabelProviderFragment {}
-
-			// outline API 
-			fragment = outline.TransformerFragment {}
-			fragment = outline.OutlineNodeAdapterFactoryFragment {}
-			fragment = outline.QuickOutlineFragment {}
-
-			// java-based API for content assistance 
-			fragment = contentAssist.JavaBasedContentAssistFragment {}
-			
-			// the following fragment tries to use the Antlr based content assist 
-			//     fragment which can be downloaded from http://www.itemis.com 
-			//     and will be ignored if it's not available. 
-			fragment = DelegatingGeneratorFragment { 
-				delegate = "de.itemis.xtext.antlr.XtextAntlrUiGeneratorFragment"
-				message="You are generating without ANTLR. It is highly recommended to download and use the plugin \'de.itemis.xtext.antlr\' \n\t using the update site http:\//download.itemis.com/updates/."
+			// serializer 2.0
+			fragment = serializer.SerializerFragment auto-inject {
+				generateStub = false
 			}
 
-			fragment = builder.BuilderIntegrationFragment {}
+			// a custom ResourceFactory for use with EMF
+			fragment = resourceFactory.ResourceFactoryFragment auto-inject {}
+				
+			// The antlr parser generator fragment.
+			fragment = parser.antlr.XtextAntlrGeneratorFragment auto-inject {
+			//  options = {
+			//	  backtrack = true
+			//  }
+			}
+/*
+			// Xtend-based API for validation
+			fragment = validation.ValidatorFragment auto-inject {
+*/
+			// Java-based API for validation
+			fragment = validation.JavaValidatorFragment auto-inject {
+			//	composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
+			//	composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
+			}
 
-			// project wizard (optional) 
-			/*
-			fragment = projectWizard.SimpleProjectWizardFragment {
-				generatorProjectName = "${projectName}.generator" 
-				modelFileExtension = file.extensions
-			}
-			*/
+			// old scoping and exporting API
+			fragment = scoping.ImportURIScopingFragment auto-inject {}
+			fragment = exporting.SimpleNamesFragment auto-inject {}
+
+			// scoping and exporting API
+//			fragment = scoping.ImportNamespacesScopingFragment auto-inject {}
+//			fragment = exporting.QualifiedNamesFragment auto-inject {}
+//			fragment = builder.BuilderIntegrationFragment auto-inject {}
+
+			// generator API
+//			fragment = generator.GeneratorFragment auto-inject {}
 			
-			// quickfix API 
-			fragment = quickfix.QuickfixProviderFragment {}			
+			// formatter API
+			fragment = formatting.FormatterFragment auto-inject {}
+
+			// labeling API
+			fragment = labeling.LabelProviderFragment auto-inject {}
+
+			// outline API
+//			fragment = outline.TransformerFragment {}
+//			fragment = outline.OutlineNodeAdapterFactoryFragment {}
+			fragment = outline.OutlineTreeProviderFragment auto-inject {}
+			fragment = outline.QuickOutlineFragment auto-inject {}
+
+			// java-based API for content assistance
+			fragment = contentAssist.JavaBasedContentAssistFragment {}
+/*
+			// content assist API
+			fragment = contentAssist.ContentAssistFragment auto-inject {}
+*/
+			// generates a more lightweight Antlr parser and lexer tailored for content assist
+			fragment = parser.antlr.XtextAntlrUiGeneratorFragment auto-inject {}
+/*
+			// generates junit test support classes into Generator#pathTestProject
+			fragment = junit.Junit4Fragment auto-inject {}
+
+			// rename refactoring
+			fragment = refactoring.RefactorElementNameFragment auto-inject {}
+
+			// provides the necessary bindings for java types integration
+			fragment = types.TypesGeneratorFragment auto-inject {}
+
+			// generates the required bindings only if the grammar inherits from Xbase
+			fragment = xbase.XbaseGeneratorFragment auto-inject {}
+			
+			// generates the required bindings only if the grammar inherits from Xtype
+			fragment = xbase.XtypeGeneratorFragment auto-inject {}
+
+			// provides a preference page for template proposals
+			fragment = templates.CodetemplatesGeneratorFragment auto-inject {}
+
+			// provides a compare view
+			fragment = compare.CompareFragment auto-inject {}
+*/
+			// quickfix API
+			fragment = quickfix.QuickfixProviderFragment auto-inject {}
 		}
 	}
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/resource/FramScriptResourceDescription.java
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/resource/FramScriptResourceDescription.java	(revision 437)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/resource/FramScriptResourceDescription.java	(revision 438)
@@ -5,5 +5,5 @@
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.xtext.naming.IQualifiedNameProvider;
+import org.eclipse.xtext.resource.IDefaultResourceDescriptionStrategy;
 import org.eclipse.xtext.resource.IEObjectDescription;
 import org.eclipse.xtext.resource.impl.DefaultResourceDescription;
@@ -20,6 +20,6 @@
 
 	public FramScriptResourceDescription(Resource resource,
-			IQualifiedNameProvider nameProvider) {
-		super(resource, nameProvider);
+			IDefaultResourceDescriptionStrategy resourceDescriptionStrategy) {
+		super(resource, resourceDescriptionStrategy);
 	}
 
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/resource/FramScriptResourceDescriptionManager.java
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/resource/FramScriptResourceDescriptionManager.java	(revision 437)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/resource/FramScriptResourceDescriptionManager.java	(revision 438)
@@ -2,11 +2,15 @@
 
 import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.xtext.resource.IDefaultResourceDescriptionStrategy;
 import org.eclipse.xtext.resource.IResourceDescription;
 import org.eclipse.xtext.resource.impl.DefaultResourceDescriptionManager;
-
+import com.google.inject.Inject;
 import com.google.inject.Provider;
 
 public class FramScriptResourceDescriptionManager extends
 		DefaultResourceDescriptionManager {
+
+	@Inject
+	private IDefaultResourceDescriptionStrategy strategy;
 
 	private static final String CACHE_KEY = FramScriptResourceDescriptionManager.class.getName() + "#getResourceDescription";
@@ -15,5 +19,5 @@
 		return getCache().get(CACHE_KEY, resource, new Provider<IResourceDescription>(){
 			public IResourceDescription get() {
-				return new FramScriptResourceDescription(resource, getNameProvider());
+				return new FramScriptResourceDescription(resource, strategy);
 			}});
 	}
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/scoping/FramScriptScopeProvider.java
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/scoping/FramScriptScopeProvider.java	(revision 437)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/scoping/FramScriptScopeProvider.java	(revision 438)
@@ -134,5 +134,5 @@
 	private IScope filterByArgumentsCount(IScope scope, int size) {
 		List<IEObjectDescription> filtered = Lists.newArrayList();
-		for (IEObjectDescription desc : scope.getContents()) {
+		for (IEObjectDescription desc : scope.getAllElements()) {
 			Function function = (Function) desc.getEObjectOrProxy();
 			if (function.getParams().size() == size) {
@@ -140,9 +140,9 @@
 			}
 		}
-		return new SimpleScope(scope.getOuterScope(), filtered);
+		return new SimpleScope(filtered);
 	}
 	
 	private IScope addAliases(IScope scope) {
-		Iterable<IEObjectDescription> contents = scope.getContents();
+		Iterable<IEObjectDescription> contents = scope.getAllElements();
 		List<IEObjectDescription> withAliases = Lists.newArrayList(contents);
 		for (IEObjectDescription desc : contents) {
@@ -152,5 +152,5 @@
 			}
 		}
-		return new SimpleScope(scope.getOuterScope(), withAliases);
+		return new SimpleScope(withAliases);
 	}
 
@@ -195,7 +195,7 @@
 	
 	protected IScope scope_VariableRef_var(Model model, EReference ref) {
-		IScope outerScope = delegateGetScope(model, ref).getOuterScope();
+//		IScope outerScope = delegateGetScope(model, ref).getOuterScope();
 		IScope types = typesScopes.get(getExtension(model));
-		return new SimpleScope(outerScope, types.getContents());
+		return new SimpleScope(types.getAllElements());
 	}
 
Index: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/script/XMLConstantProvider.java
===================================================================
--- java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/script/XMLConstantProvider.java	(revision 437)
+++ java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/script/XMLConstantProvider.java	(revision 438)
@@ -7,4 +7,5 @@
 import java.util.Map;
 
+import org.antlr.misc.MultiMap;
 import org.apache.commons.io.IOUtils;
 import org.eclipse.core.runtime.ILog;
@@ -20,6 +21,4 @@
 import com.framsticks.framclipse.script.model.Type;
 import com.google.common.collect.Maps;
-import com.google.common.collect.Multimap;
-import com.google.common.collect.Multimaps;
 import com.google.inject.Inject;
 import com.thoughtworks.xstream.XStream;
@@ -68,6 +67,6 @@
 	private Map<String, Map<String, Type>> createTypeMappings(Framscontext framscontext, Framscript framscript) {
 		Map<String, Map<String, Type>> types = Maps.newHashMap();
-		Multimap<String, String> ext2ctx = ext2Ctx(framscontext);
-		Multimap<String, Type> ctx2type = ctx2Type(framscript);
+		MultiMap<String, String> ext2ctx = ext2Ctx(framscontext);
+		MultiMap<String, Type> ctx2type = ctx2Type(framscript);
 		for (String ext : ext2ctx.keySet()) {
 			HashMap<String, Type> map = new HashMap<String, Type>();
@@ -82,6 +81,6 @@
 	}
 
-	private Multimap<String, String> ext2Ctx(Framscontext framscontext) {
-		Multimap<String, String> ext2ctx = Multimaps.newHashMultimap();
+	private MultiMap<String, String> ext2Ctx(Framscontext framscontext) {
+		MultiMap<String, String> ext2ctx = new MultiMap<String, String>();
 		for (File file : framscontext.getFiles()) {
 			String ext = file.getPattern();
@@ -89,5 +88,5 @@
 			if (file.getCode() != null) {
 				for (Context context : file.getCode().getContexts()) {
-					ext2ctx.put(ext, context.getName());
+					ext2ctx.map(ext, context.getName());
 				}
 			}
@@ -96,8 +95,8 @@
 	}
 
-	private Multimap<String, Type> ctx2Type(Framscript framscript) {
-		Multimap<String, Type> ctx2type = Multimaps.newHashMultimap();
+	private MultiMap<String, Type> ctx2Type(Framscript framscript) {
+		MultiMap<String, Type> ctx2type = new MultiMap<String, Type>();
 		for (Type type : framscript.getTypes()) {
-			ctx2type.put(type.getContext(), type);
+			ctx2type.map(type.getContext(), type);
 		}
 		return ctx2type;
