Personal code that I've developed to parse and represent OBO files, in Java.
http://www.geneontology.org/GO.format.obo-1_2.shtml
This will ultimately be replaced with a more formal parser based on Chris Mungall's OBO BNF:
http://berkeleybop.org/~cjm/obo2owl/obo-syntax.html
I've experimented with grammars for the latter in both JavaCC and ANTLR ; what grammars are currently available are placed in the grammars/ directory.