Skip to content
Snippets Groups Projects
Commit b0b99a9c authored by Fabian Brosig's avatar Fabian Brosig
Browse files

1st iter of repository text editor

git-svn-id: https://se1.informatik.uni-wuerzburg.de/usvn/svn/code/code/DMM/trunk@7810 9e42b895-fcda-4063-8a3b-11be15eb1bbd
parent c832eb11
No related branches found
No related tags found
No related merge requests found
/*
* generated by Xtext
*/
package edu.kit.ipd.descartes.mm.applicationlevel.repository.text.formatting;
import org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter;
import org.eclipse.xtext.formatting.impl.FormattingConfig;
import org.eclipse.xtext.Keyword;
import org.eclipse.xtext.util.Pair;
/**
* 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 RepositoryDSLFormatter extends AbstractDeclarativeFormatter {
@Override
protected void configureFormatting(FormattingConfig c) {
edu.kit.ipd.descartes.mm.applicationlevel.repository.text.services.RepositoryDSLGrammarAccess f = (edu.kit.ipd.descartes.mm.applicationlevel.repository.text.services.RepositoryDSLGrammarAccess) getGrammarAccess();
for(Pair<Keyword, Keyword> pair: f.findKeywordPairs("{", "}")) {
c.setIndentation(pair.getFirst(), pair.getSecond());
c.setLinewrap(1).after(pair.getFirst());
c.setLinewrap(1).before(pair.getSecond());
c.setLinewrap(1).after(pair.getSecond());
}
for(Keyword comma: f.findKeywords(",")) {
c.setNoLinewrap().before(comma);
c.setNoSpace().before(comma);
c.setLinewrap().after(comma);
}
c.setLinewrap(0, 1, 2).before(f.getSL_COMMENTRule());
c.setLinewrap(0, 1, 2).before(f.getML_COMMENTRule());
c.setLinewrap(0, 1, 1).after(f.getML_COMMENTRule());
}
}
/*
* generated by Xtext
*/
package edu.kit.ipd.descartes.mm.applicationlevel.repository.text.scoping;
import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider;
/**
* This class contains custom scoping description.
*
* see : http://www.eclipse.org/Xtext/documentation/latest/xtext.html#scoping
* on how and when to use it
*
*/
public class RepositoryDSLScopeProvider extends AbstractDeclarativeScopeProvider {
}
package edu.kit.ipd.descartes.mm.applicationlevel.repository.text.validation;
public class RepositoryDSLJavaValidator extends AbstractRepositoryDSLJavaValidator {
// @Check
// public void checkGreetingStartsWithCapital(Greeting greeting) {
// if (!Character.isUpperCase(greeting.getName().charAt(0))) {
// warning("Name should start with a capital", MyDslPackage.Literals.GREETING__NAME);
// }
// }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment