Expected behavior of AddTermsReportGroup

Aug 31, 2011 at 7:02 PM

I have been trying to use AddTermsReportGroup but the behavior is not what I expected. I expected that in the case of an error if any of the terminals provided was in that group, it would substitute them for the group alias. However, what I end up with is all the groups added displaying in all error messages. Looking at the code, it seems like there is no check to see if the group overlaps with the list of required terms it only does so for the Operator group. Is that the intended behavior?

Coordinator
Sep 1, 2011 at 6:18 AM

Don't quite understand - there is a processing for all groups, look at ComputeGroupedExpectedSetForState in CoreParser_Errorhandling.cs. The logic there seems ok to me. Trace your case through this method, and try to see why you get what you get. Maybe it's something else? - or maybe there's some bug in this method. 

Sep 2, 2011 at 3:21 AM
That was the code I looked at.

foreach(var group in grammar.TermReportGroups)
if(group.GroupType == TermReportGroupType.Normal ||
group.GroupType == TermReportGroupType.Operator &&
terms.Overlaps(group.Terminals)) {
result.Add(group.Alias);
terms.ExceptWith(group.Terminals);
}

Essentially, for an operator it overlaps the group with the expected
terminals but it does not do the same for "Normal" groups. Which seems
to cause all the normal groups to always report no matter which
terminals are expected.

On Wed, Aug 31, 2011 at 11:18 PM, rivantsov <notifications@codeplex.com> wrote:
> From: rivantsov
>
> Don't quite understand - there is a processing for all groups, look at
> ComputeGroupedExpectedSetForState in CoreParser_Errorhandling.cs. The logic
> there seems ok to me. Trace your case through this method, and try to see
> why you get what you get. Maybe it's something else? - or maybe there's some
> bug in this method.
>
> Read the full discussion online.
>
> To add a post to this discussion, reply to this email
> ([email removed])
>
> To start a new discussion for this project, email
> [email removed]
>
> You are receiving this email because you subscribed to this discussion on
> CodePlex. You can unsubscribe on CodePlex.com.
>
> Please note: Images and attachments will be removed from emails. Any posts
> to this discussion will also be available online at CodePlex.com



--
_________________________________________________
Sebastien St-Laurent (http://blogs.msdn.com/sebby1234)
Owner of Paradoxal Press (http://www.ParadoxalPress.com)
Author of "Shaders for Game Programmers and Artists"
Author of "The COMPLETE Effect and HLSL Guide"
_________________________________________________
Coordinator
Sep 2, 2011 at 5:48 AM

I think you're right, parenthesis are missing around || expression:

        if((group.GroupType == TermReportGroupType.Normal || group.GroupType == TermReportGroupType.Operator) && 
             terms.Overlaps(group.Terminals)) { ...

 thanks for finding this, will fix it in the next drop

 

Roman

Sep 2, 2011 at 5:49 AM
No problem. Made that change locally myself and seemed to have solved
the issue.

Thanks for looking into it.

On Thu, Sep 1, 2011 at 10:48 PM, rivantsov <notifications@codeplex.com> wrote:
> From: rivantsov
>
> I think you're right, parenthesis are missing around || expression:
>
> if((group.GroupType == TermReportGroupType.Normal || group
> .GroupType == TermReportGroupType.Operator) &&
> terms.Overlaps(group.Terminals)) { ...
>
>  thanks for finding this, will fix it in the next drop
>
>
>
> Roman
>
> Read the full discussion online.
>
> To add a post to this discussion, reply to this email
> ([email removed])
>
> To start a new discussion for this project, email
> [email removed]
>
> You are receiving this email because you subscribed to this discussion on
> CodePlex. You can unsubscribe on CodePlex.com.
>
> Please note: Images and attachments will be removed from emails. Any posts
> to this discussion will also be available online at CodePlex.com



--
_________________________________________________
Sebastien St-Laurent (http://blogs.msdn.com/sebby1234)
Owner of Paradoxal Press (http://www.ParadoxalPress.com)
Author of "Shaders for Game Programmers and Artists"
Author of "The COMPLETE Effect and HLSL Guide"
_________________________________________________