Index: /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/plugin.xml
===================================================================
--- /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/plugin.xml	(revision 71)
+++ /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/plugin.xml	(revision 72)
@@ -248,5 +248,6 @@
 	</extension>
 
-<!--
+<!--   -->
+   
    <extension
          point="org.eclipse.xtext.builder.participant">
@@ -255,7 +256,7 @@
       </participant>
    </extension>
-   -->
-   
-   <!--this is for using a button for generation -->
+
+   
+   <!--this is for using a button for generation 
    <extension
         point="org.eclipse.ui.handlers">
@@ -291,5 +292,5 @@
     </menuContribution>
     </extension>
-
+-->
    
    
@@ -433,4 +434,39 @@
     </provider>
   </extension>
+  <!--
+  <extension
+        point="org.eclipse.ui.commands">
+     <command
+           defaultHandler="de.ugoe.cs.swe.bnftools.ui.EbnfExecutableExtensionFactory:de.ugoe.cs.swe.bnftools.ui.handler.BT_GenerationHandler"
+           id="de.ugoe.cs.swe.bnftools.ebnf.ui.cmdgenerate"
+           name="button_generate">
+     </command>
+  </extension>
+  <extension
+        point="org.eclipse.ui.menus">
+     <menuContribution
+           allPopups="false"
+           locationURI="toolbar:org.eclipse.ui.main.toolbar">
+        <command
+              commandId="de.ugoe.cs.swe.bnftools.ebnf.ui.cmdgenerate"
+              icon="lrun_obj.gif"
+              style="push"
+              tooltip="Generate Code">
+        </command>
+     </menuContribution>
+  </extension>
+  -->
+  <extension
+        id="product"
+        point="org.eclipse.core.runtime.products">
+     <product
+           application="de.ugoe.cs.swe.bnftools.product.application"
+           name="bnf">
+        <property
+              name="appName"
+              value="bnf">
+        </property>
+     </product>
+  </extension>
 
 </plugin>
Index: /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/handler/BT_GenerationHandler.java
===================================================================
--- /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/handler/BT_GenerationHandler.java	(revision 72)
+++ /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/handler/BT_GenerationHandler.java	(revision 72)
@@ -0,0 +1,144 @@
+package de.ugoe.cs.swe.bnftools.ui.handler;
+
+import java.io.File;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.xml.type.SimpleAnyType;
+import org.eclipse.emf.ecore.xml.type.XMLTypeFactory;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.xtext.builder.EclipseResourceFileSystemAccess2;
+import org.eclipse.xtext.generator.IGenerator;
+import org.eclipse.xtext.generator.OutputConfiguration;
+import org.eclipse.xtext.resource.IResourceDescriptions;
+import org.eclipse.xtext.ui.resource.IResourceSetProvider;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class BT_GenerationHandler  extends AbstractHandler implements IHandler {
+
+	@Inject
+    private IGenerator generator;
+ 
+    @Inject
+    private Provider<EclipseResourceFileSystemAccess2> fileAccessProvider;
+     
+    @Inject
+    IResourceDescriptions resourceDescriptions;
+     
+    @Inject
+    IResourceSetProvider resourceSetProvider;
+     
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+    	 
+    	  //used to save the command name (defined in extensions)
+    	  String mode = "";
+    	 
+    	  try {
+    	     mode = event.getCommand().getName();
+    	  } catch (NotDefinedException e1) {
+    	  // TODO Auto-generated catch block
+    	    e1.printStackTrace();
+    	  }
+    	 
+    	  // stuff to get the workbench and current file
+    	  IWorkbench wb = PlatformUI.getWorkbench();
+    	  IWorkbenchWindow window = wb.getActiveWorkbenchWindow();
+    	  IWorkbenchPage page = window.getActivePage();
+    	  IEditorPart editor = page.getActiveEditor();
+    	  IEditorInput input = editor.getEditorInput();
+    	  IPath path = ((FileEditorInput) input).getPath();
+    	 
+    	  String name = path.toString();
+    	  File myfile = new File(name);
+    	 
+    	  IWorkspace workspace= ResourcesPlugin.getWorkspace();
+    	  IPath location= Path.fromOSString(myfile.getAbsolutePath());
+    	  IFile file= workspace.getRoot().getFileForLocation(location);
+    	 
+    	  IProject project = file.getProject();
+    	  IFolder srcGenFolder = project.getFolder("src-gen");
+    	  if (!srcGenFolder.exists()) {
+    	    try {
+    	      srcGenFolder.create(true, true, new NullProgressMonitor());
+    	    } catch (CoreException e) {
+    	    return null;
+    	    }
+    	  }
+    	 
+    	  final EclipseResourceFileSystemAccess2 fsa = fileAccessProvider.get();
+    	 
+    	  fsa.setProject(project);
+    	 
+    	  //same stuff
+    	  //fsa.setOutputPath("src-gen");
+    	  fsa.setOutputPath(srcGenFolder.getName().toString());
+    	 
+    	  fsa.setMonitor(new NullProgressMonitor());
+    	  Map<String, OutputConfiguration> teste = fsa.getOutputConfigurations();
+    	 
+    	  Iterator<Entry<String, OutputConfiguration>> it = teste.entrySet().iterator();
+    	 
+    	  //make a new Outputconfiguration <- needed
+    	  while(it.hasNext()){
+    	 
+    	    Entry<String, OutputConfiguration> next = it.next();
+    	    OutputConfiguration out = next.getValue();
+    	    out.isOverrideExistingResources();
+    	    out.setCreateOutputDirectory(true); // <--- do not touch this
+    	 
+    	  }
+    	  // ----->
+    	 
+    	  URI uri = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
+    	  ResourceSet rs = resourceSetProvider.get(project);
+    	  Resource r = rs.getResource(uri, true);
+    	 
+    	  // to pass a String inside a resource i have to wrap it in a EOBject
+    	  SimpleAnyType wrapper = XMLTypeFactory.eINSTANCE.createSimpleAnyType();
+    	  wrapper.setInstanceType(EcorePackage.eINSTANCE.getEString());
+    	  wrapper.setValue(mode);
+    	  //
+    	 
+    	  // add string to resource
+    	  r.getContents().add(wrapper);
+    	 
+    	  generator.doGenerate(r, fsa);
+    	 
+    	  return null;
+    	 
+    	}
+    
+    @Override
+    public boolean isEnabled() {
+        return true;
+    }
+ 
+}
Index: /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/handler/GenerationHandler.java
===================================================================
--- /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/handler/GenerationHandler.java	(revision 71)
+++ /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/handler/GenerationHandler.java	(revision 72)
@@ -1,3 +1,7 @@
 package de.ugoe.cs.swe.bnftools.ui.handler;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
 
 import org.eclipse.core.commands.AbstractHandler;
@@ -5,4 +9,5 @@
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.common.NotDefinedException;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
@@ -11,11 +16,15 @@
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EcorePackage;
 import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.xml.type.SimpleAnyType;
+import org.eclipse.emf.ecore.xml.type.XMLTypeFactory;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.xtext.builder.EclipseResourceFileSystemAccess;
+import org.eclipse.xtext.builder.EclipseResourceFileSystemAccess2;
 import org.eclipse.xtext.generator.IGenerator;
+import org.eclipse.xtext.generator.OutputConfiguration;
 import org.eclipse.xtext.resource.IResourceDescriptions;
 import org.eclipse.xtext.ui.resource.IResourceSetProvider;
@@ -30,5 +39,5 @@
  
     @Inject
-    private Provider<EclipseResourceFileSystemAccess> fileAccessProvider;
+    private Provider<EclipseResourceFileSystemAccess2> fileAccessProvider;
      
     @Inject
@@ -40,5 +49,15 @@
     @Override
     public Object execute(ExecutionEvent event) throws ExecutionException {
-         
+    	String mode = "";
+ 
+    	try {
+			mode = event.getCommand().getName();
+		} catch (NotDefinedException e1) {
+			// catch block
+			e1.printStackTrace();
+		}
+    		 
+
+    	 
         ISelection selection = HandlerUtil.getCurrentSelection(event);
         if (selection instanceof IStructuredSelection) {
@@ -58,10 +77,36 @@
                 }
  
-                final EclipseResourceFileSystemAccess fsa = fileAccessProvider.get();
+                final EclipseResourceFileSystemAccess2 fsa = fileAccessProvider.get();
                 fsa.setOutputPath(srcGenFolder.getFullPath().toString());
+                
+                //complete the filesystemaccess 
+                fsa.setMonitor(new NullProgressMonitor());
+                Map<String, OutputConfiguration> teste = fsa.getOutputConfigurations();
+        		
+                Iterator<Entry<String, OutputConfiguration>> it = teste.entrySet().iterator();
+                
+                while(it.hasNext()){
+                	 
+                    Entry<String, OutputConfiguration> next = it.next();
+                    OutputConfiguration out = next.getValue();
+                    out.isOverrideExistingResources();
+                    out.setCreateOutputDirectory(true); // <--- do not touch this
                  
+                  }
+                  // ----->
+                
                 URI uri = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
                 ResourceSet rs = resourceSetProvider.get(project);
                 Resource r = rs.getResource(uri, true);
+                
+                // to pass a String inside a resource i have to wrap it in a EOBject
+                SimpleAnyType wrapper = XMLTypeFactory.eINSTANCE.createSimpleAnyType();
+                wrapper.setInstanceType(EcorePackage.eINSTANCE.getEString());
+                wrapper.setValue(mode);
+                //
+               
+                // add string to resource
+                r.getContents().add(wrapper);
+            
                 generator.doGenerate(r, fsa);
                  
Index: /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/.classpath
===================================================================
--- /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/.classpath	(revision 71)
+++ /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/.classpath	(revision 72)
@@ -1,20 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="src" path="src-gen"/>
 	<classpathentry kind="src" path="xtend-gen"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="lib" path="C:/Users/hauke/Desktop/Uni/Hiwijob bnf tools/fop-1.1/lib/avalon-framework-4.2.0.jar"/>
-	<classpathentry kind="lib" path="C:/Users/hauke/Desktop/Uni/Hiwijob bnf tools/fop-1.1/lib/batik-all-1.7.jar"/>
-	<classpathentry kind="lib" path="C:/Users/hauke/Desktop/Uni/Hiwijob bnf tools/fop-1.1/lib/commons-io-1.3.1.jar"/>
-	<classpathentry kind="lib" path="C:/Users/hauke/Desktop/Uni/Hiwijob bnf tools/fop-1.1/lib/commons-logging-1.0.4.jar"/>
-	<classpathentry kind="lib" path="C:/Users/hauke/Desktop/Uni/Hiwijob bnf tools/fop-1.1/lib/serializer-2.7.0.jar"/>
-	<classpathentry kind="lib" path="C:/Users/hauke/Desktop/Uni/Hiwijob bnf tools/fop-1.1/lib/xalan-2.7.0.jar"/>
-	<classpathentry kind="lib" path="C:/Users/hauke/Desktop/Uni/Hiwijob bnf tools/fop-1.1/lib/xercesImpl-2.7.1.jar"/>
-	<classpathentry kind="lib" path="C:/Users/hauke/Desktop/Uni/Hiwijob bnf tools/fop-1.1/lib/xml-apis-1.3.04.jar"/>
-	<classpathentry kind="lib" path="C:/Users/hauke/Desktop/Uni/Hiwijob bnf tools/fop-1.1/lib/xml-apis-ext-1.3.04.jar"/>
-	<classpathentry kind="lib" path="C:/Users/hauke/Desktop/Uni/Hiwijob bnf tools/fop-1.1/lib/xmlgraphics-commons-1.5.jar"/>
-	<classpathentry kind="lib" path="C:/Users/hauke/Desktop/Uni/Hiwijob bnf tools/fop-1.1/build/fop.jar"/>
+	<classpathentry kind="src" path="libs"/>
+	<classpathentry kind="lib" path="libs/avalon-framework-4.2.0.jar"/>
+	<classpathentry kind="lib" path="libs/batik-all-1.7.jar"/>
+	<classpathentry kind="lib" path="libs/commons-io-1.3.1.jar"/>
+	<classpathentry kind="lib" path="libs/commons-logging-1.0.4.jar"/>
+	<classpathentry kind="lib" path="libs/fop.jar"/>
+	<classpathentry kind="lib" path="libs/serializer-2.7.0.jar"/>
+	<classpathentry kind="lib" path="libs/xalan-2.7.0.jar"/>
+	<classpathentry kind="lib" path="libs/xercesImpl-2.7.1.jar"/>
+	<classpathentry kind="lib" path="libs/xml-apis-1.3.04.jar"/>
+	<classpathentry kind="lib" path="libs/xml-apis-ext-1.3.04.jar"/>
+	<classpathentry kind="lib" path="libs/xmlgraphics-commons-1.5.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/.settings/org.eclipse.jdt.core.prefs	(revision 72)
+++ /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/.settings/org.eclipse.jdt.core.prefs	(revision 72)
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Index: /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/META-INF/MANIFEST.MF
===================================================================
--- /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/META-INF/MANIFEST.MF	(revision 71)
+++ /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/META-INF/MANIFEST.MF	(revision 72)
@@ -21,16 +21,37 @@
  org.eclipse.core.resources,
  org.eclipse.core.runtime;version="3.4.0",
- org.eclipse.xtext.xbase.lib
+ org.eclipse.xtext.xbase.lib 
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: de.ugoe.cs.swe.bnftools,
- de.ugoe.cs.swe.bnftools.services,
- de.ugoe.cs.swe.bnftools.ebnf,
- de.ugoe.cs.swe.bnftools.ebnf.impl,
- de.ugoe.cs.swe.bnftools.ebnf.util,
- de.ugoe.cs.swe.bnftools.serializer,
- de.ugoe.cs.swe.bnftools.parser.antlr,
- de.ugoe.cs.swe.bnftools.parser.antlr.internal,
- de.ugoe.cs.swe.bnftools.validation,
- de.ugoe.cs.swe.bnftools.scoping,
- de.ugoe.cs.swe.bnftools.generator,
- de.ugoe.cs.swe.bnftools.formatting
+Export-Package: de.ugoe.cs.swe.bnftools;uses:="org.eclipse.xtext,org.eclipse.xtext.service,com.google.inject",
+ de.ugoe.cs.swe.bnftools.ebnf;uses:="org.eclipse.emf.ecore,org.eclipse.emf.common.util",
+ de.ugoe.cs.swe.bnftools.ebnf.impl;
+  uses:="org.eclipse.emf.ecore,
+   de.ugoe.cs.swe.bnftools.ebnf,
+   org.eclipse.emf.common.util,
+   org.eclipse.emf.ecore.impl,
+   org.eclipse.emf.common.notify",
+ de.ugoe.cs.swe.bnftools.ebnf.util;
+  uses:="org.eclipse.emf.ecore.util,
+   org.eclipse.emf.ecore,
+   org.eclipse.emf.common.notify.impl,
+   de.ugoe.cs.swe.bnftools.ebnf,
+   org.eclipse.emf.common.notify",
+ de.ugoe.cs.swe.bnftools.formatting;uses:="org.eclipse.xtext.formatting.impl",
+ de.ugoe.cs.swe.bnftools.generator;uses:="org.eclipse.emf.ecore.resource,de.ugoe.cs.swe.bnftools.ebnf,org.eclipse.xtext.generator",
+ de.ugoe.cs.swe.bnftools.parser.antlr;uses:="de.ugoe.cs.swe.bnftools.services,org.eclipse.xtext.parser.antlr,de.ugoe.cs.swe.bnftools.parser.antlr.internal",
+ de.ugoe.cs.swe.bnftools.parser.antlr.internal;
+  uses:="org.eclipse.emf.ecore,
+   de.ugoe.cs.swe.bnftools.services,
+   org.antlr.runtime,
+   org.eclipse.xtext.parser.antlr",
+ de.ugoe.cs.swe.bnftools.scoping;uses:="org.eclipse.xtext.scoping.impl",
+ de.ugoe.cs.swe.bnftools.serializer;
+  uses:="org.eclipse.xtext,
+   org.eclipse.emf.ecore,
+   org.eclipse.xtext.serializer.sequencer,
+   de.ugoe.cs.swe.bnftools.services,
+   de.ugoe.cs.swe.bnftools.ebnf,
+   org.eclipse.xtext.serializer.analysis,
+   org.eclipse.xtext.nodemodel",
+ de.ugoe.cs.swe.bnftools.services;uses:="org.eclipse.xtext,org.eclipse.xtext.service",
+ de.ugoe.cs.swe.bnftools.validation;uses:="de.ugoe.cs.swe.bnftools.ebnf"
Index: /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/build.properties
===================================================================
--- /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/build.properties	(revision 71)
+++ /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/build.properties	(revision 72)
@@ -1,7 +1,5 @@
-source.. = src/,\
-          src-gen/,\
-          xtend-gen/
 bin.includes = model/,\
                META-INF/,\
-               .,\
                plugin.xml
+
+jars.compile.order = 
Index: /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src-gen/de/ugoe/cs/swe/bnftools/serializer/EbnfSyntacticSequencer.java
===================================================================
--- /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src-gen/de/ugoe/cs/swe/bnftools/serializer/EbnfSyntacticSequencer.java	(revision 71)
+++ /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src-gen/de/ugoe/cs/swe/bnftools/serializer/EbnfSyntacticSequencer.java	(revision 72)
@@ -76,13 +76,13 @@
 	 * Syntax:
 	 *     (
+	     ']' | 
+	     '|' | 
 	     '(' | 
+	     '*' | 
+	     '+' | 
 	     '}' | 
+	     '{' | 
 	     '[' | 
-	     '*' | 
-	     '|' | 
-	     '{' | 
-	     ')' | 
-	     ']' | 
-	     '+'
+	     ')'
 	 )*
 	 */
Index: /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/formatting/EbnfFormatter.xtend
===================================================================
--- /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/formatting/EbnfFormatter.xtend	(revision 71)
+++ /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/formatting/EbnfFormatter.xtend	(revision 72)
@@ -6,10 +6,7 @@
 import com.google.inject.Inject
 import de.ugoe.cs.swe.bnftools.services.EbnfGrammarAccess
-import org.eclipse.xtext.Keyword
 import org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter
 import org.eclipse.xtext.formatting.impl.FormattingConfig
-import org.eclipse.emf.ecore.EObject
-import de.ugoe.cs.swe.bnftools.ebnf.Rule
-import de.ugoe.cs.swe.bnftools.ebnf.DefinitionList
+
 
 /**
@@ -38,9 +35,4 @@
 
 		
-//		for (Keyword bar : f.findKeywords("|")) {
-//
-//			c.setSpace("\n\t\t").before(bar);
-//		}
-
 	}
 }
Index: /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/generator/EbnfGenerator.xtend
===================================================================
--- /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/generator/EbnfGenerator.xtend	(revision 71)
+++ /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/generator/EbnfGenerator.xtend	(revision 72)
@@ -24,4 +24,5 @@
 import org.eclipse.xtext.generator.IFileSystemAccessExtension
 import java.io.PrintWriter
+
 /**
  * Generates code from your model files on save.
@@ -30,23 +31,22 @@
  */
 class EbnfGenerator implements IGenerator {
+
 	//generation of the xsl-file
 	override void doGenerate(Resource resource, IFileSystemAccess fsa) {
-		var String workspacePath =WorkspaceResolver.getWorkspace();
+		var String workspacePath = WorkspaceResolver.getWorkspace();
 		for (e : resource.allContents.toIterable.filter(EtsiBnf)) {
-			if (e.bnfEntry.size!=0) {
-				 fsa.generateFile(e.name + ".fo", e.compile)
-				 
-				 //generate pdf
-				 var uri = (fsa as IFileSystemAccessExtension2).getURI(e.name+".fo");
-				 var String fullUri = workspacePath+uri.path.substring(10,uri.path.length);
-				System.out.println(workspacePath+uri.path.substring(10,uri.path.length));
+			if (e.bnfEntry.size != 0) {
+				fsa.generateFile(e.name + ".fo", e.compile)
+
+				//generate pdf
+				var uri = (fsa as IFileSystemAccessExtension2).getURI(e.name + ".fo");
+				var String fullUri = workspacePath + uri.path.substring(10, uri.path.length);
+				System.out.println(workspacePath + uri.path.substring(10, uri.path.length));
 				var File file = new File(fullUri);
-				System.out.println(file.exists);
-//				 System.out.println(uri.toString());
-				 
-				 
-//				 System.out.println(file.exists);
-				
-//				 foToPdf.createPdfFromFo(file,aPath.substring(0,aPath.length-3));
+				System.out.println(file.exists+ "," + fullUri.substring(0, fullUri.length - 3));
+
+				if (file.exists) {
+					foToPdf.createPdfFromFo(fullUri.substring(0, fullUri.length - 3));
+				}
 			}
 		}
@@ -54,14 +54,13 @@
 
 	// compile the different entities of the Bnf-----------------------------------------------------------------------------
-	def compile(EtsiBnf bnf) 
-	'''
+	def compile(EtsiBnf bnf) '''
 	<?xml version="1.0"?>
 	<!-- fop «bnf.name».xml -rtf «bnf.name».rtf -->
 	<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
-
+	
 		<fo:layout-master-set>
-	  		<fo:simple-page-master master-name="A4" page-width="210mm" page-height="297mm">
-	    		<fo:region-body region-name="xsl-region-body"  margin="2cm"/>
-	     	</fo:simple-page-master>
+		 		<fo:simple-page-master master-name="A4" page-width="210mm" page-height="297mm">
+		 				<fo:region-body region-name="xsl-region-body"  margin="2cm"/>
+		 				</fo:simple-page-master>
 		</fo:layout-master-set>
 	
@@ -69,7 +68,8 @@
 			<fo:flow flow-name="xsl-region-body" font-family="verdana">
 				
-				<fo:block span="all"  text-align="center" text-indent="1em" font-family="Arial" font-size="20pt" font-weight="bold" background-color="#EEEEEE" line-height="20mm">«bnf.name»</fo:block>
+				<fo:block span="all"  text-align="center" text-indent="1em" font-family="Arial" font-size="20pt" font-weight="bold" background-color="#EEEEEE" line-height="20mm">«bnf.
+		name»</fo:block>
 						
-				«FOR bnfentry:bnf.bnfEntry»
+				«FOR bnfentry : bnf.bnfEntry»
 					«bnfentry.compile»
 				«ENDFOR»
@@ -77,32 +77,38 @@
 		</fo:page-sequence>
 	</fo:root>'''
-	
-	def compile(BnfEntry bnfEntry)'''
-		«IF bnfEntry.rule!= null»
-				«bnfEntry.rule.compile»
+
+	def compile(BnfEntry bnfEntry) '''
+		«IF bnfEntry.rule != null»
+			«bnfEntry.rule.compile»
 		«ENDIF»
 	'''
-	
-	def compile(Rule rule)'''<fo:block><fo:inline id="«rule.name»"	color="purple">«IF rule.rulenumber!=0»«rule.rulenumber».	«ENDIF»«rule.name»</fo:inline>	::=	«rule.definitionList.compile»</fo:block>'''
-	
-	def compile(DefinitionList dList)'''«FOR sDef:dList.singleDefinition»«sDef.compile»«IF !sDef.equals(dList.singleDefinition.last)» | «ENDIF»«ENDFOR»'''
-	
-	def compile(SingleDefinition sDefinition)'''«FOR term:sDefinition.terms»«term.compile»«ENDFOR»'''
-	
-	def compile(Term term)'''«IF term.termAtom!=null»«term.termAtom.compile»«ENDIF»«IF term.termOptionalSequence!=null»«term.termOptionalSequence.compile»«ENDIF»«IF term.termRepeatedSequence!=null»«term.termRepeatedSequence.compile»«ENDIF»«IF term.termGroupedSequence!=null»«term.termGroupedSequence.compile»«ENDIF»'''
-	
-	def compile(GroupedSequence gSequ)'''«FOR d :gSequ.definitionList»«d.compile»«ENDFOR»'''
 
-	def compile(RepeatedSequence rSequ)'''{«FOR d:rSequ.definitions»«d.compile»«ENDFOR»}«IF rSequ.morethanonce»+«ENDIF»'''
-	
-	def compile(OptionalSequence oSequ)'''(«FOR d:oSequ.definitionList»«d.compile»«ENDFOR»)'''
-	
-	def compile(Atom atom)'''
-	«IF atom.atomRuleReference!= null»«atom.atomRuleReference.compile»«ENDIF»«IF atom.atomStringRule!= null»«atom.atomStringRule.compile»«ENDIF»'''
-	
-	def compile(RuleReference rRef)'''<fo:basic-link internal-destination="«rRef.ruleref.name»" text-decoration="underline" color="blue">«rRef.ruleref.name»</fo:basic-link>	'''
-	
-	def compile(StringRule sRule)'''«IF sRule.colon!=null»«sRule.colon»«ENDIF»«IF sRule.literal!=null»«sRule.literal»	«ENDIF»'''
-	
-	
+	def compile(Rule rule) '''<fo:block><fo:inline id="«rule.name»"	color="purple">«IF rule.rulenumber != 0»«rule.
+		rulenumber».	«ENDIF»«rule.name»</fo:inline>	::=	«rule.definitionList.compile»</fo:block>'''
+
+	def compile(DefinitionList dList) '''«FOR sDef : dList.singleDefinition»«sDef.compile»«IF !sDef.equals(
+		dList.singleDefinition.last)» | «ENDIF»«ENDFOR»'''
+
+	def compile(SingleDefinition sDefinition) '''«FOR term : sDefinition.terms»«term.compile»«ENDFOR»'''
+
+	def compile(Term term) '''«IF term.termAtom != null»«term.termAtom.compile»«ENDIF»«IF term.termOptionalSequence !=
+		null»«term.termOptionalSequence.compile»«ENDIF»«IF term.termRepeatedSequence != null»«term.termRepeatedSequence.
+		compile»«ENDIF»«IF term.termGroupedSequence != null»«term.termGroupedSequence.compile»«ENDIF»'''
+
+	def compile(GroupedSequence gSequ) '''«FOR d : gSequ.definitionList»«d.compile»«ENDFOR»'''
+
+	def compile(RepeatedSequence rSequ) '''{«FOR d : rSequ.definitions»«d.compile»«ENDFOR»}«IF rSequ.morethanonce»+«ENDIF»'''
+
+	def compile(OptionalSequence oSequ) '''(«FOR d : oSequ.definitionList»«d.compile»«ENDFOR»)'''
+
+	def compile(Atom atom) '''
+	«IF atom.atomRuleReference != null»«atom.atomRuleReference.compile»«ENDIF»«IF atom.atomStringRule != null»«atom.
+		atomStringRule.compile»«ENDIF»'''
+
+	def compile(RuleReference rRef) '''<fo:basic-link internal-destination="«rRef.ruleref.name»" text-decoration="underline" color="blue">«rRef.
+		ruleref.name»</fo:basic-link>	'''
+
+	def compile(StringRule sRule) '''«IF sRule.colon != null»«sRule.colon»«ENDIF»«IF sRule.literal != null»«sRule.
+		literal»	«ENDIF»'''
+
 }
Index: /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/generator/foToPdf.java
===================================================================
--- /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/generator/foToPdf.java	(revision 71)
+++ /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/generator/foToPdf.java	(revision 72)
@@ -15,16 +15,15 @@
 import javax.xml.transform.stream.StreamSource;
 
+
+
 import org.apache.fop.apps.FOPException;
+import org.apache.fop.apps.Fop;
 import org.apache.fop.apps.FopFactory;
-import org.apache.fop.apps.Fop;
 import org.apache.fop.apps.MimeConstants;
+
 
 public class foToPdf {
 
-	public static void main(String args[]) throws IOException, FOPException,
-			TransformerException {
 
-		createfoFromPdf("test1","test1");
-	}
 	
 	public static void createPdfFromFo(String fileName) throws IOException, FOPException,
Index: /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/validation/EbnfValidator.xtend
===================================================================
--- /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/validation/EbnfValidator.xtend	(revision 71)
+++ /v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/validation/EbnfValidator.xtend	(revision 72)
@@ -14,5 +14,4 @@
 import de.ugoe.cs.swe.bnftools.ebnf.DefinitionList
 import de.ugoe.cs.swe.bnftools.ebnf.SingleDefinition
-import java.util.ArrayList
 import com.google.inject.Inject
 import org.eclipse.xtext.resource.IResourceDescriptions
