Coder Social home page Coder Social logo

xuck-devel / simplestepcounter Goto Github PK

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

Simple step counter for multi-language,with CLI & Java API

Home Page: https://github.com/xuck-devel/SimpleStepCounter#readme

Batchfile 2.26% Shell 2.35% Java 95.39%
stepcounter multi-language costomizable java cli bat shell

simplestepcounter's Introduction

SimpleStepCounter

Simple step counter for multi-language,with CLI & Java API

function overview

  • use as CLI,as automation for getting steps of many source files,aggregating,and so on.
  • also use as Java API,for development of your programs/tools.
  • multi-language support,by customizing configuration files.

how to use

as CLI:

1.call SimpleStepCounter as below:
 
for windwos:

call SimpleStepCounter.bat [rootdir including files getting steps] [output file]

for linux,other unix:

./SimpleStepCounter.sh [rootdir including files getting steps] [output file]

2.get [output file]. If need, also get log file([output file].log):
 

3.use output file(tab divided text file),by looking text editor,copy into spreadsheet,use as another program input,and so on.

as Java API:

1.add SimpleStepCounter.jar into your classpath.If use Eclipse,import Eclipse project(eclipse_project/SimpleStepCounter) into your workspace.

2.call API as below from you Java code.

File yourfile;
 
//get line count
util.stepcounter.StepCounter.getLineCount(yourfile);
 
//get execution step count,excluding comments,empty lines
util.stepcounter.StepCounter.getExecStep(yourfile);  

multi-language support

for multi-language support,change StepCounter.properties as below:

1.add supported_filetypes(in this sample, add "cppsample")

supported_filetypes=java,c,shell,general1,general2,cppsample  

2.add configration for your types ,as below:

#extentions of appended filetype
cppsample.extentions=cpp,hpp
 
#block comment start string
cppsample.blockCommentStart=/*
 
#block comment end string
cppsample.blockCommentEnd=*/
 
#line comment start string
cppsample.lineCommentStart=//
 
#line comment end string
cppsample.lineCommentEnd=\n
 
#char literal start character
cppsample.charLiteralDelim='
 
#char literal escape character
cppsample.escapeChar_charLiteral=\\
 
#string literal start character
cppsample.stringLiteralDelim="
 
#string literal escape character
cppsample.escapeChar_stringLiteral=\\

simplestepcounter's People

Contributors

xuck-devel avatar

Stargazers

 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.