Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
5.0

Available as/for:
Description:
ANNOTATION

The program is designed to calculate algebraic expressions. Allowed to enter expressions that contain a lot of action and variable (variable must declare in advance). There are settings (for the text field log).
Base class for the program Qt - «QApplication (library Qt),« menuPar »- base class for my program (the successor of the class of the form« menuParClass »and« QMainWindow ». Has menu and sets the central widget, causing errors and configuration), «GUIPar» - heir class form «GUIParClass» and «QWidget», is the central widgets «menuPar». Functionality - graphical class «parser», «parser» - the most important class parses and evaluates its expression in action (priorities for mathematical laws). There is also a structure of options - «Csettings», contains fields that determine the accuracy of answers, or unit angle and others. For the previous structure was created graphic visualization (in dialogue «menuPar» - the successor class of the class of the form «Settings_dialogClass» and class «QDialog». When writing the program used by the operating system MS Windows XP Professional version 2002 Service Pack 2, programming language C + +, programming environment Visual Studio Professional 2008 and the commercial version of the library Qt 4.5.0.
Hardware Requirements: PC based on an Intel Pentium 3 and above with at least 128MB of RAM, operating system MS Windows XP and above. NET Framework 2.0 and above.
Incoming data is an algebraic expression. After you read the data from the registry and set as a preference (if not - default settings). The program handles errors Mathematical plan and all possible system errors (double max 10^30. Total volume of text files, program code 723 KB. The work program is the result of which you can copy (a method) or save as a text file type doc.

DESCRIPTION LOGICAL STRUCTURE

Class «parser» implements the solution of algebraic expressions according to the principle of recursive top-down analysis. Class «GUIPar» - a graphical interface for «parser». Class «menuPar» implements the main window with menus, toolbar, status bar and the central widget ( «GUIPar».
Consider the logical structure of a class «parser» for example, "2-2 * 3"
In the class of «GUIPar» 2 class methods are called «parser»: «SetFunction ()» takes an algebraic expression - an array of characters, pereprisvoyue «Functions» adopted by the expression, allocates memory for «token», «exp_ptr» indicates the beginning of the expression «Function» ( Flowchart 3.1), «start () - returns the number of type double (reply) (block diagram 3.2).
Function of demand «get_token ()» pereprisvoyue «token» - points to the current character (during parsing), «tok_type» - the format of the token ( «DELIMITER», «NUMBER» ...), and changes vkazivnk «exp_ptr» - points to the part of line that remains unintelligible. All conversions are carried out by checking the array of characters on the symbol, number, punctuation, etc.
During the call the function «start ()» (Flowchart 3.2), the starting point of analysis, using the function «get_token ()» (Flowchart 3.3) extracts the first token. If it is equal to 0, the function displays an error message «Empty expression; n» and returns control to the calling module. Only in this case, the token has the number 2 - not equal to 0, the function «ifVar ()». As a result of the function «ifVar ()» calls the «sumORsub (), and« sumORsub () »is« mulORdevisionORproc () », which in turn calls the« powNum () ». Function «powNum ()» calls the «unaryMinus_Plus ()». Then the function «unaryMinus_Plus ()» checks a token unary plus or minus, and if not, calls the «functions ()». If «tok_type = FUNC» - handled events for functions: checking the line at the name, call «get_token ()» (Flowchart 3.3) and «inBrackets ()» and calculation functions. In this example, the functions do not, therefore, the function «inBrackets ()». At this point the program function «inBrackets ()» or recursively calls the «sumORsub ()» (if the expression contains parentheses), or calls the «returnNum ()», returning a number. Since the token is not an opening parenthesis, the function is executed «returnNum ()», and the variable «result» assigned number 2. Then, in the words of the next token is retrieved, and the function returns the chain. Since the next token contains the sign "-", control is passed to the function «sumORsub ()».
Since the token contains the sign "-", he writes in the variable «op». Then the analyzer extracts the next token equal to the number 2, and then starts falling on the analysis chain. First, as before, the function «returnNum ()», which returns the number 2. Then this number is assigned to the variable «result», then reads the token "*". Then control is returned to the chain in the function «mulORdevisionORproc ()», which reads the last token equal to the number 3. At this point, running the first arithmetic operation - multiplication "2 * 3. The result is returned in the function «sumORsub ()», in which the subtraction. The result of subtracting the number is -4.


changed the priority of operations - first pow and then unary minus !!!!!!!!!!!!!


АННОТАЦИЯ

Программа предназначена для вычисления алгебраических выражений. Допускается ввод выражений, содержащих множество действий и переменных (переменные предварительно нужно объявить. Есть настройки (для текстового поля log).
Базовый класс для работы программы Qt - «QАpplication» (библиотека Qt), «menuPar» - базовый класс для моей программы (наследник от класса формы «menuParClass» и «QMainWindow». Имеет меню и устанавливает центральный виджет, вызывает ошибки и настройки), «GUIPar» - наследник класса формы «GUIParClass» и «QWidget», является центральным виджетом «menuPar». Функциональное назначение - графическая оболочка для класса «parser», «parser» - самый главный класс разбирает выражение и вычисляет его по действиям приоритеты по математическим законам. Есть также структура настроек - «Csettings», содержит поля, определяющие точность ответа или единицы измерения угла и др. Для предварительной структуры была создана графическая визуализация (диалог в «menuPar» - класс наследник от класса формы «Settings_dialogClass» и класса «QDialog». При написании программы использовалась операционная система MS Windows XP Professional версия 2002 Service Pack 2, язык программирования C + +, среда программирования Visual Studio Professional 2008 и коммерческая версия библиотеки Qt 4.5.0.
Требования к аппаратному обеспечению: ПЭВМ на базе процессора Intel Pentium 3 и выше с ОЗУ не менее 128МБ, операционная система MS Windows XP и выше. NET Framework 2.0 и выше.
Входными данными является алгебраический выражение. После запуска программы считываются данные из реестра и устанавливаются как настройки (если их нет - стандартные настройки). Программа обрабатывает ошибки математического плана и все возможные системные ошибки (а именно ограничил double max 10^30. Суммарной объем текстовых файлов с кодом 723 КБ. Результатом работы программы является результат, который можно скопировать (есть метод) или сохранить как текстовый файл типа doc.

ОПИСАНИЕ ЛОГИЧЕСКОЙ СТРУКТУРЫ

Класс «parser» реализует решение алгебраических выражений по принципу рекурсивного нисходящего анализа. Класс «GUIPar» - графический интерфейс для «parser». Класс «menuPar» реализует главное окно с меню, панелью инструментов, строкой статуса и центральным виджетом ( «GUIPar».
Рассмотрим логическую структуру класса «parser» на примере «2-2 * 3»
В классе «GUIPar» вызываются 2 методы класса «parser»: «SetFunction ()» принимает алгебраический выражение - массив символов, переприсвоюе «Functions» принятом выражения, выделяет память под «token», «exp_ptr» указывает на начало выражения «Function »(блок-схема 3.1),« start () - возвращает число типа double (ответ) (блок-схема 3.2).
Фунция «get_token ()» переприсвоюе «token» - указывает на текущий символ (во время разбора), «tok_type» - формат лексемы ( «DELIMITER», «NUMBER» ...), и изменяет вказивнк «exp_ptr» - показывает на часть строке, которую осталось разобрать. Все преобразования осуществляются посредством проверки массива символов на символ, число, знак пунктуациии и т.д.
Во время вызова функции «start ()» (блок-схема 3.2), отправная точка анализа, при помощи функции «get_token ()» (блок-схема 3.3) извлекает первую лексему. Если она равна 0, функция выводит сообщение об ошибке «Empty expression; n» и возвращает управление вызывающего модуля. Только в данном случае лексема имеет число 2 - не равно 0, вызывается функция «ifVar ()». В результате функция «ifVar ()» вызывает функцию «sumORsub (), а« sumORsub () »вызывает« mulORdevisionORproc () », которая в свою очередь вызывает функцию« powNum () ». Функция «powNum ()» вызывает функцию «unaryMinus_Plus ()». Затем функция «unaryMinus_Plus ()» проверяет, является лексема унарный плюсом или минусом, и если нет, вызывает функцию «functions ()». Если «tok_type = FUNC» - обрабатываются события для функций: проверка строке на название функции, вызов «get_token ()» (блок-схема 3.3) и «inBrackets ()» и расчет функции. На данном примере функций нет, поэтому вызывается функция «inBrackets ()». В этой точке программы функция «inBrackets ()» или рекурсивно вызывает функцию «sumORsub ()» (если выражение содержит скобки), или вызывает функцию «returnNum ()», возвращающая число. Поскольку лексема не является открывающей скобкой, выполняется функция «returnNum ()», и переменной «result» присваивается число 2. Затем по выражению извлекается следующая лексема, и функции возвращают управление по цепочке. Поскольку следующая лексема содержит знак «-», управление передается функции «sumORsub ()».
Поскольку лексема содержит знак «-», он записывается в переменную «op». Затем анализатор извлекает следующую лексему, равную числу 2, и снова начинается нисходящий анализ по цепочке. Сначала, как и раньше, вызывается функция «returnNum ()», которая возвращает число 2. Затем это число присваивается переменной «result», после чего считывается лексема «*». После этого управление возвращается по цепочке в функцию «mulORdevisionORproc ()», которая считывает последнюю лексему, равную числу 3. В этот момент выполняется первый арифметическая операция - умножение «2 * 3. Результат возвращается в функцию «sumORsub ()», в которой выполняется вычитание. Результатом вычитания является число -4.


поменялся приоритет операций - сначала степень потом унарный минус!!!!!!!!!!!!!
Last changelog:

1. Bag is -2^2 = 4, correctly -2^2 = -4 - error corrected
2. Bag is function precision double if s=-3 -> s^3 -> =nan - error corrected
3. Russian translation load for default russian language in OS


Ratings & Comments

11 Comments

daimonKor

I found bag -- -2^2=4 Error was in the priority of operations, corrected

lit-uriy

Для чернового перевода можешь воспользоваться Гуглом. Или парой программ тут же на qt-apps: gtranslate (http://qt-apps.org/content/show.php/gtranslate?content=97863) и QGoogleTranslate (http://qt-apps.org/content/show.php/QGoogleTranslate?content=100713)

zloidemon

Хоть этого перевод на английский сделай. Извените что на украинском (курсач был такой) нет времени переводить

daimonKor

Там среди файлов валяется ts

daimonKor

За оформление не серчайте позже оформлю по норме. Курсач сейчас жмёт

lit-uriy

Что за анализатор, чего анализирует?

daimonKor

Анализирует строку char * по нисходящему анализу; строка 2+2 возвращает double 4

daimonKor

там исходники зиповский архив- сам проверял скачивал

maxvanceffer

Слушай а исходники можно ?

daimonKor

Ну как прога компилится. Как работает? Ваше мнение?

daimonKor

Как прога? Ваше мнение

Pling
0 Affiliates
Details
license
version 1.0
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 0

Other Education Apps:

Fresh Memory
zavulon5
last update date: 10 years ago

Score 5.8

Programa PTC
confenalfam
last update date: 13 years ago

Score 4.0

gmbCrossword
mikaelu
last update date: 19 years ago

Score 5.0

Klassroom
bornio
last update date: 21 years ago

Score 5.0

ksociograma
edith
last update date: 16 years ago

Score 5.0

Fresh Memory Lite
zavulon6
last update date: 9 years ago

Score 5.0



System Tags