private void cm_showGram(cNotLL1Exception _ex) { f_rtbGram.Clear(); Color _col = f_rtbGram.SelectionColor; foreach (cLexem _lexem in cf_generator.cp_Lexems) { foreach (List<cLexem> _lstRightLex in _lexem.cp_ListProducts.Values) { cm_addLexemToRichText(_lexem, f_rtbGram); f_rtbGram.AppendText("-> "); bool _first = true; foreach (cLexem _rightLex in _lstRightLex) { if (_ex != null && _first && _lexem == _ex.cf_LeftLexem) if (_rightLex.cp_Type == eLexType.NonTerminal && _ex.cf_Lexem.cm_IsLeadingLexem(_rightLex) || _rightLex == _ex.cf_Lexem) f_rtbGram.SelectionColor = Color.Red; if (_first && !_rightLex.cm_HasEpsilonProduct()) _first = false; cm_addLexemToRichText(_rightLex, f_rtbGram); f_rtbGram.SelectionColor = _col; } f_rtbGram.AppendText("\n"); } } }
private void cm_showGram(cNotLL1Exception _ex) { f_rtbGram.Document.Blocks.Clear(); //Color _col = f_rtbGram.SelectionColor; foreach (cLexem _lexem in cf_generator.cp_Lexems) { foreach (cProduction _production in _lexem.cp_ListProducts) { cm_addLexemToRichText(_lexem, f_rtbGram); f_rtbGram.AppendText("-> "); bool _first = true; foreach (cLexem _rightLex in _production.cp_RightPart) { if (_ex != null && _first && _lexem == _ex.cf_LeftLexem) { if (_rightLex.cp_Type == eLexType.NonTerminal || _rightLex == _ex.cf_Lexem) { //f_rtbGram.SelectionColor = Color.Red; } } if (_first && !_rightLex.cp_HasEpsilonProduct) { _first = false; } cm_addLexemToRichText(_rightLex, f_rtbGram); //f_rtbGram.SelectionColor = _col; } foreach (cLexem _action in _production.cp_ActionList) { cm_addLexemToRichText(_action, f_rtbGram); } f_rtbGram.AppendText("\n"); } } }
private void cm_showGram(cNotLL1Exception _ex) { f_rtbGram.Clear(); Color _col = f_rtbGram.SelectionColor; foreach (cLexem _lexem in cf_generator.cp_Lexems) { foreach (List <cLexem> _lstRightLex in _lexem.cp_ListProducts.Values) { cm_addLexemToRichText(_lexem, f_rtbGram); f_rtbGram.AppendText("-> "); bool _first = true; foreach (cLexem _rightLex in _lstRightLex) { if (_ex != null && _first && _lexem == _ex.cf_LeftLexem) { if (_rightLex.cp_Type == eLexType.NonTerminal && _ex.cf_Lexem.cm_IsLeadingLexem(_rightLex) || _rightLex == _ex.cf_Lexem) { f_rtbGram.SelectionColor = Color.Red; } } if (_first && !_rightLex.cm_HasEpsilonProduct()) { _first = false; } cm_addLexemToRichText(_rightLex, f_rtbGram); f_rtbGram.SelectionColor = _col; } f_rtbGram.AppendText("\n"); } } }
private void cm_showGram(cNotLL1Exception _ex) { f_rtbGram.Document.Blocks.Clear(); //Color _col = f_rtbGram.SelectionColor; foreach (cLexem _lexem in cf_generator.cp_Lexems) { foreach (cProduction _production in _lexem.cp_ListProducts) { cm_addLexemToRichText(_lexem, f_rtbGram); f_rtbGram.AppendText("-> "); bool _first = true; foreach (cLexem _rightLex in _production.cp_RightPart) { if (_ex != null && _first && _lexem == _ex.cf_LeftLexem) { if (_rightLex.cp_Type == eLexType.NonTerminal || _rightLex == _ex.cf_Lexem) { //f_rtbGram.SelectionColor = Color.Red; } } if (_first && !_rightLex.cp_HasEpsilonProduct) _first = false; cm_addLexemToRichText(_rightLex, f_rtbGram); //f_rtbGram.SelectionColor = _col; } foreach (cLexem _action in _production.cp_ActionList) { cm_addLexemToRichText(_action, f_rtbGram); } f_rtbGram.AppendText("\n"); } } }