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
T
taste-model-checker
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TASTE
taste-model-checker
Commits
aacae1a9
Commit
aacae1a9
authored
Dec 01, 2019
by
Maxime Perrotin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new Python generator
parent
0687f5a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
asn1-iterators/src/taste-asn1-iterators.py
asn1-iterators/src/taste-asn1-iterators.py
+65
-0
No files found.
asn1-iterators/src/taste-asn1-iterators.py
0 → 100755
View file @
aacae1a9
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This application generates the Ada code needed to iterate on ASN.1 values
It is part of the TASTE project
Copyright (c) 2019 Maxime Perrotin
(c) 2019 European Space Agency
Contact : maxime.perrotin@esa.int
"""
__version__
=
"3.0.0"
import
argparse
import
logging
from
opengeode
import
Asn1scc
def
init_logging
(
options
):
''' Initialize logging '''
terminal_formatter
=
logging
.
Formatter
(
fmt
=
"[%(levelname)s] %(message)s"
)
handler_console
=
logging
.
StreamHandler
()
handler_console
.
setFormatter
(
terminal_formatter
)
LOG
.
addHandler
(
handler_console
)
level
=
logging
.
DEBUG
if
options
.
debug
else
logging
.
INFO
LOG
.
setLevel
(
level
)
def
parse_args
():
''' Parse command line arguments '''
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'-v'
,
'--version'
,
action
=
'version'
,
version
=
__version__
)
parser
.
add_argument
(
'-g'
,
'--debug'
,
action
=
'store_true'
,
default
=
False
,
help
=
'Display debug information'
)
parser
.
add_argument
(
'files'
,
metavar
=
'dataview-uniq.asn'
,
type
=
str
,
nargs
=
'*'
,
help
=
'ASN.1 file(s)'
)
return
parser
.
parse_args
()
def
main
():
''' Tool entry point '''
# Catch Ctrl-C to stop the app from the console
signal
.
signal
(
signal
.
SIGINT
,
signal
.
SIG_DFL
)
options
=
parse_args
()
init_logging
(
options
)
LOG
.
info
(
'Ada Iterators for ASN.1 - version '
+
__version__
)
if
__name__
==
'__main__'
:
''' Run main application '''
main
()
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