Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NPTAV2Maude
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
real-time maude
NPTAV2Maude
Commits
68d4c5b0
Commit
68d4c5b0
authored
1 year ago
by
Jaime Arias
Browse files
Options
Downloads
Patches
Plain Diff
feat: add tranformation to the cli
parent
16684433
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cosyverif/cli.sh
+16
-2
16 additions, 2 deletions
cosyverif/cli.sh
with
16 additions
and
2 deletions
cosyverif/cli.sh
+
16
−
2
View file @
68d4c5b0
...
@@ -65,7 +65,14 @@ function parse_imitator {
...
@@ -65,7 +65,14 @@ function parse_imitator {
local
imitator_model
=
$1
local
imitator_model
=
$1
local
method
=
$2
local
method
=
$2
local
parser
=
"./nptav2maude/app.py"
local
parser
=
"./nptav2maude/app.py"
local
parser_src
=
"./nptav2maude/src"
local
output_file
=
"
${
imitator_model
%.*
}
.maude"
local
output_file
=
"
${
imitator_model
%.*
}
.maude"
# check if grammar exists
if
[
!
-d
"
${
parser_src
}
/dist"
]
;
then
(
cd
${
parser_src
}
&&
antlr
-Dlanguage
=
Python3
-no-listener
-visitor
-o
dist Imitator.g4
)
fi
echo
-e
"
\n
Parsing
${
imitator_model
}
with method
\"
${
method
}
\"
..."
echo
-e
"
\n
Parsing
${
imitator_model
}
with method
\"
${
method
}
\"
..."
python3
${
parser
}
--input
"
${
imitator_model
}
"
--output
"
${
output_file
}
"
--method
"
${
method
}
"
python3
${
parser
}
--input
"
${
imitator_model
}
"
--output
"
${
output_file
}
"
--method
"
${
method
}
"
}
}
...
@@ -142,11 +149,12 @@ function create_package {
...
@@ -142,11 +149,12 @@ function create_package {
##############################################################################
##############################################################################
function
usage
{
function
usage
{
# Display help
# Display help
echo
"Usage:
$(
basename
"
$0
"
)
[-d|h] [-r MODEL METHOD SOLVER TIMEOUT]"
echo
"Usage:
$(
basename
"
$0
"
)
[-d|h] [-r MODEL METHOD SOLVER TIMEOUT]
[-t MODEL METHOD]
"
echo
echo
echo
-e
" -d, --deploy Create package with all the files."
echo
-e
" -d, --deploy Create package with all the files."
echo
-e
" -h, --help Print this help."
echo
-e
" -h, --help Print this help."
echo
-e
" -r, --run Run Maude using a PTA as input."
echo
-e
" -r, --run Run Maude using a PTA as input."
echo
-e
" -t, --transform Transform a PTA into Maude."
echo
echo
exit
1
exit
1
}
}
...
@@ -157,7 +165,7 @@ function usage {
...
@@ -157,7 +165,7 @@ function usage {
# If no arguments provided, display usage information
# If no arguments provided, display usage information
[[
$#
-eq
0
]]
&&
usage
[[
$#
-eq
0
]]
&&
usage
while
getopts
":hdr:"
options
;
do
while
getopts
":hdr:
t:
"
options
;
do
case
"
${
options
}
"
in
case
"
${
options
}
"
in
h
)
# display Help
h
)
# display Help
usage
;;
usage
;;
...
@@ -171,6 +179,12 @@ while getopts ":hdr:" options; do
...
@@ -171,6 +179,12 @@ while getopts ":hdr:" options; do
run_pipeline
"
$@
"
run_pipeline
"
$@
"
exit
exit
;;
;;
t
)
# run the parser
shift
1
[[
$#
-ne
2
]]
&&
usage
parse_imitator
"
$@
"
exit
;;
*
)
# incorrect option
*
)
# incorrect option
echo
-e
"Error: Invalid option
\n
"
echo
-e
"Error: Invalid option
\n
"
usage
usage
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment