Warning: session_start(): open(/tmp/sess_a9pq86rnaf8ej9erv5hklfb090, O_RDWR) failed: No space left on device (28) in /www/H01/htdocs/lib/base/lib_base.php on line 280
Parser openDesktop.org
-
 KDE-Apps.org Applications for the KDE-Desktop 
 GTK-Apps.org Applications using the GTK Toolkit 
 GnomeFiles.org Applications for GNOME 
 MeeGo-Central.org Applications for MeeGo 
 CLI-Apps.org Command Line Applications 
 Qt-Apps.org Free Qt Applications 
 Qt-Prop.org Proprietary Qt Applications 
 Maemo-Apps.org Applications for the Maemo Plattform 
 Java-Apps.org Free Java Applications 
 eyeOS-Apps.org Free eyeOS Applications 
 Wine-Apps.org Wine Applications 
 Server-Apps.org Server Applications 
 apps.ownCloud.com ownCloud Applications 
--
-
 KDE-Look.org Artwork for the KDE-Desktop 
 GNOME-Look.org Artwork for the GNOME-Desktop 
 Xfce-Look.org Artwork for the Xfce-Desktop 
 Box-Look.org Artwork for your Windowmanager 
 E17-Stuff.org Artwork for Enlightenment 
 Beryl-Themes.org Artwork for the Beryl Windowmanager 
 Compiz-Themes.org Artwork for the Compiz Windowmanager 
 EDE-Look.org Themes for your EDE Desktop 
--
-
 Debian-Art.org Stuff for Debian 
 Gentoo-Art.org Artwork for Gentoo Linux 
 SUSE-Art.org Artwork for openSUSE 
 Ubuntu-Art.org Artwork for Ubuntu 
 Kubuntu-Art.org Artwork for Kubuntu 
 LinuxMint-Art.org Artwork for Linux Mint 
 Arch-Stuff.org Art And Stuff for Arch Linux 
 Frugalware-Art.org Themes for Frugalware 
 Fedora-Art.org Artwork for Fedora Linux 
 Mandriva-Art.org Artwork for Mandriva Linux 
--
-
 KDE-Files.org Files for KDE Applications 
 OpenTemplate.org Documents for OpenOffice.org
 GIMPStuff.org Files for GIMP
 InkscapeStuff.org Files for Inkscape
 ScribusStuff.org Files for Scribus
 BlenderStuff.org Textures and Objects for Blender
 VLC-Addons.org Themes and Extensions for VLC
--
-
 KDE-Help.org Support for your KDE Desktop 
 GNOME-Help.org Support for your GNOME Desktop 
 Xfce-Help.org Support for your Xfce Desktop 
--
openDesktop.orgopenDesktop.org:   Applications   Artwork   Linux Distributions   Documents    Linux42.org    OpenSkillz.com   
 
Home
Apps
Artwork
News
Groups
Knowledge
Events
Forum
People
Jobs
Register
Login


-
- Content .- Fans (2) .- Knowledge Base  . 

Parser

   1.0  

Qt Education

Score 60%
Parser
zoom


Parser
zoom


Parser
zoom


Downloads:  285
Submitted:  Dec 10 2009
Updated:  Dec 23 2009

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^308). 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^308). Суммарной объем текстовых файлов с кодом 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.


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




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




LicenseLGPL
MS Windows(sources parser)
Send to a friend
Subscribe
Other  Content  from daimonKor
Report inappropriate content



goto page: prev   1  2 

-
.

 english please

 
 by zloidemon on: Dec 17 2009
 
Score 50%

Хоть этого перевод на английский сделай.

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


Reply to this

-

 Re: english please

 
 by daimonKor on: Dec 17 2009
 
Score 50%

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


Reply to this

-

 Перевод

 
 by lit-uriy on: Dec 17 2009
 
Score 50%

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


Reply to this

-

 Bag

 
 by daimonKor on: Dec 21 2009
 
Score 50%

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


Reply to this

goto page: prev   1  2 

Add commentBack




-



 
 
 Who we are
Contact
More about us
Frequently Asked Questions
Register
Twitter
Blog
Explore
Apps
Artwork
Jobs
Knowledge
Events
People
Updates on identi.ca
Updates on Twitter
Content RSS   
Events RSS   

Participate
Groups
Forum
Add Content
Public API
About openDesktop.org
Legal Notice
Spreadshirt Shop
CafePress Shop
Advertising
Sponsor us
Report Abuse
 

Copyright 2007-2016 openDesktop.org Team  
All rights reserved. openDesktop.org is not liable for any content or goods on this site.
All contributors are responsible for the lawfulness of their uploads.
openDesktop is a trademark of the openDesktop.org Team