Parsing Java code with Java

前端 未结 5 1276
予麋鹿
予麋鹿 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:14

    You would probably want to use a more advanced grammar parsing application than regex. You could for example look into ANTLR which also has various grammars available.

提交回复
热议问题