一個源代碼上下文感知的代碼搜索工具:Cgrep
Cgrep 是一個 grep 的工具,特別適合在大的代碼庫中進行搜索。支持 30 多種編程語言。通過通配符和組合符提供上下文感知的過濾和語義搜索,而不僅僅是簡單的模式匹配。
特性
-
多線程 可以配置jobs數量.
-
超快 Running on a single core it is nearly as fast as GNU grep, up to 6x times faster than ack.
-
多行Multi-line 模式搜索
-
Colors highlight of tokens and strings matching.
-
Recursive searches: Support of language filters and pruning directories.
-
Standard searches: through Boyer–Moore and Posix Regex.
-
Code Tokenizer: Searches as prefix, infix, suffix and edit distance (Levenshtein distance).
-
Context-aware filters distinguish among code, comments and literals in different languages.
-
Languages support for Awk, C, Cpp, Chapel, Csharp, Css, CMake, D, Erlang, Fsharp, Go, Haskell, Html, Java, Javascript, Latex, Lua, Make, OCaml, ObjectiveC, Perl, PHP, Python, Ruby, Scala, Tcl, Text, Shell, Verilog, VHDL, Vim.
-
Semantic searches through wildcards and combinators. _, _1, _2..., $, $1, $2..., ANY, KEY, STR, CHR, NUM, HEX, OCT, OR. E.g. "_1(_1 && $)" search for move constructors, "struct OR class _ { OR : OR <" search for class declarations.
-
自定義輸出 with custom format string, XML and JSON back-ends.