Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » IMP » Using other Parser/AST than LPG
Using other Parser/AST than LPG [message #24297] Tue, 30 September 2008 15:31 Go to next message
Marc Ollier is currently offline Marc OllierFriend
Messages: 8
Registered: July 2009
Junior Member
Hello

The IMP Documentation states that the interfaces found in
org.eclipse.imp.parser must be implemented in order to get IMP to work
with another parser than LPG.

However, some of these interfaces contain references to LPG classes. For
example, IParser refers to lpg.runtime.PrsStream.
Could it be that only a subset of the interfaces declared in this package
need to be implemented?

And is it possible to get a picture about which interfaces enable which
services?

Thanks
Marc
Re: Using other Parser/AST than LPG [message #24339 is a reply to message #24297] Tue, 07 October 2008 09:06 Go to previous messageGo to next message
Marc Ollier is currently offline Marc OllierFriend
Messages: 8
Registered: July 2009
Junior Member
I tried it for myself and found out that implementing IParseController and
ISourcePositionLocator is enough for getting the Syntax Coloring,
Outlining and Content Proposal functions.
Re: Using other Parser/AST than LPG [message #24380 is a reply to message #24297] Tue, 07 October 2008 16:15 Go to previous messageGo to next message
Stan Sutton is currently offline Stan SuttonFriend
Messages: 121
Registered: July 2009
Senior Member
Mark,

Very glad to hear about your experience. Unfortunately, we haven't had
the bandwidth to follow through on the exercise of building an IMP IDE
on a parser other than LPG and documenting the results. We should try
to find the time to do that.

As you've noted, we do still have some compilation dependencies on
lpg.runtime. We're still working to eliminate these. However, as I
guess you have seen, some of these dependencies may only be compilation
dependencies and you may be able to use a non-LPG parser so long as
lpg.runtime is in your classpath.

We're very interested in hearing about your experience as you go
forward, both your successes and problems. Especially please let us
know about the problems, either here or through bugzilla, and we'll try
to get those fixed.

Regards,

Stan


Marc Ollier wrote:
> Hello
>
> The IMP Documentation states that the interfaces found in
> org.eclipse.imp.parser must be implemented in order to get IMP to work
> with another parser than LPG.
>
> However, some of these interfaces contain references to LPG classes. For
> example, IParser refers to lpg.runtime.PrsStream. Could it be that only
> a subset of the interfaces declared in this package need to be implemented?
>
> And is it possible to get a picture about which interfaces enable which
> services?
>
> Thanks
> Marc
>
Re: Using other Parser/AST than LPG [message #24419 is a reply to message #24297] Fri, 10 October 2008 18:49 Go to previous message
Robert M. Fuhrer is currently offline Robert M. FuhrerFriend
Messages: 294
Registered: July 2009
Senior Member
Hi,

Marc Ollier wrote:
> Hello
>
> The IMP Documentation states that the interfaces found in
> org.eclipse.imp.parser must be implemented in order to get IMP to work
> with another parser than LPG.

The documentation needs to be more specific. As you observed, there
are several classes (e.g. IParser and ILexer) that are LPG-specific
and therefore aren't part of the required IMP interfaces.

[In fact, at some point in the not-too-distant future, these will be
moved out of the IMP runtime plugin and into an IMP-and-LPG-specific
runtime plugin, if for no other reason than to emphasize that IMP
doesn't treat LPG specially.]

The only required interfaces:

- IParseController

- IMessageHandler (used by the IParseController; if you're using
LPG, you can use the MessageHandlerAdapter to adapt from LPG's
IMessageHandler to IMP's)

Optional interfaces:

- ISourcePositionLocator (optional, but used by many services if
available)

- IModelListener (used by the "modelListener" extension point)

> However, some of these interfaces contain references to LPG classes. For
> example, IParser refers to lpg.runtime.PrsStream. Could it be that only
> a subset of the interfaces declared in this package need to be implemented?
>
> And is it possible to get a picture about which interfaces enable which
> services?

We should add documentation on these dependencies to the online
docs. Thanks for pointing this out.

Hope this helps!

--
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: Using other Parser/AST than LPG [message #573380 is a reply to message #24297] Tue, 07 October 2008 09:06 Go to previous message
Marc Ollier is currently offline Marc OllierFriend
Messages: 8
Registered: July 2009
Junior Member
I tried it for myself and found out that implementing IParseController and
ISourcePositionLocator is enough for getting the Syntax Coloring,
Outlining and Content Proposal functions.
Re: Using other Parser/AST than LPG [message #573405 is a reply to message #24297] Tue, 07 October 2008 16:15 Go to previous message
Stan Sutton is currently offline Stan SuttonFriend
Messages: 121
Registered: July 2009
Senior Member
Mark,

Very glad to hear about your experience. Unfortunately, we haven't had
the bandwidth to follow through on the exercise of building an IMP IDE
on a parser other than LPG and documenting the results. We should try
to find the time to do that.

As you've noted, we do still have some compilation dependencies on
lpg.runtime. We're still working to eliminate these. However, as I
guess you have seen, some of these dependencies may only be compilation
dependencies and you may be able to use a non-LPG parser so long as
lpg.runtime is in your classpath.

We're very interested in hearing about your experience as you go
forward, both your successes and problems. Especially please let us
know about the problems, either here or through bugzilla, and we'll try
to get those fixed.

Regards,

Stan


Marc Ollier wrote:
> Hello
>
> The IMP Documentation states that the interfaces found in
> org.eclipse.imp.parser must be implemented in order to get IMP to work
> with another parser than LPG.
>
> However, some of these interfaces contain references to LPG classes. For
> example, IParser refers to lpg.runtime.PrsStream. Could it be that only
> a subset of the interfaces declared in this package need to be implemented?
>
> And is it possible to get a picture about which interfaces enable which
> services?
>
> Thanks
> Marc
>
Re: Using other Parser/AST than LPG [message #573433 is a reply to message #24297] Fri, 10 October 2008 18:49 Go to previous message
Robert M. Fuhrer is currently offline Robert M. FuhrerFriend
Messages: 294
Registered: July 2009
Senior Member
Hi,

Marc Ollier wrote:
> Hello
>
> The IMP Documentation states that the interfaces found in
> org.eclipse.imp.parser must be implemented in order to get IMP to work
> with another parser than LPG.

The documentation needs to be more specific. As you observed, there
are several classes (e.g. IParser and ILexer) that are LPG-specific
and therefore aren't part of the required IMP interfaces.

[In fact, at some point in the not-too-distant future, these will be
moved out of the IMP runtime plugin and into an IMP-and-LPG-specific
runtime plugin, if for no other reason than to emphasize that IMP
doesn't treat LPG specially.]

The only required interfaces:

- IParseController

- IMessageHandler (used by the IParseController; if you're using
LPG, you can use the MessageHandlerAdapter to adapt from LPG's
IMessageHandler to IMP's)

Optional interfaces:

- ISourcePositionLocator (optional, but used by many services if
available)

- IModelListener (used by the "modelListener" extension point)

> However, some of these interfaces contain references to LPG classes. For
> example, IParser refers to lpg.runtime.PrsStream. Could it be that only
> a subset of the interfaces declared in this package need to be implemented?
>
> And is it possible to get a picture about which interfaces enable which
> services?

We should add documentation on these dependencies to the online
docs. Thanks for pointing this out.

Hope this helps!

--
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)
Previous Topic:Using other Parser/AST than LPG
Next Topic:New release available on update site on SourceForge
Goto Forum:
  


Current Time: Thu Apr 25 13:50:23 GMT 2024

Powered by FUDForum. Page generated in 0.03384 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top