Index: trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/formatter/EbnfFormatterVisitor.java
===================================================================
--- trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/formatter/EbnfFormatterVisitor.java	(revision 22)
+++ trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/formatter/EbnfFormatterVisitor.java	(revision 23)
@@ -3,10 +3,8 @@
 import java.util.ArrayList;
 
-import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.xtext.parsetree.AbstractNode;
 import org.eclipse.xtext.parsetree.CompositeNode;
 import org.eclipse.xtext.parsetree.LeafNode;
-import org.eclipse.xtext.parsetree.NodeAdapter;
 import org.eclipse.xtext.parsetree.NodeUtil;
 
@@ -40,16 +38,14 @@
 	private int bufferPosition = 0;
 	private int bufferPositionOriginalText = 0;
-	private int commentPosition = 0;
 	private int allCommentsPosition = 0;
 	private ArrayList<LeafNode> allComments = new ArrayList<LeafNode>();
-	private ArrayList<String> collectedComments = new ArrayList<String>();
 	
 	private boolean lastWasSectionHeading=false;
 	private CompositeNode parserEtsiBnfNode;
 	private String originalText;
-	private String originalTextNoWhitespaces;
 	private int bufferPositionFormattedText;
 	private String formattedText;
 	private String bufNoWhitespaces;
+	private String originalTextNoWhitespaces;
 	
 	public EbnfFormatterVisitor(EObject rootNode, FormatterConfig config) {
@@ -90,12 +86,4 @@
 	}
 
-//	private ArrayList<String> collectComments(CompositeNode node) {
-//		collectedComments.clear();
-////		System.out.println(node);
-////		System.out.println(node.serialize());
-////		searchSubTree(node);
-//		return collectedComments;
-//	}
-	
 	private boolean isSingleLineComment(String str) {
 		if (str.startsWith("//"))
@@ -183,10 +171,8 @@
 					LeafNode currentComment = allComments.get(allCommentsPosition); 
 					if (currentComment.getTotalOffset() == bufferPositionOriginalText) {
-						
-						
 						if (isMultiLineComment(currentComment.getText())) {
 							result.append(currentComment.getText());
 							result.append("\n");
-						} else {
+						} else if (isSingleLineComment(currentComment.getText())) {
 							String lastWhiteSpaces = scanBackWhitespaces(result.toString(), result.toString().length()-1);
 							result.delete(result.toString().length() - lastWhiteSpaces.length(), result.toString().length());
@@ -209,32 +195,5 @@
 		
 	}
-	
-	private void appendComments(EObject node) {
-//		String currentBuf = buf.toString().replaceAll("[ \t\n\r]", "");
-//		while (bufferPosition < currentBuf.length()) {
-//			skipWhitespacesOriginalText();
-//			System.out.print(currentBuf.charAt(bufferPosition));
-//			System.out.print(originalText.charAt(bufferPositionOriginalText));
-//			bufferPositionOriginalText++;
-//			bufferPosition++;
-//		}
-		
-//
-//		ArrayList<String> comments = collectComments(parseTreeNode);
-//		for (int i=0; i < comments.size(); i++) {
-//			if (isSingleLineComment(comments.get(i))) {
-//				buf.append(" ");
-//				buf.append(comments.get(i).trim());
-//				if (i+1 < comments.size())
-//					buf.append("\n");
-//			} else if (isMultiLineComment(comments.get(i))) {
-//				buf.append("\n");
-//				buf.append(comments.get(i));
-//				if (i+1 < comments.size())
-//					buf.append("\n");
-//			}
-//		}
-		
-	}
+
 	
 	// -----------------------------------------------------------------------------
@@ -252,6 +211,4 @@
 		buf.append(";");
 
-		appendComments(node);
-		
 		buf.append("\n\n");
 	}
@@ -334,7 +291,5 @@
 	protected void visitBefore(Import node) {
 		buf.append("import \"" + node.getImportURI() + "\";");
-		appendComments(node);
 		buf.append("\n");
-		
 	}
 
@@ -407,6 +362,4 @@
 		
 		buf.append(node.getSectionHeader());
-		
-		appendComments(node);
 	}
 
