[otj-users] parser for OT/J
Stephan Herrmann
stephan at cs.tu-berlin.de
Wed Jun 11 22:02:49 CEST 2008
Hi Miguel,
> Is there some parser available for OT/J?
Of course! We wouldn't be able compile OT/J without a parser ;-)
> Also, is there a complete and up to date grammar for OT/J available somewhere?
> I suppose one could build a grammar from the language definition document, but it
> would be nice if there were some complete and up to date grammar available.
The grammar that is in production is
https://svn.objectteams.org/trac/ot/browser/trunk/src/plugins/org.eclipse.jdt.core/grammar/otj_jp.g
But be warned that this grammar is not an easy read, because it is written under the tight
constraints of an LALR(1) parser generator, and additionally contains stuff for error recovery etc.
Also note, that this grammar contains rules for an experimental join point query language that
is not currently supported.
So, I'd actually recommend to directly use the Eclipse Java AST, if that is in any way feasible
for what you're planning to do. This AST has been extended to contain nodes for all OT/J elements.
Plus you'd get the benefit of a plethora of utilities built around this AST.
Should you need some pointers for working with this AST, please feel free to ask.
I might note, that we did have a JavaCC parser, but I currently couldn't tell about the
state of this piece of work.
cheers,
Stephan
More information about the otj-users
mailing list