Skip to content

Commit 40bb19e

Browse files
Add Java stubbing script
1 parent d34e748 commit 40bb19e

File tree

3 files changed

+559
-0
lines changed

3 files changed

+559
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* Tool to generate C# stubs from a qltest snapshot.
3+
*
4+
* It finds all declarations used in the source code,
5+
* and generates minimal C# stubs containing those declarations
6+
* and their dependencies.
7+
*/
8+
9+
import java
10+
import Stubs
11+
12+
/** Declarations used by source code. */
13+
class UsedInSource extends GeneratedDeclaration {
14+
UsedInSource() {
15+
(
16+
this = any(Variable v | v.fromSource()).getType()
17+
or
18+
this = any(Expr e | e.getEnclosingCallable().fromSource()).getType()
19+
or
20+
this = any(RefType t | t.fromSource())
21+
)
22+
}
23+
}
24+
25+
from GeneratedTopLevel t
26+
where not t.fromSource()
27+
select t.getQualifiedName(), t.stubFile()

0 commit comments

Comments
 (0)