-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds basic reachability integeration in cli
- Loading branch information
Showing
11 changed files
with
335 additions
and
7 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
members = [ | ||
"extlib/berkeleydb", | ||
"extlib/millhone", | ||
"extlib/reachability", | ||
"tools/diagnose", | ||
] | ||
|
||
|
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 @@ | ||
[package] | ||
name = "reachability" | ||
version = "0.0.1" | ||
edition = "2021" | ||
|
||
[features] | ||
default = [] | ||
|
||
[dependencies] | ||
tikv-jemallocator = { version = "0.5.4", optional = true } | ||
clap = { version = "4.0.0", features = ["derive"] } | ||
simple_logger = { version = "4.3.3", features = ["stderr", "colors"], default-features = false } | ||
log = "0.4.17" | ||
snippets = { git = "https://github.com/fossas/lib-snippets", version = "0.2.0", features = ["lang-java-11"] } | ||
stable-eyre = "0.2.2" | ||
serde = { version = "1.0.144", features = ["derive"] } | ||
serde_json = "1.0.85" |
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,21 @@ | ||
# reachability | ||
|
||
Parses source code, and produces call graphs for | ||
set of source code files. | ||
|
||
## usage | ||
|
||
```shell | ||
; reachability --target {directory} | ||
; reachability --target {path_to_file} | ||
|
||
# with stdin | ||
; cat {file} | reachability | ||
``` | ||
|
||
## building | ||
|
||
In the root directory, run `cargo build --bin reachability`. | ||
If release mode is desired, append `--release`. | ||
|
||
Output symbols are found in `target/debug/reachability` or `target/release/reachability`. |
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,33 @@ | ||
//! Parses language source code to create call graphs. | ||
//! | ||
//! # Supported Parser | ||
//! - Java | ||
use log::debug; | ||
use serde::Serialize; | ||
use snippets::content::Content; | ||
use stable_eyre::{eyre::Context, Result}; | ||
use std::io::{self, Read}; | ||
use std::path::PathBuf; | ||
|
||
#[derive(Debug, Serialize)] | ||
pub struct Reachability {} | ||
|
||
impl Reachability { | ||
pub fn from_stdin() -> Result<Self> { | ||
let mut stdin = String::new(); | ||
io::stdin() | ||
.read_to_string(&mut stdin) | ||
.context("buffer stdin")?; | ||
Reachability::from_string(&stdin) | ||
} | ||
|
||
pub fn from_string(s: &str) -> Result<Self> { | ||
let _content = Content::new(s.into()); | ||
todo!(); | ||
} | ||
|
||
pub fn from_fs(path: &PathBuf) -> Result<Self> { | ||
debug!("Parsing file system: {path:?}"); | ||
todo!(); | ||
} | ||
} |
Oops, something went wrong.