1 | /**
|
---|
2 | * generated by Xtext
|
---|
3 | */
|
---|
4 | package de.ugoe.cs.swe.bnftools.formatting;
|
---|
5 |
|
---|
6 | import com.google.inject.Inject;
|
---|
7 | import de.ugoe.cs.swe.bnftools.services.EbnfGrammarAccess;
|
---|
8 | import org.eclipse.xtext.IGrammarAccess;
|
---|
9 | import org.eclipse.xtext.ParserRule;
|
---|
10 | import org.eclipse.xtext.TerminalRule;
|
---|
11 | import org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter;
|
---|
12 | import org.eclipse.xtext.formatting.impl.FormattingConfig;
|
---|
13 | import org.eclipse.xtext.xbase.lib.Extension;
|
---|
14 |
|
---|
15 | /**
|
---|
16 | * This class contains custom formatting description.
|
---|
17 | *
|
---|
18 | * see : http://www.eclipse.org/Xtext/documentation.html#formatting
|
---|
19 | * on how and when to use it
|
---|
20 | *
|
---|
21 | * Also see {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} as an example
|
---|
22 | */
|
---|
23 | @SuppressWarnings("all")
|
---|
24 | public class EbnfFormatter extends AbstractDeclarativeFormatter {
|
---|
25 | @Inject
|
---|
26 | @Extension
|
---|
27 | private EbnfGrammarAccess _ebnfGrammarAccess;
|
---|
28 |
|
---|
29 | protected void configureFormatting(final FormattingConfig c) {
|
---|
30 | FormattingConfig.LinewrapLocator _setLinewrap = c.setLinewrap(0, 1, 2);
|
---|
31 | TerminalRule _sL_COMMENTRule = this._ebnfGrammarAccess.getSL_COMMENTRule();
|
---|
32 | _setLinewrap.before(_sL_COMMENTRule);
|
---|
33 | FormattingConfig.LinewrapLocator _setLinewrap_1 = c.setLinewrap(0, 1, 2);
|
---|
34 | TerminalRule _mL_COMMENTRule = this._ebnfGrammarAccess.getML_COMMENTRule();
|
---|
35 | _setLinewrap_1.before(_mL_COMMENTRule);
|
---|
36 | FormattingConfig.LinewrapLocator _setLinewrap_2 = c.setLinewrap(0, 1, 1);
|
---|
37 | TerminalRule _mL_COMMENTRule_1 = this._ebnfGrammarAccess.getML_COMMENTRule();
|
---|
38 | _setLinewrap_2.after(_mL_COMMENTRule_1);
|
---|
39 | IGrammarAccess _grammarAccess = this.getGrammarAccess();
|
---|
40 | EbnfGrammarAccess f = ((EbnfGrammarAccess) _grammarAccess);
|
---|
41 | FormattingConfig.LinewrapLocator _setLinewrap_3 = c.setLinewrap();
|
---|
42 | ParserRule _ruleRule = f.getRuleRule();
|
---|
43 | _setLinewrap_3.before(_ruleRule);
|
---|
44 | FormattingConfig.LinewrapLocator _setLinewrap_4 = c.setLinewrap();
|
---|
45 | ParserRule _importRule = f.getImportRule();
|
---|
46 | _setLinewrap_4.before(_importRule);
|
---|
47 | }
|
---|
48 | }
|
---|