On 02/01/2013 04:43 AM, Vladimir Kazanov wrote:
> On Fri, Feb 1, 2013 at 8:32 AM, Eric M. Ludlam<eric@...> wrote:
>>
>> On 01/31/2013 01:46 PM, Vladimir Kazanov wrote:
>>>
>>>
>>> Hm. Right now I am studying the iterative grammar, and trying to get to
>>> know wisent better along the way. Should I switch to the tagging grammar
>>> and improve it instead? What was the big plan on the topic?
>>
>>
>> There is no big plan. I'm not familiar with the improvements your propose to guess which is best.
>>
>> To have the broadest effect, changes should be made to the tagging grammar. If you change some output however, you would also need to update the full grammar to keep them in sync.
>>
>> The full grammar is useful to update if you have some tool that wants to operate on the code or methods for some reason. The full grammar also supports some Java feature I don't recall (generics?). Thus improvements in support there would have to go into that grammar, unless the whole feature were ported over to the tagging grammar.
>>
>> Does that help?
>> Eric
>>
>
> Okay, I got the point.
>
> By the way, I have solved that issue with tag generation. The whole
> point was that "block_statement" just nilled all results from
> "statement". Thanks!
>
> I am trying to get variables from "for" and "foreach" states into local scope:
>
> for (String iWantThisToBeSeen: args) {
> iWant_ // should autocomplete with iWantThisToBeSeen
> }
>
> Anyway, after getting a bit deeper into java.wy, I realized why that
> block had to be skipped and tried a different approach: add
> "statement" itself as one of the start productions and extend
> semantic-get-local-variables in wisent/java.el to get that var into
> business. The patch is in the attachment. Could you take a look, Eric?
> Does that look acceptable? Note, that this is a dirty proof-of-concept
> patch, definitely not for inclusion. I also plan to get into that unit
> test system of CEDET and write all the tests required to cover the
> case.
Your patch is a bit puzzling for me. On one side, it seems wrong since
there should be a nice arrangements between contexts and what gets
parsed, except that the for loop is outside said context.
I can't think of a better way to do it off the top of my head. Seems
like a reasonable idea. It could probably be used for C too.
Local variable parsing has always been a bit of a hack, particularly
since it wanders through your code backward. It would be nice to fix
that someday.
Eric
|