-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CPG Console #435
Merged
Merged
CPG Console #435
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
3d2ec7e
++
oxisto 0a3d4e9
Added CPG console plugins
oxisto 0316023
Merge branch 'master' into cpg-console
oxisto 970da40
Added value resolver
oxisto c5a1fff
starting out of bounds check
oxisto 922cefe
byName now supports a simple nested level
oxisto 0d4f8ba
Shorter, more concise toString() output for console
oxisto b3bb438
Fixed test
oxisto 45fc070
Simple Nullpointer detection
oxisto cf0f943
Fixed go tests
oxisto 1e9f252
Code cleanup. Added CouldNotResolve class
oxisto 07cefc1
nice formatting of NPE
oxisto 8ac3465
First attempt at code coloring
oxisto ada2961
First integration of syntax highlighting in console
oxisto d9c4bbc
Added more coloring
oxisto d9081f9
Even more syntax highlighting
oxisto 6099892
Tutorial
oxisto f7c56c9
added tutorial
oxisto 15f482a
tutorial ++, but needs more shortcut functions
oxisto fe72ecb
Playing around with formatting
oxisto d036bae
Fixed stuff
oxisto 8d80537
++
oxisto 2dc1d84
++
oxisto 3c9149e
++
oxisto aafc15f
++
oxisto 3bd434f
better tostring
oxisto f53ebf4
++
oxisto d839086
Merge branch 'master' into cpg-console
oxisto fe4bb07
Merge branch 'master' into cpg-console
oxisto a0be96c
Deactivate go as default language
konradweiss 85bf357
Revert "Deactivate go as default language"
konradweiss d027ae0
Some cleanup
oxisto dfe542b
Merge branch 'master' into cpg-console
oxisto c8c6999
Removing addition of experimental language
konradweiss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the :a command should be replaced with :tr I think.