Commit 8459f676 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Coverage checking ported from SVN. Still missing QGen, though

parent b5c2ded2
......@@ -214,7 +214,7 @@ types). This used to cover Dumpable C/Ada Types and OG headers.'''
asn1SccPath = spawn.find_executable('asn1.exe')
if len(asnFiles) != 0:
if not asn1SccPath:
panic("ASN1SCC seems not installed on your system (asn1.exe not found in PATH).\n")
panic("ASN1SCC seems not installed on your system (asn1.exe not found in PATH).\n") # pragma: no cover
#os.system("mono \"{asn$ASN1SCC\" -wordSize 8 -typePrefix asn1Scc -Ada -equal -uPER -o \"" + outputDir + "\" \"" + "\" \"".join(asnFiles) + "\"")
os.system('mono "{}" -wordSize 8 -typePrefix asn1Scc -Ada -equal -uPER -o "{}" "{}"'
.format(asn1SccPath,
......@@ -224,6 +224,7 @@ types). This used to cover Dumpable C/Ada Types and OG headers.'''
def main():
sys.path.append(os.path.abspath(os.path.dirname(sys.argv[0])))
sys.path.append(os.path.abspath(os.path.dirname(sys.argv[0]) + os.sep + '..'))
if sys.argv.count("-o") != 0:
idx = sys.argv.index("-o")
try:
......@@ -361,10 +362,10 @@ def main():
if modelingLanguage.lower() in ["gui_ri", "gui_pi", "vhdl", "rhapsody"]:
modelingLanguage = "C"
backendFilename = "." + modelingLanguage.lower() + "_B_mapper.py"
backendFilename = modelingLanguage.lower() + "_B_mapper.py"
inform("Parsing %s...", backendFilename)
try:
backend = import_module(backendFilename[:-3], 'aadl2glueC')
backend = import_module(backendFilename[:-3])
if backendFilename[:-3] not in loadedBackends:
loadedBackends[backendFilename[:-3]] = 1
if commonPy.configMT.verbose:
......@@ -466,10 +467,10 @@ def main():
def mappers(lang):
if lang.lower() in ["gui_pi", "gui_ri"]:
return [import_module(".python_B_mapper", "aadl2glueC"),
import_module(".pyside_B_mapper", "aadl2glueC")]
return [import_module("python_B_mapper", "aadl2glueC"),
import_module("pyside_B_mapper", "aadl2glueC")]
elif lang.lower() == "vhdl": # pragma: no cover
return [import_module(".vhdl_B_mapper", "aadl2glueC")] # pragma: no cover
return [import_module("vhdl_B_mapper", "aadl2glueC")] # pragma: no cover
for si in [x for x in SystemsAndImplementations if x[2] is not None and x[2].lower() in ["gui_ri", "gui_pi", "vhdl"]]:
# We do, start the work
......
../commonPy/recursiveMapper.py
\ No newline at end of file
......@@ -41,7 +41,7 @@ def OnStartup(unused_modelingLanguage, asnFiles, outputDir):
#print "Use ASN1SCC to generate the structures for '%s'" % asnFile
asn1SccPath = spawn.find_executable('asn1.exe')
if not asn1SccPath:
panic("ASN1SCC seems not installed on your system (asn1.exe not found in PATH).\n")
panic("ASN1SCC seems not installed on your system (asn1.exe not found in PATH).\n") # pragma: no cover
os.system(
("mono " if sys.argv[0].endswith('.py') and sys.platform.startswith('linux') else "") +
"\"{}\" -wordSize 8 -typePrefix asn1Scc -Ada -uPER -o \"".format(asn1SccPath) +
......
......@@ -64,6 +64,7 @@ def usage(argsToTools):
def main():
sys.path.append(os.path.abspath(os.path.dirname(sys.argv[0])))
sys.path.append(os.path.abspath(os.path.dirname(sys.argv[0]) + os.sep + '..'))
sys.path.append('commonPy')
argsToTools = {
......@@ -86,7 +87,7 @@ def main():
if '_A_mapper' in i and i.endswith('.py'):
target = i.split('_')[0]
if target.lower() not in [x.lower() for x in argsToTools.itervalues()]:
argsToTools['to' + target.capitalize()] = target
argsToTools['to' + target.capitalize()] = target # pragma: no cover
for i in argsToTools:
locals()[i] = False
......@@ -159,10 +160,10 @@ def main():
# For each ASN.1 grammar file referenced in the system level description
for arg, modelingLanguage in argsToTools.iteritems():
if locals()[arg]:
backendFilename = "." + modelingLanguage.lower() + "_A_mapper.py"
backendFilename = modelingLanguage.lower() + "_A_mapper.py"
inform("Parsing %s...", backendFilename)
try:
backend = import_module(backendFilename[:-3], 'asn2dataModel')
backend = import_module(backendFilename[:-3])
if backendFilename[:-3] not in loadedBackends:
loadedBackends[backendFilename[:-3]] = 1
if commonPy.configMT.verbose:
......
......@@ -40,7 +40,7 @@ def OnStartup(unused_modelingLanguage, asnFiles, outputDir):
#print "Use ASN1SCC to generate the structures for '%s'" % asnFile
asn1SccPath = spawn.find_executable('asn1.exe')
if not asn1SccPath:
panic("ASN1SCC seems not installed on your system (asn1.exe not found in PATH).\n")
panic("ASN1SCC seems not installed on your system (asn1.exe not found in PATH).\n") # pragma: no cover
os.system(
("mono " if sys.argv[0].endswith('.py') and sys.platform.startswith('linux') else "") +
"\"{}\" -wordSize 8 -typePrefix asn1Scc -c -uPER -o \"".format(asn1SccPath) +
......
../commonPy/createInternalTypes.py
\ No newline at end of file
......@@ -411,15 +411,22 @@ def DumpTypeDumper(codeIndent, outputIndent, lines, variableName, node, names):
containedNode = node._containedType
if isinstance(containedNode, str):
containedNode = names[containedNode]
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 + 'def emitElem(i):')
lines.append(codeIndent + ' if i>0:')
lines.append(codeIndent + ' lines.append(",")')
DumpTypeDumper(codeIndent+" ", outputIndent+" ", lines,
variableName+'[i]', containedNode, names)
lines.append(codeIndent + "map(emitElem, xrange(self.GetLength()))")
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):
......
......@@ -202,7 +202,7 @@ def CreateDeclarationForType(nodeTypename, names, leafTypeDict):
g_outputFile.write("\n")
elif isinstance(node, AsnSequence) or isinstance(node, AsnSet) or isinstance(node, AsnChoice):
if len(node._members) == 0:
panic("Simulink_A_mapper: Simulink can't support empty Seq/Set/Choice! (%s)" % node.Location())
panic("Simulink_A_mapper: Simulink can't support empty Seq/Set/Choice! (%s)" % node.Location()) # pragma: no cover
elemNo = 0
if isinstance(node, AsnChoice):
elemNo += 1
......
SYSTEM ConcurrencyView
END ConcurrencyView;
SYSTEM IMPLEMENTATION ConcurrencyView.others
SUBCOMPONENTS
The_Processor : PROCESSOR The_Processor;
ConcurrencyView_Async : PROCESS ConcurrencyView_Async.others;
PROPERTIES
Actual_Processor_Binding => REFERENCE The_Processor APPLIES TO ConcurrencyView_Async;
END ConcurrencyView.others;
PROCESSOR The_Processor
PROPERTIES
ARAO::Execution_Platform => Native;
END The_Processor;
PROCESS ConcurrencyView_Async
END ConcurrencyView_Async;
PROCESS IMPLEMENTATION ConcurrencyView_Async.others
SUBCOMPONENTS
BASIC_APLC_Cyclic_FV : THREAD BASIC_APLC_Cyclic_FV.others;
BASIC_APLC_Basic_FV : THREAD BASIC_APLC_Basic_FV.others;
CONTROL_APLC_Control_FV : THREAD CONTROL_APLC_Control_FV.others;
CONNECTIONS
EVENT PORT BASIC_APLC_Cyclic_FV.CyclicActivationImplementation -> BASIC_APLC_Basic_FV.CyclicActivationImplementation;
EVENT DATA PORT BASIC_APLC_Basic_FV.BasicTOControl -> CONTROL_APLC_Control_FV.BasicTOControl;
EVENT DATA PORT CONTROL_APLC_Control_FV.ControlUPTOBasic -> BASIC_APLC_Basic_FV.ControlUPTOBasic;
EVENT DATA PORT CONTROL_APLC_Control_FV.ControlDOWNTOBasic -> BASIC_APLC_Basic_FV.ControlDOWNTOBasic;
END ConcurrencyView_Async.others;
---------------------------------------------------
-- VM-Level Container: BASIC_APLC_Cyclic_FV
---------------------------------------------------
THREAD BASIC_APLC_Cyclic_FV
features
CyclicActivationImplementation : OUT EVENT PORT;
END BASIC_APLC_Cyclic_FV;
THREAD IMPLEMENTATION BASIC_APLC_Cyclic_FV.others
CALLS {
wrapper : SUBPROGRAM BASIC_APLC_Cyclic_FV_SDL_Ada;
};
PROPERTIES
Initialize_Entrypoint => "SDL_Wrappers.SDL_Init_Cyclic_FV";
Dispatch_Protocol => Periodic;
Period => 1000 ms;
ARAO::Priority => 2;
END BASIC_APLC_Cyclic_FV.others;
SUBPROGRAM BASIC_APLC_Cyclic_FV_SDL_Ada
PROPERTIES
Source_Language => Ada;
Source_Name => "SDL_Wrappers.CyclicActivation";
Source_Stack_Size => 100 KB;
END BASIC_APLC_Cyclic_FV_SDL_Ada;
---------------------------------------------------
-- VM-Level Container: BASIC_APLC_Basic_FV
---------------------------------------------------
THREAD BASIC_APLC_Basic_FV
FEATURES
CyclicActivationImplementation : IN EVENT PORT
{ Compute_Entrypoint => "SDL_Wrappers.CyclicActivationImplementation"; };
ControlUPTOBasic : IN EVENT DATA PORT DataView::T_CONTROL_UP_OUT_Buffer.impl
{ Compute_Entrypoint => "SDL_Wrappers.ControlUPTOBasic"; };
ControlDOWNTOBasic : IN EVENT DATA PORT DataView::T_CONTROL_DOWN_OUT_Buffer.impl
{ Compute_Entrypoint => "SDL_Wrappers.ControlDOWNTOBasic"; };
BasicTOControl : OUT EVENT DATA PORT DataView::T_CONTROL_IN_Buffer.impl;
END BASIC_APLC_Basic_FV;
THREAD IMPLEMENTATION BASIC_APLC_Basic_FV.others
PROPERTIES
Initialize_Entrypoint => "SDL_Wrappers.SDL_Init_Basic_FV";
Dispatch_Protocol => Sporadic;
Period => 1 ms;
ARAO::Priority => 2;
Source_Stack_Size => 100 KB;
END BASIC_APLC_Basic_FV.others;
---------------------------------------------------
-- VM-Level Container: CONTROL_APLC_Control_FV
---------------------------------------------------
THREAD CONTROL_APLC_Control_FV
FEATURES
BasicTOControl : IN EVENT DATA PORT DataView::T_CONTROL_IN_Buffer.impl
{ Compute_Entrypoint => "SDL_Wrappers.BasicTOControl"; };
ControlUPTOBasic : OUT EVENT DATA PORT DataView::T_CONTROL_UP_OUT_Buffer.impl;
ControlDOWNTOBasic : OUT EVENT DATA PORT DataView::T_CONTROL_DOWN_OUT_Buffer.impl;
END CONTROL_APLC_Control_FV;
THREAD IMPLEMENTATION CONTROL_APLC_Control_FV.others
PROPERTIES
Initialize_Entrypoint => "SDL_Wrappers.SDL_Init_Control_FV";
Dispatch_Protocol => Sporadic;
Period => 1 ms;
ARAO::Priority => 3;
Source_Stack_Size => 100 KB;
END CONTROL_APLC_Control_FV.others;
---------------------------------------------------
---------------------------------------------------
SUBPROGRAM CyclicActivationImplementation
END CyclicActivationImplementation;
SUBPROGRAM IMPLEMENTATION CyclicActivationImplementation.SDL
PROPERTIES
Source_Language => SDL;
assert_properties_extended::FV_Name => "Basic_FV";
END CyclicActivationImplementation.SDL;
SUBPROGRAM ControlUPTOBasic
FEATURES
ControlUPTOBasic : IN PARAMETER DataView::T_CONTROL_UP_OUT;
END ControlUPTOBasic;
SUBPROGRAM IMPLEMENTATION ControlUPTOBasic.SDL
PROPERTIES
Source_Language => SDL;
assert_properties_extended::FV_Name => "Basic_FV";
END ControlUPTOBasic.SDL;
SUBPROGRAM ControlDOWNTOBasic
FEATURES
ControlDOWNTOBasic : IN PARAMETER DataView::T_CONTROL_DOWN_OUT;
END ControlDOWNTOBasic;
SUBPROGRAM IMPLEMENTATION ControlDOWNTOBasic.SDL
PROPERTIES
Source_Language => SDL;
assert_properties_extended::FV_Name => "Basic_FV";
END ControlDOWNTOBasic.SDL;
SUBPROGRAM BasicTOControl
FEATURES
BASICTOCONTROL : IN PARAMETER DataView::T_CONTROL_IN;
END BasicTOControl;
SUBPROGRAM IMPLEMENTATION BasicTOControl.SDL
PROPERTIES
Source_Language => SDL;
assert_properties_extended::FV_Name => "Control_FV";
END BasicTOControl.SDL;
SUBPROGRAM APLC_Basic_OP
FEATURES
THRUSTERS_OPENING : IN PARAMETER DataView::T_THRUSTERS_OPENING;
PFS_IWM_ARMING_RELAY_STATUS_ON : IN PARAMETER DataView::T_PFS_IWM_ARMING_RELAY_STATUS_ON;
PFS_HLTC_RED_BUTTON_IS_ON : IN PARAMETER DataView::T_PFS_HLTC_RED_BUTTON_IS_ON;
MSU_ID : IN PARAMETER DataView::T_MSU_ID;
PFS_EWM_MSUY_MSUX_HS : IN PARAMETER DataView::T_PFS_EWM_MSU_MSU_HS;
FTCP_HEALTH_STATUS : IN PARAMETER DataView::T_FTCP_HEALTH_STATUS;
PFS_EWM_DTG12_MSU : IN PARAMETER DataView::T_PFS_EWM_DTG12_MSU;
HLTC : IN PARAMETER DataView::T_HLTC;
END_BOOST_IS_REACHED : IN PARAMETER DataView::T_END_BOOST_IS_REACHED;
SUN_IS_AIMED : IN PARAMETER DataView::T_SUN_IS_AIMED;
PFS_EWC_MSU_PDE_T : OUT PARAMETER DataView::T_PFS_EWC_MSU_PDE_T;
PDE_CMD_A : OUT PARAMETER DataView::T_PDE_CMD_A;
DPU_CMD : OUT PARAMETER DataView::T_DPU_CMD;
SET_PFS_EWC_MSU_DTG_MODE_COARSE : OUT PARAMETER DataView::T_ON_OFF_CMD;
HLTM : OUT PARAMETER DataView::T_HLTM;
PFS_EWM_MSUX_MSUY_HS : OUT PARAMETER DataView::T_PFS_EWM_MSU_MSU_HS;
CAM_MODE : OUT PARAMETER DataView::T_CAM_MODE;
CONTROLLER_TO_BE_ACTIVATED : OUT PARAMETER DataView::T_CONTROLLER_TO_BE_ACTIVATED;
NAVIGATION_OUTPUT : OUT PARAMETER DataView::T_NAVIGATION_OUTPUT;
END APLC_Basic_OP;
SUBPROGRAM IMPLEMENTATION APLC_Basic_OP.SCADE6
PROPERTIES
Source_Language => SCADE6;
assert_properties_extended::FV_Name => "Basic_op_FV";
END APLC_Basic_OP.SCADE6;
SUBPROGRAM IF_Upstream
FEATURES
CAM_MODE : IN PARAMETER DataView::T_CAM_MODE;
CONTROLLER_TO_BE_ACTIVATED : IN PARAMETER DataView::T_CONTROLLER_TO_BE_ACTIVATED;
NAVIGATION_OUTPUT : IN PARAMETER DataView::T_NAVIGATION_OUTPUT;
ESTIMATED_STATE : IN PARAMETER DataView::T_CONTROLLER_STATE;
THRUSTERS_OPENING : OUT PARAMETER DataView::T_THRUSTERS_OPENING;
END IF_Upstream;
SUBPROGRAM IMPLEMENTATION IF_Upstream.SCADE6
PROPERTIES
Source_Language => SCADE6;
assert_properties_extended::FV_Name => "IF_Upstream_FV";
END IF_Upstream.SCADE6;
SUBPROGRAM IF_Downstream
FEATURES
THRUSTERS_OPENING : IN PARAMETER DataView::T_THRUSTERS_OPENING;
CAM_MODE : IN PARAMETER DataView::T_CAM_MODE;
CONTROLLER_TO_BE_ACTIVATED : IN PARAMETER DataView::T_CONTROLLER_TO_BE_ACTIVATED;
NAVIGATION_OUTPUT : IN PARAMETER DataView::T_NAVIGATION_OUTPUT;
END_BOOST_IS_REACHED : OUT PARAMETER DataView::T_END_BOOST_IS_REACHED;
SUN_IS_AIMED : OUT PARAMETER DataView::T_SUN_IS_AIMED;
ESTIMATED_STATE : OUT PARAMETER DataView::T_CONTROLLER_STATE;
END IF_Downstream;
SUBPROGRAM IMPLEMENTATION IF_Downstream.SCADE6
PROPERTIES
Source_Language => SCADE6;
assert_properties_extended::FV_Name => "IF_Downstream_FV";
END IF_Downstream.SCADE6;
SUBPROGRAM CyclicActivation
END CyclicActivation;
SUBPROGRAM IMPLEMENTATION CyclicActivation.SDL
PROPERTIES
Source_Language => SDL;
assert_properties_extended::FV_Name => "Cyclic_FV";
END CyclicActivation.SDL;
---------------------------------------------------
--! File generated by asn2aadlPlus: DO NOT EDIT !--
---------------------------------------------------
package D_view
public
-- No more private heap required (we use the space certified compiler)
-- Memory_Required: 0
DATA TypeNested
PROPERTIES
-- name of the ASN.1 source file:
Source_Text => ("Data_types_choice.asn");
Source_Language => ASN1;
-- Size of a buffer to cover DER representation:
-- Real message size is 196; suggested aligned message buffer is...
Source_Data_Size => 200 B;
-- name of the corresponding data type in the source file:
Type_Source_Name => "TypeNested";
END TypeNested;
-- ENST (Jerome) specific requests
DATA TypeNested_Buffer
END TypeNested_Buffer;
DATA IMPLEMENTATION TypeNested_Buffer.impl
-- Buffer to hold a marshalled data of type TypeNested
SUBCOMPONENTS
values : data ASSERT_Types::Stream_Element;
PROPERTIES
ARAO::Length => 200; -- Size of the buffer
END TypeNested_Buffer.impl;
DATA T_POS
PROPERTIES
-- name of the ASN.1 source file:
Source_Text => ("Data_types_choice.asn");
Source_Language => ASN1;
-- Size of a buffer to cover DER representation:
-- Real message size is 3096; suggested aligned message buffer is...
Source_Data_Size => 3096 B;
-- name of the corresponding data type in the source file:
Type_Source_Name => "T-POS";
END T_POS;
-- ENST (Jerome) specific requests
DATA T_POS_Buffer
END T_POS_Buffer;
DATA IMPLEMENTATION T_POS_Buffer.impl
-- Buffer to hold a marshalled data of type T_POS
SUBCOMPONENTS
values : data ASSERT_Types::Stream_Element;
PROPERTIES
ARAO::Length => 3096; -- Size of the buffer
END T_POS_Buffer.impl;
DATA T_SETOF
PROPERTIES
-- name of the ASN.1 source file:
Source_Text => ("Data_types_choice.asn");
Source_Language => ASN1;
-- Size of a buffer to cover DER representation:
-- Real message size is 28; suggested aligned message buffer is...
Source_Data_Size => 32 B;
-- name of the corresponding data type in the source file:
Type_Source_Name => "T-SETOF";
END T_SETOF;
-- ENST (Jerome) specific requests
DATA T_SETOF_Buffer
END T_SETOF_Buffer;
DATA IMPLEMENTATION T_SETOF_Buffer.impl
-- Buffer to hold a marshalled data of type T_SETOF
SUBCOMPONENTS
values : data ASSERT_Types::Stream_Element;
PROPERTIES
ARAO::Length => 32; -- Size of the buffer
END T_SETOF_Buffer.impl;
DATA T_INT
PROPERTIES
-- name of the ASN.1 source file:
Source_Text => ("Data_types_choice.asn");
Source_Language => ASN1;
-- Size of a buffer to cover DER representation:
-- Real message size is 4; suggested aligned message buffer is...
Source_Data_Size => 8 B;
-- name of the corresponding data type in the source file:
Type_Source_Name => "T-INT";
END T_INT;
-- ENST (Jerome) specific requests
DATA T_INT_Buffer
END T_INT_Buffer;
DATA IMPLEMENTATION T_INT_Buffer.impl
-- Buffer to hold a marshalled data of type T_INT
SUBCOMPONENTS
values : data ASSERT_Types::Stream_Element;
PROPERTIES
ARAO::Length => 8; -- Size of the buffer
END T_INT_Buffer.impl;
DATA T_REAL
PROPERTIES
-- name of the ASN.1 source file:
Source_Text => ("Data_types_choice.asn");
Source_Language => ASN1;
-- Size of a buffer to cover DER representation:
-- Real message size is 13; suggested aligned message buffer is...
Source_Data_Size => 16 B;
-- name of the corresponding data type in the source file:
Type_Source_Name => "T-REAL";
END T_REAL;
-- ENST (Jerome) specific requests
DATA T_REAL_Buffer
END T_REAL_Buffer;
DATA IMPLEMENTATION T_REAL_Buffer.impl
-- Buffer to hold a marshalled data of type T_REAL
SUBCOMPONENTS
values : data ASSERT_Types::Stream_Element;
PROPERTIES
ARAO::Length => 16; -- Size of the buffer
END T_REAL_Buffer.impl;
DATA TypeEnumerated
PROPERTIES
-- name of the ASN.1 source file:
Source_Text => ("Data_types_choice.asn");
Source_Language => ASN1;
-- Size of a buffer to cover DER representation:
-- Real message size is 4; suggested aligned message buffer is...
Source_Data_Size => 8 B;
-- name of the corresponding data type in the source file:
Type_Source_Name => "TypeEnumerated";
END TypeEnumerated;
-- ENST (Jerome) specific requests
DATA TypeEnumerated_Buffer
END TypeEnumerated_Buffer;
DATA IMPLEMENTATION TypeEnumerated_Buffer.impl
-- Buffer to hold a marshalled data of type TypeEnumerated
SUBCOMPONENTS
values : data ASSERT_Types::Stream_Element;
PROPERTIES
ARAO::Length => 8; -- Size of the buffer
END TypeEnumerated_Buffer.impl;
DATA T_STRING
PROPERTIES
-- name of the ASN.1 source file:
Source_Text => ("Data_types_choice.asn");
Source_Language => ASN1;
-- Size of a buffer to cover DER representation:
-- Real message size is 20; suggested aligned message buffer is...
Source_Data_Size => 24 B;
-- name of the corresponding data type in the source file:
Type_Source_Name => "T-STRING";
END T_STRING;
-- ENST (Jerome) specific requests
DATA T_STRING_Buffer
END T_STRING_Buffer;
DATA IMPLEMENTATION T_STRING_Buffer.impl
-- Buffer to hold a marshalled data of type T_STRING
SUBCOMPONENTS
values : data ASSERT_Types::Stream_Element;
PROPERTIES
ARAO::Length => 24; -- Size of the buffer
END T_STRING_Buffer.impl;
DATA T_ARR
PROPERTIES
-- name of the ASN.1 source file:
Source_Text => ("Data_types_choice.asn");
Source_Language => ASN1;
-- Size of a buffer to cover DER representation:
-- Real message size is 28; suggested aligned message buffer is...
Source_Data_Size => 32 B;
-- name of the corresponding data type in the source file:
Type_Source_Name => "T-ARR";
END T_ARR;
-- ENST (Jerome) specific requests
DATA T_ARR_Buffer
END T_ARR_Buffer;
DATA IMPLEMENTATION T_ARR_Buffer.impl
-- Buffer to hold a marshalled data of type T_ARR
SUBCOMPONENTS
values : data ASSERT_Types::Stream_Element;
PROPERTIES
ARAO::Length => 32; -- Size of the buffer
END T_ARR_Buffer.impl;
DATA T_BOOL
PROPERTIES
-- name of the ASN.1 source file:
Source_Text => ("Data_types_choice.asn");
Source_Language => ASN1;
-- Size of a buffer to cover DER representation:
-- Real message size is 4; suggested aligned message buffer is...
Source_Data_Size => 8 B;
-- name of the corresponding data type in the source file:
Type_Source_Name => "T-BOOL";
END T_BOOL;
-- ENST (Jerome) specific requests
DATA T_BOOL_Buffer
END T_BOOL_Buffer;
DATA IMPLEMENTATION T_BOOL_Buffer.impl
-- Buffer to hold a marshalled data of type T_BOOL
SUBCOMPONENTS
values : data ASSERT_Types::Stream_Element;
PROPERTIES
ARAO::Length => 8; -- Size of the buffer
END T_BOOL_Buffer.impl;
DATA T_SET
PROPERTIES
-- name of the ASN.1 source file:
Source_Text => ("Data_types_choice.asn");
Source_Language => ASN1;
-- Size of a buffer to cover DER representation:
-- Real message size is 14; suggested aligned message buffer is...
Source_Data_Size => 16 B;
-- name of the corresponding data type in the source file:
Type_Source_Name => "T-SET";
END T_SET;
-- ENST (Jerome) specific requests
DATA T_SET_Buffer
END T_SET_Buffer;
DATA IMPLEMENTATION T_SET_Buffer.impl
-- Buffer to hold a marshalled data of type T_SET
SUBCOMPONENTS
values : data ASSERT_Types::Stream_Element;
PROPERTIES
ARAO::Length => 16; -- Size of the buffer
END T_SET_Buffer.impl;
end D_view;
This diff is collapsed.
MY-MODULE DEFINITIONS ::= BEGIN
-- Original definition by Alain
--T-POS ::= BOOLEAN
TypeEnumerated ::= ENUMERATED {
red(0),
green(1),
blue(2)
}
TypeNested ::= SEQUENCE {
intVal INTEGER(0..10),
intArray SEQUENCE (SIZE (10)) OF INTEGER (0..3),
boolArray SEQUENCE (SIZE (10)) OF T-BOOL,
enumValue TypeEnumerated,
label OCTET STRING (SIZE(10..40)),
bAlpha T-BOOL,
bBeta BOOLEAN,
sString T-STRING,
arr T-ARR
}
-- A more realistic definition
T-POS2 ::= BOOLEAN
T-POS ::= SEQUENCE {
longitude REAL(-180.0..180.0),
latitude REAL(-90.0..90.0),
height REAL(30000.0..45000.0),
subTypeArray SEQUENCE (SIZE(10..15)) OF TypeNested
}
T-ARR ::= SEQUENCE (SIZE (5..6)) OF INTEGER (0..4)
T-BOOL ::= BOOLEAN
T-INT ::= INTEGER (0..50)
T-REAL ::= REAL (-3.14..3.14)
T-STRING ::= OCTET STRING (SIZE(10..15))
END
MY-MODULE DEFINITIONS AUTOMATIC TAGS ::= BEGIN
-- Original definition by Alain
--T-POS ::= BOOLEAN
MyInt ::= INTEGER (0 .. 20)
My2ndInt ::= MyInt ( 1 .. 18)
AType ::= SEQUENCE {
blArray SEQUENCE (SIZE(10)) OF BOOLEAN
}
My2ndAType ::= AType
TypeEnumerated ::= ENUMERATED {
red(0),
green(1),
blue(2)
}
My2ndEnumerated ::= TypeEnumerated
TypeNested ::= SEQUENCE {
intVal INTEGER(0..10),
int2Val INTEGER(-10..10),
int3Val MyInt (10..12),
intArray SEQUENCE (SIZE (10)) OF INTEGER (0..3),
realArray SEQUENCE (SIZE (10)) OF REAL (0.1 .. 3.14),
octStrArray SEQUENCE (SIZE (10)) OF OCTET STRING (SIZE(1..10)),
boolArray SEQUENCE (SIZE (10)) OF T-BOOL,
enumArray SEQUENCE (SIZE (10)) OF TypeEnumerated,
enumValue TypeEnumerated,
enumValue2 ENUMERATED {
truism(0),
falsism(1)
},
label OCTET STRING (SIZE(10..40)),
bAlpha T-BOOL,
bBeta BOOLEAN,
sString T-STRING,
arr T-ARR,
arr2 T-ARR2
}
My2ndTypeNested ::= TypeNested
-- A more realistic definition
T-POS ::= CHOICE {
longitude REAL(-180.0..180.0),
latitude REAL(-90.0..90.0),
height REAL(30000.0..45000.0),
subTypeArray SEQUENCE (SIZE(10..15)) OF TypeNested,
label OCTET STRING (SIZE(50)),
intArray T-ARR,
myIntSet T-SET,
myIntSetOf T-SETOF,
anInt My2ndInt
}
T-POS-SET ::= SET {
longitude REAL(-180.0..180.0),
latitude REAL(-90.0..90.0),