Giter Site home page Giter Site logo

cpp-decomment's Introduction

cpp-decomment

remove C++ comments and white spaces in source files.

Introduction

This tool remove C++ comments and white spaces in source files.

  • remove C style block comment: "/* ... */"
  • remove C++ sytle single line comment: "//....."
  • remove white spaces.
  • remove text in string literal (optional)
  • output stdout or a file "<input-source-name>.decomment"

日本語解説(Japanese introduction)

このツールは、ソースファイルから、C++のコメントと空白を除去します. コンパイルに影響を与えない余白をソースから除去することにより、 動作に影響するコード修正内容や、コード量の計測に役立ちます.

Usage

decomment [-h?bimqgnsr] [-d<DIR>] file1.cpp file2.cpp ...
  version: 2.0
  -h -?      this help
  -b         keep blank line
  -i         keep indent spaces
  -m         keep minimum space
  -q         remove quoted string
  -g         ignore backslash at end of single line comment
  -n         print line number of input-file
  -s         output to stdout instend of output-files
  -r         [WIN32 only] recursive search under the input-file's folder(wildcard needed)
  -d<DIR>    output to DIR
  fileN.cpp  input-files. wildcard OK. The output-file is 'fileN.cpp.decomment'

Install

git clone https://github.com/hkuno9000/cpp-decomment.git
cd cpp-decomment
make
sudo make install

History

Sep.2016: version 2.0

  • change from New BSD License(BSD 3-Clause License) to MIT License.
  • add -g option
  • support C++11 raw string literal. R"opt(...)opt"

Mar.2015

License

MIT

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.