Coder Social home page Coder Social logo

jayanth-mkv / rust-cpp-function-parser Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3 KB

This Rust project is a C++ function parser that converts C++ function code from an input file into a JSON representation. The output is saved in `output.json`.

C++ 3.07% Rust 96.93%

rust-cpp-function-parser's Introduction

Rust Project - C++ Function Parser

This Rust project is a C++ function parser that converts C++ function code from an input file into a JSON representation. The output is saved in output.json.

Usage

To run the project, follow these steps:

  1. Make sure you have Rust and Cargo installed on your system.

  2. Clone the repository or download the source code.

  3. Navigate to the project directory in your terminal.

  4. Run the following command to build the project:

    cargo build

    This will compile the Rust project and its dependencies.

  5. Create an input.cpp file in the project folder. This file should contain the C++ function code you want to convert.

  6. Run the following command in your terminal:

    cargo run -- input.cpp

    This will execute the Rust project and convert the C++ function code from the input.cpp file.

  7. After running the command, the project will generate the output in the output.json file, which will contain the JSON representation of the C++ function code.

Example

Suppose you have the following C++ function code in the input.cpp file:

#include <iostream>

int main() {
    std::cout << "Hello, World!";
    return 0;
}

Running the command cargo run -- input.cpp will generate the output.json file with the following content:

{
    "function": "#include <iostream>\n\nint main() {\n    std::cout << \"Hello, World!\";\n    return 0;\n}"
}

Requirements

  • Rust (and Cargo) installed on your system

License

This project is licensed under the MIT License.

rust-cpp-function-parser's People

Contributors

jayanth-mkv avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.