|
wxMaxima
|
The evaluation-queue driver / command protocol extracted from wxMaxima. More...
#include <MaximaEvaluator.h>
Public Member Functions | |
| MaximaEvaluator (wxMaxima &wxm) | |
| void | SendMaxima (wxString s, bool addToHistory=false, bool background=false) |
| Sends a string to the Maxima process (optionally adding it to the history and/or marking it a background command that must not change the busy state). | |
| void | FirstOutput () |
| Prepares the worksheet once Maxima's first prompt has been seen. | |
| bool | AbortOnError () |
| Reacts to a Maxima error: decides whether to keep evaluating the queue. | |
| bool | QueryVariableValue () |
| Queries the value of the next variable wxMaxima wants to know about. | |
| void | EvaluateEvent (wxCommandEvent &event) |
| The "evaluate" menu/hotkey handler: queues the active/selected cells and starts evaluation (or sends an answer to a pending question). | |
| void | TriggerEvaluation () |
| If Maxima is idle and the queue is non-empty, sends the next command; otherwise settles the UI into its idle state. The core queue pump. | |
| void | SetupVariables () |
| Sends Maxima the one-time startup configuration. | |
| void | StartCommand (long start) |
| Remembers where in its cell the command that is being sent starts. | |
| void | AddCommandOutput (const wxString &text) |
| Collects what Maxima printed in reply to the current command. | |
| void | MarkErrorStatement (GroupCell *cell) |
Marks the statement the current command came from as the one that caused an error, in the cell cell (GH #289). | |
| void | MarkSyntaxErrorSpot () |
| If Maxima reported a syntax error for the current command, marks where in its statement it is, and puts the cursor there. | |
The evaluation-queue driver / command protocol extracted from wxMaxima.
Owned by value by the wxMaxima frame. Holds a reference back to that frame for the services it needs (the worksheet, the socket, the status bar).
| bool MaximaEvaluator::AbortOnError | ( | ) |
Reacts to a Maxima error: decides whether to keep evaluating the queue.
| void MaximaEvaluator::AddCommandOutput | ( | const wxString & | text | ) |
Collects what Maxima printed in reply to the current command.
Only plain text (the kind an error message is) is collected: a syntax error report can arrive in several pieces, and only all of it together tells where the error is.
| void MaximaEvaluator::MarkErrorStatement | ( | GroupCell * | cell | ) |
Marks the statement the current command came from as the one that caused an error, in the cell cell (GH #289).
Does nothing if the cell isn't the one that is being evaluated: an error can also arrive when nothing is, and there is no statement to blame then. Marks the statement only once per command, however many pieces the error message arrives in. If the error is a syntax error, also marks where in the statement it is, as soon as Maxima's output tells.
| void MaximaEvaluator::MarkSyntaxErrorSpot | ( | ) |
| bool MaximaEvaluator::QueryVariableValue | ( | ) |
Queries the value of the next variable wxMaxima wants to know about.
| void MaximaEvaluator::SendMaxima | ( | wxString | s, |
| bool | addToHistory = false, |
||
| bool | background = false |
||
| ) |
Sends a string to the Maxima process (optionally adding it to the history and/or marking it a background command that must not change the busy state).
Check for function/variable definitions
Create a template from the input
| void MaximaEvaluator::SetupVariables | ( | ) |
| void MaximaEvaluator::StartCommand | ( | long | start | ) |
Remembers where in its cell the command that is being sent starts.
Also forgets everything about the previous command's output. The end of the command is wxMaxima::m_commandIndex.