Commit de44cd9a authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
Browse files

Merge from SVN

parent c38f55e1
......@@ -22,364 +22,78 @@
# generated code.
#
'''
This is the code generator for the QgenAda code mappers.
This backend is called by aadl2glueC, when a QgenAda subprogram
is identified in the input concurrency view.
This code generator supports both UPER/ACN and Native encodings,
and also supports UPER/ACN using both ASN1SCC and Nokalva.
QgenAda is a member of the synchronous "club" (SCADE, etc) ;
The subsystem developer (or rather, the APLC developer) is
building a model in QGenAda, generating code with QGenc
and the generated code is offered
in the form of a "function" that does all the work.
To that end, we create "glue" functions for input and output
parameters, which have Ada callable interfaces. The necessary
stubs (to allow calling from the VM side) are also generated.
This is the implementation of the code mapper for Ada code.
As initially envisioned, ASSERT technology is not supposed
to support manually-made systems. A migration path, however,
that allows legacy hand-written code and modelling-tool
generated code to co-exist, can be beneficial in allowing
for a smooth transition. To that end, this backend (as well as
the C one) are written.
This is a backend for Semantix's code generator B (aadl2glueC).
Ada is a member of the asynchronous "club" (SDL, etc);
The subsystem developer (or rather, the APLC developer) is using
native Ada code to work with code generated by modelling tools.
To that end, this backend creates "glue" functions for input and
output parameters, which have Ada callable interfaces.
'''
from commonPy.utility import panicWithCallStack
from commonPy.asnAST import AsnInt, AsnReal, AsnBool, AsnEnumerated, isSequenceVariable, sourceSequenceLimit
from commonPy.aadlAST import AadlPort, AadlParameter
from recursiveMapper import RecursiveMapper
from synchronousTool import SynchronousToolGlueGenerator
# from commonPy.utility import panic
# from recursiveMapper import RecursiveMapper
# from asynchronousTool import ASynchronousToolGlueGenerator
import c_B_mapper
isAsynchronous = False
qgenadaBackend = None
isAsynchronous = True
adaBackend = None
cBackend = None
def Version():
print "Code generator: " + "$Id: qgenada_B_mapper.py 2390 2012-07-19 12:39:17Z ttsiodras $"
def IsElementMappedToPrimitive(node, names):
contained = node._containedType
while isinstance(contained, str):
contained = names[contained]
return isinstance(contained, AsnInt) or isinstance(contained, AsnReal) or isinstance(contained, AsnBool) or isinstance(contained, AsnEnumerated)
class FromQGenAdaToASN1SCC(RecursiveMapper):
def MapInteger(self, srcQGenAda, destVar, _, __, ___):
return ["%s := %s;\n" % (destVar, srcQGenAda)]
def MapReal(self, srcQGenAda, destVar, _, __, ___):
return ["%s := %s;\n" % (destVar, srcQGenAda)]
def MapBoolean(self, srcQGenAda, destVar, _, __, ___):
return ["%s := %s;\n" % (destVar, srcQGenAda)]
def MapOctetString(self, srcQGenAda, destVar, node, _, __):
lines = []
if node._range == []:
panicWithCallStack("OCTET STRING (in %s) must have a SIZE constraint inside ASN.1,\nor else we can't generate C code!" % node.Location()) # pragma: no cover
for i in xrange(0, node._range[-1]):
lines.append("%s.Data (%d) := %s.Data (%d);\n" % (destVar, i+1, srcQGenAda, i))
if isSequenceVariable(node):
lines.append("%s.nCount := %s'Length;\n" % (destVar, srcQGenAda))
# No nCount anymore
#else:
# lines.append("%s.nCount = %s;\n" % (destVar, node._range[-1]))
return lines
def MapEnumerated(self, srcQGenAda, destVar, _, __, ___):
return ["%s := %s;\n" % (destVar, srcQGenAda)]
def MapSequence(self, srcQGenAda, destVar, node, leafTypeDict, names):
lines = []
for child in node._members:
lines.extend(
self.Map(
"%s.%s" % (srcQGenAda, self.CleanName(child[0])),
destVar + "." + self.CleanName(child[0]),
child[1],
leafTypeDict,
names))
return lines
def MapSet(self, srcQGenAda, destVar, node, leafTypeDict, names):
return self.MapSequence(srcQGenAda, destVar, node, leafTypeDict, names) # pragma: nocover
def MapChoice(self, srcQGenAda, destVar, node, leafTypeDict, names):
lines = []
childNo = 0
for child in node._members:
childNo += 1
lines.append("%sif (%s.choiceIdx == %d) then\n" % (self.maybeElse(childNo), srcQGenAda, childNo))
lines.extend([' ' + x for x in self.Map(
"%s.%s" % (srcQGenAda, self.CleanName(child[0])),
destVar + ".u." + self.CleanName(child[0]),
child[1],
leafTypeDict,
names)])
lines.append(" %s.kind = %s;\n" % (destVar, self.CleanName(child[2])))
lines.append("end if;\n")
return lines
def MapSequenceOf(self, srcQGenAda, destVar, node, leafTypeDict, names):
if node._range == []:
panicWithCallStack("need a SIZE constraint or else we can't generate C code (%s)!\n" % node.Location()) # pragma: no cover
isMappedToPrimitive = IsElementMappedToPrimitive(node, names)
lines = []
for i in xrange(0, node._range[-1]):
lines.extend(self.Map(
isMappedToPrimitive and ("%s.Data (%d)" % (srcQGenAda, i)) or ("%s.element_%02d" % (srcQGenAda, i)),
destVar + ".Data (%d)" % (i+1),
node._containedType,
leafTypeDict,
names))
if isSequenceVariable(node):
lines.append("%s.nCount := %s'Length;\n" % (destVar, srcQGenAda))
# No nCount anymore
#else:
# lines.append("%s.nCount = %s;\n" % (destVar, node._range[-1]))
return lines
def MapSetOf(self, srcQGenAda, destVar, node, leafTypeDict, names):
return self.MapSequenceOf(srcQGenAda, destVar, node, leafTypeDict, names) # pragma: nocover
class FromASN1SCCtoQGenAda(RecursiveMapper):
def MapInteger(self, srcVar, dstQGenAda, _, __, ___):
return ["%s := %s;\n" % (dstQGenAda, srcVar)]
def MapReal(self, srcVar, dstQGenAda, _, __, ___):
return ["%s := %s;\n" % (dstQGenAda, srcVar)]
def MapBoolean(self, srcVar, dstQGenAda, _, __, ___):
return ["%s := %s;\n" % (dstQGenAda, srcVar)]
def MapOctetString(self, srcVar, dstQGenAda, node, _, __):
if node._range == []:
panicWithCallStack("OCTET STRING (in %s) must have a SIZE constraint inside ASN.1,\nor else we can't generate C code!" % node.Location()) # pragma: no cover
lines = []
limit = sourceSequenceLimit(node, srcVar)
for i in xrange(0, node._range[-1]):
lines.append("if (%s>=%d) %s.Data (%d) := %s.Data (%d); else %s.Data (%d) := 0;\n" %
(limit, i, dstQGenAda, i, srcVar, i+1, dstQGenAda, i))
if len(node._range)>1 and node._range[0]!=node._range[1]:
lines.append("%s.length := %s;\n" % (dstQGenAda, limit))
return lines
def MapEnumerated(self, srcVar, dstQGenAda, node, __, ___):
if None in [x[1] for x in node._members]:
panicWithCallStack("an ENUMERATED must have integer values! (%s)" % node.Location()) # pragma: no cover
return ["%s := %s;\n" % (dstQGenAda, srcVar)]
def MapSequence(self, srcVar, dstQGenAda, node, leafTypeDict, names):
lines = []
for child in node._members:
lines.extend(
self.Map(
srcVar + "." + self.CleanName(child[0]),
"%s.%s" % (dstQGenAda, self.CleanName(child[0])),
child[1],
leafTypeDict,
names))
return lines
def MapSet(self, srcVar, dstQGenAda, node, leafTypeDict, names):
return self.MapSequence(srcVar, dstQGenAda, node, leafTypeDict, names) # pragma: nocover
def MapChoice(self, srcVar, dstQGenAda, node, leafTypeDict, names):
lines = []
childNo = 0
for child in node._members:
childNo += 1
lines.append("%sif (%s.kind == %s) then\n" % (self.maybeElse(childNo), srcVar, self.CleanName(child[2])))
lines.extend([' '+x for x in self.Map(
srcVar + ".u." + self.CleanName(child[0]),
"%s.%s" % (dstQGenAda, self.CleanName(child[0])),
child[1],
leafTypeDict,
names)])
lines.append(" %s.choiceIdx := %d;\n" % (dstQGenAda, childNo))
lines.append("end if;\n")
return lines
def MapSequenceOf(self, srcVar, dstQGenAda, node, leafTypeDict, names):
if node._range == []:
panicWithCallStack("need a SIZE constraint or else we can't generate C code (%s)!\n" % node.Location()) # pragma: no cover
isMappedToPrimitive = IsElementMappedToPrimitive(node, names)
lines = []
for i in xrange(0, node._range[-1]):
lines.extend(self.Map(
srcVar + ".Data (%d)" % (i+1),
isMappedToPrimitive and ("%s.Data (%d)" % (dstQGenAda, i)) or ("%s.element_%02d" % (dstQGenAda, i)),
node._containedType,
leafTypeDict,
names))
if isSequenceVariable(node):
lines.append("%s.length := %s.nCount;\n" % (dstQGenAda, srcVar))
return lines
def MapSetOf(self, srcVar, dstQGenAda, node, leafTypeDict, names):
return self.MapSequenceOf(srcVar, dstQGenAda, node, leafTypeDict, names) # pragma: nocover
class FromQGenAdaToOSS(RecursiveMapper):
def MapInteger(self, srcQGenAda, destVar, _, __, ___):
pass # pragma: no cover
def MapReal(self, srcQGenAda, destVar, _, __, ___):
pass # pragma: no cover
print "Code generator: " + "$Id: qgenada_B_mapper.py $" # pragma: no cover
def MapBoolean(self, srcQGenAda, destVar, _, __, ___):
pass # pragma: no cover
# All the ada B mapper is now Obsolete, we are using ASN1SCC for Dumpables
def MapOctetString(self, srcQGenAda, destVar, node, _, __):
pass # pragma: no cover
def MapEnumerated(self, srcQGenAda, destVar, _, __, ___):
pass # pragma: no cover
def MapSequence(self, srcQGenAda, destVar, node, leafTypeDict, names):
pass # pragma: no cover
def MapSet(self, srcQGenAda, destVar, node, leafTypeDict, names):
pass # pragma: no cover
def MapChoice(self, srcQGenAda, destVar, node, leafTypeDict, names):
pass # pragma: no cover
def MapSequenceOf(self, srcQGenAda, destVar, node, leafTypeDict, names):
pass # pragma: no cover
def MapSetOf(self, srcQGenAda, destVar, node, leafTypeDict, names):
pass # pragma: no cover
class FromOSStoQGenAda(RecursiveMapper):
def MapInteger(self, srcVar, dstQGenAda, _, __, ___):
pass # pragma: no cover
def MapReal(self, srcVar, dstQGenAda, _, __, ___):
pass # pragma: no cover
def MapBoolean(self, srcVar, dstQGenAda, _, __, ___):
pass # pragma: no cover
def MapOctetString(self, srcVar, dstQGenAda, node, _, __):
pass # pragma: no cover
def MapEnumerated(self, srcVar, dstQGenAda, node, __, ___):
pass # pragma: no cover
def MapSequence(self, srcVar, dstQGenAda, node, leafTypeDict, names):
pass # pragma: no cover
def MapSet(self, srcVar, dstQGenAda, node, leafTypeDict, names):
pass # pragma: no cover
def MapChoice(self, srcVar, dstQGenAda, node, leafTypeDict, names):
pass # pragma: no cover
def MapSequenceOf(self, srcVar, dstQGenAda, node, leafTypeDict, names):
pass # pragma: no cover
def MapSetOf(self, srcVar, dstQGenAda, node, leafTypeDict, names):
pass # pragma: no cover
class QGenAdaGlueGenerator(SynchronousToolGlueGenerator):
def Version(self):
print "Code generator: " + "$Id: qgenada_B_mapper.py 2390 2012-07-19 12:39:17Z ttsiodras $" # pragma: no cover
def FromToolToASN1SCC(self):
return FromQGenAdaToASN1SCC()
def FromToolToOSS(self):
return FromQGenAdaToOSS() # pragma: no cover
def FromASN1SCCtoTool(self):
return FromASN1SCCtoQGenAda()
def FromOSStoTool(self):
return FromOSStoQGenAda() # pragma: no cover
def HeadersOnStartup(self, unused_modelingLanguage, unused_asnFile, subProgram, unused_subProgramImplementation, unused_outputDir, unused_maybeFVname):
pass # pragma: no cover
def SourceVar(self, unused_nodeTypename, unused_encoding, unused_node, unused_subProgram, unused_subProgramImplementation, param, unused_leafTypeDict, unused_names):
if isinstance(param._sourceElement, AadlPort):
srcQGenAda = "IN_QGen_%s" % (param._id) # pragma: no cover
elif isinstance(param._sourceElement, AadlParameter):
srcQGenAda = "IN_QGen_%s" % (param._id)
else: # pragma: no cover
panicWithCallStack("%s not supported (yet?)\n" % str(param._sourceElement)) # pragma: no cover
return srcQGenAda
def TargetVar(self, unused_nodeTypename, unused_encoding, unused_node, unused_subProgram, unused_subProgramImplementation, param, unused_leafTypeDict, unused_names):
if isinstance(param._sourceElement, AadlPort):
dstQGenAda = "OUT_QGen_%s" % (param._id) # pragma: no cover
elif isinstance(param._sourceElement, AadlParameter):
dstQGenAda = "OUT_QGen_%s" % (param._id)
else: # pragma: no cover
panicWithCallStack("%s not supported (yet?)\n" % str(param._sourceElement)) # pragma: no cover
return dstQGenAda
def InitializeBlock(self, unused_modelingLanguage, unused_asnFile, unused_sp, unused_subProgramImplementation, unused_maybeFVname):
self.C_SourceFile.write(" static int initialized = 0;\n")
self.C_SourceFile.write(" if (!initialized) {\n")
self.C_SourceFile.write(" initialized = 1;\n")
self.C_SourceFile.write(" %s_initialize(1);\n" % self.g_FVname)
self.C_SourceFile.write(" }\n")
def ExecuteBlock(self, unused_modelingLanguage, unused_asnFile, unused_sp, unused_subProgramImplementation, unused_maybeFVname):
pass
def OnStartup(modelingLanguage, asnFile, subProgram, subProgramImplementation, outputDir, maybeFVname, useOSS):
global qgenadaBackend
qgenadaBackend = QGenAdaGlueGenerator()
qgenadaBackend.OnStartup(modelingLanguage, asnFile, subProgram, subProgramImplementation, outputDir, maybeFVname, useOSS)
def OnStartup(unused_modelingLanguage, asnFile, outputDir, maybeFVname, useOSS):
global cBackend
# 2009-02-10: Since we now use ASN1SCC structures as dumpables (even for Ada)
# we no longer need these Ada-specific Dumpable structures.
#global adaBackend
#adaBackend = Ada_GlueGenerator()
cBackend = c_B_mapper.C_GlueGenerator()
#adaBackend.OnStartup(modelingLanguage, asnFile, outputDir, maybeFVname, useOSS)
cBackend.OnStartup("C", asnFile, outputDir, maybeFVname, useOSS)
def OnBasic(nodeTypename, node, subProgram, subProgramImplementation, param, leafTypeDict, names):
qgenadaBackend.OnBasic(nodeTypename, node, subProgram, subProgramImplementation, param, leafTypeDict, names)
def OnBasic(nodeTypename, node, leafTypeDict, names):
cBackend.OnBasic(nodeTypename, node, leafTypeDict, names)
def OnSequence(nodeTypename, node, subProgram, subProgramImplementation, param, leafTypeDict, names):
qgenadaBackend.OnSequence(nodeTypename, node, subProgram, subProgramImplementation, param, leafTypeDict, names)
def OnSequence(nodeTypename, node, leafTypeDict, names):
cBackend.OnSequence(nodeTypename, node, leafTypeDict, names)
def OnSet(nodeTypename, node, subProgram, subProgramImplementation, param, leafTypeDict, names):
qgenadaBackend.OnSet(nodeTypename, node, subProgram, subProgramImplementation, param, leafTypeDict, names) # pragma: nocover
def OnSet(nodeTypename, node, leafTypeDict, names):
cBackend.OnSet(nodeTypename, node, leafTypeDict, names) # pragma: nocover
def OnEnumerated(nodeTypename, node, subProgram, subProgramImplementation, param, leafTypeDict, names):
qgenadaBackend.OnEnumerated(nodeTypename, node, subProgram, subProgramImplementation, param, leafTypeDict, names)
def OnEnumerated(nodeTypename, node, leafTypeDict, names):
cBackend.OnEnumerated(nodeTypename, node, leafTypeDict, names)
def OnSequenceOf(nodeTypename, node, subProgram, subProgramImplementation, param, leafTypeDict, names):
qgenadaBackend.OnSequenceOf(nodeTypename, node, subProgram, subProgramImplementation, param, leafTypeDict, names)
def OnSequenceOf(nodeTypename, node, leafTypeDict, names):
cBackend.OnSequenceOf(nodeTypename, node, leafTypeDict, names)
def OnSetOf(nodeTypename, node, subProgram, subProgramImplementation, param, leafTypeDict, names):
qgenadaBackend.OnSetOf(nodeTypename, node, subProgram, subProgramImplementation, param, leafTypeDict, names) # pragma: nocover
def OnSetOf(nodeTypename, node, leafTypeDict, names):
cBackend.OnSetOf(nodeTypename, node, leafTypeDict, names) # pragma: nocover
def OnChoice(nodeTypename, node, subProgram, subProgramImplementation, param, leafTypeDict, names):
qgenadaBackend.OnChoice(nodeTypename, node, subProgram, subProgramImplementation, param, leafTypeDict, names)
def OnChoice(nodeTypename, node, leafTypeDict, names):
cBackend.OnChoice(nodeTypename, node, leafTypeDict, names)
def OnShutdown(modelingLanguage, asnFile, sp, subProgramImplementation, maybeFVname):
qgenadaBackend.OnShutdown(modelingLanguage, asnFile, sp, subProgramImplementation, maybeFVname)
def OnShutdown(unused_modelingLanguage, asnFile, maybeFVname):
cBackend.OnShutdown("C", asnFile, maybeFVname)
This diff is collapsed.
......@@ -418,15 +418,6 @@ def DumpTypeDumper(codeIndent, outputIndent, lines, variableName, node, names):
variableName+'[i]', containedNode, names)
lines.append(codeIndent + "map(emitElem, xrange(%s.GetLength()))" % variableName)
lines.append(codeIndent + 'lines.append("}")')
#for i in xrange(0, node._range[-1]):
# lines.append(codeIndent + 'if %s.GetLength()>%d:' % (variableName, i))
# if i > 0:
# # Separate fields with comas
# lines.append(codeIndent + " lines.append(', ')")
# #lines.append(codeIndent + ' print "%s[%d]:"' % (outputIndent, i))
# DumpTypeDumper(codeIndent+" ", outputIndent+" ", lines,
# variableName+'['+str(i)+']', containedNode, names)
#lines.append(codeIndent + 'lines.append("}")')
def CreateDeclarationForType(nodeTypename, names, leafTypeDict):
......
......@@ -136,9 +136,9 @@ def MapInteger(node):
def CreateAlias(nodeTypename, mappedType, description):
# Requirements have changed: Simulink has an issue with AliasType...
name = CleanNameAsSimulinkWants(nodeTypename)
g_outputFile.write("%s = Simulink.AliasType;\n" % name)
g_outputFile.write("%s.BaseType = '%s';\n" % (name, mappedType))
g_outputFile.write("%s = Simulink.AliasType;\n" % CleanNameAsSimulinkWants(nodeTypename))
g_outputFile.write("%s.BaseType = '%s';\n" % (CleanNameAsSimulinkWants(nodeTypename), mappedType))
g_outputFile.write("%s.Description = '%s';\n\n" % (CleanNameAsSimulinkWants(nodeTypename), description))
return
......@@ -165,7 +165,7 @@ def DeclareCollection(node, name, internal):
def DeclareSimpleCollection(node, name, internal):
g_outputFile.write('%s_member_data=Simulink.BusElement;\n' % name)
g_outputFile.write("%s_member_data.name='Data';\n" % name)
g_outputFile.write("%s_member_data.name='element_data';\n" % name)
g_outputFile.write("%s_member_data.DataType='%s';\n" % (name, internal))
g_outputFile.write("%s_member_data.dimensions=%d;\n\n" % (name, node._range[-1]))
......
......@@ -21,9 +21,6 @@
# Note that in both cases, there are no charges (royalties) for the
# generated code.
#
import os
import sys
import re
import commonPy
from commonPy.utility import panic, inform
......@@ -49,21 +46,7 @@ def CleanNameAsSimulinkWants(name):
return re.sub(r'[^a-zA-Z0-9_]', '_', name)
def OnStartup(unused_modelingLanguage, asnFiles, outputDir):
if None == os.getenv("ASN1SCC"):
if None == os.getenv("DMT"): # pragma: no cover
panic("DMT environment variable is not set, you must set it.") # pragma: no cover
os.putenv("ASN1SCC", os.getenv("DMT") + os.sep + "asn1scc/asn1.exe") # pragma: no cover
os.system(
("mono " if sys.argv[0].endswith('.py') and sys.platform.startswith('linux') else "") +
"\"$ASN1SCC\" -wordSize 8 -typePrefix asn1Scc -c -uPER -o \"" + outputDir + "\" \"" + "\" \"".join(asnFiles) + "\"")
cmd = 'rm -f '
for i in ['real.c', 'asn1crt.c', 'acn.c', 'ber.c', 'xer.c']:
cmd += ' "' + outputDir + '"/' + i
os.system(cmd)
for tmp in asnFiles:
os.system("rm -f \"" + outputDir + os.sep + os.path.basename(os.path.splitext(tmp)[0]) + ".c\"")
def OnStartup(unused_modelingLanguage, unused_asnFile, outputDir):
global g_bHasStartupRunOnce
if g_bHasStartupRunOnce:
# Don't rerun, it has already done all the work
......@@ -76,7 +59,6 @@ def OnStartup(unused_modelingLanguage, asnFiles, outputDir):
outputFilename = "Simulink_DataView_asn.m"
inform("QGenC_A_mapper: Creating file '%s'...", outputFilename)
global g_outputFile
outputDir = outputDir + "../"
g_outputFile = open(outputDir + outputFilename, 'w')
global g_definedTypes
g_definedTypes = {}
......@@ -134,11 +116,9 @@ def MapInteger(node):
def CreateAlias(nodeTypename, mappedType, description):
# Requirements have changed: Simulink has an issue with AliasType...
name = CleanNameAsSimulinkWants(nodeTypename)
g_outputFile.write("%s = Simulink.AliasType;\n" % name)
g_outputFile.write("%s.BaseType = '%s';\n" % (name, mappedType))
g_outputFile.write("%s.Description = 'TypeName: asn1Scc%s %s';\n" % (name, name, description))
g_outputFile.write("%s.HeaderFile='C_ASN1_Types.h';\n\n" % name)
g_outputFile.write("%s = Simulink.AliasType;\n" % CleanNameAsSimulinkWants(nodeTypename))
g_outputFile.write("%s.BaseType = '%s';\n" % (CleanNameAsSimulinkWants(nodeTypename), mappedType))
g_outputFile.write("%s.Description = '%s';\n\n" % (CleanNameAsSimulinkWants(nodeTypename), description))
return
......@@ -154,8 +134,6 @@ def DeclareCollection(node, name, internal):
g_outputFile.write("%s_member_length.DataType='int32';\n" % name)
g_outputFile.write("%s_member_length.dimensions=1;\n\n" % name)
g_outputFile.write('%s=Simulink.Bus;\n' % name)
g_outputFile.write("%s.Description='TypeName: asn1Scc%s';\n" % (name, name))
g_outputFile.write("%s.HeaderFile='C_ASN1_Types.h';\n" % name)
g_outputFile.write("%s.Elements = " % name)
g_outputFile.write('[')
for i in xrange(0, node._range[-1]):
......@@ -167,7 +145,7 @@ def DeclareCollection(node, name, internal):
def DeclareSimpleCollection(node, name, internal):
g_outputFile.write('%s_member_data=Simulink.BusElement;\n' % name)
g_outputFile.write("%s_member_data.name='arr';\n" % name)
g_outputFile.write("%s_member_data.name='element_data';\n" % name)
g_outputFile.write("%s_member_data.DataType='%s';\n" % (name, internal))
g_outputFile.write("%s_member_data.dimensions=%d;\n\n" % (name, node._range[-1]))
......@@ -182,8 +160,6 @@ def DeclareSimpleCollection(node, name, internal):
g_outputFile.write("%s_member_length.dimensions=1;\n\n" % name)
g_outputFile.write('%s=Simulink.Bus;\n' % name)
g_outputFile.write("%s.Description='TypeName: asn1Scc%s';\n" % (name, name))
g_outputFile.write("%s.HeaderFile='C_ASN1_Types.h';\n" % name)
g_outputFile.write("%s.Elements = " % name)
g_outputFile.write('[')
g_outputFile.write("%s_member_data " % name)
......@@ -282,8 +258,6 @@ def CreateDeclarationForType(nodeTypename, names, leafTypeDict):
g_outputFile.write(name + ".dimensions=1;\n\n")
g_outputFile.write("%s = Simulink.Bus;\n" % CleanNameAsSimulinkWants(nodeTypename))
g_outputFile.write("%s.Description='TypeName: asn1Scc%s';\n" % (CleanNameAsSimulinkWants(nodeTypename), CleanNameAsSimulinkWants(nodeTypename)))
g_outputFile.write("%s.HeaderFile='C_ASN1_Types.h';\n" % CleanNameAsSimulinkWants(nodeTypename))
g_outputFile.write("%s.Elements = " % CleanNameAsSimulinkWants(nodeTypename))
if elemNo>1:
g_outputFile.write('[')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment