kezhuw commented on code in PR #2206: URL: https://github.com/apache/zookeeper/pull/2206#discussion_r1818339448
########## zookeeper-jute/src/main/java/org/apache/jute/compiler/JRecord.java: ########## @@ -767,4 +780,30 @@ public static String getCsharpFQName(String name) { } return fQName.toString(); } + + protected String getRecordComments() { + if (mRecordToken == null || mRecordToken.specialToken == null) { + return null; + } + + StringJoiner joiner = new StringJoiner("\n * ", "/**\n * ", "\n */\n"); + Token tmpTkn = mRecordToken.specialToken; + while (tmpTkn.specialToken != null) { + tmpTkn = tmpTkn.specialToken; + } + + while (tmpTkn != null) { + String image = tmpTkn.image.trim(); + tmpTkn = tmpTkn.next; + if (image.startsWith("//")) { Review Comment: The capture does not shaped well for directly usage. I tasted the following capture, and it captured a complete line comment. This way we can output whatever it captured without post work. ``` SPECIAL_TOKEN : { <SINGLE_LINE_COMMENT: "//" (~["\n","\r"])* ("\n"|"\r"|"\r\n")> } ``` See also https://javacc.github.io/javacc/tutorials/token-manager.html -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@zookeeper.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org