-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ++ * Added CPG console plugins * Added value resolver * starting out of bounds check * byName now supports a simple nested level * Shorter, more concise toString() output for console * Fixed test * Simple Nullpointer detection * Fixed go tests * Code cleanup. Added CouldNotResolve class * nice formatting of NPE * First attempt at code coloring * First integration of syntax highlighting in console * Added more coloring * Even more syntax highlighting * Tutorial * added tutorial * tutorial ++, but needs more shortcut functions * Playing around with formatting * Fixed stuff * ++ * ++ * ++ * ++ * better tostring * ++ * Deactivate go as default language * Revert "Deactivate go as default language" This reverts commit a0be96c. * Some cleanup * Removing addition of experimental language Co-authored-by: Konrad Weiss <[email protected]>
- Loading branch information
1 parent
856e233
commit 866e599
Showing
56 changed files
with
2,125 additions
and
142 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# | ||
# https://help.github.com/articles/dealing-with-line-endings/ | ||
# | ||
# These are explicitly windows files and should use crlf | ||
*.bat text eol=crlf | ||
|
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,5 @@ | ||
# Ignore Gradle project-specific cache directory | ||
.gradle | ||
|
||
# Ignore Gradle build output directory | ||
build |
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,17 @@ | ||
# CPG Console | ||
|
||
```bash | ||
../gradlew installDist | ||
build/install/cpg-console/bin/cpg-console | ||
``` | ||
|
||
The following example snippet can be used: | ||
|
||
```kotlin | ||
:a src/test/resources/array.cpp | ||
var tu = result.translationUnits.first() | ||
var main = tu.byName<FunctionDeclaration>("main") | ||
:code main? | ||
var decl = main?.body<DeclarationStatement>(0) | ||
var v = decl?.singleDeclaration as? VariableDeclaration | ||
``` |
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,63 @@ | ||
/* | ||
* Copyright (c) 2021, Fraunhofer AISEC. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* $$$$$$\ $$$$$$$\ $$$$$$\ | ||
* $$ __$$\ $$ __$$\ $$ __$$\ | ||
* $$ / \__|$$ | $$ |$$ / \__| | ||
* $$ | $$$$$$$ |$$ |$$$$\ | ||
* $$ | $$ ____/ $$ |\_$$ | | ||
* $$ | $$\ $$ | $$ | $$ | | ||
* \$$$$$ |$$ | \$$$$$ | | ||
* \______/ \__| \______/ | ||
* | ||
*/ | ||
plugins { | ||
application | ||
} | ||
|
||
application { | ||
mainClass.set("de.fraunhofer.aisec.cpg.console.CpgConsole") | ||
} | ||
|
||
tasks.withType<Test> { | ||
useJUnitPlatform { | ||
if (!project.hasProperty("integration")) { | ||
excludeTags("integration") | ||
} | ||
} | ||
} | ||
|
||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { | ||
kotlinOptions.jvmTarget = "1.8" // important, since ki is 1.8 and otherwise inlining wont work | ||
} | ||
|
||
val versions = mapOf( | ||
"junit5" to "5.6.0" | ||
) | ||
|
||
dependencies { | ||
// CPG | ||
api(project(":cpg-library")) | ||
api(project(":cpg-neo4j")) | ||
|
||
// JUnit | ||
testImplementation("org.junit.jupiter", "junit-jupiter-api", versions["junit5"]) | ||
testImplementation("org.junit.jupiter", "junit-jupiter-params", versions["junit5"]) | ||
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine", versions["junit5"]) | ||
|
||
implementation("org.jline:jline:3.20.0") | ||
|
||
implementation("org.jetbrains.kotlinx:ki-shell:0.3.3") | ||
} |
Oops, something went wrong.