Skip to content

Commit 3d6503c

Browse files
committed
0.10.2 - Added plugin-js with CLI command string generator script for TypeScript/Javascript. Added more documentation, specifically around CLI usage.
1 parent 5cdf7fa commit 3d6503c

File tree

7 files changed

+59
-13
lines changed

7 files changed

+59
-13
lines changed

.classpath

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<classpath>
33
<classpathentry kind="src" path="src"/>
44
<classpathentry kind="src" path="test"/>
5+
<classpathentry kind="src" path="plugin-js"/>
56
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
67
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
78
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/ANTLR"/>

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ This project does its best to adhere to [Semantic Versioning](http://semver.org/
44

55

66
--------
7-
###[0.10.1](N/A) - 2016-05-13
7+
###[0.10.2](N/A) - 2016-06-21
8+
####Added
9+
* plugin-js to help generate CLI strings from TypeScript/Javascript projects, with Node.js in mind
10+
* Readme section about the CLI
11+
12+
13+
--------
14+
###[0.10.1](https://github.com/TeamworkGuy2/JParserTools/commit/5cdf7fabab17d8d9d8037c83c29047979a6438e7) - 2016-05-13
815
####Changed
916
* Merged DocumentFragmentRef with DocumentFragmentText
1017
* Added some documentation

README.md

+46-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ParserToolsTmp
22
==============
3-
version: 0.10.1
3+
version: 0.10.2
44

55
In progress C#/Java/TypeScript parser tools built atop [JTextParser] (https://github.com/TeamworkGuy2/JTextParser), [Jackson] (https://github.com/FasterXML/jackson-core/) (core, databind, annotations) and half a dozen other utility libraries.
66

@@ -176,3 +176,48 @@ JSON Result (printed to System.out):
176176
}]
177177
}
178178
```
179+
180+
181+
--------
182+
Command Line Interface (CLI):
183+
A command line call looks like:
184+
```
185+
path/to/java -jar path/to/jparser-tools.jar
186+
-sources './src/java/Server/Services=1,[cs];./src/java/Server/Models=3,[cs]'
187+
-destinations './output/Services.json=[App.Services];./output/Models.json=[App.Entities]'
188+
-log './output/parser.log'
189+
```
190+
Where ./src/java/Server/** is where source files are kept
191+
And the files in ./src/java/Server/Services belong to the C# namespace 'App.Services' and ./src/java/Server/Models/ belong to the C# namespace 'App.Entities'
192+
193+
194+
###Sources
195+
A semicolon separated list of paths set equal to a directory depth followed by a comma and a comma separated, brackets wrapped, list of file extensions.
196+
The path, child directory depth, and file extensions are used to create a file system filter and all matching files are parsed.
197+
The following formats are valid:
198+
'path=depth,[fileExt,fileExt,...]'
199+
'path=depth'
200+
'path'
201+
202+
Example: '/project/myApp/Models=3,[java,json]'
203+
Note: the brackets around '[fileExt]' are literla.
204+
205+
206+
###Destinations
207+
A semicolon separated list of output file names associated with lists of namespaces. Each parsed file who's namespace falls into one of these lists is written to that file.
208+
The following format is valid:
209+
'path=[namespace,namespace,...]'
210+
211+
Example: '/project/output/models.json=[MyApp.Models]'
212+
213+
214+
####Log
215+
An optional log file name to write parser information to, in the format:
216+
'path'
217+
218+
Example: '/project/output/parser-log.log'
219+
220+
221+
--------
222+
Plugins:
223+
Currently there is one plugin, a dual purpose TypeScript/Javascript plugin for create the CLI argument strings used by jparser-tools.jar

bin/jparser-tools.jar

334 KB
Binary file not shown.

package-lib.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version" : "0.10.1",
2+
"version" : "0.10.2",
33
"name" : "jparser-tools",
44
"description" : "An in-progress suite of parsing tools for C#, Java, and TypeScript source code",
55
"homepage" : "https://github.com/TeamworkGuy2/JFileIo",

src/twg2/parser/main/MainParser.java

-7
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import twg2.parser.baseAst.tools.NameUtil;
2020
import twg2.parser.codeParser.CodeFileSrc;
2121
import twg2.parser.codeParser.csharp.CsBlock;
22-
import twg2.parser.codeParser.test.CsClassParseTest;
2322
import twg2.parser.language.CodeLanguage;
2423
import twg2.parser.output.WriteSettings;
2524
import twg2.parser.project.ProjectClassSet;
@@ -75,12 +74,6 @@ public static void parseAndValidProjectCsClasses(FileReadUtil fileReader) throws
7574

7675

7776
public static void main(String[] args) throws IOException, FileFormatException {
78-
new CsClassParseTest().simpleCsParseTest();
79-
80-
if(3.1/1.1 > 1.4) {
81-
return;
82-
}
83-
8477
boolean multithread = false;
8578
ExecutorService executor = multithread ? Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()) : null;
8679
FileReadUtil fileReader = FileReadUtil.threadLocalInst();

src/twg2/parser/main/ParserWorkflow.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,9 @@ public static ParserWorkflow parseArgs(String[] args) {
379379
}
380380

381381
Map<String, String> argNames = new HashMap<>();
382-
argNames.put("sources", "sources - a semicolon separated list of strings in the format 'path_string[=depth_int[,[file_extension_string], ..], ..]'. Example: '/project/myApp/Models=3,[java,json]'");
383-
argNames.put("destinations", "destinations - a semicolon separated list of strings in the format 'path_string[=[namespace_string], ..]'. Example: '/project/tmp_files/models.json=[MyApp.Models]'");
384-
argNames.put("log", "log - a log file path in the format 'path_string'. Example: '/project/tmp_files/parser-log.log'");
382+
argNames.put("sources", "sources - a semicolon separated list of strings in the format 'path=depth,[fileExt,fileExt,...];path=depth,[fileExt,fileExt,...];...'. Example: '/project/myApp/Models=3,[java,json]'");
383+
argNames.put("destinations", "destinations - a semicolon separated list of strings in the format 'path=[namespace,namespace,...], ...'. Example: '/project/tmp_files/models.json=[MyApp.Models]'");
384+
argNames.put("log", "log - a log file path in the format 'path'. Example: '/project/tmp_files/parser-log.log'");
385385

386386
List<SourceInfo> srcs = new ArrayList<>();
387387
List<DestinationInfo> dsts = new ArrayList<>();

0 commit comments

Comments
 (0)