Hello!
Using 13.1, I'm trying to reproduce Step 1 from the "Implementing a TextDocument with a RichTextBox" documentation but the FromEbnf() method of the Grammar object doesn't seem to exist. Am I doing something wrong or is the doc wrong?
http://help.infragistics.com/NetAdvantage/WinForms/2013.1/CLR4.0/?page=Implementing_a_TextDocument_with_a_RichTextBox.html
What I'm trying to achieve is loading the syntax at runtime. This used to work in the CTP:
****************************
var grammar = new Grammar();grammar.FromEbnf(@"?<Grammar> <Name>MyGrammar</Name> <StartSymbol>Document</StartSymbol></Grammar>?;
?<TerminalSymbols> <TerminalSymbol> <Name>CommaToken</Name> <Value>,</Value> </TerminalSymbol> <TerminalSymbol> <Name>DotToken</Name> <Value>.</Value> </TerminalSymbol> <TerminalSymbol> <Name>ExclamationPointToken</Name> <Value>!</Value> </TerminalSymbol>
<!-- The question mark must be escaped below so the special sequence is not ended. --> <TerminalSymbol> <Name>QuestionMarkToken</Name> <Value>?</Value> </TerminalSymbol>
<TerminalSymbol> <Name>SemicolonToken</Name> <Value>;</Value> </TerminalSymbol> <TerminalSymbol> <Name>WordToken</Name> <Value>\w+</Value> <Comparison>RegularExpression</Comparison> </TerminalSymbol></TerminalSymbols>?;
Document = {Sentence};Sentence = Phrase, {PhraseSeparatingPunctuation, Phrase}, SentenceEndingPunctuation;SentenceEndingPunctuation = DotToken | ExclamationPointToken | QuestionMarkToken;PhraseSeparatingPunctuation = CommaToken | SemicolonToken;Phrase = _words;_words = WordToken | WordToken, _words;");
CustomLanguage language = new CustomLanguage(grammar);TextDocument document = new TextDocument();document.Language = language;
document.Append(@"Hello World! This sentence has multiple phrases; they are separated by a semicolon.");
document.Parse();
Is this still possible?
BTW, why is this forum still labeled with CTP? Has not the Parsing engine reached RTM in 13.1?
Thanks
Guy Barrette
Hello Guy,
Thank you for contacting Infragistics. I have been assigned to handle your case. You are not wrong as this documentation will be updated.
Please use the following documentation to understand our new object model. http://help.infragistics.com/NetAdvantage/WPF/2013.1/CLR4.0/?page=IG_SPE.html
The documentation I've provided is for WPF, but will provide you with the same terminology used in our WinForms.
Please let me know if you have any additional questions about this matter.