Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 288666 - [parser] LPG v2 into Orbit
Summary: [parser] LPG v2 into Orbit
Status: CLOSED FIXED
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: 1.3.0   Edit
Hardware: PC Windows Vista
: P3 enhancement (vote)
Target Milestone: 3.0.0   Edit
Assignee: Adolfo Sanchez-Barbudo Herrera CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 297659 (view as bug list)
Depends on:
Blocks: 242153
  Show dependency tree
 
Reported: 2009-09-04 13:01 EDT by Adolfo Sanchez-Barbudo Herrera CLA
Modified: 2011-05-27 02:47 EDT (History)
4 users (show)

See Also:


Attachments
LPG Runtime inclusion patch (627.63 KB, patch)
2009-12-22 11:47 EST, Adolfo Sanchez-Barbudo Herrera CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adolfo Sanchez-Barbudo Herrera CLA 2009-09-04 13:01:22 EDT
Make LPGv2 take part in Orbit so that new OCL grammars, parsing infrastructure and textual editor based on this LPG runtime may be integrated in MDT-OCL project.

In principle, LPG 2.0.18 will be our target.
Comment 1 Adolfo Sanchez-Barbudo Herrera CLA 2009-12-10 08:02:16 EST
Since LPG 2.0.18 release has been delayed, our target will be 2.0.17.
Comment 2 Ed Willink CLA 2009-12-12 07:04:50 EST
*** Bug 297659 has been marked as a duplicate of this bug. ***
Comment 3 Adolfo Sanchez-Barbudo Herrera CLA 2009-12-22 11:07:08 EST
CQ approved: http://dev.eclipse.org/ipzilla/show_bug.cgi?id=3653

Next step: Check in the new LPG Runtime into Orbit's repository

As agreed with Robert's Fuhrer, the bundle's name will be: lpg.runtime.java
Comment 4 Adolfo Sanchez-Barbudo Herrera CLA 2009-12-22 11:47:29 EST
Created attachment 154938 [details]
LPG Runtime inclusion patch

The attached patch should be applied against 

dev.eclipse.org/tools/org.eclipse.orbit/lpg.runtime.java project BRANCH v2_0_17

The bundle has been created in a similar way the previous net.sourceforge.lpg.lpgjavaruntime bundle was created.

The following guidelines have also been taken:

http://wiki.eclipse.org/Adding_Bundles_to_Orbit
Comment 5 Adolfo Sanchez-Barbudo Herrera CLA 2009-12-22 12:14:08 EST
Adding David...

David, since it's my first contribution to Orbit I would be pleased if you are able to do a quick review of the contribution.

I think that I'll need tag once this is committed to properly update the bundles.map

A patch with iplog, bundles.map, orbit.psf and set1/features.xml will be provided when this one is committed.
Comment 6 Adolfo Sanchez-Barbudo Herrera CLA 2009-12-22 12:17:56 EST
Also adding Robert since he must be interested in this.
Comment 7 David Williams CLA 2009-12-22 13:11:22 EST
Looks close enough to try. I didn't see any obvious errors or common mistakes (with a 4 minute review). 

Don't forget, you'll also have to add it to the feature.xml file and map file too. 

I'll be "around" most the time, so I think its fine if you just give it a try, and if there's a few build failures, this is a good time to have them (not a critical time of milestone) and I'm sure you'll straighten it out ... I mean, I'll be here and happy to help if you need it. :) 

Thanks.
Comment 8 Adolfo Sanchez-Barbudo Herrera CLA 2009-12-22 14:01:25 EST
David,

Thank you very much !!

I think I'm done. How could I check that all has gone fine ?. I remember reading that I have to wait 1 hour so that Orbit's realizes that it has a new bundle to build. Am I wrong ?

Cheers,
Adolfo.
Comment 9 Mat Booth CLA 2009-12-22 14:08:18 EST
Adolfo,

For my own edification, would you be able to outline the chief benefits in moving to LPG2?

Regards,
Mat
Comment 10 David Williams CLA 2009-12-22 14:25:48 EST
(In reply to comment #8)
> ... I remember
> reading that I have to wait 1 hour so that Orbit's realizes that it has a new
> bundle to build. Am I wrong ?
> 

Yes, up to one hour. But if you are impatient, you can "force a build" by clicking on the refreshing-looking button at 
http://build.eclipse.org:9777/dashboard/tab/builds

But, one has started, and will be done in hour or two.
Comment 11 David Williams CLA 2009-12-22 14:26:51 EST
Oh, and if the build works at all, you can see/get the results from 
http://download.eclipse.org/tools/orbit/committers/
Comment 12 David Williams CLA 2009-12-22 14:29:26 EST
You'll want to be sure this runs as expected. When I pulled in the code from cvs, I later noticed a bunch of messages in my log file. All of this form: 

!ENTRY org.eclipse.jdt.core 2 0 2009-12-22 13:08:25.556
!MESSAGE The Java indexing could not index /lpg.runtime.java/lpg/runtime/Recover
yParser.class. This .class file doesn't follow the class file format specificati
on. Please report this issue against the .class file vendor

So ... think these are really odd .class files? Could you have accidental added end-of-lines in them somehow?
Comment 13 Adolfo Sanchez-Barbudo Herrera CLA 2009-12-22 14:36:25 EST
(In reply to comment #12)
> You'll want to be sure this runs as expected. When I pulled in the code from
> cvs, I later noticed a bunch of messages in my log file. All of this form: 
> 
> !ENTRY org.eclipse.jdt.core 2 0 2009-12-22 13:08:25.556
> !MESSAGE The Java indexing could not index
> /lpg.runtime.java/lpg/runtime/Recover
> yParser.class. This .class file doesn't follow the class file format
> specificati
> on. Please report this issue against the .class file vendor
> 
> So ... think these are really odd .class files? Could you have accidental added
> end-of-lines in them somehow?

I think I have simply added the classes (and the .java files in the source-bundle), from the lpg.runtime.jar downloaded from sourceforge.net... I'll check it again to ensure they are same...
Comment 14 Adolfo Sanchez-Barbudo Herrera CLA 2009-12-22 14:42:09 EST
> 
> I think I have simply added the classes (and the .java files in the
> source-bundle), from the lpg.runtime.jar downloaded from sourceforge.net...
> I'll check it again to ensure they are same...

I'll try to recompile the .java file with my Java 5 compiler, and check if they are the same.

Cheers,
Adolfo.
Comment 15 Adolfo Sanchez-Barbudo Herrera CLA 2009-12-22 14:57:41 EST
> 
> I'll try to recompile the .java file with my Java 5 compiler, and check if they
> are the same.
> 
> Cheers,
> Adolfo.

After:
1. recompiling the source-bundle .java files in a temporal bin folder.
2. replacing the original root-project .class files by the new .class files.
3. Comparing the project the Orbit's cvs.

Only a non-perceptible-by-the-compare-editor change is detected for the messages.properties file. Do you think this could be error's source ?
Comment 16 David Williams CLA 2009-12-22 15:40:11 EST
(In reply to comment #15)


> ... Do you think this could be error's source ?

No, I wouldn't think so. I'm using eclipse SDK M4 as my development environment. I wonder if this is some new JDT check? Maybe their bug? Maybe would happen to lots of .class files? (not compiled by JDT :) 

If you haven't done something funny (like use FTP to get the .class files, or change your .class cvs filetype setting to ascii (both, highly unlikely ... that's all I can think of of how you'd cause this) then it may not be a real problem. 

If someone else sees (after using eclipse-sdk M4) perhaps we could ask someone on JDT team "what it means" and if we should be concerned. As far as I know, it could just be my setup, somehow.
Comment 17 David Williams CLA 2009-12-22 15:46:49 EST
(In reply to comment #16)
> (In reply to comment #15)
> 
> 
> > ... Do you think this could be error's source ?
> 
> ...  it could just be my setup, somehow.
>

Oh wait, I think I know what caused this. I initially didn't check out from cvs, but just applied your patch. And "binary" files don't actually patch correctly, or at least not easily ... so probably did have some extra EOLs in there, or something. I imagine you actually "imported" these into your workspace and then committed, so should be fine. 

I do not see this message now that I've checked out your version directly from cvs. 

Sorry for the false alarm.
Comment 18 Ed Willink CLA 2009-12-22 17:05:24 EST
> For my own edification, would you be able to outline the chief benefits in
> moving to LPG2?

a) responding from a plea from the LPG developers to stop using LPG 1
b) using the active development stream
c) using the same stream as used by IMP

Of the technical changes, the only one that I know of that seems useful for MDT/OCL's mundane purposes is:

d) the possibility to use type-safe grammar rule returns
Comment 19 Adolfo Sanchez-Barbudo Herrera CLA 2009-12-23 04:34:15 EST
> 
> Oh wait, I think I know what caused this. I initially didn't check out from cvs,
> but just applied your patch. And "binary" files don't actually patch correctly,
> or at least not easily ... so probably did have some extra EOLs in there, or
> something. I imagine you actually "imported" these into your workspace and then
> committed, so should be fine.
> 
> I do not see this message now that I've checked out your version directly from
> cvs.
> 
> Sorry for the false alarm.

It doesn't matter. It seems that all has gone fine. I have checked that the binary and source bundles have been sucessfully built.

Thank you very much for the help and congratulations for the helpful documentation, it has been essential to make this work in my first try.

N.B: I'll wait until LPGv2.0.17 reuse approval for MDT-OCL, to resolve the bug.
Comment 20 Adolfo Sanchez-Barbudo Herrera CLA 2009-12-23 04:58:05 EST
(In reply to comment #18)
> > For my own edification, would you be able to outline the chief benefits in
> > moving to LPG2?
> 
> a) responding from a plea from the LPG developers to stop using LPG 1
> b) using the active development stream
> c) using the same stream as used by IMP
> 
> Of the technical changes, the only one that I know of that seems useful for
> MDT/OCL's mundane purposes is:
> 
> d) the possibility to use type-safe grammar rule returns

There is a long thread in which you may find more reasons. If you are bored you could try to follow Bug 242153. Apart from all that Ed has pointed out, I could add some notes:
- We tend to ship an OCLEditor as an example which uses IMP, which uses LPGv2. So, since LPGv2 will be needed by the example it should be good that the parser uses the same runtime, and we could then forget the old runtime.
- Technically, LPGv2.x runtime has been refactored improving its design, including more interfaces, etc which should also be exploited by MDT-OCL. At least, we will do the first step, changing the runtime in this major version increment (MDT-OCL 3.0.0). Let's see if we are able to do notable changes to make MDT-OCL parser take advantage from the new LPG design.
- Technically, LPGv1.x runtime has some deficiences relating performance and memory usage. I detected one related to backtracking parser, which used an  IntTuple action = new IntTuple(1 << 20) to stack parser actions. In Lpg v2.x an improved dinamic array is used instead, which shouldn't use so amount of memory: private IntSegmentedTuple action = new IntSegmentedTuple(10, 1024);

Regards,
Adolfo.
Comment 21 Adolfo Sanchez-Barbudo Herrera CLA 2009-12-24 04:59:11 EST
Approval granted : http://dev.eclipse.org/ipzilla/show_bug.cgi?id=3656

Fixed
Comment 22 Ed Willink CLA 2011-05-27 02:47:22 EDT
Closing after over 18 months in resolved state.