comment-parser


License

License

GroupId

GroupId

io.github.qwefgh90
ArtifactId

ArtifactId

comment-parser_2.11
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

comment-parser
comment-parser
Project URL

Project URL

https://github.com/qwefgh90/comment-parser
Project Organization

Project Organization

io.github.qwefgh90
Source Code Management

Source Code Management

https://github.com/qwefgh90/comment-parser

Download comment-parser_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.qwefgh90/comment-parser_2.11/ -->
<dependency>
    <groupId>io.github.qwefgh90</groupId>
    <artifactId>comment-parser_2.11</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.qwefgh90/comment-parser_2.11/
implementation 'io.github.qwefgh90:comment-parser_2.11:0.1.0'
// https://jarcasting.com/artifacts/io.github.qwefgh90/comment-parser_2.11/
implementation ("io.github.qwefgh90:comment-parser_2.11:0.1.0")
'io.github.qwefgh90:comment-parser_2.11:jar:0.1.0'
<dependency org="io.github.qwefgh90" name="comment-parser_2.11" rev="0.1.0">
  <artifact name="comment-parser_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.qwefgh90', module='comment-parser_2.11', version='0.1.0')
)
libraryDependencies += "io.github.qwefgh90" % "comment-parser_2.11" % "0.1.0"
[io.github.qwefgh90/comment-parser_2.11 "0.1.0"]

Dependencies

compile (4)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.11
io.github.qwefgh90 : jsearch jar 0.3.0
com.googlecode.juniversalchardet : juniversalchardet jar 1.0.3
com.typesafe.scala-logging : scala-logging_2.11 jar 3.5.0

test (2)

Group / Artifact Type Version
org.slf4j : slf4j-simple jar 1.7.25
org.scalatest : scalatest_2.11 jar 3.0.3

Project Modules

There are no modules declared in this project.

Comment Parser

The Comment Parser supports various languages based on FSM. It's written by scala and java.

Prerequisites

  • Java 1.8

Getting comment parser

Comment Parser is published to Sonatype OSS and Maven Central:

  • Group id / organization: io.github.qwefgh90
  • Artifact id / name: comment-parser
  • Latest version is 0.1.0

Add it to your sbt build definition:

libraryDependencies += "io.github.qwefgh90" %% "comment-parser" % "0.1.0"

Add one of them to your maven pom file:

<dependency>
    <groupId>io.github.qwefgh90</groupId>
    <artifactId>comment-parser_2.11</artifactId>
    <version>0.1.0</version>
</dependency>

or

<dependency>
    <groupId>io.github.qwefgh90</groupId>
    <artifactId>comment-parser_2.11</artifactId>
    <version>0.1.0</version>
</dependency>

Using Comment Parser

CommentParser is a main class to extract comments from various files. Import io.github.qwefgh90.commentparser package to your sources to use CommentParser. Also, there is a inner CommentParser.CommentResult class containing a result.

It has four static methods to do that.

You can pass URI object to first parameter.

import io.github.qwefgh90.commentparser.CommentParser;
import java.nio.file.Paths;
import java.util.Optional;
import java.util.List;
Optional<java.util.List<CommentParser.CommentResult>> result = CommentParser.extractComments(Paths.get("C:\\java.java").toUri(), "java.java");

InputStream object can be used to first parameter.

import io.github.qwefgh90.commentparser.CommentParser;
import java.nio.file.Paths;
import java.io.InputStream;
import java.io.File;
import java.util.Optional;
import java.util.List;
File f = Paths.get("C:\\java.java").toFile();
InputStream is = new FileInputStream(f);
Optional<java.util.List<CommentParser.CommentResult>> result = CommentParser.extractComments(is, "java.java");
is.close();

You can pass Charset object to third parameter optionally.

import io.github.qwefgh90.commentparser.CommentParser;
import java.nio.file.Paths;
import java.nio.charset.StandardCharsets;
import java.util.Optional;
import java.util.List;
Optional<java.util.List<CommentParser.CommentResult>> result = CommentParser.extractComments(Paths.get("C:\\java.java").toUri(), "java.java", StandardCharsets.UTF_8);

For more information, You can check API document.

Supported Languages

  • JAVA
  • PY
  • C
  • CPP
  • C_HEADER
  • CPP_HEADER
  • SCALA
  • RUBY
  • GO
  • JS
  • HTML
  • BAT
  • SH
  • XML
  • TEXT
  • MD
  • ETC

Compile & Test

  • sbt compile
  • sbt test

Versions

Version
0.1.0