Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
LARA
inox
Commits
e8c0f97a
Commit
e8c0f97a
authored
12 years ago
by
Etienne Kneuss
Browse files
Options
Downloads
Patches
Plain Diff
Some more options, help, etc..
parent
1bcf168b
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
src/main/scala/leon/Main.scala
+28
-5
28 additions, 5 deletions
src/main/scala/leon/Main.scala
with
28 additions
and
5 deletions
src/main/scala/leon/Main.scala
+
28
−
5
View file @
e8c0f97a
...
...
@@ -17,13 +17,28 @@ object Main {
)
}
lazy
val
allOptions
=
allPhases
.
flatMap
(
_
.
definedOptions
)
++
Set
(
LeonOptionDef
(
"synthesis"
,
true
,
"--synthesis Partial synthesis or choose() constructs"
),
LeonOptionDef
(
"xlang"
,
true
,
"--xlang Support for extra program constructs (imperative,...)"
),
LeonOptionDef
(
"parse"
,
true
,
"--parse Checks only whether the program is valid PureScala"
),
LeonOptionDef
(
"debug"
,
false
,
"--debug=[1-5] Debug level"
),
LeonOptionDef
(
"help"
,
true
,
"--help This help"
)
)
def
displayHelp
()
{
println
(
"usage: leon [--xlang] [--help] [--synthesis] [--help] [--debug=<N>] [..] <files>"
)
println
println
(
"Leon options are:"
)
for
(
opt
<-
allOptions
.
toSeq
.
sortBy
(
_
.
name
))
{
println
(
" "
+
opt
.
description
)
}
sys
.
exit
(
1
)
}
def
processOptions
(
reporter
:
Reporter
,
args
:
List
[
String
])
=
{
val
phases
=
allPhases
val
allOptions
=
allPhases
.
flatMap
(
_
.
definedOptions
)
++
Set
(
LeonOptionDef
(
"synthesis"
,
true
,
"--synthesis Magic!"
),
LeonOptionDef
(
"xlang"
,
true
,
"--xlang Preprocessing and transformation from extended programs"
)
)
val
allOptions
=
this
.
allOptions
val
allOptionsMap
=
allOptions
.
map
(
o
=>
o
.
name
->
o
).
toMap
...
...
@@ -47,10 +62,12 @@ object Main {
case
(
false
,
LeonValueOption
(
name
,
value
))
=>
Some
(
leonOpt
)
case
_
=>
reporter
.
fatalError
(
"Invalid option usage"
)
System
.
err
.
println
(
"Invalid option usage: "
+
opt
)
displayHelp
()
None
}
}
else
{
System
.
err
.
println
(
"leon: '"
+
opt
+
"' is not a valid option. See 'leon --help'"
)
None
}
}
...
...
@@ -63,6 +80,10 @@ object Main {
settings
=
settings
.
copy
(
synthesis
=
true
,
xlang
=
false
,
analyze
=
false
)
case
LeonFlagOption
(
"xlang"
)
=>
settings
=
settings
.
copy
(
synthesis
=
false
,
xlang
=
true
)
case
LeonFlagOption
(
"parse"
)
=>
settings
=
settings
.
copy
(
synthesis
=
false
,
xlang
=
false
,
analyze
=
false
)
case
LeonFlagOption
(
"help"
)
=>
displayHelp
()
case
_
=>
}
...
...
@@ -112,8 +133,10 @@ object Main {
// Process options
val
ctx
=
processOptions
(
reporter
,
args
.
toList
)
// Compute leon pipeline
val
pipeline
=
computePipeLine
(
ctx
.
settings
)
// Run phases
pipeline
.
run
(
ctx
)(
args
.
toList
)
}
}
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