-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Remove te legacy LaraCommonLanguage experiment from the project"
This reverts commit c65182f.
- Loading branch information
Showing
13 changed files
with
213 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { laraImport } from "@specs-feup/lara/api/lara/core/LaraCore.js"; | ||
laraImport("lcl.ml.Code2Vec"); | ||
|
||
new Code2Vec().printPaths(); |
32 changes: 32 additions & 0 deletions
32
ClavaWeaver/resources/clava/test/api/LaraCommonLanguageTest.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { laraImport } from "@specs-feup/lara/api/lara/core/LaraCore.js"; | ||
|
||
laraImport("lcl.LaraCommonLanguage"); | ||
laraImport("weaver.jp.ClavaJoinPoint"); | ||
laraImport("weaver.jp.FileJp"); | ||
laraImport("weaver.Query"); | ||
|
||
var $file = Query.search("file").first(); | ||
//printlnObject($file); | ||
console.log("line: " + $file.line); | ||
console.log("is FileJP? : " + ($file instanceof FileJp)); | ||
|
||
var classes = Query.search("classType", "A").get(); | ||
console.log("# A classes: " + classes.length); | ||
|
||
var classesOnlyDecl = Query.search("classType", "classOnlyDecl").get(); | ||
console.log("# onlyDecl classes: " + classesOnlyDecl.length); | ||
|
||
var fooFunctions = Query.search("function", "foo").get(); | ||
console.log("# foo functions: " + fooFunctions.length); | ||
|
||
var fooOnlyDeclFunctions = Query.search("function", "fooOnlyDecl").get(); | ||
console.log("# fooOnlyDecl functions: " + fooOnlyDeclFunctions.length); | ||
|
||
var bClasses = Query.search("classType", "B").get(); | ||
console.log("# B classes: " + bClasses.length); | ||
|
||
var cClasses = Query.search("classType", "C").get(); | ||
console.log("# C classes: " + cClasses.length); | ||
|
||
var dCalls = Query.search("classType", "D").search("call").get(); | ||
console.log("# calls in D: " + dCalls.length); |
55 changes: 55 additions & 0 deletions
55
ClavaWeaver/resources/clava/test/api/cpp/results/Code2VecTest.js.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
Warning: using laraImport() for file 'JoinPointsCommonPath.js', however it does not define a variable or class 'JoinPointsCommonPath' | ||
decl (up) file (down) decl | ||
__________________________________ | ||
decl (up) file (down) function (down) param | ||
__________________________________ | ||
decl (up) file (down) function (down) stmt (down) stmt (down) varDecl (down) expr | ||
__________________________________ | ||
decl (up) file (down) function (down) stmt (down) loop (down) stmt (down) varDecl (down) expr | ||
__________________________________ | ||
decl (up) file (down) function (down) stmt (down) loop (down) stmt (down) binary (down) varRef | ||
__________________________________ | ||
decl (up) file (down) function (down) stmt (down) loop (down) stmt (down) binary (down) varRef | ||
__________________________________ | ||
decl (up) file (down) function (down) stmt (down) loop (down) stmt (down) expr (down) varRef | ||
__________________________________ | ||
decl (up) file (down) function (down) stmt (down) loop (down) stmt (down) stmt (down) expr (down) varRef | ||
__________________________________ | ||
decl (up) file (down) function (down) stmt (down) stmt (down) varRef | ||
__________________________________ | ||
decl (up) file (down) decl | ||
__________________________________ | ||
decl (up) file (down) function (down) param | ||
__________________________________ | ||
decl (up) file (down) function (down) stmt (down) stmt (down) varDecl (down) expr | ||
__________________________________ | ||
decl (up) file (down) function (down) stmt (down) loop (down) stmt (down) varDecl (down) expr | ||
__________________________________ | ||
decl (up) file (down) function (down) stmt (down) loop (down) stmt (down) binary (down) varRef | ||
__________________________________ | ||
decl (up) file (down) function (down) stmt (down) loop (down) stmt (down) binary (down) varRef | ||
__________________________________ | ||
decl (up) file (down) function (down) stmt (down) loop (down) stmt (down) expr (down) varRef | ||
__________________________________ | ||
decl (up) file (down) function (down) stmt (down) loop (down) stmt (down) stmt (down) expr (down) varRef | ||
__________________________________ | ||
decl (up) file (down) function (down) stmt (down) stmt (down) varRef | ||
__________________________________ | ||
param (up) function (down) stmt (down) stmt (down) varDecl (down) expr | ||
__________________________________ | ||
param (up) function (down) stmt (down) loop (down) stmt (down) varDecl (down) expr | ||
__________________________________ | ||
param (up) function (down) stmt (down) loop (down) stmt (down) binary (down) varRef | ||
__________________________________ | ||
param (up) function (down) stmt (down) loop (down) stmt (down) binary (down) varRef | ||
__________________________________ | ||
param (up) function (down) stmt (down) loop (down) stmt (down) expr (down) varRef | ||
__________________________________ | ||
param (up) function (down) stmt (down) loop (down) stmt (down) stmt (down) expr (down) varRef | ||
__________________________________ | ||
param (up) function (down) stmt (down) stmt (down) varRef | ||
__________________________________ | ||
varRef (up) binary (down) varRef | ||
__________________________________ | ||
varRef (up) binary (down) varRef | ||
__________________________________ |
10 changes: 10 additions & 0 deletions
10
ClavaWeaver/resources/clava/test/api/cpp/results/LaraCommonLanguageTest.js.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Warning: using laraImport() for file 'JoinPointsCommonPath.js', however it does not define a variable or class 'JoinPointsCommonPath' | ||
line: 1 | ||
is FileJP? : true | ||
# A classes: 1 | ||
# onlyDecl classes: 1 | ||
# foo functions: 1 | ||
# fooOnlyDecl functions: 1 | ||
# B classes: 1 | ||
# C classes: 1 | ||
# calls in D: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <stdio.h> | ||
#include <math.h> | ||
|
||
int foo(int numIter) { | ||
|
||
int acc = 0; | ||
|
||
for(int i=0; i<numIter; i++) { | ||
acc++; | ||
} | ||
|
||
return acc; | ||
} |
79 changes: 79 additions & 0 deletions
79
ClavaWeaver/resources/clava/test/api/cpp/src/lara_common_language.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#include "lara_common_language.h" | ||
|
||
class A; | ||
|
||
class A { | ||
}; | ||
|
||
void foo(); | ||
|
||
void foo(); | ||
|
||
void foo() { | ||
|
||
for(int i=0; i < 10; i++) { | ||
} | ||
|
||
} | ||
|
||
void fooOnlyDecl(); | ||
|
||
void fooOnlyDecl(); | ||
|
||
class classOnlyDecl; | ||
|
||
class classOnlyDecl; | ||
|
||
int main() { | ||
|
||
return 0; | ||
} | ||
|
||
|
||
namespace b { | ||
|
||
class B; | ||
|
||
} | ||
|
||
|
||
namespace b { | ||
|
||
class B; | ||
|
||
class B { | ||
public: | ||
void bar(); | ||
}; | ||
|
||
} | ||
|
||
namespace c { | ||
namespace cc { | ||
class C; | ||
} | ||
} | ||
|
||
namespace c { | ||
namespace cc { | ||
class C { | ||
public: | ||
void bar(); | ||
}; | ||
} | ||
} | ||
|
||
|
||
namespace d { | ||
|
||
class D; | ||
|
||
class D { | ||
void bar(b::B b, c::cc::C c); | ||
}; | ||
} | ||
|
||
void d::D::bar(b::B b, c::cc::C c) { | ||
b.bar(); | ||
c.bar(); | ||
} |
1 change: 1 addition & 0 deletions
1
ClavaWeaver/resources/clava/test/api/cpp/src/lara_common_language.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
class A; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters