<< It Could Go Either Way | Home | Thursday Silly Contest: Are You 250 Years Old >>

Friday Java Quiz: How Many Parser Generator Runtimes Does The Sun JDK include?

This months OCI internal Java lunch is an introduction to ANTLR 3 and AntlrWorks by Dean Wette. I didn't take good notes, so I can't do a live blog today.

Like what I did 7 days ago with the St. Louis JUG meeting, I'm going to turn the talk into a Java Quiz. (Dean did ask me "No Friday Java Quiz today?" to which I replied "No.")

Well, Friday is not over yet. And Dean may be surprised to find this quiz when he gets back to the client site. I do have a parser generator related question for you. To set it up, let me just mention that if you write a parser in Antlr 3, you will have to ship the Antlr 3 runtime with your final product. This is not the case for JavaCC.

Now the question: How many parser-generator runtimes does the Sun JDK (say Java 6) contain? What are they?



Re: Friday Java Quiz: How Many Parser Generator Runtimes Does The Sun JDK include?

Yeah! Friday quiz. Boohoo! I don't know the answer.

Re: Friday Java Quiz: How Many Parser Generator Runtimes Does The Sun JDK include?

I don't know the answer either. But I know at least one such runtime in the JDK.

Re: Friday Java Quiz: How Many Parser Generator Runtimes Does The Sun JDK include?

If you're talking about the JavaCup parser generator runtime, that's only there because the builtin version of Xalan/XSLTC relies on it. It's merely a JDK implementation detail and as such you can't really depend on it being there for your shipping applications.

Or is there something else in there with a supported API? Would be nice to know.

Re: Friday Java Quiz: How Many Parser Generator Runtimes Does The Sun JDK include?

That's the one I know. I stumbled upon the com.sun.java_cup.internal.runtime.lr_parser class when I tried to search for "*parser" in IDEA.

This particular quiz question is for your amusement only. I'm not advocating anyone to use this undocumented feature. However, the fact that Sun see it fit to use JavaCup in the JDK ought to prompt the curious person to give it another look.


Add a comment Send a TrackBack