Розробка системних програмних модулів та компонент систем програмування

Автор: Пользователь скрыл имя, 25 Февраля 2012 в 16:19, курсовая работа

Описание работы

Незважаючи на більш ніж піввікову історію обчислювальної техніки, формально роком народження теорії трансляторів можна вважати 1957, коли з'явився перший транслятор мови Фортран, створений Бекасом. До цього часу створення трансляторів було досить "творчим" процесом. Лише поява теорії формальних мов і строгих математичних моделей дозволило перейти від "творчості" до "науки".

Содержание

Вступ
1. Огляд методів та способів проектування трансляторів
1.1. Основні поняття і визначення
1.2. Узагальнена структура транслятора
1.4. Варіанти взаємодії блоків транслятора
2. Формальний опис вхідної мови програмування
2.1. Деталізований опис вхідної мови в термінах розширеної нотації Бекуса-Наура
2.2. Опис термінальних символів та ключових слів
3. Розробка транслятора вхідної мови програмування
3.1. Вибір технології програмування
3.2. Проектування таблиць транслятора та вибір структур даних
3.3. Розробка лексичного аналізатора
3.3.1. Розробка граф-схеми алгоритму
3.3.2. Опис програмної реалізації лексичного аналізатора
3.4. Розробка синтаксичного та семантичного аналізатора
3.4.1. Розробка граф-схеми алгоритму
3.4.2. Опис програмної реалізації синтаксичного та семантичного аналізатора
3.5. Розробка генератора коду
3.5.1. Розробка граф-схеми алгоритму
3.5.2. Опис програмної реалізації генератора коду
4. Опис інтерфейсу та інструкції користувача
4.1. Опис інтерфейсу
4.1.1. Головне меню та панель інструментів.
4.2. Інструкція програміста
4.2.1. Алфавіт мови
4.2.2. Коментарі
4.2.3. Тип даних
4.2.4. Розділи, використовувані при написанні програм
4.2.5. Типи операцій
4.2.6. Типи операторів
5. Відлагодження та тестування програми
5.1. Виявлення лексичних помилок
5.2. Виявлення синтаксичних помилок
5.3. Виявлення семантичних помилок
5.4. Загальна перевірка коректності роботи транслятора
Висновки
Список літератури
Додатки
А. Лістинг програми

Работа содержит 1 файл

asm_cource_k9.doc

— 1,020.00 Кб (Скачать)

                                    Lex.Value = 0;

                                    SourcePointer += 3;

                                }

                                else

                                {

                                    return ProcessIdent();

                                }

 

                            }

                            else

                            {

                                return ProcessIdent();

                            }

                            return Lex;

                        }

                    case 'I':

                        {

                            if (Source[SourcePointer + 1] != '$')

                            {

                                if (Source[SourcePointer + 1] == 'f')

                                {

                                    if ((LexemEnd(Source[SourcePointer + 2]) | IsSeparator(Source[SourcePointer + 2]) | (Source[SourcePointer + 2] == '$')))

                                    {

                                        Lex.Type = LexemType.If;

                                        Lex.Text = "If";

                                        Lex.Line = Line;

                                        Lex.Value = 0;

                                        SourcePointer += 2;

                                    }

                                    else

                                    {

                                        return ProcessIdent();

                                    }

                                }

                                else

                                {

                                    if (Source[SourcePointer + 1] == 'n')

                                    {

                                        if (SourcePointer < Source.Length - 5)

                                        {

                                            string sub = Source.Substring(SourcePointer, 5);

                                            if ((sub == "Input") & (LexemEnd(Source[SourcePointer + 5]) | IsSeparator(Source[SourcePointer + 5]) | (Source[SourcePointer + 5] == '$')))

                                            {

                                                Lex.Type = LexemType.Input;

                                                Lex.Text = "Input";

                                                Lex.Line = Line;

                                                Lex.Value = 0;

                                                SourcePointer += 5;

                                            }

                                            else

                                            {

                                                return ProcessIdent();

                                            }

                                        }

                                        else

                                        {

                                            return ProcessIdent();

                                        }

                                    }

                                    else

                                    {

                                        return ProcessIdent();

                                    }

                                }

                            }

                            else

                            {

                                return ProcessIdent();

                            }

                            return Lex;

                        }

                    case 'F':

                        {

                            if (Source[SourcePointer + 1] != '$')

                            {

                                if (Source[SourcePointer + 1] == 'o')

                                {

                                    if (!(LexemEnd(Source[SourcePointer + 2]) | IsSeparator(Source[SourcePointer + 2]) | (Source[SourcePointer + 2] == '$')))

                                    {

                                        if (SourcePointer < Source.Length - 3)

                                        {

                                            string sub = Source.Substring(SourcePointer, 3);

                                            if ((sub == "For") & (LexemEnd(Source[SourcePointer + 3]) | IsSeparator(Source[SourcePointer + 3]) | (Source[SourcePointer + 3] == '$')))

                                            {

                                                Lex.Type = LexemType.For;

                                                Lex.Text = "For";

                                                Lex.Line = Line;

                                                Lex.Value = 0;

                                                SourcePointer += 3;

                                            }

                                            else

                                            {

                                                return ProcessIdent();

                                            }

                                        }

                                        else

                                        {

                                            return ProcessIdent();

                                        }

                                    }

                                    else

                                    {

                                        return ProcessIdent();

                                    }

                                }

                                else

                                {

                                    if (Source[SourcePointer + 1] == 'i')

                                    {

                                        if (SourcePointer < Source.Length - 6)

                                        {

                                            string sub = Source.Substring(SourcePointer, 6);

                                            if ((sub == "Finish") & (LexemEnd(Source[SourcePointer + 6]) | IsSeparator(Source[SourcePointer + 6]) | (Source[SourcePointer + 6] == '$')))

                                            {

                                                Lex.Type = LexemType.Finish;

                                                Lex.Text = "Finish";

                                                Lex.Line = Line;

                                                Lex.Value = 0;

                                                SourcePointer += 6;

                                            }

                                            else

                                            {

                                                return ProcessIdent();

                                            }

                                        }

                                        else

                                        {

                                            return ProcessIdent();

                                        }

                                    }

                                    else

                                    {

                                        return ProcessIdent();

                                    }

                                }

                            }

                            else

                            {

                                return ProcessIdent();

                            }

                            return Lex;

                        }

                    case 'D':

                        {

                            if (Source[SourcePointer + 1] != '$')

                            {

                                if ((Source[SourcePointer + 1] == 'o')& (LexemEnd(Source[SourcePointer + 3]) | IsSeparator(Source[SourcePointer + 3]) | (Source[SourcePointer + 3] == '$')))

                                {

                                    Lex.Type = LexemType.Do;

                                    Lex.Text = "Do";

                                    Lex.Line = Line;

                                    Lex.Value = 0;

                                    SourcePointer += 2;

                                }

                                else

                                {

                                    if (Source[SourcePointer + 1] == 'i')

                                    {

                                        if (SourcePointer < Source.Length - 3)

                                        {

                                            string sub = Source.Substring(SourcePointer, 3);

                                            if ((sub == "Div") & (LexemEnd(Source[SourcePointer + 3]) | IsSeparator(Source[SourcePointer + 3]) | (Source[SourcePointer + 3] == '$')))

                                            {

                                                Lex.Type = LexemType.Divide;

                                                Lex.Text = "Div";

                                                Lex.Line = Line;

                                                Lex.Value = 0;

                                                SourcePointer += 3;

                                            }

                                            else

                                            {

                                                return ProcessIdent();

                                            }

                                        }

                                        else

                                        {

                                            return ProcessIdent();

                                        }

                                    }

                                    else

                                    {

                                        if (SourcePointer < Source.Length - 6)

                                        {

                                            string sub = Source.Substring(SourcePointer, 6);

                                            if ((sub == "DownTo") & (LexemEnd(Source[SourcePointer + 6]) | IsSeparator(Source[SourcePointer + 6]) | (Source[SourcePointer + 6] == '$')))

                                            {

                                                Lex.Type = LexemType.DownTo;

                                                Lex.Text = "DownTo";

                                                Lex.Line = Line;

                                                Lex.Value = 0;

                                                SourcePointer += 6;

                                            }

                                            else

                                            {

                                                return ProcessIdent();

                                            }

                                        }

                                        else

                                        {

                                            return ProcessIdent();

                                        }

                                    }

                                }

                            }

                            else

                            {

                                return ProcessIdent();

                            }

                            return Lex;

                        }

                    case 'O':

                        {

                            if (SourcePointer < Source.Length - 6)

                            {

                                string sub = Source.Substring(SourcePointer, 6);

                                if ((sub == "Output") & (LexemEnd(Source[SourcePointer + 6]) | IsSeparator(Source[SourcePointer + 6]) | (Source[SourcePointer + 6] == '$')))

                                {

                                    Lex.Type = LexemType.Output;

                                    Lex.Text = "Output";

                                    Lex.Line = Line;

                                    Lex.Value = 0;

                                    SourcePointer += 6;

                                }

                                else

                                {

                                    return ProcessIdent();

                                }

                            }

                            else

                            {

Информация о работе Розробка системних програмних модулів та компонент систем програмування