Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
dmt
Commits
574bef65
Commit
574bef65
authored
Jun 24, 2016
by
Thanassis Tsiodras
Browse files
[distutils] No more symlinks. Extremely tough challenges with aadl2glueC and antlr met.
parent
4d31450c
Changes
25
Hide whitespace changes
Inline
Side-by-side
dmt/A_mappers/createInternalTypes.py
deleted
120000 → 0
View file @
4d31450c
..
/
commonPy
/
createInternalTypes
.
py
\ No newline at end of file
dmt/A_mappers/qgenada_A_mapper.py
View file @
574bef65
...
...
@@ -33,7 +33,7 @@ import distutils.spawn as spawn
from
..commonPy
import
asnParser
from
..commonPy.utility
import
panic
,
inform
from
..commonPy.asnAST
import
AsnBool
,
AsnInt
,
AsnReal
,
AsnString
,
AsnEnumerated
,
AsnSequence
,
AsnSet
,
AsnChoice
,
AsnMetaMember
,
AsnSequenceOf
,
AsnSetOf
from
.createInternalTypes
import
ScanChildren
from
..commonPy
.createInternalTypes
import
ScanChildren
# The file written to
g_outputFile
=
None
...
...
dmt/A_mappers/qgenc_A_mapper.py
View file @
574bef65
...
...
@@ -28,7 +28,7 @@ from ..commonPy import asnParser
from
..commonPy.asnAST
import
(
AsnBool
,
AsnInt
,
AsnReal
,
AsnString
,
AsnEnumerated
,
AsnSequence
,
AsnSet
,
AsnChoice
,
AsnMetaMember
,
AsnSequenceOf
,
AsnSetOf
)
from
.createInternalTypes
import
ScanChildren
from
..commonPy
.createInternalTypes
import
ScanChildren
# The file written to
g_outputFile
=
None
...
...
dmt/A_mappers/simulink_A_mapper.py
View file @
574bef65
...
...
@@ -25,7 +25,7 @@ from ..commonPy import asnParser
from
..commonPy.asnAST
import
(
AsnBool
,
AsnInt
,
AsnReal
,
AsnString
,
AsnEnumerated
,
AsnSequence
,
AsnSet
,
AsnChoice
,
AsnMetaMember
,
AsnSequenceOf
,
AsnSetOf
)
from
.createInternalTypes
import
ScanChildren
from
..commonPy
.createInternalTypes
import
ScanChildren
# The file written to
g_outputFile
=
None
...
...
dmt/B_mappers/asynchronousTool.py
View file @
574bef65
...
...
@@ -25,7 +25,7 @@ Base class for all asynchronous tools
import
re
import
os
from
commonPy.utility
import
inform
,
panicWithCallStack
from
..
commonPy.utility
import
inform
,
panicWithCallStack
class
ASynchronousToolGlueGenerator
:
...
...
dmt/B_mappers/c_B_mapper.py
View file @
574bef65
...
...
@@ -36,10 +36,10 @@ To that end, this backend creates "glue" functions for input and
output parameters, which have C callable interfaces.
'''
from
commonPy.utility
import
panic
from
commonPy.asnAST
import
sourceSequenceLimit
,
isSequenceVariable
,
targetSequenceLimit
from
..
commonPy.utility
import
panic
from
..
commonPy.asnAST
import
sourceSequenceLimit
,
isSequenceVariable
,
targetSequenceLimit
from
commonPy.recursiveMapper
import
RecursiveMapper
from
..
commonPy.recursiveMapper
import
RecursiveMapper
from
.asynchronousTool
import
ASynchronousToolGlueGenerator
isAsynchronous
=
True
...
...
dmt/B_mappers/commonPy
deleted
120000 → 0
View file @
4d31450c
../commonPy
\ No newline at end of file
dmt/B_mappers/gui_B_mapper.py
View file @
574bef65
...
...
@@ -21,10 +21,12 @@
import
re
import
os
from
commonPy.asnAST
import
AsnBasicNode
,
AsnEnumerated
,
AsnSequence
,
AsnSet
,
AsnChoice
,
AsnSequenceOf
,
AsnSetOf
,
AsnMetaMember
,
\
AsnInt
,
AsnReal
,
AsnOctetString
,
AsnBool
,
isSequenceVariable
,
sourceSequenceLimit
from
commonPy.utility
import
panic
,
panicWithCallStack
import
commonPy.asnParser
from
..commonPy.asnAST
import
(
AsnBasicNode
,
AsnEnumerated
,
AsnSequence
,
AsnSet
,
AsnChoice
,
AsnSequenceOf
,
AsnSetOf
,
AsnMetaMember
,
AsnInt
,
AsnReal
,
AsnOctetString
,
AsnBool
,
isSequenceVariable
,
sourceSequenceLimit
)
from
..commonPy.utility
import
panic
,
panicWithCallStack
from
..commonPy
import
asnParser
g_HeaderFile
=
None
g_SourceFile
=
None
...
...
@@ -171,7 +173,7 @@ enumFieldNames = {}
def
VerifySingleFieldEnums
(
node
):
names
=
commonPy
.
asnParser
.
g_names
names
=
asnParser
.
g_names
while
isinstance
(
node
,
str
):
node
=
names
[
node
]
if
isinstance
(
node
,
AsnBasicNode
):
...
...
@@ -194,8 +196,8 @@ def VerifySingleFieldEnums(node):
def
OneTimeOnly
(
unused_modelingLanguage
,
asnFile
,
subProgram
,
subProgramImplementation
,
outputDir
,
maybeFVname
,
unused_useOSS
):
for
typename
in
commonPy
.
asnParser
.
g_names
:
node
=
commonPy
.
asnParser
.
g_names
[
typename
]
for
typename
in
asnParser
.
g_names
:
node
=
asnParser
.
g_names
[
typename
]
VerifySingleFieldEnums
(
node
)
global
g_outputDir
...
...
@@ -455,8 +457,8 @@ def OnStartup(modelingLanguage, asnFile, subProgram, subProgramImplementation, o
g_MyTelemetryActions
.
write
(
' long long arrivalTime = getTimeInMilliseconds();
\n
'
)
g_MyTelemetryActions
.
write
(
" wxMutexGuiEnter();
\n
"
)
g_MyTelemetryActions
.
write
(
" char *pData = (char *)message_data_received;
\n
"
)
names
=
commonPy
.
asnParser
.
g_names
leafTypeDict
=
commonPy
.
asnParser
.
g_leafTypeDict
names
=
asnParser
.
g_names
leafTypeDict
=
asnParser
.
g_leafTypeDict
for
param
in
subProgram
.
_params
:
node
=
names
[
param
.
_signal
.
_asnNodename
]
CleanParam
=
CleanName
(
param
.
_id
)
...
...
dmt/B_mappers/og_B_mapper.py
View file @
574bef65
...
...
@@ -89,9 +89,9 @@ hpredef.h :
Contains the prototypes (extern declarations) of the vm callbacks.
'''
from
commonPy.asnAST
import
isSequenceVariable
,
sourceSequenceLimit
,
AsnInt
,
AsnBool
,
AsnReal
,
AsnEnumerated
from
..
commonPy.asnAST
import
isSequenceVariable
,
sourceSequenceLimit
,
AsnInt
,
AsnBool
,
AsnReal
,
AsnEnumerated
from
.recursiveMapper
import
RecursiveMapper
from
..commonPy
.recursiveMapper
import
RecursiveMapper
from
.asynchronousTool
import
ASynchronousToolGlueGenerator
isAsynchronous
=
True
...
...
dmt/B_mappers/pyside_B_mapper.py
View file @
574bef65
...
...
@@ -4,12 +4,12 @@
import
re
import
os
from
commonPy.asnAST
import
\
AsnInt
,
AsnBool
,
AsnReal
,
AsnEnumerated
,
\
AsnOctetString
,
AsnChoice
,
AsnSequence
,
AsnSet
,
\
AsnSequenceOf
,
AsnSetOf
,
AsnMetaMember
from
..
commonPy.asnAST
import
(
AsnInt
,
AsnBool
,
AsnReal
,
AsnEnumerated
,
AsnOctetString
,
AsnChoice
,
AsnSequence
,
AsnSet
,
AsnSequenceOf
,
AsnSetOf
,
AsnMetaMember
)
from
commonPy.utility
import
panic
from
..
commonPy.utility
import
panic
g_PyDataModel
=
None
g_iter
=
1
...
...
dmt/B_mappers/recursiveMapper.py
deleted
120000 → 0
View file @
4d31450c
..
/
commonPy
/
recursiveMapper
.
py
\ No newline at end of file
dmt/B_mappers/scade6_B_mapper.py
View file @
574bef65
...
...
@@ -35,11 +35,11 @@ parameters, which have C callable interfaces. The necessary
stubs (to allow calling from the VM side) are also generated.
'''
from
commonPy.utility
import
panic
,
panicWithCallStack
from
commonPy.asnAST
import
isSequenceVariable
,
sourceSequenceLimit
from
commonPy.aadlAST
import
AadlPort
,
AadlParameter
from
..
commonPy.utility
import
panic
,
panicWithCallStack
from
..
commonPy.asnAST
import
isSequenceVariable
,
sourceSequenceLimit
from
..
commonPy.aadlAST
import
AadlPort
,
AadlParameter
from
.recursiveMapper
import
RecursiveMapper
from
..commonPy
.recursiveMapper
import
RecursiveMapper
from
.synchronousTool
import
SynchronousToolGlueGenerator
isAsynchronous
=
False
...
...
dmt/B_mappers/sdl_B_mapper.py
View file @
574bef65
...
...
@@ -89,9 +89,9 @@ hpredef.h :
Contains the prototypes (extern declarations) of the vm callbacks.
'''
from
commonPy.asnAST
import
isSequenceVariable
,
sourceSequenceLimit
,
AsnInt
,
AsnBool
,
AsnReal
,
AsnEnumerated
from
..
commonPy.asnAST
import
isSequenceVariable
,
sourceSequenceLimit
,
AsnInt
,
AsnBool
,
AsnReal
,
AsnEnumerated
from
.recursiveMapper
import
RecursiveMapper
from
..commonPy
.recursiveMapper
import
RecursiveMapper
from
.asynchronousTool
import
ASynchronousToolGlueGenerator
isAsynchronous
=
True
...
...
dmt/B_mappers/simulink_B_mapper.py
View file @
574bef65
...
...
@@ -35,11 +35,11 @@ parameters, which have C callable interfaces. The necessary
stubs (to allow calling from the VM side) are also generated.
'''
from
commonPy.utility
import
panicWithCallStack
from
commonPy.asnAST
import
AsnInt
,
AsnReal
,
AsnBool
,
AsnEnumerated
,
isSequenceVariable
,
sourceSequenceLimit
from
commonPy.aadlAST
import
AadlPort
,
AadlParameter
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
..commonPy
.recursiveMapper
import
RecursiveMapper
from
.synchronousTool
import
SynchronousToolGlueGenerator
isAsynchronous
=
False
...
...
dmt/B_mappers/synchronousTool.py
View file @
574bef65
...
...
@@ -24,8 +24,8 @@ Base class for all synchronous tools
import
re
import
os
from
commonPy.utility
import
panic
,
inform
,
panicWithCallStack
from
commonPy.aadlAST
import
InParam
,
OutParam
,
InOutParam
from
..
commonPy.utility
import
panic
,
inform
,
panicWithCallStack
from
..
commonPy.aadlAST
import
InParam
,
OutParam
,
InOutParam
class
SynchronousToolGlueGenerator
:
...
...
dmt/aadl2glueC.py
View file @
574bef65
...
...
@@ -84,16 +84,17 @@ import copy
import
distutils.spawn
as
spawn
from
importlib
import
import_module
import
commonPy
.configMT
from
.
import
commonPy
import
commonPy.asnParser
import
commonPy.aadlAST
import
commonPy.cleanupNodes
# To unpickle the Py2/ANTLR2-generated pickle file...
# http://stackoverflow.com/questions/2121874/python-pickling-after-changing-a-modules-directory
from
.
import
commonPy2
sys
.
modules
[
'commonPy2'
]
=
commonPy2
from
commonPy.utility
import
panic
,
inform
from
.commonPy.utility
import
panic
,
inform
from
.commonPy
import
verify
import
commonPy.verify
as
verify
import
B_mappers
# NOQA pylint: disable=unused-import
from
.
import
B_mappers
# NOQA pylint: disable=unused-import
g_mappedName
=
{
'SEQUENCE'
:
'OnSequence'
,
...
...
@@ -144,7 +145,7 @@ of each SUBPROGRAM param.'''
patchMe
(
cn
)
try
:
import
pickle
astInfo
=
pickle
.
load
(
open
(
astFile
,
'rb'
))
astInfo
=
pickle
.
load
(
open
(
astFile
,
'rb'
)
,
fix_imports
=
False
)
for
k
in
[
'g_processImplementations'
,
'g_apLevelContainers'
,
'g_signals'
,
'g_systems'
,
'g_subProgramImplementations'
,
'g_threadImplementations'
]:
...
...
@@ -176,7 +177,6 @@ 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
])))
if
sys
.
argv
.
count
(
"-o"
)
!=
0
:
idx
=
sys
.
argv
.
index
(
"-o"
)
try
:
...
...
@@ -301,7 +301,7 @@ def main():
backendFilename
=
"."
+
modelingLanguage
.
lower
()
+
"_B_mapper.py"
inform
(
"Parsing %s..."
,
backendFilename
)
try
:
backend
=
import_module
(
backendFilename
[:
-
3
],
'B_mappers'
)
# pragma: no cover
backend
=
import_module
(
backendFilename
[:
-
3
],
'
dmt.
B_mappers'
)
# pragma: no cover
if
backendFilename
[:
-
3
]
not
in
loadedBackends
:
loadedBackends
[
backendFilename
[:
-
3
]]
=
1
if
commonPy
.
configMT
.
verbose
:
...
...
@@ -401,10 +401,10 @@ def main():
def
mappers
(
lang
):
if
lang
.
lower
()
in
[
"gui_pi"
,
"gui_ri"
]:
return
[
import_module
(
".python_B_mapper"
,
"B_mappers"
),
import_module
(
".pyside_B_mapper"
,
"B_mappers"
)]
# pragma: no cover
return
[
import_module
(
".python_B_mapper"
,
"
dmt.
B_mappers"
),
import_module
(
".pyside_B_mapper"
,
"
dmt.
B_mappers"
)]
# pragma: no cover
elif
lang
.
lower
()
==
"vhdl"
:
# pragma: no cover
return
[
import_module
(
".vhdl_B_mapper"
,
"B_mappers"
)]
# pragma: no cover
return
[
import_module
(
".vhdl_B_mapper"
,
"
dmt.
B_mappers"
)]
# 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
...
...
@@ -454,4 +454,9 @@ def main():
b
.
OnFinal
()
# pragma: no cover
if
__name__
==
"__main__"
:
main
()
if
"-pdb"
in
sys
.
argv
:
sys
.
argv
.
remove
(
"-pdb"
)
# pragma: no cover
import
pdb
# pragma: no cover pylint: disable=wrong-import-position,wrong-import-order
pdb
.
run
(
'main()'
)
# pragma: no cover
else
:
main
()
dmt/commonPy/__init__.py
View file @
574bef65
...
...
@@ -7,6 +7,7 @@
from
.
import
configMT
from
.
import
asnParser
from
.
import
asnAST
from
.
import
aadlAST
from
.
import
utility
from
.
import
createInternalTypes
from
.
import
verify
...
...
dmt/commonPy/commonSMP2.py
View file @
574bef65
...
...
@@ -4,9 +4,9 @@ import sys
from
typing
import
Any
,
Dict
# NOQA pylint: disable=unused-import
from
lxml
import
etree
from
commonPy
.asnAST
import
AsnBool
,
AsnInt
,
AsnReal
,
\
AsnEnumerated
,
AsnOctetString
,
AsnSequenceOf
,
AsnSet
,
\
AsnSetOf
,
AsnSequence
,
AsnChoice
,
AsnMetaMember
from
.asnAST
import
(
AsnBool
,
AsnInt
,
AsnReal
,
AsnEnumerated
,
AsnOctetString
,
AsnSequenceOf
,
AsnSet
,
AsnSetOf
,
AsnSequence
,
AsnChoice
,
AsnMetaMember
)
# Level of verbosity
g_verboseLevel
=
0
...
...
dmt/commonPy/createInternalTypes.py
View file @
574bef65
...
...
@@ -21,14 +21,14 @@
import
re
from
typing
import
Any
,
Dict
,
List
# NOQA pylint: disable=unused-import
from
.
.commonPy
import
asnParser
from
.
import
asnParser
from
..commonPy
.asnAST
import
(
from
.asnAST
import
(
AsnString
,
AsnBasicNode
,
AsnSetOf
,
AsnSequenceOf
,
AsnSet
,
AsnSequence
,
AsnChoice
,
AsnMetaMember
,
AsnEnumerated
,
AsnNode
)
from
..commonPy
.utility
import
panic
from
.utility
import
panic
# Separate cache per ASN.1 AST dictionary (i.e. per 'names' parameter of ScanChildren)
...
...
parse_aadl.py
→
dmt/
parse_aadl.py
View file @
574bef65
File moved
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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