File tree 2 files changed +46
-0
lines changed
2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 8
8
branches : [ main ]
9
9
paths :
10
10
- godel-script/**
11
+ workflow_dispatch :
11
12
12
13
jobs :
13
14
mac-aarch64-build :
47
48
run : |
48
49
git config --global user.name "$(git log -n 1 --pretty=format:%an)"
49
50
git config --global user.email "$(git log -n 1 --pretty=format:%ae)"
51
+ - name : Install Package
52
+ run : |
53
+ apt-get install sqlite3 libsqlite3-dev
50
54
- name : Build
51
55
run : |
52
56
cd godel-script
Original file line number Diff line number Diff line change
1
+ // script
2
+ use coref::java::*
3
+ use coref::xml::*
4
+
5
+ fn default_xml_db() -> XmlDB { return XmlDB::load("coref_xml_src.db") }
6
+ fn default_java_db() -> JavaDB { return JavaDB::load("coref_java_src.db") }
7
+
8
+ schema DBElement extends XmlElement {}
9
+
10
+ impl DBElement {
11
+ // find XmlElement with name "resultMap"
12
+ pub fn __all__(db: XmlDB) -> *Self {
13
+ for (x in XmlElement(db)) {
14
+ if (x.getElementName() = "resultMap") {
15
+ yield DBElement { ..x }
16
+ }
17
+ }
18
+ }
19
+
20
+ // get attribute "type" from XmlElement "resultMap"
21
+ pub fn getType(self) -> string {
22
+ for (a in self.getAttribute()) {
23
+ if (a.getName() = "type") {
24
+ return a.getValue()
25
+ }
26
+ }
27
+ }
28
+ }
29
+
30
+ // if DBElement's type name equals to Java Class name, then collect this Class info
31
+ fn getDOClassFromResultMap() -> *Class {
32
+ for (c in Class(default_java_db()), e in DBElement(default_xml_db())) {
33
+ if (c.getQualifiedName() = e.getType()) {
34
+ yield c
35
+ }
36
+ }
37
+ }
38
+
39
+ // example query, just get the class name, you could do other queries
40
+ query do_class
41
+ from c in getDOClassFromResultMap()
42
+ select c.getQualifiedName() as do_class_name
You can’t perform that action at this time.
0 commit comments