Parsing some Java in VW

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Parsing some Java in VW

Bergel, Alexandre
Dear List,

I wish to parse some Java in VW using SmaCC, but where can I find a  
proper grammar? The SmaCC parcel does not seem to include one, and  
google was not that successful this time.
I am therefore using the Java Grammar that is included in the Squeak  
SmaCC distribution.  Works fine, expect for multilines comments.
The scanner definition ends with

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
<eol>: \r | \n | \r\n ;
<whitespace>: \s+ ;
<comment>: \/\/ [^\r\n]* <eol> ;
<multipleLineComment>: \/ \* ;
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Maybe it has to be adjusted for VW since it works fine for Squeak.

Am I missing something obvious?

Cheers,
Alexandre

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



Reply | Threaded
Open this post in threaded view
|

Re: Parsing some Java in VW

Holger Kleinsorgen-3
Scanner definition:

<multipleLineComment>: \/ \* ;"

and the following scanner method:

multipleLineComment
    | char |
       
    [[(char := stream next) isNil or: [char == $*]] whileFalse.
    stream atEnd ifTrue: [self scannerError].
    stream peekFor: $/]
       whileFalse.
    ^ self whitespace

Reply | Threaded
Open this post in threaded view
|

RE: Parsing some Java in VW

Wallen, David
In reply to this post by Bergel, Alexandre
I haven't looked at SmaCC for Squeak, but what is wrong with the SmaCC
Java parser in the examples parcel? Seems to work fine with multi-line
comments.
You can find it in the Contributed/SmaCC directory (using Directories
tab in the Parcel Manager tool).

- Dave
-----Original Message-----
From: Bergel, Alexandre [mailto:[hidden email]]
Sent: Saturday, December 08, 2007 1:03 PM
To: VWNC
Subject: Parsing some Java in VW

Dear List,

I wish to parse some Java in VW using SmaCC, but where can I find a  
proper grammar? The SmaCC parcel does not seem to include one, and  
google was not that successful this time.
I am therefore using the Java Grammar that is included in the Squeak  
SmaCC distribution.  Works fine, expect for multilines comments.
The scanner definition ends with

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
<eol>: \r | \n | \r\n ;
<whitespace>: \s+ ;
<comment>: \/\/ [^\r\n]* <eol> ;
<multipleLineComment>: \/ \* ;
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Maybe it has to be adjusted for VW since it works fine for Squeak.

Am I missing something obvious?

Cheers,
Alexandre

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



Reply | Threaded
Open this post in threaded view
|

Re: Parsing some Java in VW

Bergel, Alexandre
I did not know this package existed.
This package is for Java 1.2.
do you know whether a java 1.5 is around ? I wish to parse generic-
aware code...

Cheers,
Alexandre



On 10 Dec 2007, at 16:16, Wallen, David wrote:

> I haven't looked at SmaCC for Squeak, but what is wrong with the SmaCC
> Java parser in the examples parcel? Seems to work fine with multi-line
> comments.
> You can find it in the Contributed/SmaCC directory (using Directories
> tab in the Parcel Manager tool).
>
> - Dave
> -----Original Message-----
> From: Bergel, Alexandre [mailto:[hidden email]]
> Sent: Saturday, December 08, 2007 1:03 PM
> To: VWNC
> Subject: Parsing some Java in VW
>
> Dear List,
>
> I wish to parse some Java in VW using SmaCC, but where can I find a
> proper grammar? The SmaCC parcel does not seem to include one, and
> google was not that successful this time.
> I am therefore using the Java Grammar that is included in the Squeak
> SmaCC distribution.  Works fine, expect for multilines comments.
> The scanner definition ends with
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> <eol>: \r | \n | \r\n ;
> <whitespace>: \s+ ;
> <comment>: \/\/ [^\r\n]* <eol> ;
> <multipleLineComment>: \/ \* ;
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> Maybe it has to be adjusted for VW since it works fine for Squeak.
>
> Am I missing something obvious?
>
> Cheers,
> Alexandre
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



Reply | Threaded
Open this post in threaded view
|

RE: Parsing some Java in VW

Wallen, David
1.5 sounds significantly different. Were you saying that the Java 1.5
parser is available in Squeak? If not, maybe someone on the list can
help.

- Dave
-----Original Message-----
From: Bergel, Alexandre [mailto:[hidden email]]
Sent: Monday, December 10, 2007 5:33 PM
To: Wallen, David
Cc: VWNC
Subject: Re: Parsing some Java in VW

I did not know this package existed.
This package is for Java 1.2.
do you know whether a java 1.5 is around ? I wish to parse generic-
aware code...

Cheers,
Alexandre



On 10 Dec 2007, at 16:16, Wallen, David wrote:

> I haven't looked at SmaCC for Squeak, but what is wrong with the SmaCC
> Java parser in the examples parcel? Seems to work fine with multi-line
> comments.
> You can find it in the Contributed/SmaCC directory (using Directories
> tab in the Parcel Manager tool).
>
> - Dave
> -----Original Message-----
> From: Bergel, Alexandre [mailto:[hidden email]]
> Sent: Saturday, December 08, 2007 1:03 PM
> To: VWNC
> Subject: Parsing some Java in VW
>
> Dear List,
>
> I wish to parse some Java in VW using SmaCC, but where can I find a
> proper grammar? The SmaCC parcel does not seem to include one, and
> google was not that successful this time.
> I am therefore using the Java Grammar that is included in the Squeak
> SmaCC distribution.  Works fine, expect for multilines comments.
> The scanner definition ends with
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> <eol>: \r | \n | \r\n ;
> <whitespace>: \s+ ;
> <comment>: \/\/ [^\r\n]* <eol> ;
> <multipleLineComment>: \/ \* ;
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> Maybe it has to be adjusted for VW since it works fine for Squeak.
>
> Am I missing something obvious?
>
> Cheers,
> Alexandre
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



Reply | Threaded
Open this post in threaded view
|

Re: Parsing some Java in VW

Bergel, Alexandre
It seems to be the same java parser in VW and Squeak for Java 1.2.

So, nobody has a grammar that parses Java 1.5?
If I do not have any positive answer in a couple of days, I will work  
on it...

Cheers,
Alexandre


On 11 Dec 2007, at 01:19, Wallen, David wrote:

> 1.5 sounds significantly different. Were you saying that the Java 1.5
> parser is available in Squeak? If not, maybe someone on the list can
> help.
>
> - Dave
> -----Original Message-----
> From: Bergel, Alexandre [mailto:[hidden email]]
> Sent: Monday, December 10, 2007 5:33 PM
> To: Wallen, David
> Cc: VWNC
> Subject: Re: Parsing some Java in VW
>
> I did not know this package existed.
> This package is for Java 1.2.
> do you know whether a java 1.5 is around ? I wish to parse generic-
> aware code...
>
> Cheers,
> Alexandre
>
>
>
> On 10 Dec 2007, at 16:16, Wallen, David wrote:
>
>> I haven't looked at SmaCC for Squeak, but what is wrong with the  
>> SmaCC
>> Java parser in the examples parcel? Seems to work fine with multi-
>> line
>> comments.
>> You can find it in the Contributed/SmaCC directory (using Directories
>> tab in the Parcel Manager tool).
>>
>> - Dave
>> -----Original Message-----
>> From: Bergel, Alexandre [mailto:[hidden email]]
>> Sent: Saturday, December 08, 2007 1:03 PM
>> To: VWNC
>> Subject: Parsing some Java in VW
>>
>> Dear List,
>>
>> I wish to parse some Java in VW using SmaCC, but where can I find a
>> proper grammar? The SmaCC parcel does not seem to include one, and
>> google was not that successful this time.
>> I am therefore using the Java Grammar that is included in the Squeak
>> SmaCC distribution.  Works fine, expect for multilines comments.
>> The scanner definition ends with
>>
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> <eol>: \r | \n | \r\n ;
>> <whitespace>: \s+ ;
>> <comment>: \/\/ [^\r\n]* <eol> ;
>> <multipleLineComment>: \/ \* ;
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>
>> Maybe it has to be adjusted for VW since it works fine for Squeak.
>>
>> Am I missing something obvious?
>>
>> Cheers,
>> Alexandre
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



Reply | Threaded
Open this post in threaded view
|

Re: Parsing some Java in VW

Toon Verwaest
Why don't you just reuse parsers existing for java to output MSE which
you -then- load into smalltalk? Why going through the trouble of
redoing it fully in smalltalk?

On (11/12/07 07:56), Bergel, Alexandre wrote:

> From: "Bergel, Alexandre" <[hidden email]>
> To: "Wallen, David" <[hidden email]>
> Cc: VWNC <[hidden email]>, Holger Kleinsorgen <[hidden email]>
> Subject: Re: Parsing some Java in VW
> Date: Tue, 11 Dec 2007 07:56:24 -0300
>
> It seems to be the same java parser in VW and Squeak for Java 1.2.
>
> So, nobody has a grammar that parses Java 1.5?
> If I do not have any positive answer in a couple of days, I will work on
> it...
>
> Cheers,
> Alexandre
>
>
> On 11 Dec 2007, at 01:19, Wallen, David wrote:
>
>> 1.5 sounds significantly different. Were you saying that the Java 1.5
>> parser is available in Squeak? If not, maybe someone on the list can
>> help.
>>
>> - Dave
>> -----Original Message-----
>> From: Bergel, Alexandre [mailto:[hidden email]]
>> Sent: Monday, December 10, 2007 5:33 PM
>> To: Wallen, David
>> Cc: VWNC
>> Subject: Re: Parsing some Java in VW
>>
>> I did not know this package existed.
>> This package is for Java 1.2.
>> do you know whether a java 1.5 is around ? I wish to parse generic-
>> aware code...
>>
>> Cheers,
>> Alexandre
>>
>>
>>
>> On 10 Dec 2007, at 16:16, Wallen, David wrote:
>>
>>> I haven't looked at SmaCC for Squeak, but what is wrong with the SmaCC
>>> Java parser in the examples parcel? Seems to work fine with multi-line
>>> comments.
>>> You can find it in the Contributed/SmaCC directory (using Directories
>>> tab in the Parcel Manager tool).
>>>
>>> - Dave
>>> -----Original Message-----
>>> From: Bergel, Alexandre [mailto:[hidden email]]
>>> Sent: Saturday, December 08, 2007 1:03 PM
>>> To: VWNC
>>> Subject: Parsing some Java in VW
>>>
>>> Dear List,
>>>
>>> I wish to parse some Java in VW using SmaCC, but where can I find a
>>> proper grammar? The SmaCC parcel does not seem to include one, and
>>> google was not that successful this time.
>>> I am therefore using the Java Grammar that is included in the Squeak
>>> SmaCC distribution.  Works fine, expect for multilines comments.
>>> The scanner definition ends with
>>>
>>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>> <eol>: \r | \n | \r\n ;
>>> <whitespace>: \s+ ;
>>> <comment>: \/\/ [^\r\n]* <eol> ;
>>> <multipleLineComment>: \/ \* ;
>>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>>
>>> Maybe it has to be adjusted for VW since it works fine for Squeak.
>>>
>>> Am I missing something obvious?
>>>
>>> Cheers,
>>> Alexandre
>>>
>>> --
>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>> Alexandre Bergel  http://www.bergel.eu
>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>
>>>
>>>
>>>
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>