none
SrgsRuleRef with special attribute: GARBAGE RRS feed

  • Question

  • Greetings.

    I am creating a dynamic grammar (created during runtime) in c# and I want to do something like this:

    <item>
    <ruleref special="GARBAGE"/>
    </item>

    I've been browsing the documentation and I still can't figure how to do this.

    I need to create an SrgsRuleRef object and then set the attribute 'special' to "GARBAGE", correct? But, the constructor of the SrgsRuleRef needs a reference to a Rule... Which rule should I use? And how can I set the attribute 'special'?

    Is this possible to do? Or do I need to edit the XML myself?

    Thank you and regards,
    Paulo Pinto
    Thursday, May 17, 2007 5:02 PM

Answers

  •  

    I think that the line below will do what you want, but I haven't had a chance to try it, so caveat emptor. The Garbage field returns a SrgsRuleRef with the attribute you want. Presumably the code below will be preceded by and/or followed by definitions of other SrgsItem, SrgsOneOf, etc. to make up the grammar of your rule.

     

    SrgsRuleRef garbageRuleRef = SrgsRuleRef.Garbage;

     

    Mark

    Friday, May 18, 2007 12:24 AM

All replies

  •  

    I think that the line below will do what you want, but I haven't had a chance to try it, so caveat emptor. The Garbage field returns a SrgsRuleRef with the attribute you want. Presumably the code below will be preceded by and/or followed by definitions of other SrgsItem, SrgsOneOf, etc. to make up the grammar of your rule.

     

    SrgsRuleRef garbageRuleRef = SrgsRuleRef.Garbage;

     

    Mark

    Friday, May 18, 2007 12:24 AM
  • Thank you Mark!

    Your suggestion solved the problem.

    Regards,
    Paulo
    Friday, May 18, 2007 11:35 AM