6 ms·
Ask HN: Parser for Java
I've done google searches, and generally get back Parser Generators in Java / how to write Parsers in Java.
What I want instead, is just a single industrial parser that can parse Java source code (like anything that the jvm can run). (Doing some really simple static analysis stuff).
Is there anything "official" that's easy to modify, like a parser from Sun or IBM or eclipse?
Thanks!
- scotth 17y agoI believe that one of the ANTLR examples (as provided in the source download), is a Java parser. http://www.antlr.org/ http://www.antlr.org/
- robdimarco 17y agoAre you looking for JavaCC? https://javacc.dev.java.net/ https://javacc.dev.java.net/
- adatta02 17y agoEclipse has the JDT package which gives you access to the parser that Eclipse uses internally.
- live_to_code 17y agoAh; this is closest to what I want; though if I can use the Sun one Sun uses for javac, it'd be even better.
- skybrian 17y agoYes, Javac is open source. You can't get any more official than that. http://openjdk.java.net/groups/compiler/ http://openjdk.java.net/groups/compiler/
- JimmyL 17y ago>> industrial parser that can parse Java source code (like anything that the jvm can run) Do you mean a parser for Java source code or bytecode? I would guess the former, but the reference to "anything that the jvm can run" suggests you may be looking for bytecode...
- live_to_code 17y agoJava source code.