*** wxParserDemo - STX Expression Parser Demo Application *** Author: Timo Bingmann (Mail: tb a-with-circle idlebox dot net) Date: 2007-07-17 --- Summary --- This directory contains a wxWidgets demo application. It is a user-friendly graphical user interface to demonstrate the STX Expression Parser's functions. The demo allows the user to enter an expression string and press "Evaluate" to run the parser over it. If the expression could be parsed and evaluated correctly, the result's value and type are displayed. Otherwise an error message is shown. The demo also has a data input grid to specify variables, which can be used in the expression. The demo program uses the cross-platform wxWidgets toolkit and can be compiled on Linux, Windows and MacOSX. --- Website / License --- The current demo source and some compiled binaries can be downloaded from http://idlebox.net/2007/stx-exparser/ Some binary executables for Linux and Windows can be downloaded from http://idlebox.net/2007/stx-exparser/demo.htt The demo's source code is released under the GNU General Public License v2 (GPL) which can be found in the file COPYING. --- Short Usage Walk-Through --- The demo application has one large expression input field in the upper half of the dialog. The given expression can be parsed and evaluated by pressing "Evaluate". These results are printed in the "Result" tag, which automatically gets activated. The "Result" tab is separated into two parts: the upper group box contains the resulting parse tree converted back to a string; or the syntax error if the expression is invalid. The re-stringified expression usually contains more brackets than your input expression. It is generated by the toString() function of stx::ParseNode or stx::ParseTree. The lower part of the "Result" tab shows the evaluation result, if it could be computed. Both type and value of the resulting AnyScalar are displayed. If the tree could not be evaluated, e.g. if an undefined variable was used, then the exception message is shown. The "XML Tree" tab contains Boost.Spirit's debug XML output. It shows in detail which Spirit rules are used to compose the parse tree. The demo applications allows input expressions to use variable names. The (non-standard) variables set before evaluating a parse tree are shown in the grid input on the "Variables" tab. They can be set by entering data into the grid. Lines with empty names are ignored. For screenshots on how to use the demo, please see the screenshot directory. Or visit http://idlebox.net/2007/stx-exparser/demo.htt