Build your own languages with JavaCC

JavaCC makes it a snap to write your own compiler or interpreter for languages of your own design in Java

1 2 Page 2
Page 2 of 2

Conclusion

JavaCC, a parser generator for Java, makes writing parsers for programming languages a snap. JavaCC provides a high-level notation for defining grammars, and a concise specification for grammars and associated actions. It's also easy to read. Especially useful for Java programmers are the Java grammars that are part of the JavaCC distribution. (The Java 1.2 grammar is a separate download.) Based on those grammars you can create your own set of nifty Java tools such as your own version of javadoc, a Java interpreter, or a Java printer. There really is no limit to what you can do.

JavaCC includes two additional tools. JJDoc automatically generates documentation in HTML for your grammar in a fashion similar to javadoc. JJTree automatically generates actions that build a tree structure when parsing a program. It provides a framework based on the Visitor design pattern that allows you to traverse the parse tree in memory.

Oliver Enseling is a seasoned software architect. Programming has been his passion since he was 16. A Sun-certified Java developer, Oliver works on distributed systems development in the Twin Cities area of Minnesota.

Learn more about this topic

1 2 Page 2
Page 2 of 2