Skip to content
Snippets Groups Projects
Commit 8cc75cdc authored by Antonio García-Domínguez's avatar Antonio García-Domínguez
Browse files

Simplify TT metamodel: drop LocatedElement

parent 21bbb40a
Branches
No related tags found
No related merge requests found
Showing
with 272 additions and 493 deletions
Model transformation case study using ATL :
Truth tables to Binary Decision Diagrams
Guillaume Savaton, ESEO
<guillaume (dot) savaton (at) eseo (dot) fr>
-----------------------------------------------------------
Summary
-----------------------------------------------------------
These files provide a case study for model transformation applied to digital logic circuits.
Engineers can use various formalisms to represent combinatorial or sequential logic.
The most widespread representations for combinatorial logic are truth tables and boolean equations.
In many EDA tools, combinatorial logic is represented in a canonical form using Binary Decision
Diagrams (BDD).
BDDs are manly used for model checking and logic optimization.
The purpose here is to use model transformation to transform a truth table into
a binary decision diagram.
-----------------------------------------------------------
Truth tables
-----------------------------------------------------------
The test files provided correspond to the following example.
Files TT/examples/Test.tt and Test.ttmodel contain representations of this truth table :
A B C D | S
----------|---
0 0 - - | 0
0 1 0 0 | 1
0 1 0 1 | 0
0 1 1 - | 0
1 0 0 0 | 0
1 0 1 0 | 1
1 - - 1 | 0
1 1 0 0 | 1
1 1 1 0 | 0
A truth table (class TruthTable of the metamodel) has ports (class Port).
Ports are either
- input ports (class InputPort) such as A, B, C, D in the example ;
- or output ports (class OutputPort) such as S in the example.
A truth table is composed of rows (class Row of the metamodels) that can appear in any order.
A row provides a mapping between an input pattern (a detected set of values of input ports)
and an output pattern (values assigned to output ports).
A row is made of cells (class Cell) : each cell associates a boolean value to a given port.
Usually, boolean values are represented using symbols "0" (false) and "1" (true).
In file Test.tt, the symbols used are "F" (false) and "T" (true).
In a given row, the absence of a cell for a given input port means that the value of this port is
indifferent with respect to the result. In the example, this is the case for ports C and D in the first row.
However, in each row, all output ports must have a corresponding cell.
-----------------------------------------------------------
Binary decision diagrams
-----------------------------------------------------------
Here is a BDD representation for the example truth table :
(A)
|
0 --------------------- 1
| |
(B) (D)
| |
0 ------- 1 0 -------- 1
| | | |
| (C) (B) |
| | | |
| 0 --- 1 0---------1 |
| | | | | |
| (D) | (C) (C) |
| | | | | |
| 0 --- 1 | 0 --- 1 0 --- 1 |
| | | | | | | | |
S = [0] [1] [0][0][0] [1] [1] [0][0]
Usually, edges are distinguished by a line style :
- dashed lines represent 0 (or false) decisions
- continuouse lines represent 1 (or true) decisions.
In file Test.bdd, edges are labelled with a symbol : "F" (false) or "T" (true).
The evaluation process in a BDD is recursive and can be easily translated into an if-then-else
hierarchy :
if A=0 then
if B=0 then
S := 0;
else
if C=0 then
if D=0 then
S := 1;
else
S := 0;
endif
else
S := 0;
endif
endif
else
if D=0 then
if B=0 then
if C=0 then
S := 0;
else
S := 1;
endif
else
if C=0 then
S := 1;
else
S := 0;
endif
endif
else
S := 0;
endif
endif
In our metamodel, a binary decision diagram (class BDD of the metamodel) has input and output ports in
the same sense as truth tables.
A BDD is composed of a tree (class Tree).
A tree can be either a leaf node (class Leaf) or a subtree (class Subtree).
A subtree has a reference to an input port (see nodes labeled A, B, C and D on the example).
Upon the value of this port, two edges can be followed :
- one corresponding to a 0 (false) value (reference subtreeForZero in the metamodel)
- one corresponding to a 1 (true) value (reference subtreeForOne in the metamodel)
Leaf nodes represent values assigned to output ports.
In this example there is only one output port but the provided metamodel supports
multiple output ports if needed.
As a result, a leaf node is composed of one or several assignments (class Assignment).
-----------------------------------------------------------
File index
-----------------------------------------------------------
Folders :
TT/ - All files related to truth tables (metamodel, models, diagrams)
BDD/ - All files related to Binary Decision Diagrams (metamodel, models, diagrams)
TT2BDD/ - The transformation from truth table to BDD
Files :
TT/TT.km3 - The Truth Table metamodel in text form (KM3 notation)
TT/TT.ecore - The Truth Table metamodel in XMI format
TT/diagrams/TT.png - Graphical representation of the Truth Table metamodel
TT/examples/Test.tt - An example truth table in text form
TT/examples/Test.ttmodel - The same example in XMI format
BDD/BDD.km3 - The BDD metamodel in text form (KM3 notation)
BDD/BDD.ecore - The BDD metamodel in XMI format
BDD/diagrams/BDD.png -
BDD/diagrams/Tree.png - Graphical representation of the BDD metamodel
BDD/diagrams/Nodes.png -
BDD/examples/Test.bdd - An example BDD in text form
BDD/examples/Test.bddmodel - The same example BDD in XMI format
TT2BDD/TT2BDD.atl - The transformation from Truth Table to BDD, in ATL
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<TruthTable xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://www.transformation-tool-contest.eu/2019/tt" location="2:1-13:2" name="Test"> <TruthTable xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://www.transformation-tool-contest.eu/2019/tt" name="Test">
<ports xsi:type="InputPort" location="2:19-2:23" name="a" cells="//@rows.0/@cells.0 //@rows.1/@cells.0 //@rows.2/@cells.0 //@rows.3/@cells.0 //@rows.4/@cells.0 //@rows.5/@cells.0 //@rows.6/@cells.0 //@rows.7/@cells.0 //@rows.8/@cells.0"/> <ports xsi:type="InputPort" name="a" cells="//@rows.0/@cells.0 //@rows.1/@cells.0 //@rows.2/@cells.0 //@rows.3/@cells.0 //@rows.4/@cells.0 //@rows.5/@cells.0 //@rows.6/@cells.0 //@rows.7/@cells.0 //@rows.8/@cells.0"/>
<ports xsi:type="InputPort" location="2:25-2:29" name="b" cells="//@rows.0/@cells.1 //@rows.1/@cells.1 //@rows.2/@cells.1 //@rows.3/@cells.1 //@rows.4/@cells.1 //@rows.5/@cells.1 //@rows.7/@cells.1 //@rows.8/@cells.1"/> <ports xsi:type="InputPort" name="b" cells="//@rows.0/@cells.1 //@rows.1/@cells.1 //@rows.2/@cells.1 //@rows.3/@cells.1 //@rows.4/@cells.1 //@rows.5/@cells.1 //@rows.7/@cells.1 //@rows.8/@cells.1"/>
<ports xsi:type="InputPort" location="2:31-2:35" name="c" cells="//@rows.1/@cells.2 //@rows.2/@cells.2 //@rows.3/@cells.2 //@rows.4/@cells.2 //@rows.5/@cells.2 //@rows.7/@cells.2 //@rows.8/@cells.2"/> <ports xsi:type="InputPort" name="c" cells="//@rows.1/@cells.2 //@rows.2/@cells.2 //@rows.3/@cells.2 //@rows.4/@cells.2 //@rows.5/@cells.2 //@rows.7/@cells.2 //@rows.8/@cells.2"/>
<ports xsi:type="InputPort" location="2:37-2:41" name="d" cells="//@rows.1/@cells.3 //@rows.2/@cells.3 //@rows.4/@cells.3 //@rows.5/@cells.3 //@rows.6/@cells.1 //@rows.7/@cells.3 //@rows.8/@cells.3"/> <ports xsi:type="InputPort" name="d" cells="//@rows.1/@cells.3 //@rows.2/@cells.3 //@rows.4/@cells.3 //@rows.5/@cells.3 //@rows.6/@cells.1 //@rows.7/@cells.3 //@rows.8/@cells.3"/>
<ports xsi:type="OutputPort" location="2:43-2:48" name="s" cells="//@rows.0/@cells.2 //@rows.1/@cells.4 //@rows.2/@cells.4 //@rows.3/@cells.3 //@rows.4/@cells.4 //@rows.5/@cells.4 //@rows.6/@cells.2 //@rows.7/@cells.4 //@rows.8/@cells.4"/> <ports xsi:type="OutputPort" name="s" cells="//@rows.0/@cells.2 //@rows.1/@cells.4 //@rows.2/@cells.4 //@rows.3/@cells.3 //@rows.4/@cells.4 //@rows.5/@cells.4 //@rows.6/@cells.2 //@rows.7/@cells.4 //@rows.8/@cells.4"/>
<rows location="4:4-4:29"> <rows>
<cells location="4:5-4:8" value="false" port="//@ports.0"/> <cells value="false" port="//@ports.0"/>
<cells location="4:10-4:13" value="false" port="//@ports.1"/> <cells value="false" port="//@ports.1"/>
<cells location="4:25-4:28" value="false" port="//@ports.4"/> <cells value="false" port="//@ports.4"/>
</rows> </rows>
<rows location="5:4-5:29"> <rows>
<cells location="5:5-5:8" value="false" port="//@ports.0"/> <cells value="false" port="//@ports.0"/>
<cells location="5:10-5:13" value="true" port="//@ports.1"/> <cells value="true" port="//@ports.1"/>
<cells location="5:15-5:18" value="false" port="//@ports.2"/> <cells value="false" port="//@ports.2"/>
<cells location="5:20-5:23" value="false" port="//@ports.3"/> <cells value="false" port="//@ports.3"/>
<cells location="5:25-5:28" value="true" port="//@ports.4"/> <cells value="true" port="//@ports.4"/>
</rows> </rows>
<rows location="6:4-6:29"> <rows>
<cells location="6:5-6:8" value="false" port="//@ports.0"/> <cells value="false" port="//@ports.0"/>
<cells location="6:10-6:13" value="true" port="//@ports.1"/> <cells value="true" port="//@ports.1"/>
<cells location="6:15-6:18" value="false" port="//@ports.2"/> <cells value="false" port="//@ports.2"/>
<cells location="6:20-6:23" value="true" port="//@ports.3"/> <cells value="true" port="//@ports.3"/>
<cells location="6:25-6:28" value="false" port="//@ports.4"/> <cells value="false" port="//@ports.4"/>
</rows> </rows>
<rows location="7:4-7:29"> <rows>
<cells location="7:5-7:8" value="false" port="//@ports.0"/> <cells value="false" port="//@ports.0"/>
<cells location="7:10-7:13" value="true" port="//@ports.1"/> <cells value="true" port="//@ports.1"/>
<cells location="7:15-7:18" value="true" port="//@ports.2"/> <cells value="true" port="//@ports.2"/>
<cells location="7:25-7:28" value="false" port="//@ports.4"/> <cells value="false" port="//@ports.4"/>
</rows> </rows>
<rows location="8:4-8:29"> <rows>
<cells location="8:5-8:8" value="true" port="//@ports.0"/> <cells value="true" port="//@ports.0"/>
<cells location="8:10-8:13" value="false" port="//@ports.1"/> <cells value="false" port="//@ports.1"/>
<cells location="8:15-8:18" value="false" port="//@ports.2"/> <cells value="false" port="//@ports.2"/>
<cells location="8:20-8:23" value="false" port="//@ports.3"/> <cells value="false" port="//@ports.3"/>
<cells location="8:25-8:28" value="false" port="//@ports.4"/> <cells value="false" port="//@ports.4"/>
</rows> </rows>
<rows location="9:4-9:29"> <rows>
<cells location="9:5-9:8" value="true" port="//@ports.0"/> <cells value="true" port="//@ports.0"/>
<cells location="9:10-9:13" value="false" port="//@ports.1"/> <cells value="false" port="//@ports.1"/>
<cells location="9:15-9:18" value="true" port="//@ports.2"/> <cells value="true" port="//@ports.2"/>
<cells location="9:20-9:23" value="false" port="//@ports.3"/> <cells value="false" port="//@ports.3"/>
<cells location="9:25-9:28" value="true" port="//@ports.4"/> <cells value="true" port="//@ports.4"/>
</rows> </rows>
<rows location="10:4-10:29"> <rows>
<cells location="10:5-10:8" value="true" port="//@ports.0"/> <cells value="true" port="//@ports.0"/>
<cells location="10:10-10:13" value="true" port="//@ports.3"/> <cells value="true" port="//@ports.3"/>
<cells location="10:25-10:28" value="false" port="//@ports.4"/> <cells value="false" port="//@ports.4"/>
</rows> </rows>
<rows location="11:4-11:29"> <rows>
<cells location="11:5-11:8" value="true" port="//@ports.0"/> <cells value="true" port="//@ports.0"/>
<cells location="11:10-11:13" value="true" port="//@ports.1"/> <cells value="true" port="//@ports.1"/>
<cells location="11:15-11:18" value="false" port="//@ports.2"/> <cells value="false" port="//@ports.2"/>
<cells location="11:20-11:23" value="false" port="//@ports.3"/> <cells value="false" port="//@ports.3"/>
<cells location="11:25-11:28" value="true" port="//@ports.4"/> <cells value="true" port="//@ports.4"/>
</rows> </rows>
<rows location="12:4-12:29"> <rows>
<cells location="12:5-12:8" value="true" port="//@ports.0"/> <cells value="true" port="//@ports.0"/>
<cells location="12:10-12:13" value="true" port="//@ports.1"/> <cells value="true" port="//@ports.1"/>
<cells location="12:15-12:18" value="true" port="//@ports.2"/> <cells value="true" port="//@ports.2"/>
<cells location="12:20-12:23" value="false" port="//@ports.3"/> <cells value="false" port="//@ports.3"/>
<cells location="12:25-12:28" value="false" port="//@ports.4"/> <cells value="false" port="//@ports.4"/>
</rows> </rows>
</TruthTable> </TruthTable>
...@@ -2,11 +2,7 @@ ...@@ -2,11 +2,7 @@
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="tt" nsURI="https://www.transformation-tool-contest.eu/2019/tt" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="tt" nsURI="https://www.transformation-tool-contest.eu/2019/tt"
nsPrefix="tt"> nsPrefix="tt">
<eClassifiers xsi:type="ecore:EClass" name="LocatedElement"> <eClassifiers xsi:type="ecore:EClass" name="TruthTable">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="location" ordered="false"
unique="false" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="TruthTable" eSuperTypes="#//LocatedElement">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" unique="false" <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" unique="false"
lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="ports" ordered="false" <eStructuralFeatures xsi:type="ecore:EReference" name="ports" ordered="false"
...@@ -14,7 +10,7 @@ ...@@ -14,7 +10,7 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="rows" ordered="false" lowerBound="2" <eStructuralFeatures xsi:type="ecore:EReference" name="rows" ordered="false" lowerBound="2"
upperBound="-1" eType="#//Row" containment="true" eOpposite="#//Row/owner"/> upperBound="-1" eType="#//Row" containment="true" eOpposite="#//Row/owner"/>
</eClassifiers> </eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Port" abstract="true" eSuperTypes="#//LocatedElement"> <eClassifiers xsi:type="ecore:EClass" name="Port" abstract="true">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" unique="false" <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" unique="false"
lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="owner" ordered="false" <eStructuralFeatures xsi:type="ecore:EReference" name="owner" ordered="false"
...@@ -24,13 +20,13 @@ ...@@ -24,13 +20,13 @@
</eClassifiers> </eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="InputPort" eSuperTypes="#//Port"/> <eClassifiers xsi:type="ecore:EClass" name="InputPort" eSuperTypes="#//Port"/>
<eClassifiers xsi:type="ecore:EClass" name="OutputPort" eSuperTypes="#//Port"/> <eClassifiers xsi:type="ecore:EClass" name="OutputPort" eSuperTypes="#//Port"/>
<eClassifiers xsi:type="ecore:EClass" name="Row" eSuperTypes="#//LocatedElement"> <eClassifiers xsi:type="ecore:EClass" name="Row">
<eStructuralFeatures xsi:type="ecore:EReference" name="owner" ordered="false" <eStructuralFeatures xsi:type="ecore:EReference" name="owner" ordered="false"
lowerBound="1" eType="#//TruthTable" eOpposite="#//TruthTable/rows"/> lowerBound="1" eType="#//TruthTable" eOpposite="#//TruthTable/rows"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="cells" ordered="false" <eStructuralFeatures xsi:type="ecore:EReference" name="cells" ordered="false"
lowerBound="1" upperBound="-1" eType="#//Cell" containment="true" eOpposite="#//Cell/owner"/> lowerBound="1" upperBound="-1" eType="#//Cell" containment="true" eOpposite="#//Cell/owner"/>
</eClassifiers> </eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Cell" eSuperTypes="#//LocatedElement"> <eClassifiers xsi:type="ecore:EClass" name="Cell">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" ordered="false" <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" ordered="false"
unique="false" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> unique="false" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="owner" ordered="false" <eStructuralFeatures xsi:type="ecore:EReference" name="owner" ordered="false"
......
...@@ -7,9 +7,6 @@ ...@@ -7,9 +7,6 @@
<foreignModel>TT.ecore</foreignModel> <foreignModel>TT.ecore</foreignModel>
<genPackages prefix="TT" basePackage="ttc2019" disposableProviderFactory="true" <genPackages prefix="TT" basePackage="ttc2019" disposableProviderFactory="true"
ecorePackage="TT.ecore#/"> ecorePackage="TT.ecore#/">
<genClasses ecoreClass="TT.ecore#//LocatedElement">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TT.ecore#//LocatedElement/location"/>
</genClasses>
<genClasses ecoreClass="TT.ecore#//TruthTable"> <genClasses ecoreClass="TT.ecore#//TruthTable">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TT.ecore#//TruthTable/name"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute TT.ecore#//TruthTable/name"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TT.ecore#//TruthTable/ports"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TT.ecore#//TruthTable/ports"/>
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
*/ */
package ttc2019.tt; package ttc2019.tt;
import org.eclipse.emf.ecore.EObject;
/** /**
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
...@@ -21,7 +23,7 @@ package ttc2019.tt; ...@@ -21,7 +23,7 @@ package ttc2019.tt;
* @model * @model
* @generated * @generated
*/ */
public interface Cell extends LocatedElement { public interface Cell extends EObject {
/** /**
* Returns the value of the '<em><b>Value</b></em>' attribute. * Returns the value of the '<em><b>Value</b></em>' attribute.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
package ttc2019.tt; package ttc2019.tt;
import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
/** /**
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
...@@ -22,7 +23,7 @@ import org.eclipse.emf.common.util.EList; ...@@ -22,7 +23,7 @@ import org.eclipse.emf.common.util.EList;
* @model abstract="true" * @model abstract="true"
* @generated * @generated
*/ */
public interface Port extends LocatedElement { public interface Port extends EObject {
/** /**
* Returns the value of the '<em><b>Name</b></em>' attribute. * Returns the value of the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
package ttc2019.tt; package ttc2019.tt;
import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
/** /**
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
...@@ -21,7 +22,7 @@ import org.eclipse.emf.common.util.EList; ...@@ -21,7 +22,7 @@ import org.eclipse.emf.common.util.EList;
* @model * @model
* @generated * @generated
*/ */
public interface Row extends LocatedElement { public interface Row extends EObject {
/** /**
* Returns the value of the '<em><b>Owner</b></em>' container reference. * Returns the value of the '<em><b>Owner</b></em>' container reference.
* It is bidirectional and its opposite is '{@link ttc2019.tt.TruthTable#getRows <em>Rows</em>}'. * It is bidirectional and its opposite is '{@link ttc2019.tt.TruthTable#getRows <em>Rows</em>}'.
......
...@@ -21,15 +21,6 @@ public interface TTFactory extends EFactory { ...@@ -21,15 +21,6 @@ public interface TTFactory extends EFactory {
*/ */
TTFactory eINSTANCE = ttc2019.tt.impl.TTFactoryImpl.init(); TTFactory eINSTANCE = ttc2019.tt.impl.TTFactoryImpl.init();
/**
* Returns a new object of class '<em>Located Element</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Located Element</em>'.
* @generated
*/
LocatedElement createLocatedElement();
/** /**
* Returns a new object of class '<em>Truth Table</em>'. * Returns a new object of class '<em>Truth Table</em>'.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
......
...@@ -56,43 +56,6 @@ public interface TTPackage extends EPackage { ...@@ -56,43 +56,6 @@ public interface TTPackage extends EPackage {
*/ */
TTPackage eINSTANCE = ttc2019.tt.impl.TTPackageImpl.init(); TTPackage eINSTANCE = ttc2019.tt.impl.TTPackageImpl.init();
/**
* The meta object id for the '{@link ttc2019.tt.impl.LocatedElementImpl <em>Located Element</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see ttc2019.tt.impl.LocatedElementImpl
* @see ttc2019.tt.impl.TTPackageImpl#getLocatedElement()
* @generated
*/
int LOCATED_ELEMENT = 0;
/**
* The feature id for the '<em><b>Location</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int LOCATED_ELEMENT__LOCATION = 0;
/**
* The number of structural features of the '<em>Located Element</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int LOCATED_ELEMENT_FEATURE_COUNT = 1;
/**
* The number of operations of the '<em>Located Element</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int LOCATED_ELEMENT_OPERATION_COUNT = 0;
/** /**
* The meta object id for the '{@link ttc2019.tt.impl.TruthTableImpl <em>Truth Table</em>}' class. * The meta object id for the '{@link ttc2019.tt.impl.TruthTableImpl <em>Truth Table</em>}' class.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
...@@ -101,16 +64,7 @@ public interface TTPackage extends EPackage { ...@@ -101,16 +64,7 @@ public interface TTPackage extends EPackage {
* @see ttc2019.tt.impl.TTPackageImpl#getTruthTable() * @see ttc2019.tt.impl.TTPackageImpl#getTruthTable()
* @generated * @generated
*/ */
int TRUTH_TABLE = 1; int TRUTH_TABLE = 0;
/**
* The feature id for the '<em><b>Location</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int TRUTH_TABLE__LOCATION = LOCATED_ELEMENT__LOCATION;
/** /**
* The feature id for the '<em><b>Name</b></em>' attribute. * The feature id for the '<em><b>Name</b></em>' attribute.
...@@ -119,7 +73,7 @@ public interface TTPackage extends EPackage { ...@@ -119,7 +73,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int TRUTH_TABLE__NAME = LOCATED_ELEMENT_FEATURE_COUNT + 0; int TRUTH_TABLE__NAME = 0;
/** /**
* The feature id for the '<em><b>Ports</b></em>' containment reference list. * The feature id for the '<em><b>Ports</b></em>' containment reference list.
...@@ -128,7 +82,7 @@ public interface TTPackage extends EPackage { ...@@ -128,7 +82,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int TRUTH_TABLE__PORTS = LOCATED_ELEMENT_FEATURE_COUNT + 1; int TRUTH_TABLE__PORTS = 1;
/** /**
* The feature id for the '<em><b>Rows</b></em>' containment reference list. * The feature id for the '<em><b>Rows</b></em>' containment reference list.
...@@ -137,7 +91,7 @@ public interface TTPackage extends EPackage { ...@@ -137,7 +91,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int TRUTH_TABLE__ROWS = LOCATED_ELEMENT_FEATURE_COUNT + 2; int TRUTH_TABLE__ROWS = 2;
/** /**
* The number of structural features of the '<em>Truth Table</em>' class. * The number of structural features of the '<em>Truth Table</em>' class.
...@@ -146,7 +100,7 @@ public interface TTPackage extends EPackage { ...@@ -146,7 +100,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int TRUTH_TABLE_FEATURE_COUNT = LOCATED_ELEMENT_FEATURE_COUNT + 3; int TRUTH_TABLE_FEATURE_COUNT = 3;
/** /**
* The number of operations of the '<em>Truth Table</em>' class. * The number of operations of the '<em>Truth Table</em>' class.
...@@ -155,7 +109,7 @@ public interface TTPackage extends EPackage { ...@@ -155,7 +109,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int TRUTH_TABLE_OPERATION_COUNT = LOCATED_ELEMENT_OPERATION_COUNT + 0; int TRUTH_TABLE_OPERATION_COUNT = 0;
/** /**
* The meta object id for the '{@link ttc2019.tt.impl.PortImpl <em>Port</em>}' class. * The meta object id for the '{@link ttc2019.tt.impl.PortImpl <em>Port</em>}' class.
...@@ -165,16 +119,7 @@ public interface TTPackage extends EPackage { ...@@ -165,16 +119,7 @@ public interface TTPackage extends EPackage {
* @see ttc2019.tt.impl.TTPackageImpl#getPort() * @see ttc2019.tt.impl.TTPackageImpl#getPort()
* @generated * @generated
*/ */
int PORT = 2; int PORT = 1;
/**
* The feature id for the '<em><b>Location</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int PORT__LOCATION = LOCATED_ELEMENT__LOCATION;
/** /**
* The feature id for the '<em><b>Name</b></em>' attribute. * The feature id for the '<em><b>Name</b></em>' attribute.
...@@ -183,7 +128,7 @@ public interface TTPackage extends EPackage { ...@@ -183,7 +128,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int PORT__NAME = LOCATED_ELEMENT_FEATURE_COUNT + 0; int PORT__NAME = 0;
/** /**
* The feature id for the '<em><b>Owner</b></em>' container reference. * The feature id for the '<em><b>Owner</b></em>' container reference.
...@@ -192,7 +137,7 @@ public interface TTPackage extends EPackage { ...@@ -192,7 +137,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int PORT__OWNER = LOCATED_ELEMENT_FEATURE_COUNT + 1; int PORT__OWNER = 1;
/** /**
* The feature id for the '<em><b>Cells</b></em>' reference list. * The feature id for the '<em><b>Cells</b></em>' reference list.
...@@ -201,7 +146,7 @@ public interface TTPackage extends EPackage { ...@@ -201,7 +146,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int PORT__CELLS = LOCATED_ELEMENT_FEATURE_COUNT + 2; int PORT__CELLS = 2;
/** /**
* The number of structural features of the '<em>Port</em>' class. * The number of structural features of the '<em>Port</em>' class.
...@@ -210,7 +155,7 @@ public interface TTPackage extends EPackage { ...@@ -210,7 +155,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int PORT_FEATURE_COUNT = LOCATED_ELEMENT_FEATURE_COUNT + 3; int PORT_FEATURE_COUNT = 3;
/** /**
* The number of operations of the '<em>Port</em>' class. * The number of operations of the '<em>Port</em>' class.
...@@ -219,7 +164,7 @@ public interface TTPackage extends EPackage { ...@@ -219,7 +164,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int PORT_OPERATION_COUNT = LOCATED_ELEMENT_OPERATION_COUNT + 0; int PORT_OPERATION_COUNT = 0;
/** /**
* The meta object id for the '{@link ttc2019.tt.impl.InputPortImpl <em>Input Port</em>}' class. * The meta object id for the '{@link ttc2019.tt.impl.InputPortImpl <em>Input Port</em>}' class.
...@@ -229,16 +174,7 @@ public interface TTPackage extends EPackage { ...@@ -229,16 +174,7 @@ public interface TTPackage extends EPackage {
* @see ttc2019.tt.impl.TTPackageImpl#getInputPort() * @see ttc2019.tt.impl.TTPackageImpl#getInputPort()
* @generated * @generated
*/ */
int INPUT_PORT = 3; int INPUT_PORT = 2;
/**
* The feature id for the '<em><b>Location</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int INPUT_PORT__LOCATION = PORT__LOCATION;
/** /**
* The feature id for the '<em><b>Name</b></em>' attribute. * The feature id for the '<em><b>Name</b></em>' attribute.
...@@ -293,16 +229,7 @@ public interface TTPackage extends EPackage { ...@@ -293,16 +229,7 @@ public interface TTPackage extends EPackage {
* @see ttc2019.tt.impl.TTPackageImpl#getOutputPort() * @see ttc2019.tt.impl.TTPackageImpl#getOutputPort()
* @generated * @generated
*/ */
int OUTPUT_PORT = 4; int OUTPUT_PORT = 3;
/**
* The feature id for the '<em><b>Location</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int OUTPUT_PORT__LOCATION = PORT__LOCATION;
/** /**
* The feature id for the '<em><b>Name</b></em>' attribute. * The feature id for the '<em><b>Name</b></em>' attribute.
...@@ -357,16 +284,7 @@ public interface TTPackage extends EPackage { ...@@ -357,16 +284,7 @@ public interface TTPackage extends EPackage {
* @see ttc2019.tt.impl.TTPackageImpl#getRow() * @see ttc2019.tt.impl.TTPackageImpl#getRow()
* @generated * @generated
*/ */
int ROW = 5; int ROW = 4;
/**
* The feature id for the '<em><b>Location</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int ROW__LOCATION = LOCATED_ELEMENT__LOCATION;
/** /**
* The feature id for the '<em><b>Owner</b></em>' container reference. * The feature id for the '<em><b>Owner</b></em>' container reference.
...@@ -375,7 +293,7 @@ public interface TTPackage extends EPackage { ...@@ -375,7 +293,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int ROW__OWNER = LOCATED_ELEMENT_FEATURE_COUNT + 0; int ROW__OWNER = 0;
/** /**
* The feature id for the '<em><b>Cells</b></em>' containment reference list. * The feature id for the '<em><b>Cells</b></em>' containment reference list.
...@@ -384,7 +302,7 @@ public interface TTPackage extends EPackage { ...@@ -384,7 +302,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int ROW__CELLS = LOCATED_ELEMENT_FEATURE_COUNT + 1; int ROW__CELLS = 1;
/** /**
* The number of structural features of the '<em>Row</em>' class. * The number of structural features of the '<em>Row</em>' class.
...@@ -393,7 +311,7 @@ public interface TTPackage extends EPackage { ...@@ -393,7 +311,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int ROW_FEATURE_COUNT = LOCATED_ELEMENT_FEATURE_COUNT + 2; int ROW_FEATURE_COUNT = 2;
/** /**
* The number of operations of the '<em>Row</em>' class. * The number of operations of the '<em>Row</em>' class.
...@@ -402,7 +320,7 @@ public interface TTPackage extends EPackage { ...@@ -402,7 +320,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int ROW_OPERATION_COUNT = LOCATED_ELEMENT_OPERATION_COUNT + 0; int ROW_OPERATION_COUNT = 0;
/** /**
* The meta object id for the '{@link ttc2019.tt.impl.CellImpl <em>Cell</em>}' class. * The meta object id for the '{@link ttc2019.tt.impl.CellImpl <em>Cell</em>}' class.
...@@ -412,16 +330,7 @@ public interface TTPackage extends EPackage { ...@@ -412,16 +330,7 @@ public interface TTPackage extends EPackage {
* @see ttc2019.tt.impl.TTPackageImpl#getCell() * @see ttc2019.tt.impl.TTPackageImpl#getCell()
* @generated * @generated
*/ */
int CELL = 6; int CELL = 5;
/**
* The feature id for the '<em><b>Location</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int CELL__LOCATION = LOCATED_ELEMENT__LOCATION;
/** /**
* The feature id for the '<em><b>Value</b></em>' attribute. * The feature id for the '<em><b>Value</b></em>' attribute.
...@@ -430,7 +339,7 @@ public interface TTPackage extends EPackage { ...@@ -430,7 +339,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int CELL__VALUE = LOCATED_ELEMENT_FEATURE_COUNT + 0; int CELL__VALUE = 0;
/** /**
* The feature id for the '<em><b>Owner</b></em>' container reference. * The feature id for the '<em><b>Owner</b></em>' container reference.
...@@ -439,7 +348,7 @@ public interface TTPackage extends EPackage { ...@@ -439,7 +348,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int CELL__OWNER = LOCATED_ELEMENT_FEATURE_COUNT + 1; int CELL__OWNER = 1;
/** /**
* The feature id for the '<em><b>Port</b></em>' reference. * The feature id for the '<em><b>Port</b></em>' reference.
...@@ -448,7 +357,7 @@ public interface TTPackage extends EPackage { ...@@ -448,7 +357,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int CELL__PORT = LOCATED_ELEMENT_FEATURE_COUNT + 2; int CELL__PORT = 2;
/** /**
* The number of structural features of the '<em>Cell</em>' class. * The number of structural features of the '<em>Cell</em>' class.
...@@ -457,7 +366,7 @@ public interface TTPackage extends EPackage { ...@@ -457,7 +366,7 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int CELL_FEATURE_COUNT = LOCATED_ELEMENT_FEATURE_COUNT + 3; int CELL_FEATURE_COUNT = 3;
/** /**
* The number of operations of the '<em>Cell</em>' class. * The number of operations of the '<em>Cell</em>' class.
...@@ -466,29 +375,8 @@ public interface TTPackage extends EPackage { ...@@ -466,29 +375,8 @@ public interface TTPackage extends EPackage {
* @generated * @generated
* @ordered * @ordered
*/ */
int CELL_OPERATION_COUNT = LOCATED_ELEMENT_OPERATION_COUNT + 0; int CELL_OPERATION_COUNT = 0;
/**
* Returns the meta object for class '{@link ttc2019.tt.LocatedElement <em>Located Element</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Located Element</em>'.
* @see ttc2019.tt.LocatedElement
* @generated
*/
EClass getLocatedElement();
/**
* Returns the meta object for the attribute '{@link ttc2019.tt.LocatedElement#getLocation <em>Location</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Location</em>'.
* @see ttc2019.tt.LocatedElement#getLocation()
* @see #getLocatedElement()
* @generated
*/
EAttribute getLocatedElement_Location();
/** /**
* Returns the meta object for class '{@link ttc2019.tt.TruthTable <em>Truth Table</em>}'. * Returns the meta object for class '{@link ttc2019.tt.TruthTable <em>Truth Table</em>}'.
...@@ -694,24 +582,6 @@ public interface TTPackage extends EPackage { ...@@ -694,24 +582,6 @@ public interface TTPackage extends EPackage {
* @generated * @generated
*/ */
interface Literals { interface Literals {
/**
* The meta object literal for the '{@link ttc2019.tt.impl.LocatedElementImpl <em>Located Element</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see ttc2019.tt.impl.LocatedElementImpl
* @see ttc2019.tt.impl.TTPackageImpl#getLocatedElement()
* @generated
*/
EClass LOCATED_ELEMENT = eINSTANCE.getLocatedElement();
/**
* The meta object literal for the '<em><b>Location</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute LOCATED_ELEMENT__LOCATION = eINSTANCE.getLocatedElement_Location();
/** /**
* The meta object literal for the '{@link ttc2019.tt.impl.TruthTableImpl <em>Truth Table</em>}' class. * The meta object literal for the '{@link ttc2019.tt.impl.TruthTableImpl <em>Truth Table</em>}' class.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
package ttc2019.tt; package ttc2019.tt;
import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
/** /**
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
...@@ -22,7 +23,7 @@ import org.eclipse.emf.common.util.EList; ...@@ -22,7 +23,7 @@ import org.eclipse.emf.common.util.EList;
* @model * @model
* @generated * @generated
*/ */
public interface TruthTable extends LocatedElement { public interface TruthTable extends EObject {
/** /**
* Returns the value of the '<em><b>Name</b></em>' attribute. * Returns the value of the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
......
...@@ -10,6 +10,7 @@ import org.eclipse.emf.ecore.InternalEObject; ...@@ -10,6 +10,7 @@ import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.util.EcoreUtil;
import ttc2019.tt.Cell; import ttc2019.tt.Cell;
...@@ -32,7 +33,7 @@ import ttc2019.tt.TTPackage; ...@@ -32,7 +33,7 @@ import ttc2019.tt.TTPackage;
* *
* @generated * @generated
*/ */
public class CellImpl extends LocatedElementImpl implements Cell { public class CellImpl extends MinimalEObjectImpl.Container implements Cell {
/** /**
* The default value of the '{@link #isValue() <em>Value</em>}' attribute. * The default value of the '{@link #isValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
......
/**
*/
package ttc2019.tt.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import ttc2019.tt.LocatedElement;
import ttc2019.tt.TTPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Located Element</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link ttc2019.tt.impl.LocatedElementImpl#getLocation <em>Location</em>}</li>
* </ul>
*
* @generated
*/
public class LocatedElementImpl extends MinimalEObjectImpl.Container implements LocatedElement {
/**
* The default value of the '{@link #getLocation() <em>Location</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLocation()
* @generated
* @ordered
*/
protected static final String LOCATION_EDEFAULT = null;
/**
* The cached value of the '{@link #getLocation() <em>Location</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLocation()
* @generated
* @ordered
*/
protected String location = LOCATION_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected LocatedElementImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return TTPackage.Literals.LOCATED_ELEMENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getLocation() {
return location;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLocation(String newLocation) {
String oldLocation = location;
location = newLocation;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TTPackage.LOCATED_ELEMENT__LOCATION, oldLocation, location));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case TTPackage.LOCATED_ELEMENT__LOCATION:
return getLocation();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case TTPackage.LOCATED_ELEMENT__LOCATION:
setLocation((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case TTPackage.LOCATED_ELEMENT__LOCATION:
setLocation(LOCATION_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case TTPackage.LOCATED_ELEMENT__LOCATION:
return LOCATION_EDEFAULT == null ? location != null : !LOCATION_EDEFAULT.equals(location);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (location: ");
result.append(location);
result.append(')');
return result.toString();
}
} //LocatedElementImpl
...@@ -14,6 +14,7 @@ import org.eclipse.emf.ecore.InternalEObject; ...@@ -14,6 +14,7 @@ import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.emf.ecore.util.InternalEList;
...@@ -38,7 +39,7 @@ import ttc2019.tt.TruthTable; ...@@ -38,7 +39,7 @@ import ttc2019.tt.TruthTable;
* *
* @generated * @generated
*/ */
public abstract class PortImpl extends LocatedElementImpl implements Port { public abstract class PortImpl extends MinimalEObjectImpl.Container implements Port {
/** /**
* The default value of the '{@link #getName() <em>Name</em>}' attribute. * The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
......
...@@ -14,6 +14,7 @@ import org.eclipse.emf.ecore.InternalEObject; ...@@ -14,6 +14,7 @@ import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.emf.ecore.util.InternalEList;
...@@ -37,7 +38,7 @@ import ttc2019.tt.TruthTable; ...@@ -37,7 +38,7 @@ import ttc2019.tt.TruthTable;
* *
* @generated * @generated
*/ */
public class RowImpl extends LocatedElementImpl implements Row { public class RowImpl extends MinimalEObjectImpl.Container implements Row {
/** /**
* The cached value of the '{@link #getCells() <em>Cells</em>}' containment reference list. * The cached value of the '{@link #getCells() <em>Cells</em>}' containment reference list.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
......
...@@ -56,7 +56,6 @@ public class TTFactoryImpl extends EFactoryImpl implements TTFactory { ...@@ -56,7 +56,6 @@ public class TTFactoryImpl extends EFactoryImpl implements TTFactory {
@Override @Override
public EObject create(EClass eClass) { public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) { switch (eClass.getClassifierID()) {
case TTPackage.LOCATED_ELEMENT: return createLocatedElement();
case TTPackage.TRUTH_TABLE: return createTruthTable(); case TTPackage.TRUTH_TABLE: return createTruthTable();
case TTPackage.INPUT_PORT: return createInputPort(); case TTPackage.INPUT_PORT: return createInputPort();
case TTPackage.OUTPUT_PORT: return createOutputPort(); case TTPackage.OUTPUT_PORT: return createOutputPort();
...@@ -67,16 +66,6 @@ public class TTFactoryImpl extends EFactoryImpl implements TTFactory { ...@@ -67,16 +66,6 @@ public class TTFactoryImpl extends EFactoryImpl implements TTFactory {
} }
} }
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LocatedElement createLocatedElement() {
LocatedElementImpl locatedElement = new LocatedElementImpl();
return locatedElement;
}
/** /**
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
......
...@@ -11,7 +11,6 @@ import org.eclipse.emf.ecore.impl.EPackageImpl; ...@@ -11,7 +11,6 @@ import org.eclipse.emf.ecore.impl.EPackageImpl;
import ttc2019.tt.Cell; import ttc2019.tt.Cell;
import ttc2019.tt.InputPort; import ttc2019.tt.InputPort;
import ttc2019.tt.LocatedElement;
import ttc2019.tt.OutputPort; import ttc2019.tt.OutputPort;
import ttc2019.tt.Port; import ttc2019.tt.Port;
import ttc2019.tt.Row; import ttc2019.tt.Row;
...@@ -26,13 +25,6 @@ import ttc2019.tt.TruthTable; ...@@ -26,13 +25,6 @@ import ttc2019.tt.TruthTable;
* @generated * @generated
*/ */
public class TTPackageImpl extends EPackageImpl implements TTPackage { public class TTPackageImpl extends EPackageImpl implements TTPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass locatedElementEClass = null;
/** /**
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
...@@ -136,24 +128,6 @@ public class TTPackageImpl extends EPackageImpl implements TTPackage { ...@@ -136,24 +128,6 @@ public class TTPackageImpl extends EPackageImpl implements TTPackage {
return theTTPackage; return theTTPackage;
} }
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getLocatedElement() {
return locatedElementEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getLocatedElement_Location() {
return (EAttribute)locatedElementEClass.getEStructuralFeatures().get(0);
}
/** /**
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
...@@ -335,9 +309,6 @@ public class TTPackageImpl extends EPackageImpl implements TTPackage { ...@@ -335,9 +309,6 @@ public class TTPackageImpl extends EPackageImpl implements TTPackage {
isCreated = true; isCreated = true;
// Create classes and their features // Create classes and their features
locatedElementEClass = createEClass(LOCATED_ELEMENT);
createEAttribute(locatedElementEClass, LOCATED_ELEMENT__LOCATION);
truthTableEClass = createEClass(TRUTH_TABLE); truthTableEClass = createEClass(TRUTH_TABLE);
createEAttribute(truthTableEClass, TRUTH_TABLE__NAME); createEAttribute(truthTableEClass, TRUTH_TABLE__NAME);
createEReference(truthTableEClass, TRUTH_TABLE__PORTS); createEReference(truthTableEClass, TRUTH_TABLE__PORTS);
...@@ -390,17 +361,10 @@ public class TTPackageImpl extends EPackageImpl implements TTPackage { ...@@ -390,17 +361,10 @@ public class TTPackageImpl extends EPackageImpl implements TTPackage {
// Set bounds for type parameters // Set bounds for type parameters
// Add supertypes to classes // Add supertypes to classes
truthTableEClass.getESuperTypes().add(this.getLocatedElement());
portEClass.getESuperTypes().add(this.getLocatedElement());
inputPortEClass.getESuperTypes().add(this.getPort()); inputPortEClass.getESuperTypes().add(this.getPort());
outputPortEClass.getESuperTypes().add(this.getPort()); outputPortEClass.getESuperTypes().add(this.getPort());
rowEClass.getESuperTypes().add(this.getLocatedElement());
cellEClass.getESuperTypes().add(this.getLocatedElement());
// Initialize classes, features, and operations; add parameters // Initialize classes, features, and operations; add parameters
initEClass(locatedElementEClass, LocatedElement.class, "LocatedElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getLocatedElement_Location(), ecorePackage.getEString(), "location", null, 1, 1, LocatedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
initEClass(truthTableEClass, TruthTable.class, "TruthTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(truthTableEClass, TruthTable.class, "TruthTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getTruthTable_Name(), ecorePackage.getEString(), "name", null, 1, 1, TruthTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); initEAttribute(getTruthTable_Name(), ecorePackage.getEString(), "name", null, 1, 1, TruthTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
initEReference(getTruthTable_Ports(), this.getPort(), this.getPort_Owner(), "ports", null, 1, -1, TruthTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); initEReference(getTruthTable_Ports(), this.getPort(), this.getPort_Owner(), "ports", null, 1, -1, TruthTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
......
...@@ -14,6 +14,7 @@ import org.eclipse.emf.ecore.InternalEObject; ...@@ -14,6 +14,7 @@ import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.emf.ecore.util.InternalEList;
...@@ -37,7 +38,7 @@ import ttc2019.tt.TruthTable; ...@@ -37,7 +38,7 @@ import ttc2019.tt.TruthTable;
* *
* @generated * @generated
*/ */
public class TruthTableImpl extends LocatedElementImpl implements TruthTable { public class TruthTableImpl extends MinimalEObjectImpl.Container implements TruthTable {
/** /**
* The default value of the '{@link #getName() <em>Name</em>}' attribute. * The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
......
...@@ -67,10 +67,6 @@ public class TTAdapterFactory extends AdapterFactoryImpl { ...@@ -67,10 +67,6 @@ public class TTAdapterFactory extends AdapterFactoryImpl {
*/ */
protected TTSwitch<Adapter> modelSwitch = protected TTSwitch<Adapter> modelSwitch =
new TTSwitch<Adapter>() { new TTSwitch<Adapter>() {
@Override
public Adapter caseLocatedElement(LocatedElement object) {
return createLocatedElementAdapter();
}
@Override @Override
public Adapter caseTruthTable(TruthTable object) { public Adapter caseTruthTable(TruthTable object) {
return createTruthTableAdapter(); return createTruthTableAdapter();
...@@ -115,20 +111,6 @@ public class TTAdapterFactory extends AdapterFactoryImpl { ...@@ -115,20 +111,6 @@ public class TTAdapterFactory extends AdapterFactoryImpl {
} }
/**
* Creates a new adapter for an object of class '{@link ttc2019.tt.LocatedElement <em>Located Element</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see ttc2019.tt.LocatedElement
* @generated
*/
public Adapter createLocatedElementAdapter() {
return null;
}
/** /**
* Creates a new adapter for an object of class '{@link ttc2019.tt.TruthTable <em>Truth Table</em>}'. * Creates a new adapter for an object of class '{@link ttc2019.tt.TruthTable <em>Truth Table</em>}'.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
......
...@@ -66,23 +66,15 @@ public class TTSwitch<T> extends Switch<T> { ...@@ -66,23 +66,15 @@ public class TTSwitch<T> extends Switch<T> {
@Override @Override
protected T doSwitch(int classifierID, EObject theEObject) { protected T doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) { switch (classifierID) {
case TTPackage.LOCATED_ELEMENT: {
LocatedElement locatedElement = (LocatedElement)theEObject;
T result = caseLocatedElement(locatedElement);
if (result == null) result = defaultCase(theEObject);
return result;
}
case TTPackage.TRUTH_TABLE: { case TTPackage.TRUTH_TABLE: {
TruthTable truthTable = (TruthTable)theEObject; TruthTable truthTable = (TruthTable)theEObject;
T result = caseTruthTable(truthTable); T result = caseTruthTable(truthTable);
if (result == null) result = caseLocatedElement(truthTable);
if (result == null) result = defaultCase(theEObject); if (result == null) result = defaultCase(theEObject);
return result; return result;
} }
case TTPackage.PORT: { case TTPackage.PORT: {
Port port = (Port)theEObject; Port port = (Port)theEObject;
T result = casePort(port); T result = casePort(port);
if (result == null) result = caseLocatedElement(port);
if (result == null) result = defaultCase(theEObject); if (result == null) result = defaultCase(theEObject);
return result; return result;
} }
...@@ -90,7 +82,6 @@ public class TTSwitch<T> extends Switch<T> { ...@@ -90,7 +82,6 @@ public class TTSwitch<T> extends Switch<T> {
InputPort inputPort = (InputPort)theEObject; InputPort inputPort = (InputPort)theEObject;
T result = caseInputPort(inputPort); T result = caseInputPort(inputPort);
if (result == null) result = casePort(inputPort); if (result == null) result = casePort(inputPort);
if (result == null) result = caseLocatedElement(inputPort);
if (result == null) result = defaultCase(theEObject); if (result == null) result = defaultCase(theEObject);
return result; return result;
} }
...@@ -98,21 +89,18 @@ public class TTSwitch<T> extends Switch<T> { ...@@ -98,21 +89,18 @@ public class TTSwitch<T> extends Switch<T> {
OutputPort outputPort = (OutputPort)theEObject; OutputPort outputPort = (OutputPort)theEObject;
T result = caseOutputPort(outputPort); T result = caseOutputPort(outputPort);
if (result == null) result = casePort(outputPort); if (result == null) result = casePort(outputPort);
if (result == null) result = caseLocatedElement(outputPort);
if (result == null) result = defaultCase(theEObject); if (result == null) result = defaultCase(theEObject);
return result; return result;
} }
case TTPackage.ROW: { case TTPackage.ROW: {
Row row = (Row)theEObject; Row row = (Row)theEObject;
T result = caseRow(row); T result = caseRow(row);
if (result == null) result = caseLocatedElement(row);
if (result == null) result = defaultCase(theEObject); if (result == null) result = defaultCase(theEObject);
return result; return result;
} }
case TTPackage.CELL: { case TTPackage.CELL: {
Cell cell = (Cell)theEObject; Cell cell = (Cell)theEObject;
T result = caseCell(cell); T result = caseCell(cell);
if (result == null) result = caseLocatedElement(cell);
if (result == null) result = defaultCase(theEObject); if (result == null) result = defaultCase(theEObject);
return result; return result;
} }
...@@ -120,21 +108,6 @@ public class TTSwitch<T> extends Switch<T> { ...@@ -120,21 +108,6 @@ public class TTSwitch<T> extends Switch<T> {
} }
} }
/**
* Returns the result of interpreting the object as an instance of '<em>Located Element</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Located Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseLocatedElement(LocatedElement object) {
return null;
}
/** /**
* Returns the result of interpreting the object as an instance of '<em>Truth Table</em>'. * Returns the result of interpreting the object as an instance of '<em>Truth Table</em>'.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment