Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2018-01-05 21:16:05 +0000
committerHenrik Rentz-Reichert2018-01-08 19:47:48 +0000
commit33e5411e9632baa741e2e93e91922cd40693cfd3 (patch)
tree1814b0a170406345b83937901b928040fd58c6a9 /plugins/org.eclipse.etrice.generator.c
parent97db531e8fa6d639abf4ac2bbbb1dbdb5ad79f15 (diff)
downloadorg.eclipse.etrice-33e5411e9632baa741e2e93e91922cd40693cfd3.tar.gz
org.eclipse.etrice-33e5411e9632baa741e2e93e91922cd40693cfd3.tar.xz
org.eclipse.etrice-33e5411e9632baa741e2e93e91922cd40693cfd3.zip
Bug 529445 - [newfsmgen] make old style transition data deprecated
Implementation as suggested in the bug. Change-Id: I6a6f6ea966e4060646427078d82cb2b12eb046b6
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.c')
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend21
1 files changed, 11 insertions, 10 deletions
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend
index f13bc4f7c..f5770af10 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend
@@ -33,10 +33,10 @@ import org.eclipse.etrice.core.room.EnumLiteral
import org.eclipse.etrice.core.room.EnumerationType
import org.eclipse.etrice.core.room.ExternalType
import org.eclipse.etrice.core.room.Message
+import org.eclipse.etrice.core.room.MessageData
import org.eclipse.etrice.core.room.PrimitiveType
import org.eclipse.etrice.core.room.RoomClass
import org.eclipse.etrice.core.room.RoomModel
-import org.eclipse.etrice.core.room.VarDecl
import org.eclipse.etrice.core.room.util.RoomHelpers
import org.eclipse.etrice.generator.generic.ILanguageExtension
import org.eclipse.xtext.util.Pair
@@ -236,7 +236,7 @@ class CExtensions implements ILanguageExtension {
EnumerationType:
getDefaultValue(dt)
ExternalType:{
- if (dt.defaultValueLiteral != null )
+ if (dt.defaultValueLiteral !== null )
return dt.getDefaultValueLiteral
diagnostician.error("external type "+dt.name + "has no default initialization", dt.eContainer, dt.eContainingFeature)
""
@@ -282,7 +282,7 @@ class CExtensions implements ILanguageExtension {
def initializationWithDefaultValues(Attribute att) {
val dv = att.defaultValueLiteral
- if (dv!=null) {
+ if (dv!==null) {
if (dv.startsWith("{"))
dv
else
@@ -296,11 +296,12 @@ class CExtensions implements ILanguageExtension {
}
override generateArglistAndTypedData(EObject d) {
- if (d==null || !(d instanceof VarDecl))
+ // TODO 529445: d will be a RefableType, not MessageData
+ if (d===null || !(d instanceof MessageData))
return newArrayList("", "", "")
- val data = d as VarDecl
- if (data==null)
+ val data = d as MessageData
+ if (data===null)
return newArrayList("", "", "")
var typeName = if (data.getRefType().getType() instanceof PrimitiveType)
@@ -314,7 +315,7 @@ class CExtensions implements ILanguageExtension {
var castTypeName = if (data.getRefType().getType() instanceof PrimitiveType) {
val ct = (data.getRefType().getType() as PrimitiveType).getCastName()
- if (ct!=null && !ct.isEmpty())
+ if (ct!==null && !ct.isEmpty())
ct
else
typeName
@@ -356,7 +357,7 @@ class CExtensions implements ILanguageExtension {
}
override getTargetType(EnumerationType type) {
- if (type.getPrimitiveType()!=null)
+ if (type.getPrimitiveType()!==null)
type.getPrimitiveType().getTargetName()
else
type.getName()
@@ -366,14 +367,14 @@ class CExtensions implements ILanguageExtension {
val type = literal.eContainer() as EnumerationType
val cast = type.targetType
- if (type.primitiveType==null)
+ if (type.primitiveType===null)
Long.toString(literal.getLiteralValue())
else
"(("+cast+")"+Long.toString(literal.getLiteralValue())+")"
}
override getCastType(EnumerationType type) {
- if (type.getPrimitiveType()!=null)
+ if (type.getPrimitiveType()!==null)
type.getPrimitiveType().getCastName()
else
type.getName()

Back to the top