Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Reusable Analysis
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Value stream analytics
Contributor 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
JastAdd
Reusable Analysis
Commits
f9b26267
Commit
f9b26267
authored
5 years ago
by
Johannes Mey
Browse files
Options
Downloads
Patches
Plain Diff
fix CLI, add option --ast for scope4j
parent
dd9b4954
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
scope4j/build.gradle
+3
-0
3 additions, 0 deletions
scope4j/build.gradle
scope4m/build.gradle
+3
-0
3 additions, 0 deletions
scope4m/build.gradle
scope4m/src/main/java/org/jmodelica/ScopeAnalysis.java
+8
-6
8 additions, 6 deletions
scope4m/src/main/java/org/jmodelica/ScopeAnalysis.java
with
14 additions
and
6 deletions
scope4j/build.gradle
+
3
−
0
View file @
f9b26267
...
@@ -140,6 +140,9 @@ jastadd {
...
@@ -140,6 +140,9 @@ jastadd {
run
{
run
{
mainClassName
=
'org.extendj.ScopeAnalysis'
mainClassName
=
'org.extendj.ScopeAnalysis'
if
(
project
.
hasProperty
(
"appArgs"
))
{
args
Eval
.
me
(
appArgs
)
}
}
}
task
preprocess
(
type:
JavaExec
)
{
task
preprocess
(
type:
JavaExec
)
{
...
...
This diff is collapsed.
Click to expand it.
scope4m/build.gradle
+
3
−
0
View file @
f9b26267
...
@@ -105,6 +105,9 @@ jastadd {
...
@@ -105,6 +105,9 @@ jastadd {
run
{
run
{
mainClassName
=
'org.jmodelica.SimpleMain'
mainClassName
=
'org.jmodelica.SimpleMain'
if
(
project
.
hasProperty
(
"appArgs"
))
{
args
Eval
.
me
(
appArgs
)
}
}
}
task
preprocess
(
type:
JavaExec
)
{
task
preprocess
(
type:
JavaExec
)
{
...
...
This diff is collapsed.
Click to expand it.
scope4m/src/main/java/org/jmodelica/ScopeAnalysis.java
+
8
−
6
View file @
f9b26267
...
@@ -35,15 +35,16 @@ public class ScopeAnalysis {
...
@@ -35,15 +35,16 @@ public class ScopeAnalysis {
boolean
debug
=
arguments
.
isEmpty
()
||
arguments
.
remove
(
"--debug"
);
boolean
debug
=
arguments
.
isEmpty
()
||
arguments
.
remove
(
"--debug"
);
boolean
tree
=
arguments
.
remove
(
"--tree"
);
boolean
tree
=
arguments
.
remove
(
"--tree"
);
boolean
warnings
=
arguments
.
remove
(
"--warnings"
);
boolean
warnings
=
arguments
.
remove
(
"--warnings"
);
boolean
ast
=
arguments
.
remove
(
"--ast"
);
if
(
arguments
.
size
()
>
1
)
{
if
(
arguments
.
size
()
>
1
)
{
System
.
out
.
println
(
"usage: ScopeAnalysis [--debug] [--tree] [--warnings] <directory with modelica files>"
);
System
.
out
.
println
(
"usage: ScopeAnalysis [--debug] [--tree] [--warnings]
[--ast]
<directory with modelica files>"
);
System
.
exit
(-
1
);
System
.
exit
(-
1
);
}
}
String
path
=
arguments
.
isEmpty
()
?
"../testprograms/modelica/simple"
:
arguments
.
get
(
arguments
.
size
()
-
1
);
String
path
=
arguments
.
isEmpty
()
?
"../testprograms/modelica/simple"
:
arguments
.
get
(
0
);
if
(
debug
)
{
if
(
debug
)
{
new
ScopeAnalysis
().
analyze
(
path
,
tree
,
warnings
);
new
ScopeAnalysis
().
analyze
(
path
,
tree
,
warnings
,
ast
);
}
else
{
}
else
{
new
ScopeAnalysis
().
analyzeTimed
(
path
);
new
ScopeAnalysis
().
analyzeTimed
(
path
);
}
}
...
@@ -97,7 +98,7 @@ public class ScopeAnalysis {
...
@@ -97,7 +98,7 @@ public class ScopeAnalysis {
}
}
public
Set
<
AbstractFinding
>
analyze
(
String
path
,
boolean
tree
,
boolean
warnings
)
{
public
Set
<
AbstractFinding
>
analyze
(
String
path
,
boolean
tree
,
boolean
warnings
,
boolean
ast
)
{
try
{
try
{
List
<
String
>
files
=
Files
.
walk
(
Paths
.
get
(
path
))
List
<
String
>
files
=
Files
.
walk
(
Paths
.
get
(
path
))
.
filter
(
Files:
:
isRegularFile
)
.
filter
(
Files:
:
isRegularFile
)
...
@@ -112,8 +113,9 @@ public class ScopeAnalysis {
...
@@ -112,8 +113,9 @@ public class ScopeAnalysis {
}
}
// TODO just temp debug output:
if
(
ast
)
{
sourceRoot
.
printAST
();
sourceRoot
.
printAST
();
}
if
(
warnings
)
{
if
(
warnings
)
{
// TODO find out if there are compiler warnings in JModelica
// TODO find out if there are compiler warnings in JModelica
...
...
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