luozongle01 commented on code in PR #2206:
URL: https://github.com/apache/zookeeper/pull/2206#discussion_r1860637296


##########
zookeeper-jute/src/main/java/org/apache/jute/compiler/generated/rcc.jj:
##########
@@ -274,22 +261,37 @@ JRecord Record() :
     ArrayList<JField> flist = new ArrayList<JField>();
     Token t;
     JField f;
+    // Get the comments on the class token
+    Token recordTkn;
+    Token rbraceTkn;
 }
 {
-    <RECORD_TKN>
+    recordTkn = <RECORD_TKN>
     t = <IDENT_TKN>
     { rname = t.image; }
     <LBRACE_TKN>
     (
         f = Field()

Review Comment:
   > I think 
[`getToken(1)`](https://www.cs.purdue.edu/homes/hosking/javacc/doc/apiroutines.html#getToken)
 could help you eliminating most intrusive code.
   > 
   > ```
   > { typeToken = getToken(1) }
   > ```
   > 
   > Then most changes should resides in `Record()`.
   
   Oh, I've been searching for a long time before. I was looking for an API 
that could traverse tokens, but I couldn't find it. I didn't expect to find 
such an API. I'll give it a try. 



-- 
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

Reply via email to