Home » Archived » IMP » Parser message adaptation/customization
Parser message adaptation/customization [message #25297] |
Fri, 07 November 2008 22:50 |
Robert M. Fuhrer Messages: 294 Registered: July 2009 |
Senior Member |
|
|
Hi All,
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?
--
Cheers,
-- Bob
--------------------------------
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)
|
|
|
Re: Parser message adaptation/customization [message #25457 is a reply to message #25297] |
Wed, 12 November 2008 20:37 |
Stan Sutton Messages: 121 Registered: July 2009 |
Senior Member |
|
|
I think there are really two questions implicit in the one question that
Bob asks at the end of his posting.
One is, should we provide some support for customizing parser messages,
regardless of the parser technology used?
The other is, should we provide a more convenient way to customize
parser messages from an LPG parser as used with our standard
SimpleLPGParseController?
I'm inclined to answer "yes" to both questions.
In both cases, the IDE developer can customize messages by developing or
modifying the parse controller implementation, but in either case that
may be more work than the developer really wants to undertake. So it
would be good if we could provide some help.
Since we want to facilitate the use of LPG, I think it makes sense for
us to facilitate the customization of messages from LPG-generated
parsers. To do this, we can leverage the other components that we
supply for use with LPG, such as the MessageHandlerAdapter and the
SimpleLPGParseController (or the language-specific extensions that we
generate for it).
But we don't want to restrict IMP users to use LPG, so it would also be
nice to have some avenue to customization of messages from any parser
(or for alternative implementations for the parse controller).
Customization approaches that are geared for use with LPG may not work
well for other parser technologies.
There are probably some additional questions lurking in here, but I'm
going to leave it at that for now.
Bob and I have discussed this without coming to any conclusion, and we'd
really like to get some other perspectives!
Thanks,
Stan Sutton
Robert M. Fuhrer wrote:
> Hi All,
>
> 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?
>
|
|
| |
Re: Parser message adaptation/customization [message #574148 is a reply to message #25297] |
Wed, 12 November 2008 20:37 |
Stan Sutton Messages: 121 Registered: July 2009 |
Senior Member |
|
|
I think there are really two questions implicit in the one question that
Bob asks at the end of his posting.
One is, should we provide some support for customizing parser messages,
regardless of the parser technology used?
The other is, should we provide a more convenient way to customize
parser messages from an LPG parser as used with our standard
SimpleLPGParseController?
I'm inclined to answer "yes" to both questions.
In both cases, the IDE developer can customize messages by developing or
modifying the parse controller implementation, but in either case that
may be more work than the developer really wants to undertake. So it
would be good if we could provide some help.
Since we want to facilitate the use of LPG, I think it makes sense for
us to facilitate the customization of messages from LPG-generated
parsers. To do this, we can leverage the other components that we
supply for use with LPG, such as the MessageHandlerAdapter and the
SimpleLPGParseController (or the language-specific extensions that we
generate for it).
But we don't want to restrict IMP users to use LPG, so it would also be
nice to have some avenue to customization of messages from any parser
(or for alternative implementations for the parse controller).
Customization approaches that are geared for use with LPG may not work
well for other parser technologies.
There are probably some additional questions lurking in here, but I'm
going to leave it at that for now.
Bob and I have discussed this without coming to any conclusion, and we'd
really like to get some other perspectives!
Thanks,
Stan Sutton
Robert M. Fuhrer wrote:
> Hi All,
>
> 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?
>
|
|
| |
Goto Forum:
Current Time: Wed May 08 05:54:36 GMT 2024
Powered by FUDForum. Page generated in 0.03953 seconds
|