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

import com.google.inject.Inject;
import de.ugoe.cs.swe.bnftools.services.EbnfGrammarAccess;
import org.eclipse.xtext.IGrammarAccess;
import org.eclipse.xtext.ParserRule;
import org.eclipse.xtext.TerminalRule;
import org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter;
import org.eclipse.xtext.formatting.impl.FormattingConfig;
import org.eclipse.xtext.xbase.lib.Extension;

/**
 * This class contains custom formatting description.
 * 
 * see : http://www.eclipse.org/Xtext/documentation.html#formatting
 * on how and when to use it
 * 
 * Also see {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} as an example
 */
@SuppressWarnings("all")
public class EbnfFormatter extends AbstractDeclarativeFormatter {
  @Inject
  @Extension
  private EbnfGrammarAccess _ebnfGrammarAccess;
  
  protected void configureFormatting(final FormattingConfig c) {
    FormattingConfig.LinewrapLocator _setLinewrap = c.setLinewrap(0, 1, 2);
    TerminalRule _sL_COMMENTRule = this._ebnfGrammarAccess.getSL_COMMENTRule();
    _setLinewrap.before(_sL_COMMENTRule);
    FormattingConfig.LinewrapLocator _setLinewrap_1 = c.setLinewrap(0, 1, 2);
    TerminalRule _mL_COMMENTRule = this._ebnfGrammarAccess.getML_COMMENTRule();
    _setLinewrap_1.before(_mL_COMMENTRule);
    FormattingConfig.LinewrapLocator _setLinewrap_2 = c.setLinewrap(0, 1, 1);
    TerminalRule _mL_COMMENTRule_1 = this._ebnfGrammarAccess.getML_COMMENTRule();
    _setLinewrap_2.after(_mL_COMMENTRule_1);
    IGrammarAccess _grammarAccess = this.getGrammarAccess();
    EbnfGrammarAccess f = ((EbnfGrammarAccess) _grammarAccess);
    FormattingConfig.LinewrapLocator _setLinewrap_3 = c.setLinewrap();
    ParserRule _ruleRule = f.getRuleRule();
    _setLinewrap_3.before(_ruleRule);
    FormattingConfig.LinewrapLocator _setLinewrap_4 = c.setLinewrap();
    ParserRule _importRule = f.getImportRule();
    _setLinewrap_4.before(_importRule);
  }
}
