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
2456f05f
Commit
2456f05f
authored
9 years ago
by
Manos Koukoutos
Committed by
Etienne Kneuss
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Some cosmetic changes in Main
parent
4e238ff0
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
+16
-14
16 additions, 14 deletions
src/main/scala/leon/Main.scala
with
16 additions
and
14 deletions
src/main/scala/leon/Main.scala
+
16
−
14
View file @
2456f05f
...
@@ -45,7 +45,7 @@ object Main {
...
@@ -45,7 +45,7 @@ object Main {
lazy
val
allOptions
=
allComponents
.
flatMap
(
_
.
definedOptions
)
++
topLevelOptions
lazy
val
allOptions
=
allComponents
.
flatMap
(
_
.
definedOptions
)
++
topLevelOptions
def
displayHelp
(
reporter
:
Reporter
)
{
def
displayHelp
(
reporter
:
Reporter
,
error
:
Boolean
)
{
reporter
.
info
(
"usage: leon [--xlang] [--termination] [--synthesis] [--help] [--debug=<N>] [..] <files>"
)
reporter
.
info
(
"usage: leon [--xlang] [--termination] [--synthesis] [--help] [--debug=<N>] [..] <files>"
)
reporter
.
info
(
""
)
reporter
.
info
(
""
)
for
(
opt
<-
topLevelOptions
.
toSeq
.
sortBy
(
_
.
name
))
{
for
(
opt
<-
topLevelOptions
.
toSeq
.
sortBy
(
_
.
name
))
{
...
@@ -63,9 +63,11 @@ object Main {
...
@@ -63,9 +63,11 @@ object Main {
reporter
.
info
(
f
"${opt.usageOption}%-20s ${opt.usageDesc}"
)
reporter
.
info
(
f
"${opt.usageOption}%-20s ${opt.usageDesc}"
)
}
}
}
}
sys
.
exit
(
1
)
exit
(
error
)
}
}
private
def
exit
(
error
:
Boolean
)
=
sys
.
exit
(
if
(
error
)
1
else
0
)
def
processOptions
(
args
:
Seq
[
String
])
:
LeonContext
=
{
def
processOptions
(
args
:
Seq
[
String
])
:
LeonContext
=
{
val
initReporter
=
new
DefaultReporter
(
Settings
())
val
initReporter
=
new
DefaultReporter
(
Settings
())
...
@@ -129,7 +131,7 @@ object Main {
...
@@ -129,7 +131,7 @@ object Main {
Some
(
LeonFlagOption
(
fod
.
name
,
v
))
Some
(
LeonFlagOption
(
fod
.
name
,
v
))
case
None
=>
case
None
=>
initReporter
.
error
(
"Invalid option usage: --"
+
fod
.
name
+
"="
+
value
)
initReporter
.
error
(
"Invalid option usage: --"
+
fod
.
name
+
"="
+
value
)
displayHelp
(
initReporter
)
displayHelp
(
initReporter
,
error
=
true
)
None
None
}
}
case
(
vod
:
LeonValueOptionDef
,
value
)
=>
case
(
vod
:
LeonValueOptionDef
,
value
)
=>
...
@@ -174,7 +176,7 @@ object Main {
...
@@ -174,7 +176,7 @@ object Main {
case
LeonFlagOption
(
"noop"
,
true
)
=>
case
LeonFlagOption
(
"noop"
,
true
)
=>
settings
=
settings
.
copy
(
verify
=
false
)
settings
=
settings
.
copy
(
verify
=
false
)
case
LeonFlagOption
(
"help"
,
true
)
=>
case
LeonFlagOption
(
"help"
,
true
)
=>
displayHelp
(
initReporter
)
displayHelp
(
initReporter
,
error
=
false
)
case
_
=>
case
_
=>
}
}
...
@@ -204,6 +206,8 @@ object Main {
...
@@ -204,6 +206,8 @@ object Main {
def
computePipeline
(
settings
:
Settings
)
:
Pipeline
[
List
[
String
]
,
Any
]
=
{
def
computePipeline
(
settings
:
Settings
)
:
Pipeline
[
List
[
String
]
,
Any
]
=
{
import
purescala.Definitions.Program
import
purescala.Definitions.Program
import
purescala.
{
FunctionClosure
,
RestoreMethods
}
import
utils.FileOutputPhase
import
frontends.scalac.ExtractionPhase
import
frontends.scalac.ExtractionPhase
import
synthesis.SynthesisPhase
import
synthesis.SynthesisPhase
import
termination.TerminationPhase
import
termination.TerminationPhase
...
@@ -232,9 +236,9 @@ object Main {
...
@@ -232,9 +236,9 @@ object Main {
}
else
if
(
settings
.
xlang
)
{
}
else
if
(
settings
.
xlang
)
{
XLangAnalysisPhase
XLangAnalysisPhase
}
else
if
(
settings
.
verify
)
{
}
else
if
(
settings
.
verify
)
{
purescala
.
FunctionClosure
andThen
AnalysisPhase
FunctionClosure
andThen
AnalysisPhase
}
else
{
}
else
{
purescala
.
RestoreMethods
andThen
utils
.
FileOutputPhase
RestoreMethods
andThen
FileOutputPhase
}
}
}
}
...
@@ -242,7 +246,7 @@ object Main {
...
@@ -242,7 +246,7 @@ object Main {
pipeProcess
pipeProcess
}
}
private
var
hasFatal
=
false
;
private
var
hasFatal
=
false
def
main
(
args
:
Array
[
String
])
{
def
main
(
args
:
Array
[
String
])
{
val
argsl
=
args
.
toList
val
argsl
=
args
.
toList
...
@@ -250,9 +254,10 @@ object Main {
...
@@ -250,9 +254,10 @@ object Main {
// Process options
// Process options
val
ctx
=
try
{
val
ctx
=
try
{
processOptions
(
argsl
)
processOptions
(
argsl
)
}
catch
{
}
catch
{
case
LeonFatalError
(
None
)
=>
case
LeonFatalError
(
None
)
=>
sys
.
exit
(
1
)
exit
(
error
=
true
)
case
LeonFatalError
(
Some
(
msg
))
=>
case
LeonFatalError
(
Some
(
msg
))
=>
// For the special case of fatal errors not sent though Reporter, we
// For the special case of fatal errors not sent though Reporter, we
...
@@ -263,7 +268,7 @@ object Main {
...
@@ -263,7 +268,7 @@ object Main {
case
_:
LeonFatalError
=>
case
_:
LeonFatalError
=>
}
}
sys
.
exit
(
1
)
exit
(
error
=
true
)
}
}
ctx
.
interruptManager
.
registerSignalHandler
()
ctx
.
interruptManager
.
registerSignalHandler
()
...
@@ -282,11 +287,7 @@ object Main {
...
@@ -282,11 +287,7 @@ object Main {
execute
(
args
,
ctx
)
execute
(
args
,
ctx
)
}
}
if
(
hasFatal
)
{
exit
(
hasFatal
)
sys
.
exit
(
1
)
}
else
{
sys
.
exit
(
0
)
}
}
}
def
execute
(
args
:
Seq
[
String
],
ctx0
:
LeonContext
)
:
Unit
=
{
def
execute
(
args
:
Seq
[
String
],
ctx0
:
LeonContext
)
:
Unit
=
{
...
@@ -314,6 +315,7 @@ object Main {
...
@@ -314,6 +315,7 @@ object Main {
ctx
.
reporter
.
whenDebug
(
DebugSectionTimers
)
{
debug
=>
ctx
.
reporter
.
whenDebug
(
DebugSectionTimers
)
{
debug
=>
ctx
.
timers
.
outputTable
(
debug
)
ctx
.
timers
.
outputTable
(
debug
)
}
}
hasFatal
=
false
}
catch
{
}
catch
{
case
LeonFatalError
(
None
)
=>
case
LeonFatalError
(
None
)
=>
hasFatal
=
true
hasFatal
=
true
...
...
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