Skip to content
Snippets Groups Projects
Commit 286bfbb9 authored by Georgios Treska's avatar Georgios Treska
Browse files

xtext test project before checking changes in ecore

git-svn-id: https://se1.informatik.uni-wuerzburg.de/usvn/svn/code/code/DMM/trunk@8981 9e42b895-fcda-4063-8a3b-11be15eb1bbd
parent 7b533c5b
No related branches found
No related tags found
No related merge requests found
/*
* generated by Xtext
*/
package org.xtext.example.mydsl.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 MyDslTestFormatter extends AbstractDeclarativeFormatter {
@Override
protected void configureFormatting(FormattingConfig c) {
org.xtext.example.mydsl.services.MyDslTestGrammarAccess f = (org.xtext.example.mydsl.services.MyDslTestGrammarAccess) 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 org.xtext.example.mydsl.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 MyDslTestScopeProvider extends AbstractDeclarativeScopeProvider {
}
package org.xtext.example.mydsl.validation;
public class MyDslTestJavaValidator extends AbstractMyDslTestJavaValidator {
// @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