Ejemplo n.º 1
0
        private void DirectoryClick(object sender, RoutedEventArgs e)
        {
            List <string[]> directories = Grammar.FindDirectories();
            bool            v           = Grammar.VerifyDis(directories);

            if (v == false)
            {
                TableBlock.AppendText("\n Gramatica nu respecte conditia necesara pentru a fi GRAMATICA LL1 \n");
            }

            foreach (string[] dir in Grammar.Directory)
            {
                if (dir[0] == "first ")
                {
                    TableBlock.AppendText("\n");
                    TableBlock.AppendText(dir[0].ToUpper() + " " + dir[1].Substring(0, 1) + " : { ");
                    //   TableBlock.Text = s;
                }
                else
                {
                    TableBlock.AppendText("\n");
                    TableBlock.AppendText(dir[0].ToUpper() + " " + dir[2] + " : { ");
                }

                int i = 5;


                while (i < dir.Length)
                {
                    if (dir[i] == null)
                    {
                        TableBlock.AppendText(" }\n");

                        break;
                    }


                    TableBlock.AppendText(" " + dir[i]);
                    i++;
                }
            }

            TableBlock.AppendText(" }\n");


            table = GetTable();
        }