Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » IMP » Using IMP for LPG in non-IMP target
Using IMP for LPG in non-IMP target [message #26007] Thu, 15 January 2009 20:34 Go to next message
Eclipse User
Originally posted by: mike.aol.com

I need to use LPG for parsing data within my application, and I would
like to use the IMP tooling to help me build it. The application, in one
of its forms, is not even eclipse, so I have to embed the lpg runtime in
my application. It looks like IMP might be helpful for developing my
parser, but I'm not so sure. The default grammar created by the New LPG
Grammar (non-IMP) generates an example lexer.gi file that cannot resolve
its reference to LexerVeryBasicMapF.gi. It is defined in the
org.eclipse.imp.lpg.metatooling_0.1.79/templates directory which is the
value of the LPG include path, so why does it generate the "could not be
read" error? Even when I copy the .gi file into the same directory as
the generated FoobarLexer.gi, it doesn't get found. The LPG preferences
let me override the include path, but I really would like to use a
relative path to my workspace or project. That doesn't seem to work either.

I'm simultaneously trying to learn LPG, so I'm sure there is a simple
solution. I would expect the generated grammar to compile without change.

Mike Gering
Re: Using IMP for LPG in non-IMP target [message #26050 is a reply to message #26007] Mon, 19 January 2009 13:20 Go to previous messageGo to next message
Eclipse User
Originally posted by: mike.aol.com

I've learned a few things and have answered (most) of my questions. What
I've learned is that I can use the IMP grammar editor for a non-IMP
project is mostly ok. But I should use my own external tool launcher to
invoke the lpg generator. And I should avoid using templates that rely
on the IMP infrastructure.

Mike Gering
Re: Using IMP for LPG in non-IMP target [message #26090 is a reply to message #26050] Tue, 20 January 2009 08:42 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
Hi Mike

Your experiences sound very familiar. Unfortunately I've forgotten
the details of the stupid mistakes I made and how I solved them.

While your problems are fresh in your mind it might be helpful
to share them.

I suspect that there are at least a couple of examples or wizards
that should be adjusted to be more helpful.

Regards

Ed Willink
Re: Using IMP for LPG in non-IMP target [message #26131 is a reply to message #26050] Fri, 23 January 2009 03:15 Go to previous messageGo to next message
Jin Missing name is currently offline Jin Missing name
Messages: 100
Registered: July 2009
Senior Member
Mike,
The dependence between the lpg for non-imp is minimal as my memory, only two
interfaces( IParser,ILexer). You can simply copy these files to your
standalone package. It is nearly clear.
The gramme dependence aslo can be extracted from some projects
(...metatooling.., sorry for forgetting^_^). But the runtime is not related
to this gramme files dependence, so you can ignore this problem.

Jin

"Mike Gering" <mike@aol.com>
> I've learned a few things and have answered (most) of my questions. What
> I've learned is that I can use the IMP grammar editor for a non-IMP
> project is mostly ok. But I should use my own external tool launcher to
> invoke the lpg generator. And I should avoid using templates that rely on
> the IMP infrastructure.
>
> Mike Gering
Re: Using IMP for LPG in non-IMP target [message #26851 is a reply to message #26007] Tue, 24 February 2009 15:13 Go to previous message
Robert M. Fuhrer is currently offline Robert M. Fuhrer
Messages: 294
Registered: July 2009
Senior Member
Mike Gering wrote:
> I need to use LPG for parsing data within my application, and I would
> like to use the IMP tooling to help me build it. The application, in one
> of its forms, is not even eclipse, so I have to embed the lpg runtime in
> my application. It looks like IMP might be helpful for developing my
> parser, but I'm not so sure. The default grammar created by the New LPG
> Grammar (non-IMP) generates an example lexer.gi file that cannot resolve
> its reference to LexerVeryBasicMapF.gi. It is defined in the
> org.eclipse.imp.lpg.metatooling_0.1.79/templates directory which is the
> value of the LPG include path, so why does it generate the "could not be
> read" error? Even when I copy the .gi file into the same directory as
> the generated FoobarLexer.gi, it doesn't get found. The LPG preferences
> let me override the include path, but I really would like to use a
> relative path to my workspace or project. That doesn't seem to work either.
>
> I'm simultaneously trying to learn LPG, so I'm sure there is a simple
> solution. I would expect the generated grammar to compile without change.

Hi Mike,

Sorry for the late response.

We've recently split the LPG feature in two to separate the runtime
componenents from the compile-time components. Also, we removed the
LPG templates from org.eclipse.imp.lpg.metatooling, since it turned
out that they didn't actually depend on IMP.

As for your troubles with the include path settings, can you post
more details as to where the templates files are located and what
include path you used? Naturally, this ought to work (and it does
for us).

--
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 IMP for LPG in non-IMP target [message #574658 is a reply to message #26007] Mon, 19 January 2009 13:20 Go to previous message
Mike Gering is currently offline Mike Gering
Messages: 41
Registered: July 2009
Member
I've learned a few things and have answered (most) of my questions. What
I've learned is that I can use the IMP grammar editor for a non-IMP
project is mostly ok. But I should use my own external tool launcher to
invoke the lpg generator. And I should avoid using templates that rely
on the IMP infrastructure.

Mike Gering
Re: Using IMP for LPG in non-IMP target [message #574682 is a reply to message #26050] Tue, 20 January 2009 08:42 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
Hi Mike

Your experiences sound very familiar. Unfortunately I've forgotten
the details of the stupid mistakes I made and how I solved them.

While your problems are fresh in your mind it might be helpful
to share them.

I suspect that there are at least a couple of examples or wizards
that should be adjusted to be more helpful.

Regards

Ed Willink
Re: Using IMP for LPG in non-IMP target [message #574706 is a reply to message #26050] Fri, 23 January 2009 03:15 Go to previous message
Jin Missing name is currently offline Jin Missing name
Messages: 100
Registered: July 2009
Senior Member
Mike,
The dependence between the lpg for non-imp is minimal as my memory, only two
interfaces( IParser,ILexer). You can simply copy these files to your
standalone package. It is nearly clear.
The gramme dependence aslo can be extracted from some projects
(...metatooling.., sorry for forgetting^_^). But the runtime is not related
to this gramme files dependence, so you can ignore this problem.

Jin

"Mike Gering" <mike@aol.com>
> I've learned a few things and have answered (most) of my questions. What
> I've learned is that I can use the IMP grammar editor for a non-IMP
> project is mostly ok. But I should use my own external tool launcher to
> invoke the lpg generator. And I should avoid using templates that rely on
> the IMP infrastructure.
>
> Mike Gering
Re: Using IMP for LPG in non-IMP target [message #575049 is a reply to message #26007] Tue, 24 February 2009 15:13 Go to previous message
Robert M. Fuhrer is currently offline Robert M. Fuhrer
Messages: 294
Registered: July 2009
Senior Member
Mike Gering wrote:
> I need to use LPG for parsing data within my application, and I would
> like to use the IMP tooling to help me build it. The application, in one
> of its forms, is not even eclipse, so I have to embed the lpg runtime in
> my application. It looks like IMP might be helpful for developing my
> parser, but I'm not so sure. The default grammar created by the New LPG
> Grammar (non-IMP) generates an example lexer.gi file that cannot resolve
> its reference to LexerVeryBasicMapF.gi. It is defined in the
> org.eclipse.imp.lpg.metatooling_0.1.79/templates directory which is the
> value of the LPG include path, so why does it generate the "could not be
> read" error? Even when I copy the .gi file into the same directory as
> the generated FoobarLexer.gi, it doesn't get found. The LPG preferences
> let me override the include path, but I really would like to use a
> relative path to my workspace or project. That doesn't seem to work either.
>
> I'm simultaneously trying to learn LPG, so I'm sure there is a simple
> solution. I would expect the generated grammar to compile without change.

Hi Mike,

Sorry for the late response.

We've recently split the LPG feature in two to separate the runtime
componenents from the compile-time components. Also, we removed the
LPG templates from org.eclipse.imp.lpg.metatooling, since it turned
out that they didn't actually depend on IMP.

As for your troubles with the include path settings, can you post
more details as to where the templates files are located and what
include path you used? Naturally, this ought to work (and it does
for us).

--
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:New release of IMP available on eclipse.org
Next Topic:How to get LPG to treat comments as terminals
Goto Forum:
  


Current Time: Sun Sep 21 12:27:13 GMT 2014

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

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