示例#1
0
        public static void Main(string[] args)
        {
            string pathToResourceFile = "..\\..\\resources\\resource.db";
            string pathToResultFile   = "..\\..\\result.db";

            Analizer      analizer = new Analizer(pathToResourceFile);
            ResultsWriter writer   = new ResultsWriter(pathToResultFile);

            writer.WriteResultToFile(analizer.GetIdentsFormattedString());
            writer.WriteResultToFile(analizer.GetConstantsFormattedString());
            writer.WriteResultToFile(analizer.GetOtherLexemsWordsFormattedString());
            writer.Finish();
        }
示例#2
0
        public static void Main(string[] args)
        {
            string pathToResourceFile = "..\\..\\resources\\resource.db";
            string pathToResultFile   = "..\\..\\result.db";

            InstructionsTreatment treater = new InstructionsTreatment(pathToResourceFile);
            ResultsWriter         writer  = new ResultsWriter(pathToResultFile);

            while (true)
            {
                treater.SetNextLexemTypeToTreater();
                LexemsType type = treater.CurrentLexem;
                string     word = treater.CurrentWord;
                writer.WriteResultToFile(type, word);
                if (word.Trim() == "@")
                {
                    break;
                }
            }

            treater.Finish();
            writer.Finish();
        }