[vwnc] SmaCC Bug - dependent code generated

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

[vwnc] SmaCC Bug - dependent code generated

Steffen Märcker
Hi,

I've build some parser (attached) using SmaCC and noticed, that the  
generated code calls the method isBlank, if RBCodeHighlighting is loaded.  
This parser fails in a deployed image, where code highlighting is not  
used. If RBCodeHighlighting is not loaded, the generator does not use that  
method.
I think this is a bug, because the generated code should be independent  
 from other packages than SmaCCRuntime.

Regards,
Steffen
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

Parser.st (20K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] SmaCC Bug - dependent code generated

Ralf Propach
That is AR 54125

Steffen Märcker wrote:

> Hi,
>
> I've build some parser (attached) using SmaCC and noticed, that the
> generated code calls the method isBlank, if RBCodeHighlighting is
> loaded.  This parser fails in a deployed image, where code highlighting
> is not  used. If RBCodeHighlighting is not loaded, the generator does
> not use that  method.
> I think this is a bug, because the generated code should be independent
> from other packages than SmaCCRuntime.
>
> Regards,
> Steffen
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


--
Ralf Propach, [hidden email]
Tel: +49 231 975 99 38   Fax: +49 231 975 99 20
Georg Heeg eK (Dortmund)
Handelsregister: Amtsgericht Dortmund  A 12812
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] SmaCC Bug - dependent code generated

Steven Kelly
In reply to this post by Steffen Märcker
We've successfully used this for a few years. It limits the search to the package that defines class Character, and to the protocol "testing".
Steve

SmaCCCharacterEdge>>initializeIsExpressions
        "Creates a map from sets of characters to selectors that start with 'is' on Character. This allows generated scanners to take
        full advantage of selectors that are already implemented on Character"

        | selectors |
        IsExpressions := Dictionary new.
        selectors := #{Store.Registry}
                ifDefinedDo: [:reg | | pkg |
                        pkg := reg packageForClass: Character.
                        (pkg methodsForClassNamed: Character absoluteName andProtocol: #testing meta: false) collect:
                                [:m | m selector]]
                elseDo:
                        [Character selectors].
        selectors := selectors select:
                                        [:each |
                                        ('is#*' match: each)
                                                and: [each numArgs = 0 and: [(each at: 3) isUppercase]]].
        selectors do:
                        [:sel |
                        | string |
                        string := self generateCharacterSetFor: sel.
                        string isEmpty ifFalse: [IsExpressions at: string put: sel]]

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of Ralf Propach
> Sent: 23 October 2009 18:00
> To: [hidden email]
> Cc: vwnc
> Subject: Re: [vwnc] SmaCC Bug - dependent code generated
>
> That is AR 54125
>
> Steffen Märcker wrote:
> > Hi,
> >
> > I've build some parser (attached) using SmaCC and noticed, that the
> > generated code calls the method isBlank, if RBCodeHighlighting is
> > loaded.  This parser fails in a deployed image, where code
> highlighting
> > is not  used. If RBCodeHighlighting is not loaded, the generator does
> > not use that  method.
> > I think this is a bug, because the generated code should be
> independent
> > from other packages than SmaCCRuntime.
> >
> > Regards,
> > Steffen
> >
> >
> > ---------------------------------------------------------------------
> ---
> >
> > _______________________________________________
> > vwnc mailing list
> > [hidden email]
> > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
>
> --
> Ralf Propach, [hidden email]
> Tel: +49 231 975 99 38   Fax: +49 231 975 99 20
> Georg Heeg eK (Dortmund)
> Handelsregister: Amtsgericht Dortmund  A 12812
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc