# 代码搜索-索引构建子系统-代码解析器 **Repository Path**: shawshankchau/code-search-index-build-subsystem-parser ## Basic Information - **Project Name**: 代码搜索-索引构建子系统-代码解析器 - **Description**: 代码搜索-索引构建子系统的代码解析器组件 - **Primary Language**: C++ - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2022-02-28 - **Last Updated**: 2023-02-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Method Parser This project is based on [tree-sitter](https://tree-sitter.github.io/tree-sitter/) development, used to parse out the function signature and function method from the source code. Program languages that currently support parsing are: - [x] Go - [x] Java - [x] JavaScript - [x] Python - [x] Ruby ## Prerequisites This project uses [Bazel](https://bazel.build/install) build system, so you need to first install [Bazel](https://bazel.build/install) ## Build Go to project directory and run `bazel build :method-parser`.After finishing building,the location of the executable file is `bazel-bin\method-parser` ## Usage ```shell ./method-parser --help method-parser: Use this program to parse methods from source code! Flags from src/main.cpp: -bootstrap_type (command_line or unix_socket) type: string default: "command_line" -language (program language, this option only works if ) type: string default: "" -path (unix like path, unix socket file path, this option only works if ) type: string default: "" -source_code (source code, this option only works if ) type: string default: "" ``` ### Command line ```shell method-parser -language=${source_code_language} -source_code=${source_code} ``` ### Unix Socket (Developing) ```shell method-parser -bootstrap_type="unix_socket" -path=${unix_socket_path} ``` ## Test After finishing building this project, go to the project directory and run the shell_script: `run_test.sh`. You can put your source code in `test/`, the shell script will read all source code files in `test/` and pass them to method parser, finally echo the output in terminal.