Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TASTE
dmt
Commits
6c418708
Commit
6c418708
authored
Jul 29, 2019
by
Thanassis Tsiodras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only check for ASN1SCC existence in the PATH if source ASN.1 files have changed.
parent
dd06103f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
42 deletions
+41
-42
dmt/commonPy/asnParser.py
dmt/commonPy/asnParser.py
+41
-42
No files found.
dmt/commonPy/asnParser.py
View file @
6c418708
...
@@ -420,48 +420,47 @@ def ParseAsnFileList(listOfFilenames: List[str]) -> None: # pylint: disable=inv
...
@@ -420,48 +420,47 @@ def ParseAsnFileList(listOfFilenames: List[str]) -> None: # pylint: disable=inv
os
.
fdopen
(
dummy
).
close
()
os
.
fdopen
(
dummy
).
close
()
xmlAST2
=
xmlAST
+
"2"
xmlAST2
=
xmlAST
+
"2"
asn1SccPath
=
spawn
.
find_executable
(
'asn1.exe'
)
if
someFilesHaveChanged
:
if
asn1SccPath
is
None
:
asn1SccPath
=
spawn
.
find_executable
(
'asn1.exe'
)
utility
.
panic
(
"ASN1SCC seems not installed on your system (asn1.exe not found in PATH).
\n
"
)
if
asn1SccPath
is
None
:
else
:
utility
.
panic
(
"ASN1SCC seems not installed on your system (asn1.exe not found in PATH).
\n
"
)
if
someFilesHaveChanged
:
asn1SccDir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
asn1SccPath
))
asn1SccDir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
asn1SccPath
))
spawnResult
=
os
.
system
(
"mono
\"
"
+
asn1SccPath
+
"
\"
-customStg
\"
"
+
asn1SccDir
+
"/xml.stg:"
+
xmlAST
+
"
\"
-typePrefix asn1Scc -fp AUTO -customStgAstVersion 4
\"
"
+
"
\"
\"
"
.
join
(
listOfFilenames
)
+
"
\"
"
)
spawnResult
=
os
.
system
(
"mono
\"
"
+
asn1SccPath
+
"
\"
-customStg
\"
"
+
asn1SccDir
+
"/xml.stg:"
+
xmlAST
+
"
\"
-typePrefix asn1Scc -fp AUTO -customStgAstVersion 4
\"
"
+
"
\"
\"
"
.
join
(
listOfFilenames
)
+
"
\"
"
)
if
spawnResult
!=
0
:
if
spawnResult
!=
0
:
errCode
=
spawnResult
/
256
errCode
=
spawnResult
/
256
if
errCode
==
1
:
if
errCode
==
1
:
utility
.
panic
(
"ASN1SCC reported syntax errors. Aborting..."
)
utility
.
panic
(
"ASN1SCC reported syntax errors. Aborting..."
)
elif
errCode
==
2
:
elif
errCode
==
2
:
utility
.
panic
(
"ASN1SCC reported semantic errors (or mono failed). Aborting..."
)
utility
.
panic
(
"ASN1SCC reported semantic errors (or mono failed). Aborting..."
)
elif
errCode
==
3
:
elif
errCode
==
3
:
utility
.
panic
(
"ASN1SCC reported internal error. Contact ESA with this input. Aborting..."
)
utility
.
panic
(
"ASN1SCC reported internal error. Contact ESA with this input. Aborting..."
)
elif
errCode
==
4
:
elif
errCode
==
4
:
utility
.
panic
(
"ASN1SCC reported usage error. Aborting..."
)
utility
.
panic
(
"ASN1SCC reported usage error. Aborting..."
)
else
:
else
:
utility
.
panic
(
"ASN1SCC generic error. Contact ESA with this input. Aborting..."
)
utility
.
panic
(
"ASN1SCC generic error. Contact ESA with this input. Aborting..."
)
ParseASN1SCC_AST
(
xmlAST
)
ParseASN1SCC_AST
(
xmlAST
)
if
projectCache
is
None
:
if
projectCache
is
None
:
os
.
unlink
(
xmlAST
)
os
.
unlink
(
xmlAST
)
g_names
.
update
(
g_names
)
g_names
.
update
(
g_names
)
g_leafTypeDict
.
update
(
g_leafTypeDict
)
g_leafTypeDict
.
update
(
g_leafTypeDict
)
g_checkedSoFarForKeywords
.
update
(
g_checkedSoFarForKeywords
)
g_checkedSoFarForKeywords
.
update
(
g_checkedSoFarForKeywords
)
g_typesOfFile
.
update
(
g_typesOfFile
)
g_typesOfFile
.
update
(
g_typesOfFile
)
# We also need to mark the artificial types -
# We also need to mark the artificial types -
# So spawn the custom type output at level 1 (unfiltered)
# So spawn the custom type output at level 1 (unfiltered)
# and mark any types not inside it as artificial.
# and mark any types not inside it as artificial.
if
someFilesHaveChanged
:
if
someFilesHaveChanged
:
os
.
system
(
"mono
\"
"
+
asn1SccPath
+
"
\"
-customStg
\"
"
+
asn1SccDir
+
"/xml.stg:"
+
xmlAST2
+
"
\"
-fp AUTO -typePrefix asn1Scc -customStgAstVersion 1
\"
"
+
"
\"
\"
"
.
join
(
listOfFilenames
)
+
"
\"
"
)
os
.
system
(
"mono
\"
"
+
asn1SccPath
+
"
\"
-customStg
\"
"
+
asn1SccDir
+
"/xml.stg:"
+
xmlAST2
+
"
\"
-fp AUTO -typePrefix asn1Scc -customStgAstVersion 1
\"
"
+
"
\"
\"
"
.
join
(
listOfFilenames
)
+
"
\"
"
)
realTypes
=
{}
realTypes
=
{}
for
line
in
os
.
popen
(
"grep 'ExportedType\>'
\"
"
+
xmlAST2
+
"
\"
"
).
readlines
():
# flake8: noqa pylint: disable=anomalous-backslash-in-string
for
line
in
os
.
popen
(
"grep 'ExportedType\>'
\"
"
+
xmlAST2
+
"
\"
"
).
readlines
():
# flake8: noqa pylint: disable=anomalous-backslash-in-string
line
=
re
.
sub
(
r'^.*Name="'
,
''
,
line
.
strip
())
line
=
re
.
sub
(
r'^.*Name="'
,
''
,
line
.
strip
())
line
=
re
.
sub
(
r'" />$'
,
''
,
line
)
line
=
re
.
sub
(
r'" />$'
,
''
,
line
)
realTypes
[
line
]
=
1
realTypes
[
line
]
=
1
if
projectCache
is
None
:
if
projectCache
is
None
:
os
.
unlink
(
xmlAST2
)
os
.
unlink
(
xmlAST2
)
for
nodeTypename
in
list
(
g_names
.
keys
()):
for
nodeTypename
in
list
(
g_names
.
keys
()):
if
nodeTypename
not
in
realTypes
:
if
nodeTypename
not
in
realTypes
:
g_names
[
nodeTypename
].
_isArtificial
=
True
g_names
[
nodeTypename
].
_isArtificial
=
True
def
Dump
()
->
None
:
def
Dump
()
->
None
:
...
...
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