amath
1.8.5
Simple command line calculator
|
Master control class. More...
#include <program.h>
Public Member Functions | |
Program () | |
virtual | ~Program () |
virtual void | Initialize (int argc, char **argv)=0 |
virtual void | Start ()=0 |
virtual void | Exit () |
void | NewPositionalInput (short unsigned int base, short unsigned int digits) |
void | NewPositionalOutput (short unsigned int base, short unsigned int digits) |
void | SetLastResult (Number *number) |
void | SetPrompt (const char *text) const |
int | GetExitStatus () const |
bool | GetAnsiMode () const |
void | SetAnsiMode (bool value) |
struct Number * | GetLastResult () const |
Public Attributes | |
class Language * | Language |
class ConsoleBase * | Console |
class PreferencesBase * | Preferences |
class FilesystemBase * | Filesystem |
class NumeralSystem * | Input |
class NumeralSystem * | Output |
class VariableList * | Variables |
class FunctionList * | Functions |
class GraphList * | Graphs |
Protected Member Functions | |
void | InitAnsiMode () |
Protected Attributes | |
bool | shellMode |
bool | ansiMode |
int | status |
Private Attributes | |
struct Number * | ins |
Master control class.
This control class handles all processes and data in the entire program. It usually only exist as a single instance.
Program::Program | ( | ) |
Definition at line 48 of file program.cpp.
References ansiMode, Console, DecimalSystem::DecimalSystem(), Filesystem, FunctionList::FunctionList(), Functions, PreferencesBase::GetDigits(), Language::GetFractionPoint(), Input, ins, Output, Preferences, RealNumber::RealNumber(), shellMode, StandardLanguage::StandardLanguage(), status, VariableList::VariableList(), and Variables.
Referenced by StandardProgram::StandardProgram().
|
virtual |
Definition at line 67 of file program.cpp.
References Filesystem, Functions, Input, ins, PreferencesBase::Keep(), Output, Preferences, and Variables.
|
virtual |
Reimplemented in TestProgram.
Definition at line 168 of file program.cpp.
References Console, and ConsoleBase::Exit().
Referenced by ExitStatement::Execute().
bool Program::GetAnsiMode | ( | ) | const |
Definition at line 143 of file program.cpp.
References ansiMode.
int Program::GetExitStatus | ( | ) | const |
Definition at line 133 of file program.cpp.
References status.
Referenced by main().
Number * Program::GetLastResult | ( | ) | const |
Definition at line 122 of file program.cpp.
References ins.
Referenced by InsVariableNode::Evaluate().
|
protected |
Definition at line 138 of file program.cpp.
References ansiMode, and SetAnsiMode().
|
pure virtual |
Implemented in TestProgram, and StandardProgram.
Referenced by main().
void Program::NewPositionalInput | ( | short unsigned int | base, |
short unsigned int | digits | ||
) |
Definition at line 81 of file program.cpp.
References DecimalSystem::DecimalSystem(), Language::GetFractionPoint(), Input, and PositionalNumeralSystem::PositionalNumeralSystem().
Referenced by InputStatement::Execute().
void Program::NewPositionalOutput | ( | short unsigned int | base, |
short unsigned int | digits | ||
) |
Definition at line 97 of file program.cpp.
References DecimalSystem::DecimalSystem(), Language::GetFractionPoint(), Output, and PositionalNumeralSystem::PositionalNumeralSystem().
Referenced by OutputStatement::Execute().
void Program::SetAnsiMode | ( | bool | value | ) |
Definition at line 148 of file program.cpp.
References ansiMode, Console, ConsoleBase::SetAnsiMode(), and Language::SetAnsiMode().
Referenced by InitAnsiMode(), StandardProgram::Initialize(), and StandardProgram::Start().
void Program::SetLastResult | ( | Number * | number | ) |
Definition at line 127 of file program.cpp.
References Number::Clone(), and ins.
Referenced by EvalStatement::Execute().
void Program::SetPrompt | ( | const char * | text | ) | const |
Definition at line 113 of file program.cpp.
References Console, Preferences, PreferencesBase::SetPrompt(), and ConsoleBase::SetPrompt().
Referenced by PromptStatement::Execute().
|
pure virtual |
Implemented in TestProgram, and StandardProgram.
Referenced by main().
|
protected |
Definition at line 84 of file program.h.
Referenced by GetAnsiMode(), InitAnsiMode(), Program(), and SetAnsiMode().
class ConsoleBase* Program::Console |
Definition at line 72 of file program.h.
Referenced by AboutStatement::Execute(), ClearStatement::Execute(), VersionStatement::Execute(), LicenseStatement::Execute(), PrefsStatement::Execute(), Exit(), StandardProgram::Initialize(), Program(), SetAnsiMode(), SetPrompt(), StandardProgram::StandardProgram(), StandardProgram::Start(), and StandardProgram::~StandardProgram().
class FilesystemBase* Program::Filesystem |
Definition at line 74 of file program.h.
Referenced by ExecuteStatement::Execute(), SaveStatement::Execute(), ShowStatement::Execute(), LoadStatement::Execute(), ListStatement::Execute(), Program(), and ~Program().
class FunctionList* Program::Functions |
Definition at line 78 of file program.h.
Referenced by SaveStatement::Execute(), PlotStatement::Execute(), ListFunctionsStatement::Execute(), DeleteStatement::Execute(), Parser::ParseFunctionDef(), Parser::ParseIdent(), Program(), and ~Program().
class NumeralSystem* Program::Input |
Definition at line 75 of file program.h.
Referenced by DigitsStatement::Execute(), InputStatement::Execute(), PrefsStatement::Execute(), Lexer::GetDigitValue(), NumericValueNode::GetNodeText(), NewPositionalInput(), Parser::ParseNumber(), Program(), and ~Program().
|
private |
Definition at line 88 of file program.h.
Referenced by GetLastResult(), Program(), SetLastResult(), and ~Program().
class NumeralSystem* Program::Output |
Definition at line 76 of file program.h.
Referenced by DigitsStatement::Execute(), EvalStatement::Execute(), PrefsStatement::Execute(), OutputStatement::Execute(), VariableList::ListContent(), NewPositionalOutput(), Program(), and ~Program().
class PreferencesBase* Program::Preferences |
Definition at line 73 of file program.h.
Referenced by DigitsStatement::Execute(), PrefsStatement::Execute(), FunctionNode::GetNodeText(), StandardProgram::Initialize(), Program(), SetPrompt(), StandardProgram::Start(), and ~Program().
|
protected |
Definition at line 83 of file program.h.
Referenced by StandardProgram::Initialize(), Program(), StandardProgram::StandardProgram(), and StandardProgram::Start().
|
protected |
Definition at line 85 of file program.h.
Referenced by GetExitStatus(), and Program().
class VariableList* Program::Variables |
Definition at line 77 of file program.h.
Referenced by SaveStatement::Execute(), DeleteStatement::Execute(), ListVariablesStatement::Execute(), Parser::ParseFunctionDef(), Parser::ParseIdent(), Program(), and ~Program().