aboutsummaryrefslogtreecommitdiffstats
path: root/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.language/xtend-gen/ca/mcgill/ecse/dslreasoner/formatting2/VampireLanguageFormatter.java
blob: 48b973e73e3541e89368d36a6dc6b49d1f4b7e96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/**
 * generated by Xtext 2.12.0
 */
package ca.mcgill.ecse.dslreasoner.formatting2;

import ca.mcgill.ecse.dslreasoner.services.VampireLanguageGrammarAccess;
import ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSComment;
import ca.mcgill.ecse.dslreasoner.vampireLanguage.VLSFofFormula;
import ca.mcgill.ecse.dslreasoner.vampireLanguage.VampireModel;
import com.google.inject.Inject;
import java.util.Arrays;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.formatting2.AbstractFormatter2;
import org.eclipse.xtext.formatting2.IFormattableDocument;
import org.eclipse.xtext.formatting2.IHiddenRegionFormatter;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;

@SuppressWarnings("all")
public class VampireLanguageFormatter extends AbstractFormatter2 {
  @Inject
  @Extension
  private VampireLanguageGrammarAccess _vampireLanguageGrammarAccess;
  
  protected void _format(final VampireModel vampireModel, @Extension final IFormattableDocument document) {
    EList<VLSComment> _comments = vampireModel.getComments();
    for (final VLSComment vLSComment : _comments) {
      document.<VLSComment>format(vLSComment);
    }
    EList<VLSFofFormula> _formulas = vampireModel.getFormulas();
    for (final VLSFofFormula vLSFofFormula : _formulas) {
      document.<VLSFofFormula>format(vLSFofFormula);
    }
  }
  
  protected void _format(final VLSFofFormula formula, @Extension final IFormattableDocument document) {
    final Procedure1<IHiddenRegionFormatter> _function = (IHiddenRegionFormatter it) -> {
      it.newLine();
    };
    document.<VLSFofFormula>append(formula, _function);
  }
  
  protected void _format(final VLSComment comment, @Extension final IFormattableDocument document) {
    final Procedure1<IHiddenRegionFormatter> _function = (IHiddenRegionFormatter it) -> {
      it.newLine();
    };
    document.<VLSComment>append(comment, _function);
  }
  
  public void format(final Object comment, final IFormattableDocument document) {
    if (comment instanceof XtextResource) {
      _format((XtextResource)comment, document);
      return;
    } else if (comment instanceof VLSComment) {
      _format((VLSComment)comment, document);
      return;
    } else if (comment instanceof VLSFofFormula) {
      _format((VLSFofFormula)comment, document);
      return;
    } else if (comment instanceof VampireModel) {
      _format((VampireModel)comment, document);
      return;
    } else if (comment instanceof EObject) {
      _format((EObject)comment, document);
      return;
    } else if (comment == null) {
      _format((Void)null, document);
      return;
    } else if (comment != null) {
      _format(comment, document);
      return;
    } else {
      throw new IllegalArgumentException("Unhandled parameter types: " +
        Arrays.<Object>asList(comment, document).toString());
    }
  }
}