/*
 * generated by Xtext
 */
package de.ugoe.cs.swe.bnftools.formatting;

import org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter;
import org.eclipse.xtext.formatting.impl.FormattingConfig;

/**
 * This class contains custom formatting description.
 * 
 * see : http://www.eclipse.org/Xtext/documentation/latest/xtext.html#formatting
 * on how and when to use it 
 * 
 * Also see {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} as an example
 */
public class EbnfFormatter extends AbstractDeclarativeFormatter {
	
	@Override
	protected void configureFormatting(FormattingConfig c) {
		de.ugoe.cs.swe.bnftools.services.EbnfGrammarAccess f = (de.ugoe.cs.swe.bnftools.services.EbnfGrammarAccess) getGrammarAccess();

		c.setIndentationSpace(" ");
		c.setNoLinewrap();
		c.setAutoLinewrap(10000000);
		c.setLinewrap(2).before(f.getSectionHeadingRule());
		c.setLinewrap(2).after(f.getSectionHeadingRule());
		
		
		c.setNoSpace().after(f.getRuleAccess().getRulenumberINTTerminalRuleCall_0_0_0());
		c.setNoSpace().after(f.getRuleAccess().getRulevariantIDTerminalRuleCall_0_1_0());

		c.setLinewrap().before(f.getRuleAccess().getRulenumberINTTerminalRuleCall_0_0_0());
		c.setNoSpace().before(f.getRuleAccess().getSemicolonKeyword_4());
//		c.setNoSpace().before(f.getRuleAccess().getNameIDTerminalRuleCall_1_0());

//		c.setLinewrap().after(f.getRuleAccess().getDefinitionListDefinitionListParserRuleCall_3_0());
		c.setLinewrap().after(f.getRuleAccess().getDefinitionListAssignment_3());

		c.setLinewrap(2).before(f.getSL_COMMENTRule());
		c.setNoLinewrap().after(f.getSL_COMMENTRule());
		c.setLinewrap(2).before(f.getML_COMMENTRule());	
	}
	
}
