_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
I was converting the filestream into a readWriteStream so that the character $( I add to it does not affect the file itself. If you let the fileStream itself, I think your file will be modified and then you will not be able to re-import it at all.
2010/2/18 Laval Jannik <[hidden email]>
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi Cyrille,
Why exactly do you need to add a $(? Cheers, Doru On 18 Feb 2010, at 10:06, Cyrille Delaunay wrote: > I was converting the filestream into a readWriteStream so that the > character $( I add to it does not affect the file itself. If you let > the fileStream itself, I think your file will be modified and then > you will not be able to re-import it at all. > > 2010/2/18 Laval Jannik <[hidden email]> > >> >> Hi Johan, >> >> When I work on big models, I run the VM with more memory: >> >> In Command line: >> Squeak\ 4.2.2beta1U.app/Contents/MacOS/Squeak\ VM\ Opt -memory 1500m >> >> It should work with this. >> >> Cheers, >> Jannik >> >> On Feb 18, 2010, at 08:12 , Johan Brichau wrote: >> >>> Thanks Doru. I will take a look at that. >>> >>> It all seems to work very well now except for large models. What >>> can you in Pharo to use more memory? >>> >>> I have a large model exported from VW which gives trouble >>> importing into Pharo merely because of the size of it. >>> One item that first seemed to help is not to convert the >>> filestream into a readwritestream in the #importFromFamix2MSE >>> method. I changed the method as follows: >>> >>> importFromFamix2MSE >>> <menuItem: 'Import from Famix2 MSE' category: 'Import / Export'> >>> | stream contents streamCopy | >>> stream := UITheme builder >>> fileOpen: 'Import model from MSE file' extensions: #('mse'). >>> "we skip all the famix 2 specific head of file." >>> stream upTo: $( . >>> stream upTo: $( . >>> stream upTo: $( . >>> stream upTo: $( . >>> stream next: 6. >>> stream nextPut: $(. >>> stream back. >>> >>> self name: (FileDirectory baseNameFor: stream localName). >>> self importFromFamix2MSEStream: stream. >>> stream close >>> >>> >>> However, I later run out of memory when parsing it. >>> Any ideas? >>> > > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev -- www.tudorgirba.com "When people care, great things can happen." _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Because a Famix3 mse file (in other words, the kind of file that the mse parser accept) begins with:
'( ( entity ... ' To obtain this syntax from a famix2 mse file, I skip all that is present before, and just add the first '(' so that the parser deals with this stream like with any other famix3mse stream.
2010/2/18 Tudor Girba <[hidden email]> Hi Cyrille, _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi Cyrille,
The FAMIX2 preamble is (Moose.Model (entity (...) ) ) So, why is it not easier to just ignore the entity string? This would imply no modification of the file. Cheers, Doru On 18 Feb 2010, at 13:11, Cyrille Delaunay wrote: > Because a Famix3 mse file (in other words, the kind of file that the > mse parser accept) begins with: > '( > ( entity ... ' > > To obtain this syntax from a famix2 mse file, I skip all that is > present before, and just add the first '(' so that the parser deals > with this stream like with any other famix3mse stream. > > 2010/2/18 Tudor Girba <[hidden email]> > Hi Cyrille, > > Why exactly do you need to add a $(? > > Cheers, > Doru > > > > On 18 Feb 2010, at 10:06, Cyrille Delaunay wrote: > > I was converting the filestream into a readWriteStream so that the > character $( I add to it does not affect the file itself. If you let > the fileStream itself, I think your file will be modified and then > you will not be able to re-import it at all. > > 2010/2/18 Laval Jannik <[hidden email]> > > > Hi Johan, > > When I work on big models, I run the VM with more memory: > > In Command line: > Squeak\ 4.2.2beta1U.app/Contents/MacOS/Squeak\ VM\ Opt -memory 1500m > > It should work with this. > > Cheers, > Jannik > > On Feb 18, 2010, at 08:12 , Johan Brichau wrote: > > Thanks Doru. I will take a look at that. > > It all seems to work very well now except for large models. What can > you in Pharo to use more memory? > > I have a large model exported from VW which gives trouble importing > into Pharo merely because of the size of it. > One item that first seemed to help is not to convert the filestream > into a readwritestream in the #importFromFamix2MSE method. I changed > the method as follows: > > importFromFamix2MSE > <menuItem: 'Import from Famix2 MSE' category: 'Import / Export'> > | stream contents streamCopy | > stream := UITheme builder > fileOpen: 'Import model from MSE file' extensions: #('mse'). > "we skip all the famix 2 specific head of file." > stream upTo: $( . > stream upTo: $( . > stream upTo: $( . > stream upTo: $( . > stream next: 6. > stream nextPut: $(. > stream back. > > self name: (FileDirectory baseNameFor: stream localName). > self importFromFamix2MSEStream: stream. > stream close > > > However, I later run out of memory when parsing it. > Any ideas? > > > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > -- > www.tudorgirba.com > > "When people care, great things can happen." > > > > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev -- www.tudorgirba.com "Some battles are better lost than fought." _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Beacause 'ignore the entity string' means 'modify the Parser so that it ignore the entity string'.
So, I found easier to not touch the parser but rather to give it a stream ready to be parsed. Then, I choose to modify a stream with the file contents rather than the file itself.
But this solution was maybe more 'faster' than 'easier'. So I don't know if it's the best solution. And now, we already have subclassed the classic parser to make specific things, so it would not be very difficult to override the method parsing the begening of the document.
2010/2/18 Tudor Girba <[hidden email]> Hi Cyrille, _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Free forum by Nabble | Edit this page |