You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
0.7.0 - Fixed toJson() issue and default behavior now prints empty annotation arguments map. Updated to use latest version of JTextParser and JStreamish, including switch from StringLineSupplier to new CharLineSuppler. Moved twg2.parser.test package to separate test directory.
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.
6
6
7
-
####The Goal:
7
+
####Goals:
8
8
* A competent source code parser that can turn C#, Java, or JavaScript/TypeScript code into a simple AST like structure ('competent' meaning this project aims to support common use cases, not every syntatic feature of the supported languages).
9
9
* A 'code first' parser aimed at manipulating the resulting AST and writing it back as source code or JSON. With the goal of allowing simple language constructs like interfaces and data models to be transpiled to different languages.
10
10
@@ -19,39 +19,51 @@ Example:
19
19
Source Code (SimpleCs.cs):
20
20
```C#
21
21
namespaceParserExamples.Samples {
22
-
22
+
23
23
/// <summary>
24
24
/// A simple class to test parsing.
25
25
/// </summary>
26
26
publicclassSimpleCs {
27
-
27
+
28
+
/// <value>The modification count.</value>
29
+
privateintmod;
30
+
31
+
/// <value>The name.</value>
32
+
privatestring_name;
33
+
28
34
/// <value>The names.</value>
29
-
publicIList<string> Names { get; set; }
30
-
35
+
publicIList<string> Names { get; }
36
+
31
37
/// <value>The number of names.</value>
32
-
publicintCount { get; set; }
33
-
38
+
publicintCount { set; }
39
+
40
+
/// <value>The access timestamps.</value>
41
+
publicDateTime[] accesses { set { this.mod++; this.accesses=value; } }
42
+
43
+
/// <value>The access timestamps.</value>
44
+
publicstringname { get { this.mod++; returnthis._name; } set { this.mod++; this._name=value; } }
usingSystem.ServiceModel;usingSystem.ServiceModel.Web;usingParserExamples.Models;usingParserExamples.Searching;namespaceParserExamples.Services{/// <summary>/// This interface provides the contract for track searching./// </summary>/// <remarks>/// Implementations are expected to be effectively thread-safe./// </remarks>[ServiceContract]publicinterfaceITrackSearchService{/// <summary>/// Searches tracks./// </summary>/// <param name="criteria">The search criteria</param>/// <returns>The search result</returns>[OperationContract][WebInvoke(Method="POST",UriTemplate="/TrackSearch",RequestFormat=WebMessageFormat.Json,ResponseFormat=WebMessageFormat.Json)][TransactionFlow(TransactionFlowOption.Allowed)]SearchResult<TrackInfo>Search(TrackSearchCriteriacriteria){;}/// <summary>/// Searches tracks that have past due date./// </summary>/// <param name="albumName">The album name</param>/// <returns>The search result</returns>[OperationContract][WebInvoke(Method="POST",UriTemplate="/GetAlbumTracks?albumName={albumName}",ResponseFormat=WebMessageFormat.Json)][TransactionFlow(TransactionFlowOption.Allowed)]SearchResult<IDictionary<AlbumInfo,IList<TrackInfo>>>GetAlbumTracks(stringalbumName){contentof block;}}}
1
+
usingSystem.ServiceModel;
2
+
usingSystem.ServiceModel.Web;
3
+
usingParserExamples.Models;
4
+
usingParserExamples.Searching;
5
+
6
+
namespaceParserExamples.Services
7
+
{
8
+
/// <summary>
9
+
/// This interface provides the contract for track searching.
10
+
/// </summary>
11
+
/// <remarks>
12
+
/// Implementations are expected to be effectively thread-safe.
Stringprefix = comment.getLineStart() < i ? "" : line.substring(0, comment.getColumnStart()); // if the token started on a previous line, there is no prefix text before it starts on this line
68
+
Stringprefix = comment.getLineStart() < i ? "" : newString(line, 0, comment.getColumnStart()); // if the token started on a previous line, there is no prefix text before it starts on this line
0 commit comments