public void Print_Info(List <Grammatics> element_str, string str_nterminals, string pr) { string s1 = ""; foreach (var element in element_str) { s1 += element.m_name + " "; } CompilerEvent.PrintCompileInfoLLParser("\nСтрока:" + s1); CompilerEvent.PrintCompileInfoLLParser("Магазин:" + str_nterminals); CompilerEvent.PrintCompileInfoLLParser("Правила:" + pr); }
public void Algoritm_Down() { string str_nterminals = m_nterminals[0].m_name + " " + eps.m_name; int index_i = 0, index_j = 0; index_i = m_element_str[0].number; index_j = Search_Index_J(Convert.ToString(str_nterminals[0])); int number_rule = 0; string pr = ""; while (m_tabel[index_j - 1, index_i - 1] != 33) { number_rule = m_tabel[index_j - 1, index_i - 1]; // определение номера правила if (number_rule == 32) { int rule = str_nterminals.IndexOf(" "); str_nterminals = str_nterminals.Remove(0, rule + 1); // удаление первого нетерминала m_element_str.RemoveAt(0); // удаление первого элемента из списка Print_Info(m_element_str, str_nterminals, pr); } else { foreach (var rule in m_rule) { if (rule.number == number_rule) { string[] str_nterminals_array = str_nterminals.Split(' '); str_nterminals_array[0] = rule.m_name; str_nterminals = ""; Scaning_Eps_Rule(str_nterminals_array, ref str_nterminals, rule.number); pr += " " + Convert.ToString(rule.number); Print_Info(m_element_str, str_nterminals, pr); } } } index_i = m_element_str[0].number; string[] laM = str_nterminals.Split(' '); index_j = Search_Index_J(laM[0]); if (m_tabel[index_j - 1, index_i - 1] == 31) { CompilerEvent.PrintCompileInfoLLParser("Ошибка при выполнении нисходящего разбора!"); m_element_str.Clear(); break; } } }