### Install Emfatic via Eclipse Update Sites
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/download/index.html
Instructions for installing Emfatic using Eclipse's 'Install new software' feature. It lists the stable and interim update site locations.
```text
Site
Location
Stable
http://download.eclipse.org/emfatic/update
Interim
http://download.eclipse.org/emfatic/interim
```
--------------------------------
### Emfatic Annotation Examples
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Demonstrates the usage of Emfatic annotation labels for defining `EAnnotation.source` values. It shows how to use predefined labels like `ecore` and `genmodel`, and how to create custom labels using `EmfaticAnnotationMap`. The example also illustrates adding model documentation and constraints.
```Emfatic
@EmfaticAnnotationMap(myLabel="http://foo/bar")
@genmodel(documentation="model documentation")
package test;
@ecore(constraints="constraintA constraintB")
@myLabel(key="value")
class C {
}
```
--------------------------------
### Emfatic Annotations
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Provides examples of how to apply annotations in Emfatic, inspired by Java 1.5 annotations. It demonstrates attaching annotations to packages, classes, attributes, operations, parameters, and enum literals, including key-value pairs for details.
```emf
"@"http://source/uri"("key1"="value1", "key2"="value2")
@sourceLabel(key.a="value1", key.b="value2")
@simpleAttr
package test;
"@"http://class/annotation"(k="v")
class C {
"@"http://attribute/annotation"(k="v")
attr int a;
op int Op(
@before(k=v) int a,
int b @after(k=v)
);
}
enum E {
"@"http://before"(k=v)
A=1;
B=2 "@"http://after"(k=v);
}
```
--------------------------------
### Emfatic Instance Class Name Declaration
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Specifies the 'instanceClassName' attribute for an EClassifier, using 'EStringToStringMapEntry' as an example which extends 'java.util.Map$Entry'. The extends clause must precede the instanceClassName specification.
```emf
class EStringToStringMapEntry : java.util.Map$Entry {
// ... contents omitted ...
}
```
--------------------------------
### Emfatic: Negating Modifiers with '!'
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Shows how to negate the default behavior of certain Emfatic modifiers using the '!' prefix. This example demonstrates negating the 'ordered' modifier for a String attribute, making it non-ordered.
```emf
class X {
!ordered attr String[*] s;
}
```
--------------------------------
### Declare Enumerated Type with Auto-Generated Values
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Illustrates defining an enumerated type in Emfatic where literal values are not explicitly provided. Emfatic automatically assigns values starting from 0 for the first literal and increments by 1 for subsequent unspecified literals.
```Emfatic
enum E {
A; // = 0 (if not specified, first literal has value 0)
B = 3;
C; // = 4 (in general, unspecified values are 1 greater than previous value)
D; // = 5
}
```
--------------------------------
### Emfatic Website Initialization (JavaScript)
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/404.html
This JavaScript code initializes various functionalities for the Emfatic website, including theme management, scope handling, and local storage interactions. It sets up theme colors based on local storage settings.
```JavaScript
var palette = __md_get("__palette");
if (palette && "object" == typeof palette.color) for (var key of Object.keys(palette.color)) document.body.setAttribute("data-md-color-" + key, palette.color[key])
```
--------------------------------
### Emfatic Website Configuration (JSON)
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/404.html
This JSON object contains configuration settings for the Emfatic website, including base URL, enabled features, search script path, and translation strings for various UI elements.
```JSON
{"base": "/", "features": ["content.code.copy", "content.tabs.link", "navigation.footer"], "search": "/assets/javascripts/workers/search.74e28a9f.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}
```
--------------------------------
### Emfatic: Basic Package Declaration
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
The simplest Emfatic program requires a main package declaration. This package defines the root of the Ecore model.
```Emfatic
package p;
```
--------------------------------
### Emfatic Package Declaration
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Demonstrates the basic syntax for declaring a package and a class in Emfatic. This program generates an EPackage named 'test' containing an EClass named 'Foo'.
```Emfatic
package test;
class Foo { }
```
--------------------------------
### Emfatic Main Package Declaration
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
The simplest Emfatic program, declaring a main package named 'p'. This is a mandatory element in any Emfatic source file.
```emf
package p;
```
--------------------------------
### Emfatic Import Statements
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Demonstrates how to import external Ecore models using URIs. It shows importing a local resource and the standard Ecore model. Note that Ecore.ecore is implicitly imported.
```emf
package main;
import "platform:/resource/proj1/foo.ecore";
import "http://www.eclipse.org/emf/2002/Ecore";
package sub { }
```
--------------------------------
### Emfatic Class and Interface Declarations
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Shows the Emfatic syntax for declaring classes, abstract classes, interfaces, and abstract interfaces. Comments indicate the corresponding EClass attributes (isInterface, isAbstract).
```emf
package main;
class C1 { } // isInterface=false, isAbstract=false
abstract class C2 { } // isInterface=false, isAbstract=true
interface I1 { } // isInterface=true, isAbstract=false
abstract interface I2 { } // isInterface=true, isAbstract=true
```
--------------------------------
### Emfatic: Import Statements
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Allows referencing types from external Ecore models. Import statements must follow the main package declaration. Ecore.ecore is automatically imported.
```Emfatic
package main;
import "platform:/resource/proj1/foo.ecore";
import "http://www.eclipse.org/emf/2002/Ecore";
package sub { }
```
--------------------------------
### Declare Emfatic Data Types
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Demonstrates the declaration of various EDataTypes in Emfatic, mapping to Ecore's EDataType. It shows how to specify instance class names, including Java types and quoted types for special characters, and the use of the 'transient' keyword.
```emf
datatype EInt : int;
datatype EIntegerObject : java.lang.Integer;
transient datatype EJavaObject : java.lang.Object;
datatype EFeatureMapEntry : org.eclipse.emf.ecore.util.FeatureMap$Entry;
datatype EByteArray : "byte[]";
```
--------------------------------
### Declare EDataType with Instance Class Name
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Demonstrates the basic syntax for declaring an EDataType in Emfatic, specifying its corresponding Java class name. The instance class name is required for datatypes.
```Emfatic
datatype EInt : int;
datatype EIntegerObject : java.lang.Integer;
transient datatype EJavaObject : java.lang.Object;
datatype EFeatureMapEntry : org.eclipse.emf.ecore.util.FeatureMap$Entry;
datatype EByteArray : "byte[]";
```
--------------------------------
### Emfatic Basic Types Mapping
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
This section outlines the mapping between Emfatic keywords, Ecore EClassifier names, and Java type names for various basic data types. It serves as a reference for developers using Emfatic to define models.
```Emfatic
boolean
Boolean
byte
Byte
char
Character
double
Double
float
Float
int
Integer
long
Long
short
Short
Date
String
Object
Class
EObject
EClass
```
--------------------------------
### Emfatic Map Entry Shorthand
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Defines a MapEntry using Emfatic's shorthand notation, specifying the key and value types. This is an alternative to declaring a class with 'key' and 'value' features and an instance class annotation.
```Emfatic
mapentry EStringToStringMapEntry : String -> String;
```
--------------------------------
### Emfatic: Defining EPackage Class Features
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Illustrates the Emfatic syntax for defining various class features of the Ecore EPackage class, including operations, attributes, references, and containment references. It showcases the use of keywords like 'op', 'attr', 'ref', and 'val' along with modifiers.
```emf
class EPackage extends ENamedElement {
op EClassifier getEClassifier(EString name);
attr EString nsURI;
attr EString nsPrefix;
transient !resolve ref EFactory[1]#ePackage eFactoryInstance;
val EClassifier[*]#ePackage eClassifiers;
val EPackage[*]#eSuperPackage eSubpackages;
readonly transient ref EPackage#eSubpackages eSuperPackage;
}
```
--------------------------------
### Emfatic Attribute Declarations with Type Expressions
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Demonstrates how to declare attributes in Emfatic, showcasing the use of simple and qualified type expressions to reference different Ecore datatypes and built-in types.
```emf
package test;
datatype D1 : int;
package P {
datatype D2 : int;
}
class C {
attr D1 d1;
attr P.D2 d2;
attr ecore.EString s1;
attr String s2;
}
```
--------------------------------
### Emfatic Annotations
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Demonstrates attaching annotations to various EMF elements like packages, classes, attributes, operations, and enum literals. Annotations use the '@' symbol and can include source URIs and key-value pairs for details.
```Emfatic
"@"http://source/uri"("key1"="value1", "key2"="value2")
@sourceLabel(key.a="value1", key.b="value2")
@simpleAttr
package test;
@"http://class/annotation"(k="v")
class C {
@"http://attribute/annotation"(k="v")
attr int a;
op int Op(
@before(k=v) int a,
int b @after(k=v)
);
}
enum E {
@"http://before"(k=v)
A=1;
B=2 @"http://after"(k=v);
}
```
--------------------------------
### Emfatic Package Declaration
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Defines a basic Emfatic package named 'test' containing a class 'Foo'. This translates to an EPackage named 'test' with an EClass named 'Foo' in the generated Ecore model.
```emf
package test;
class Foo { }
```
--------------------------------
### Emfatic Nested Package Declaration
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Illustrates nested package structures in Emfatic. The 'main' package contains 'sub1', and 'sub2' which itself contains 'sub2_1' and 'sub2_2'. This maps to a hierarchical EPackage structure in Ecore.
```emf
package main;
package sub1 {
}
package sub2 {
package sub2_1 { }
package sub2_2 { }
}
```
--------------------------------
### Emfatic Operation Declaration
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Shows the syntax for declaring operations in Emfatic, similar to Java methods. It covers return types, parameters, and exception handling using the 'throws' clause.
```emf
class X {
op String getFullName();
op void returnsNothing();
op int add(int a, int b);
op EObject doSomething(int a, ecore.EBoolean b) throws ExceptionA, ExceptionB;
}
```
--------------------------------
### Add Emfatic Core Dependency to Maven Project
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/download.md
This snippet shows how to include the Emfatic core library as a dependency in your Maven project's pom.xml file. It specifies the group ID, artifact ID, and version, and also configures the Sonatype repository for snapshot versions.
```xml
4.0.0
org.eclipse.emfatic
standalone-example
1.0.0-SNAPSHOT
Sonatype
https://oss.sonatype.org/content/repositories/snapshots
compile
1.8
1.8
org.eclipse.emfatic
org.eclipse.emfatic.core
1.0.1-SNAPSHOT
```
--------------------------------
### Emfatic: Representing EPackage Features from Ecore
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Shows the Emfatic representation of the EPackage class from Ecore.ecore, illustrating how structural and behavioral features like operations ('op'), attributes ('attr'), references ('ref'), and valued references ('val') are defined.
```Emfatic
class EPackage extends ENamedElement {
op EClassifier getEClassifier(EString name);
attr EString nsURI;
attr EString nsPrefix;
transient !resolve ref EFactory[1]#ePackage eFactoryInstance;
val EClassifier[*]#ePackage eClassifiers;
val EPackage[*]#eSuperPackage eSubpackages;
readonly transient ref EPackage#eSubpackages eSuperPackage;
}
```
--------------------------------
### Emfatic Attribute Declarations with Type Expressions
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Demonstrates attribute declarations within an Emfatic class, showcasing different ways to specify types using simple identifiers, qualified identifiers, and shorthand for built-in types.
```Emfatic
package test;
datatype D1 : int;
package P {
datatype D2 : int;
}
class C {
attr D1 d1;
attr P.D2 d2;
attr ecore.EString s1;
attr String s2;
}
```
--------------------------------
### Add Emfatic Dependency to Maven pom.xml
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/download/index.html
A Maven `pom.xml` configuration snippet to include the Emfatic core library. It specifies the group ID, artifact ID, version, and repository configurations for accessing snapshot versions.
```XML
4.0.0
org.eclipse.emfatic
standalone-example
1.0.0-SNAPSHOT
Sonatype
https://oss.sonatype.org/content/repositories/snapshots
compile
1.8
1.8
org.eclipse.emfatic
org.eclipse.emfatic.core
1.0.1-SNAPSHOT
```
--------------------------------
### Emfatic Operation Declaration
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Defines operations with return types, parameters, and optional exception clauses. The syntax is Java-like, using 'void' for no return value and 'throws' for exceptions.
```Emfatic
class X {
op String getFullName();
op void returnsNothing();
op int add(int a, int b);
op EObject doSomething(int a, ecore.EBoolean b) throws ExceptionA, ExceptionB;
}
```
--------------------------------
### Emfatic Multiplicity to ETypedElement Mapping
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Provides a detailed mapping of Emfatic multiplicity expressions to the lowerBound and upperBound attributes of ETypedElement. This helps understand how cardinality constraints are translated in the EMF model.
```Emfatic
none -> lowerBound=0, upperBound=1
[?] -> lowerBound=0, upperBound=1
[] -> lowerBound=0, upperBound=-1
[*] -> lowerBound=0, upperBound=-1
[+] -> lowerBound=1, upperBound=-1
[1] -> lowerBound=1, upperBound=1
[n] -> lowerBound=n, upperBound=n
[0..4] -> lowerBound=0, upperBound=4
[m..n] -> lowerBound=m, upperBound=n
[5..*] -> lowerBound=5, upperBound=-1
[1..?] -> lowerBound=1, upperBound=-2
```
--------------------------------
### Emfatic Annotation Labels
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Demonstrates the use of annotation labels in Emfatic to simplify long URIs for the EAnnotation.source attribute. It shows how to define custom labels using '@EmfaticAnnotationMap' and use predefined labels like '@ecore' and '@genmodel'.
```emf
@EmfaticAnnotationMap(myLabel="http://foo/bar")
@genmodel(documentation="model documentation")
package test;
@ecore(constraints="constraintA constraintB")
@myLabel(key="value")
class C {
}
```
--------------------------------
### Emfatic: Class and Interface Declarations
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Defines classes and interfaces using 'class', 'interface', and 'abstract' keywords. Emfatic supports Java-style comments to denote EClass attributes.
```Emfatic
package main;
class C1 { } // isInterface=false, isAbstract=false
abstract class C2 { } // isInterface=false, isAbstract=true
interface I1 { } // isInterface=true, isAbstract=false
abstract interface I2 { } // isInterface=true, isAbstract=true
```
--------------------------------
### Emfatic: Nested Package Declaration
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Demonstrates package nesting in Emfatic. Nested packages are declared within curly braces. Use of nested packages is discouraged.
```Emfatic
package main;
package sub1 {
}
package sub2 {
package sub2_1 { }
package sub2_2 { }
}
```
--------------------------------
### Emfatic Namespace Declaration
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Declares a namespace for the 'ecore' package with a specific URI and prefix. This demonstrates the use of the @namespace annotation for EPackage attributes.
```emf
@namespace(uri="http://www.eclipse.org/emf/2002/Ecore", prefix="ecore")
package ecore;
```
--------------------------------
### Emfatic Inheritance Declaration
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Defines an inheritance hierarchy using the 'extends' keyword. Class 'C' inherits from both 'A' and 'B', and 'D' inherits from 'C'. Emfatic supports multiple inheritance.
```emf
package main;
class A { }
class B { }
class C extends A, B { }
class D extends C { }
```
--------------------------------
### Emfatic: Escaping Keywords in Model Elements
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Demonstrates how to use a keyword as a model element name by prefixing it with the '~' symbol. This is useful for representing elements from Ecore.ecore where keywords like 'abstract' and 'interface' are used as attribute names.
```Emfatic
class EClass extends EClassifier
{
// ...
~abstract : EBoolean;
~interface : EBoolean;
// ...
}
```
--------------------------------
### Emfatic: Escaping Keywords for Model Elements
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Demonstrates how to use reserved keywords as identifiers for model elements in Emfatic by prefixing them with the '~' symbol. This is useful for representing existing models like Ecore.ecore where keywords might be used as names.
```emf
class EClass extends EClassifier
{
// ...
~abstract : EBoolean;
~interface : EBoolean;
// ...
}
```
--------------------------------
### Emfatic Attribute Declaration
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Demonstrates the syntax for declaring attributes in Emfatic, including default values and type expressions. It highlights similarities to Java field declarations.
```emf
class C {
attr String s;
attr int i = 1;
attr ecore.EBoolean b = true;
}
```
--------------------------------
### Emfatic: Namespace Declaration
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Specifies namespace URI and prefix for an EPackage using the @namespace annotation. The identifiers 'namespace', 'uri', and 'prefix' are case-insensitive.
```Emfatic
@namespace(uri="http://www.eclipse.org/emf/2002/Ecore", prefix="ecore")
package ecore;
```
--------------------------------
### Emfatic: Instance Class Name Specification
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Allows specifying the 'instanceClassName' attribute for an EClassifier. The 'extends' clause must precede the 'instanceClassName' clause if both are present.
```Emfatic
class EStringToStringMapEntry : java.util.Map$Entry {
// ... contents omitted ...
}
```
--------------------------------
### Declare Emfatic Map Entries
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Shows the shorthand notation in Emfatic for declaring map entry classes, which correspond to Ecore's MapEntry. It specifies the key and value types for the map entry.
```emf
mapentry EStringToStringMapEntry : String -> String;
```
--------------------------------
### Emfatic Tabbed Content Handling (JavaScript)
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/404.html
This JavaScript code handles the functionality of tabbed content on the Emfatic website. It retrieves tab states from local storage and applies them to the corresponding tabbed elements, ensuring the correct tab is displayed.
```JavaScript
var tabs = __md_get("__tabs");
if (Array.isArray(tabs)) e: for (var set of document.querySelectorAll(".tabbed-set")) {
var tab,
labels = set.querySelector(".tabbed-labels");
for (tab of tabs) for (var label of labels.getElementsByTagName("label"))
if (label.innerText.trim() === tab) {
var input = document.getElementById(label.htmlFor);
input.checked = !0;
continue e
}
}
```
--------------------------------
### Emfatic Class with Multiplicity Expressions
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
This Emfatic code snippet demonstrates the declaration of attributes with various multiplicity expressions, showcasing how Emfatic handles cardinality for elements.
```Emfatic
class C {
attr String[1] s1;
attr String[0..3] s2;
attr String[*] s3;
attr String[+] s4;
}
```
--------------------------------
### Emfatic: Inheritance Declaration
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Specifies inheritance using the 'extends' keyword. Emfatic supports multiple inheritance for classes.
```Emfatic
package main;
class A { }
class B { }
class C extends A, B { }
class D extends C { }
```
--------------------------------
### Emfatic Multiplicity Expressions
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Demonstrates how to define attribute multiplicity in Emfatic using various expressions. These expressions control the number of instances an attribute can hold, mapping to ETypedElement's lowerBound and upperBound.
```Emfatic
class C {
attr String[1] s1;
attr String[0..3] s2;
attr String[*] s3;
attr String[+] s4;
}
```
--------------------------------
### Declare Emfatic Enumerated Types
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Illustrates the Emfatic syntax for defining enumerated types (EEnum) and their literals (EEnumLiteral). It shows how to assign explicit integer values to literals and the default value assignment when values are omitted.
```emf
enum E {
A=1;
B=2;
C=3;
}
```
```emf
enum E {
A; // = 0 (if not specified, first literal has value 0)
B = 3;
C; // = 4 (in general, unspecified values are 1 greater than previous value)
D; // = 5
}
```
--------------------------------
### Emfatic Reference Declaration with Opposite
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/mkdocs/docs/index.md
Illustrates how to declare references in Emfatic, including specifying the opposite reference using the '#' symbol. This is crucial for defining bidirectional relationships between model elements.
```emf
class EPackage extends ENamedElement {
// ...
val EPackage[*]#eSuperPackage eSubpackages;
readonly transient ref EPackage#eSubpackages eSuperPackage;
}
```
--------------------------------
### Emfatic: Using Modifiers for Feature Properties
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Illustrates the use of modifiers in Emfatic to define properties of structural and behavioral features. Modifiers like 'readonly', 'transient', '!resolve', and '!ordered' are shown, which map to boolean attributes in Ecore.
```Emfatic
class X {
!ordered attr String[*] s;
}
```
--------------------------------
### Emfatic Attribute Declaration
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Declares attributes with types and optional default values. The syntax is similar to Java fields, with the 'attr' keyword.
```Emfatic
class C {
attr String s;
attr int i = 1;
attr ecore.EBoolean b = true;
}
```
--------------------------------
### Emfatic Reference Declaration with Opposite
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Declares references, including specifying the opposite reference using a '#' symbol followed by the identifier of the opposite ERerference.
```Emfatic
class EPackage extends ENamedElement {
// ...
val EPackage[*]#eSuperPackage eSubpackages;
readonly transient ref EPackage#eSubpackages eSuperPackage;
}
```
--------------------------------
### Declare Enumerated Type with Literal Values
Source: https://github.com/eclipse-emfatic/emfatic-website/blob/master/index.html
Shows how to define an enumerated type (EEnum) in Emfatic, assigning specific integer values to its literals (EEnumLiteral).
```Emfatic
enum E {
A=1;
B=2;
C=3;
}
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.