Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
AF3
Commits
e0afd070
Commit
e0afd070
authored
May 22, 2012
by
Florian Hölzl
Browse files
moved C source package utils
added program to C transformation refs 118
parent
34cabfcf
Changes
6
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.component/trunk/src/org/fortiss/af3/component/generator/c/CSourceCompositeComponent.java
View file @
e0afd070
...
...
@@ -27,7 +27,7 @@ import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.seq
import
static
org
.
fortiss
.
af3
.
expression
.
utils
.
ExpressionModelElementFactory
.
var
;
import
static
org
.
fortiss
.
af3
.
generator
.
common
.
model
.
oldc
.
Function
.
createExternFunction
;
import
static
org
.
fortiss
.
af3
.
generator
.
common
.
model
.
oldc
.
VoidType
.
VOID_TYPE
;
import
static
org
.
fortiss
.
af3
.
generator
.
common
.
utils
.
CSourcePackageUtils
.
flattenAndSortHierarchicSourcePackages
;
import
static
org
.
fortiss
.
af3
.
generator
.
common
.
utils
.
Old
CSourcePackageUtils
.
flattenAndSortHierarchicSourcePackages
;
import
java.util.LinkedList
;
import
java.util.List
;
...
...
org.fortiss.af3.expression/trunk/plugin.xml
View file @
e0afd070
...
...
@@ -63,4 +63,20 @@
</modelElementClass>
</modelElementConstraintChecker>
</extension>
<extension
point=
"org.fortiss.tooling.kernel.transformationProvider"
>
<transformationProvider
transformationProvider=
"org.fortiss.af3.expression.generator.imperative.DataDictionaryTransformation"
>
<source>
<objectClass
objectClass=
"org.fortiss.af3.expression.model.DataDictionary"
>
</objectClass>
</source>
<target>
<objectClass
objectClass=
"org.fortiss.af3.expression.model.generator.Program"
>
</objectClass>
</target>
</transformationProvider>
</extension>
</plugin>
org.fortiss.af3.expression/trunk/src/org/fortiss/af3/expression/generator/c/ProgramTransformation.java
0 → 100644
View file @
e0afd070
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2012 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package
org.fortiss.af3.expression.generator.c
;
import
org.fortiss.af3.expression.model.generator.Program
;
import
org.fortiss.af3.generator.common.model.source.SourcePackage
;
import
org.fortiss.tooling.kernel.extension.ITransformationProvider
;
import
org.fortiss.tooling.kernel.extension.data.ITransformationContext
;
import
org.fortiss.tooling.kernel.extension.exception.TransformationFailedException
;
/**
* An {@link ITransformationProvider} for the transformation of {@link Program} into a C
* {@link SourcePackage}. The resulting package contains two sub-packages {@code inc-gen} and
* {@code src-gen}, which contain the header and implementation files respectively.
*
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public
class
ProgramTransformation
implements
ITransformationProvider
{
/** {@inheritDoc} */
@Override
public
Class
<?>
getTargetClass
()
{
return
null
;
}
/** {@inheritDoc} */
@Override
public
boolean
canHandleChainTransformation
(
Class
<?>
sourceClass
,
ITransformationContext
context
)
{
// TODO Auto-generated method stub
return
false
;
}
/** {@inheritDoc} */
@Override
public
boolean
canTransform
(
Object
source
,
ITransformationContext
context
)
{
// TODO Auto-generated method stub
return
false
;
}
/** {@inheritDoc} */
@Override
public
Object
transform
(
Object
source
,
ITransformationContext
context
)
throws
TransformationFailedException
{
// TODO Auto-generated method stub
return
null
;
}
}
org.fortiss.af3.generator.common/trunk/model/languages.ecore
View file @
e0afd070
...
...
@@ -97,5 +97,6 @@
<eStructuralFeatures
xsi:type=
"ecore:EReference"
name=
"declaration"
eType=
"#//c/FunctionDeclaration"
eOpposite=
"#//c/FunctionDeclaration/definition"
/>
</eClassifiers>
<eClassifiers
xsi:type=
"ecore:EClass"
name=
"CSourcePackage"
eSuperTypes=
"#//source/SourcePackage"
/>
</eSubpackages>
</ecore:EPackage>
org.fortiss.af3.generator.common/trunk/src/org/fortiss/af3/generator/common/utils/CSourcePackageUtils.java
→
org.fortiss.af3.generator.common/trunk/src/org/fortiss/af3/generator/common/utils/
Old
CSourcePackageUtils.java
View file @
e0afd070
...
...
@@ -31,7 +31,7 @@ import org.fortiss.af3.generator.common.model.oldsource.SourceUnitBase;
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: DCF53C35BBD6407BADD559BEAFF8D13A
*/
public
class
CSourcePackageUtils
{
public
class
Old
CSourcePackageUtils
{
/**
* Flattens the given source package and puts the source files into the given root package. The
* root package is required to have two or more sub-packages. The first will be used for header
...
...
org.fortiss.af3.mode/trunk/src/org/fortiss/af3/mode/generator/c/CSourceModeAutomaton.java
View file @
e0afd070
...
...
@@ -42,7 +42,7 @@ import static org.fortiss.af3.generator.common.model.oldc.Function.createExternF
import
static
org
.
fortiss
.
af3
.
generator
.
common
.
model
.
oldc
.
Function
.
createInternFunction
;
import
static
org
.
fortiss
.
af3
.
generator
.
common
.
model
.
oldc
.
Modifier
.
STATIC
;
import
static
org
.
fortiss
.
af3
.
generator
.
common
.
model
.
oldc
.
VoidType
.
VOID_TYPE
;
import
static
org
.
fortiss
.
af3
.
generator
.
common
.
utils
.
CSourcePackageUtils
.
flattenAndSortHierarchicSourcePackages
;
import
static
org
.
fortiss
.
af3
.
generator
.
common
.
utils
.
Old
CSourcePackageUtils
.
flattenAndSortHierarchicSourcePackages
;
import
java.util.LinkedList
;
import
java.util.List
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment