Пример #1
0
        public void Analyse()
        {
            bool         ok;
            WorkWithText workWithText  = new WorkWithText("OutPut.txt");
            WorkWithText workWithLexem = new WorkWithText("Lexem");
            string       text          = "";

            for (int i = 0; i < Lines.Length; i++)
            {
                Pos  = 0;
                Bail = 0;
                try {
                    ok = Start(Lines[i]);
                    if (ok && Bail == 1)
                    {
                        text += Lines[i] + "\n";
                    }
                    else
                    {
                        Console.WriteLine($"Lexical exception in {i} row, {Pos} position");
                    }
                } catch (Exception ex) {
                    Console.WriteLine($"Lexical exception in {i} row, {Pos} position. Body{ex.Message}");
                }
            }
            if (!String.IsNullOrWhiteSpace(text))
            {
                workWithText.SetText(text);
            }
            workWithLexem.SetText(LexemText);
        }
Пример #2
0
        static void Main(string[] args)
        {
            WorkWithText workWithText = new WorkWithText("input.txt");
            LexAnelasy   lexAnelasy   = new LexAnelasy(workWithText.GetLines());

            lexAnelasy.Analyse();
            Console.ReadLine();
        }