From 49fdc47cfce54a7f1a09e0f977d34ea7063e001f Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Sun, 4 Feb 2024 08:40:54 +0800 Subject: [PATCH] feat(docs): add links and code example to usecases and quick-start Added links to ArchGuard, UnitGen, and ChocolateFactory in the usecases.md file to provide more information about these tools. Also, added a code example in the quick-start.md file to demonstrate how to use the AST in Java. --- chapi-ast-cpp/build.gradle.kts | 2 +- docs/quick-start.md | 13 +++++++++++++ docs/usecases/usecases.md | 8 ++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/chapi-ast-cpp/build.gradle.kts b/chapi-ast-cpp/build.gradle.kts index 16d7daf0..fd8e3380 100644 --- a/chapi-ast-cpp/build.gradle.kts +++ b/chapi-ast-cpp/build.gradle.kts @@ -21,8 +21,8 @@ dependencies { implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2") implementation(kotlin("stdlib-jdk8")) + // Kotlin's reflection. implementation(kotlin("reflect")) - // Kotlin reflection. testImplementation(kotlin("test")) // JUnit 5 diff --git a/docs/quick-start.md b/docs/quick-start.md index 2683c9f5..b93a31ea 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -61,3 +61,16 @@ public static void main(String[] args) { } ``` +## 3. Use the AST + +Use the following code to use the AST: + +```java +import chapi.ast.javaast.JavaAnalyser; + +// main +public static void main(String[] args) { + JavaAnalyser analyser = new JavaAnalyser(); + List containerList= analyser.parse("public class HelloWorld { public static void main(String[] args) { System.out.println(\"Hello, World\"); } }", "HelloWorld.java"); + // handle the containerList +``` diff --git a/docs/usecases/usecases.md b/docs/usecases/usecases.md index 94335677..d2f7f65a 100644 --- a/docs/usecases/usecases.md +++ b/docs/usecases/usecases.md @@ -6,3 +6,11 @@ has_children: true permalink: /usecases --- +- [ArchGuard](https://github.com/archguard/archguard) - ArchGuard is an architecture workbench, also for architecture + governance, which can analysis architecture in container, component, code level, create architecture fitness + functions, + and analysis system dependencies. +- [UnitGen](https://github.com/unit-mesh/unit-gen) is a code fine-tuning data framework that generates data from your + existing codebase. +- [ChocolateFactory](https://github.com/unit-mesh/chocolate-factory) is a cutting-edge LLM toolkit designed to empower + you in creating your very own AI assistant.