|Parser message adaptation/customization [message #574026]
||Fri, 07 November 2008 17:50
| Robert M. Fuhrer
Registered: July 2009
It's recently come to light that some of our users don't like the
messages coming out of the parsers they're using, and they would
thus like to customize the messages (e.g. to make them more human-
consumable) without changing the parser itself.
IMP presently defines an IMessageHandler interface that it passes
into the IParseController so that the IParseController has a place
to which to direct messages coming out of the parser.
So, it's presently possible to customize parser messages by changing
the IParseController (or whatever actually passes messages to the
IMessageHandler) to modify the messages before handing them upward.
That said, at least when using LPG and the SimpleLPGParseController,
the spot to customize is buried in the class MessageHandlerAdapter,
which adapts the LPG-defined message handling interface (sadly also
called IMessageHandler) to whatever implements the IMP-defined
IMessageHandler interface. So one would have to replace the
MessageHandlerAdapter with something that does the appropriate
message fiddling, and instantiate that in your IParseController's
override of parse().
So our question to you, dear Reader, if you're not already blind
at this point, is:
Is this arrangement complicated enough that we ought to provide a
more direct and obvious way to customize parser messages?
Robert M. Fuhrer
Research Staff Member
Programming Technologies Dept.
IBM T.J. Watson Research Center
IDE Meta-tooling Platform Project Lead (http://www.eclipse.org/imp)
X10: Productive High-Performance Parallel Programming (http://x10.sf.net)
Powered by FUDForum
. Page generated in 0.01628 seconds