Parsing Java code with Java

前端 未结 5 1235
予麋鹿
予麋鹿 2021-01-29 11:32

Is it possible to parse some Java code with a regex?

So let\'s say I want a list of the int variables from this:



        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-29 12:12

    You can try with regular expressions, but it may be easier to user a Java Parser. You can try JavaCC.

提交回复
热议问题