Exemple #1
0
        public void printNewFile()
        {
            rezultNumber.Text = "";
            rezult.Text       = "";
            var st = new TextRange(begin.Document.ContentStart, begin.Document.ContentEnd).Text;

            st = st.Remove(st.Length - 3);
            var stMass = st.Split('\n');

            deleteSymbol(stMass);
            var st2 = new TextRange(RTB.Document.ContentStart, RTB.Document.ContentEnd).Text;
            //st2 = st2.Remove(st2.Length - 2);
            var stMass2 = st2.Split('\n');

            // deleteSymbol(stMass2);
            rezultName.Text = nameFileRezult;
            using (var streamWriter = new StreamWriter("\\\\Mac\\Home\\Desktop\\Универ\\Методы трансляции\\CompilerPascal\\CompilerPascal\\TextFile\\" + nameFileRezult, false))
            {
                modulInpOut        = new InpOut(stMass, stMass2, streamWriter);
                modulInpOut.Parent = this;
                lexAnalyz          = new LexAnalyz(modulInpOut, "Listing.txt");

                while (!modulInpOut.EndOfFile)
                {
                    lexAnalyz.NextSum();
                }
                if (lexAnalyz.IsComm)
                {
                    modulInpOut.error(86, modulInpOut.posNow);
                    modulInpOut.ListErrors();
                }
                streamWriter.WriteLine("Кoмпиляция окончена: ошибок - " + modulInpOut.NumError + "!");
                rezult.Text += "Кoмпиляция окончена: ошибок - " + modulInpOut.NumError + "!" + "\n";
            }
        }
Exemple #2
0
 public LexAnalyz(InpOut inpOut, string nameFileListing)
 {
     this.inpOut          = inpOut;
     this.nameFileListing = nameFileListing;
     textPosition         = new TextPosition()
     {
         LineNumber = 1,
         PosInLine  = 1
     };
     using (var streamWriter = new StreamWriter("\\\\Mac\\Home\\Desktop\\Универ\\Методы трансляции\\CompilerPascal\\CompilerPascal\\TextFile\\" + nameFileListing, false))
     {
     }
 }