Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src')
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/CSS.xtext339
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/CSSRuntimeModule.java19
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/CSSStandaloneSetup.java15
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/GenerateCSS.mwe2133
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/formatting/CSSFormatter.xtend30
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/generator/CSSGenerator.xtend24
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/scoping/CSSScopeProvider.xtend15
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/validation/CSSValidator.xtend25
8 files changed, 600 insertions, 0 deletions
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/CSS.xtext b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/CSS.xtext
new file mode 100644
index 00000000000..61a501b25e2
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/CSS.xtext
@@ -0,0 +1,339 @@
+/*
+ * Copied from org.eclipse.fx.ide.css
+ */
+grammar org.eclipse.papyrus.infra.gmfdiag.css3.CSS hidden(WS, ML_COMMENT)
+
+import "http://www.eclipse.org/emf/2002/Ecore" as ecore
+
+generate cSS "http://www.eclipse.org/papyrus/infra/gmfdiag/css3/CSS"
+
+
+/*
+ * TODOS:
+ * - add more CSS grammar like import
+ */
+
+
+stylesheet:
+ charset=charset?
+ imports+=importExpression*
+ (
+ ruleset+=ruleset |
+ media+=media |
+ page+=page |
+ font_face+=font_face |
+ keyframes+=keyframes
+ )*
+;
+
+charset:
+ ('@charset'|'@CHARSET') charset=CSSSTRING ';'
+;
+
+importExpression:
+ ('@import'|'@IMPORT') (value=CSSSTRING | URLType mediaList=media_list?) ';'
+;
+
+page:
+ {page} ('@page'|'@PAGE') pseudoPage=pseudo_page?
+ '{' declarations+=css_declaration? ( ';' declarations+=css_declaration? )* '}'
+;
+
+pseudo_page:
+ COLON Identifier
+;
+
+media:
+ ('@media'|'@MEDIA') medialist=media_list '{' rulesets+=ruleset* '}'
+;
+
+media_list:
+ medium ( COMMA medium)*
+;
+
+medium:
+ Identifier
+;
+
+font_face:
+ {font_face} ('@font-face'|'@FONT-FACE')
+ '{' declarations+=css_declaration? ( ';' declarations+=css_declaration? )* '}'
+;
+
+keyframes:
+ {font_face} ('@keyframes'|'@KEYFRAMES') name=Identifier
+ '{' keyframeselectors+=keyframe_selector? ( ';' keyframeselectors+=keyframe_selector? )* '}'
+;
+
+keyframe_selector:
+ (type=Identifier | (percentage=Num PERCENT)) '{'
+ declarations+=css_declaration? ( ';' declarations+=css_declaration? )*
+ '}'
+;
+
+
+ruleset:
+ selectors+=selector ( WS* COMMA selectors+=selector )* WS* '{'
+ (declarations+=css_declaration (';' declarations+=css_declaration)* ';'?)?
+ '}'
+;
+
+// check simple_selctor cardinality
+selector hidden(ML_COMMENT):
+ simpleselectors+=simple_selector ( combinator=combinator WS* selector=selector | WS+ (combinator=combinator WS*)? selector=selector )?
+;
+
+SimpleSelectorForNegation:
+ ((element=ElementSelector | universal=UniversalSelector) subSelectors+=SubSelectorForNegation*) |
+ => subSelectors+=SubSelectorForNegation+
+;
+
+SubSelectorForNegation returns CssSelector:
+ IdSelector |
+ ClassSelector |
+ AttributeSelector |
+ PseudoClass
+;
+
+simple_selector hidden(ML_COMMENT):
+ ((element=ElementSelector | universal=UniversalSelector) subSelectors+=SubSelector*) |
+ subSelectors+=SubSelector+
+;
+
+SubSelector returns CssSelector:
+ IdSelector |
+ ClassSelector |
+ AttributeSelector |
+ PseudoClassOrFunc
+;
+
+AttributeSelector returns CssSelector:
+ {AttributeSelector} '[' name=Identifier ( op=( '^=' | '$=' | '*=' | '=' | INCLUDES | DASHMATCH ) value=( Identifier | CSSSTRING ) )? ']'
+;
+
+ClassSelector:
+ {ClassSelector} '.' name=Identifier
+;
+
+ElementSelector:
+ {ElementSelector} name=Identifier
+;
+
+UniversalSelector:
+ {UniversalSelector} ( namespace=css_namespace_prefix )? '*'
+;
+
+IdSelector:
+ {IdSelector} HASHMARK name=Identifier
+;
+
+css_namespace_prefix
+ : ( Identifier | '*' )? '|'
+ ;
+
+css_declaration hidden(ML_COMMENT):
+ WS* property=css_property WS* COLON valueTokens+=CssTok+ important?=IMPORTANT_SYM?
+;
+
+css_property:
+ {css_property} name=ValidPropertyIdent
+;
+
+ValidPropertyIdent:
+ Identifier
+;
+
+PseudoClassOrFunc:
+ PseudoClass | PseudoClassFunction
+;
+
+PseudoClass:
+ COLON COLON? PseudoClassName
+;
+
+PseudoClassName:
+ name=Identifier
+;
+
+PseudoClassFunction:
+ not?=NotFunctionCall paramSelector=SimpleSelectorForNegation ')' |
+ COLON name=Identifier '(' params+=CssTok* ')'
+;
+
+NotFunctionCall hidden():
+ COLON 'not('
+;
+
+combinator
+ :
+ (
+ PLUS
+ | '>'
+ | '~'
+ )
+;
+
+operator
+ : '/' | COMMA
+ ;
+
+unary_operator
+ : DASH | PLUS
+ ;
+
+SymbolTok returns CssTok:
+ {SymbolTok} symbol=(COMMA|PERCENT)
+;
+
+WSTok returns CssTok:
+ {WSTok} WS
+;
+
+StringTok returns CssTok:
+ {StringTok} value=CSSSTRING
+;
+
+
+
+NumberTok returns CssTok hidden():
+ {NumberTok} val=Num
+
+// {NumberTok} DASH? ( ONE_INT+ | ONE_INT* '.' => ONE_INT+)
+
+// {NumberTok} val=Integer | Real
+ //sign=DASH? ( ival=Integer | dval=Real)
+;
+
+
+UrlTok returns CssTok:
+ {UrlTok} url=URLType
+;
+
+ColorTok returns CssTok hidden():
+ {ColorTok} value=Hex
+;
+
+IdentifierOrFuncTok returns CssTok hidden(ML_COMMENT):
+ {IdentifierTok} name=Identifier ( {FuncTok.name=current} '(' params+=CssTok+ ')')?
+;
+
+CssTok hidden(ML_COMMENT):
+ IdentifierOrFuncTok |
+ SymbolTok |
+ WSTok |
+ StringTok |
+ NumberTok |
+ UrlTok |
+ ColorTok
+;
+
+
+URLType hidden():
+// FULLURL
+ 'url(' url=ValidURL ')'
+;
+
+ValidURLSymbol:
+ DASH | '.' | UNDERSCORE | '~' | COLON |
+ '/' |'?' | HASHMARK | '[' | ']' | '@' |
+ '!' | '$' | '&' | /* "'" | '(' | ')' | need to be escaped*/
+ '*' | PLUS | COMMA | ';' | '='
+ KeywordHack
+;
+
+KeywordHack:
+ 'not' |
+ 'no' |
+ 'url' |
+ 'ur'
+;
+
+ValidURL returns ecore::EString hidden():
+ CSSSTRING |
+ ( ValidURLSymbol |
+ KeywordHack |
+ ONE_HEX_LETTER |
+ ONE_NON_HEX_LETTER |
+ ONE_INT |
+ '\\ ' |
+ '\\(' |
+ '\\)' |
+ '\\\'' |
+ '\\"' |
+ PERCENT (ONE_INT|ONE_HEX_LETTER) (ONE_INT|ONE_HEX_LETTER)
+ )+
+;
+
+terminal IMPORTANT_SYM:
+ '!important'
+;
+
+Identifier returns ecore::EString hidden():
+ DASH? (UNDERSCORE | ONE_HEX_LETTER | ONE_NON_HEX_LETTER | KeywordHack) => (UNDERSCORE | DASH | ONE_HEX_LETTER | ONE_NON_HEX_LETTER | ONE_INT | KeywordHack)*
+;
+
+Num returns ecore::EDouble hidden():
+ (PLUS|DASH)? (
+ '.' => ONE_INT+ |
+ => ONE_INT+ (=> '.' => ONE_INT+)?
+ )
+;
+
+Hex returns ecore::EString:
+ HASHMARK => (ONE_INT|ONE_HEX_LETTER)+
+;
+
+
+//terminal fragment URL_ESCAPES:
+// '\\' (' '|'('|')'|"'"|'"')
+//;
+//
+//terminal FULLURL:
+// 'url('
+// '"' ( URL_ESCAPES | !('\\'|'"'|')') )* '"' |
+// "'" ( URL_ESCAPES | !('\\'|"'"|')') )* "'" |
+// ( URL_ESCAPES | !('\\'|')') )*
+// ')'
+//;
+
+
+terminal ONE_INT: '0'..'9';
+terminal ONE_HEX_LETTER: ('a'..'f'|'A'..'F');
+terminal ONE_NON_HEX_LETTER: ('g'..'z'|'G'..'Z');
+
+
+terminal UNDERSCORE: '_';
+terminal DASH: '-';
+terminal PLUS: '+';
+
+//terminal INTEGER returns ecore::EInt: ('0'..'9')+;
+//terminal INTEGER:('0'..'9')+;
+
+//terminal REAL: (('0'..'9')*"."('0'..'9')+);
+//terminal HASH: '#' ('_' | '-' | 'a'..'z' | 'A'..'Z' | '0'..'9' )+;
+
+terminal HASHMARK: '#';
+
+//terminal COLORHASH: '#' ('a'..'z' | 'A'..'Z' | '0'..'9' )+;
+
+//terminal IDENT: ('_' | 'a'..'z' | 'A'..'Z' ) ('_' | '-' | 'a'..'z' | 'A'..'Z' | '0'..'9' )*;
+
+//terminal HEX: '###' ('a'..'z' | 'A'..'Z' | '0'..'9' )+;
+
+terminal COMMA: ',';
+terminal PERCENT: '%';
+
+terminal ML_COMMENT : '/*' -> '*/';
+terminal WS : (' '|'\t'|'\r'|'\n')+;
+
+
+
+terminal CSSSTRING :
+ '"' ( '\\' ('b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'0'..'9'|'a'..'f'|'A'..'F'|'\\') | !('\\'|'"') )* '"' |
+ "'" ( '\\' ('b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'0'..'9'|'a'..'f'|'A'..'F'|'\\') | !('\\'|"'") )* "'";
+
+
+terminal INCLUDES: "~=";
+terminal DASHMATCH: "|=";
+
+terminal COLON: ':'; \ No newline at end of file
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/CSSRuntimeModule.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/CSSRuntimeModule.java
new file mode 100644
index 00000000000..00e48686b1a
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/CSSRuntimeModule.java
@@ -0,0 +1,19 @@
+/*
+ * generated by Xtext
+ */
+package org.eclipse.papyrus.infra.gmfdiag.css3;
+
+import org.eclipse.xtext.formatting.IFormatter;
+import org.eclipse.xtext.formatting.impl.NullFormatter;
+
+/**
+ * Use this class to register components to be used at runtime / without the Equinox extension registry.
+ */
+public class CSSRuntimeModule extends org.eclipse.papyrus.infra.gmfdiag.css3.AbstractCSSRuntimeModule {
+
+ // Formatter is not properly implemented yet. Disable all formatting to avoid errors
+ @Override
+ public Class<? extends IFormatter> bindIFormatter() {
+ return NullFormatter.class;
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/CSSStandaloneSetup.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/CSSStandaloneSetup.java
new file mode 100644
index 00000000000..28234d44b9e
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/CSSStandaloneSetup.java
@@ -0,0 +1,15 @@
+/*
+ * generated by Xtext
+ */
+package org.eclipse.papyrus.infra.gmfdiag.css3;
+
+/**
+ * Initialization support for running Xtext languages
+ * without equinox extension registry
+ */
+public class CSSStandaloneSetup extends CSSStandaloneSetupGenerated {
+
+ public static void doSetup() {
+ new CSSStandaloneSetup().createInjectorAndDoEMFRegistration();
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/GenerateCSS.mwe2 b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/GenerateCSS.mwe2
new file mode 100644
index 00000000000..13b03455c58
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/GenerateCSS.mwe2
@@ -0,0 +1,133 @@
+module org.eclipse.papyrus.infra.gmfdiag.css3.GenerateCSS
+
+import org.eclipse.emf.mwe.utils.*
+import org.eclipse.xtext.generator.*
+import org.eclipse.xtext.ui.generator.*
+
+var grammarURI = "classpath:/org/eclipse/papyrus/infra/gmfdiag/css3/CSS.xtext"
+var fileExtensions = "css"
+var projectName = "org.eclipse.papyrus.infra.gmfdiag.css3.xtext"
+var runtimeProject = "../${projectName}"
+var generateXtendStub = true
+var encoding = "UTF-8"
+
+Workflow {
+ bean = StandaloneSetup {
+ scanClassPath = true
+ platformUri = "${runtimeProject}/.."
+ // The following two lines can be removed, if Xbase is not used.
+ registerGeneratedEPackage = "org.eclipse.xtext.xbase.XbasePackage"
+ registerGenModelFile = "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel"
+ }
+
+ component = DirectoryCleaner {
+ directory = "${runtimeProject}/src-gen"
+ }
+
+ component = DirectoryCleaner {
+ directory = "${runtimeProject}/model/generated"
+ }
+
+ component = DirectoryCleaner {
+ directory = "${runtimeProject}.ui/src-gen"
+ }
+
+ component = DirectoryCleaner {
+ directory = "${runtimeProject}.tests/src-gen"
+ }
+
+ component = Generator {
+ pathRtProject = runtimeProject
+ pathUiProject = "${runtimeProject}.ui"
+ pathTestProject = "${runtimeProject}.tests"
+ projectNameRt = projectName
+ projectNameUi = "${projectName}.ui"
+ encoding = encoding
+ language = auto-inject {
+ uri = grammarURI
+
+ // Java API to access grammar elements (required by several other fragments)
+ fragment = grammarAccess.GrammarAccessFragment auto-inject {}
+
+ // generates Java API for the generated EPackages
+ fragment = ecore.EMFGeneratorFragment auto-inject {}
+
+ // the old serialization component
+ // fragment = parseTreeConstructor.ParseTreeConstructorFragment auto-inject {}
+
+ // serializer 2.0
+ fragment = serializer.SerializerFragment auto-inject {
+ generateStub = false
+ }
+
+ // a custom ResourceFactory for use with EMF
+ fragment = resourceFactory.ResourceFactoryFragment auto-inject {}
+
+ // The antlr parser generator fragment.
+ fragment = parser.antlr.XtextAntlrGeneratorFragment auto-inject {
+ // options = {
+ // backtrack = true
+ // }
+ }
+
+ // Xtend-based API for validation
+ fragment = validation.ValidatorFragment auto-inject {
+ // composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
+ // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
+ }
+
+ // old scoping and exporting API
+ // fragment = scoping.ImportURIScopingFragment auto-inject {}
+ // fragment = exporting.SimpleNamesFragment auto-inject {}
+
+ // scoping and exporting API
+ fragment = scoping.ImportNamespacesScopingFragment auto-inject {}
+ fragment = exporting.QualifiedNamesFragment auto-inject {}
+ fragment = builder.BuilderIntegrationFragment auto-inject {}
+
+ // generator API
+ fragment = generator.GeneratorFragment auto-inject {}
+
+ // formatter API
+ fragment = formatting.FormatterFragment auto-inject {}
+
+ // labeling API
+ fragment = labeling.LabelProviderFragment auto-inject {}
+
+ // outline API
+ fragment = outline.OutlineTreeProviderFragment auto-inject {}
+ fragment = outline.QuickOutlineFragment auto-inject {}
+
+ // quickfix API
+ fragment = quickfix.QuickfixProviderFragment auto-inject {}
+
+ // content assist API
+ fragment = contentAssist.ContentAssistFragment auto-inject {}
+
+ // generates a more lightweight Antlr parser and lexer tailored for content assist
+ fragment = parser.antlr.XtextAntlrUiGeneratorFragment auto-inject {}
+
+ // generates junit test support classes into Generator#pathTestProject
+ fragment = junit.Junit4Fragment auto-inject {}
+
+ // rename refactoring
+ fragment = refactoring.RefactorElementNameFragment auto-inject {}
+
+ // provides the necessary bindings for java types integration
+ fragment = types.TypesGeneratorFragment auto-inject {}
+
+ // generates the required bindings only if the grammar inherits from Xbase
+ fragment = xbase.XbaseGeneratorFragment auto-inject {}
+
+ // generates the required bindings only if the grammar inherits from Xtype
+ fragment = xbase.XtypeGeneratorFragment auto-inject {}
+
+ // provides a preference page for template proposals
+ fragment = templates.CodetemplatesGeneratorFragment auto-inject {}
+
+ // provides a compare view
+ fragment = compare.CompareFragment auto-inject {}
+ }
+ }
+}
+
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/formatting/CSSFormatter.xtend b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/formatting/CSSFormatter.xtend
new file mode 100644
index 00000000000..f812d4e1b21
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/formatting/CSSFormatter.xtend
@@ -0,0 +1,30 @@
+/*
+ * generated by Xtext
+ */
+package org.eclipse.papyrus.infra.gmfdiag.css3.formatting
+
+import org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter
+import org.eclipse.xtext.formatting.impl.FormattingConfig
+// import com.google.inject.Inject;
+// import org.eclipse.papyrus.infra.gmfdiag.css3.services.CSSGrammarAccess
+
+/**
+ * This class contains custom formatting declarations.
+ *
+ * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#formatting
+ * on how and when to use it.
+ *
+ * Also see {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} as an example
+ */
+class CSSFormatter extends AbstractDeclarativeFormatter {
+
+// @Inject extension CSSGrammarAccess
+
+ override protected void configureFormatting(FormattingConfig c) {
+// It's usually a good idea to activate the following three statements.
+// They will add and preserve newlines around comments
+// c.setLinewrap(0, 1, 2).before(SL_COMMENTRule)
+// c.setLinewrap(0, 1, 2).before(ML_COMMENTRule)
+// c.setLinewrap(0, 1, 1).after(ML_COMMENTRule)
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/generator/CSSGenerator.xtend b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/generator/CSSGenerator.xtend
new file mode 100644
index 00000000000..e4fabb1ed8c
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/generator/CSSGenerator.xtend
@@ -0,0 +1,24 @@
+/*
+ * generated by Xtext
+ */
+package org.eclipse.papyrus.infra.gmfdiag.css3.generator
+
+import org.eclipse.emf.ecore.resource.Resource
+import org.eclipse.xtext.generator.IGenerator
+import org.eclipse.xtext.generator.IFileSystemAccess
+
+/**
+ * Generates code from your model files on save.
+ *
+ * see http://www.eclipse.org/Xtext/documentation.html#TutorialCodeGeneration
+ */
+class CSSGenerator implements IGenerator {
+
+ override void doGenerate(Resource resource, IFileSystemAccess fsa) {
+// fsa.generateFile('greetings.txt', 'People to greet: ' +
+// resource.allContents
+// .filter(typeof(Greeting))
+// .map[name]
+// .join(', '))
+ }
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/scoping/CSSScopeProvider.xtend b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/scoping/CSSScopeProvider.xtend
new file mode 100644
index 00000000000..391b47a97fb
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/scoping/CSSScopeProvider.xtend
@@ -0,0 +1,15 @@
+/*
+ * generated by Xtext
+ */
+package org.eclipse.papyrus.infra.gmfdiag.css3.scoping
+
+/**
+ * This class contains custom scoping description.
+ *
+ * see : http://www.eclipse.org/Xtext/documentation.html#scoping
+ * on how and when to use it
+ *
+ */
+class CSSScopeProvider extends org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider {
+
+}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/validation/CSSValidator.xtend b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/validation/CSSValidator.xtend
new file mode 100644
index 00000000000..e8ad9f9ae81
--- /dev/null
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css3.xtext/src/org/eclipse/papyrus/infra/gmfdiag/css3/validation/CSSValidator.xtend
@@ -0,0 +1,25 @@
+/*
+ * generated by Xtext
+ */
+package org.eclipse.papyrus.infra.gmfdiag.css3.validation
+
+//import org.eclipse.xtext.validation.Check
+
+/**
+ * Custom validation rules.
+ *
+ * see http://www.eclipse.org/Xtext/documentation.html#validation
+ */
+class CSSValidator extends AbstractCSSValidator {
+
+// public static val INVALID_NAME = 'invalidName'
+//
+// @Check
+// def checkGreetingStartsWithCapital(Greeting greeting) {
+// if (!Character.isUpperCase(greeting.name.charAt(0))) {
+// warning('Name should start with a capital',
+// MyDslPackage.Literals.GREETING__NAME,
+// INVALID_NAME)
+// }
+// }
+}

Back to the top