Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-dev] Jikespg syntax description used in ...compiler.batch/grammar/java.g

Hi Manoj.

I think this subtle, but seemingly very important difference should be
comprehensively documented somewhere. Maybe it is already, and I simply
do not know where.

I made a little experiment, using the original (AspectJ) grammar,
replacing the mixed '::=' and '->' symbols by

  1. '::=' only,
  2- '->' only,

comparing the results. Most obviously, in javadef.java, for (1)
NUM_STATES gets smaller and for (2) bigger. As you said that the arrow
notation permits for optimising productions away, I was naively
expecting there to be fewer states than before, not more. It is the
other way around of what I expected.

Moreover, the switch-case in JavaAction.java seems to be identical, only
differing in debug statement strings due to the different operators.
Everything else is exactly the same.

In the light of this information, can you elaborate more about the
actual effect the different equality symbols for productions have? I do
not quite understand, probably due to missing compiler building background.

Sorry to bother you, but this is interesting.

Regards
--
Alexander Kriegisch
https://scrum-master.de


Manoj Palat schrieb am 06.01.2023 um 04:33:
> Hi Alex,
> 
> I just read the yesterday’s  mail thread only now – hope the reply is
> not late. To answer your query on what’s the difference between ::= and
> ->, here is what I gathered:
> 
>  
> 
> Both are equivalent in the sense they are both valid grammars without
> any difference in terms of meaning. However, when you use ->, then you
> are giving the parser generator the freedom to optimize this production
> out if there is a chance. If you use ::=, then you are mandating that
> this production needs to be there – don’t optimize this out even if
> there is a chance.
> 
>  
> 
> So why is this relevant to us? If you have a consume*() method which is
> dependent on the reduction of this production, and if that consume*() is
> **important** [it should be important or atleast it should be having a
> future use, otherwise you would not put that there in the first place],
> then you should use ::= so that we have that production and consequently
> that consume*() method in the Parser[.java]. Otherwise, you are free to
> use ->. You can see examples of both in java.g.
> 
>  
> 
> Hope this helps..
> 
>  
> 
> Regards,
> 
> Manoj
> 
>  
> 
> *From: *jdt-dev <jdt-dev-bounces@xxxxxxxxxxx> on behalf of Andrey
> Loskutov <loskutov@xxxxxx>
> *Date: *Thursday, 5 January 2023 at 11:21 PM
> *To: *
> *Cc: *Eclipse JDT general developers list. <jdt-dev@xxxxxxxxxxx>
> *Subject: *[EXTERNAL] Re: [jdt-dev] Jikespg syntax description used in
> ...compiler.batch/grammar/java.g
> 
> OMG, yep, sure, why not shut down wiki too. I've asked on that ticket
> about instructions, let see if I can do that move on our ancient RHEL 7.
>  9 (I guess most of the tools needed will not work there or not
> available). If not, we've got
> 
> ZjQcmQRYFpfptBannerStart
> 
> *This Message Is From an External Sender *
> 
> This message came from outside your organization.
> 
> ZjQcmQRYFpfptBannerEnd
> 
> OMG, yep, sure, why not shut down wiki too.
>  
> 
> I've asked on that ticket about instructions, let see if I can do that
> move on our ancient RHEL 7.9 (I guess most of the tools needed will not
> work there or not available).
> 
> If not, we've got "promise" that may be by the end of the year we will
> move to RHEL 9, let see...
> 
>  
> 
> Kind regards,
> Andrey Loskutov
> 
> Спасение утопающих - дело рук самих утопающих
> 
> https://www.eclipse.org/user/aloskutov
> 
>  
> 
>  
> 
> *Gesendet:* Donnerstag, 05. Januar 2023 um 18:25 Uhr
> *Von:* "Aleksandar Kurtakov" <akurtako@xxxxxxxxxx>
> *An:* "Andrey Loskutov" <loskutov@xxxxxx>
> *Cc:* "Eclipse JDT general developers list." <jdt-dev@xxxxxxxxxxx>
> *Betreff:* Re: [jdt-dev] Jikespg syntax description used in
> ...compiler.batch/grammar/java.g
> 
>  
> 
>  
> 
> On Thu, Jan 5, 2023 at 7:18 PM Andrey Loskutov <loskutov@xxxxxx
> <mailto:loskutov@xxxxxx>> wrote:
> 
>     The question is if there is a tool that could automatically convert
>     / export existing wiki content to github markdown format?
>     If not, manually changing everything is not an option.
> 
>     But as of today the "old" wiki is not planned to be shut down by
>     foundation like everything else?
> 
>  
> 
> There is issue about shutting it down but no date AFAICT
> https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/681
> <https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/681>
> 
>  
> 
>     So wd can keep it there.
> 
> 
> _______________________________________________
> jdt-dev mailing list
> jdt-dev@xxxxxxxxxxx
> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jdt-dev


Back to the top