amath  1.8.5
Simple command line calculator
DrawStatement Class Reference

#include <draw.h>

Inheritance diagram for DrawStatement:
Collaboration diagram for DrawStatement:

Public Member Functions

 DrawStatement (const char *name, const char *parameter)
 
 ~DrawStatement ()
 
char * Execute ()
 
- Public Member Functions inherited from StatementNode
 StatementNode ()
 
 StatementNode (const char *text)
 
virtual ~StatementNode ()
 
NodeType GetNodeType ()
 
virtual SyntaxNodeGetNext ()
 
virtual char * GetTextCode ()
 
void Attach (SyntaxNode *node)
 
void Detach (SyntaxNode *node)
 
void Replace (SyntaxNode *n, SyntaxNode *x)
 
- Public Member Functions inherited from SyntaxNode
 SyntaxNode ()
 
virtual ~SyntaxNode ()
 
void SetFirstNode ()
 
bool GetFirstNode () const
 
SyntaxNodeGetParent () const
 
void SetParent (SyntaxNode *node)
 
virtual ReductionType GetReductionType ()
 
virtual void ResetIterator ()
 

Private Attributes

char * name
 
char * parameter
 

Additional Inherited Members

- Protected Attributes inherited from StatementNode
char * statementText
 
- Protected Attributes inherited from SyntaxNode
CharBufferoutput
 
SyntaxNodeparent
 
SyntaxNodeiterator
 
bool leftBottom
 

Detailed Description

Definition at line 35 of file draw.h.

Constructor & Destructor Documentation

◆ DrawStatement()

DrawStatement::DrawStatement ( const char *  name,
const char *  parameter 
)

Definition at line 34 of file draw.cpp.

References AllocAndCopy(), name, parameter, and StatementNode::StatementNode().

Referenced by Parser::ParseDrawStatement().

35  : StatementNode()
36 {
37  AllocAndCopy(&this->name, name);
39 }
char * parameter
Definition: draw.h:44
unsigned int AllocAndCopy(char **destination, const char *source)
Allocate memory and copy a string into the array.
Definition: alloccpy.c:40
StatementNode()
Definition: node.cpp:34
char * name
Definition: draw.h:43
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~DrawStatement()

DrawStatement::~DrawStatement ( )

Definition at line 41 of file draw.cpp.

References name, and parameter.

42 {
43  delete [] name;
44  delete [] parameter;
45 }
char * parameter
Definition: draw.h:44
char * name
Definition: draw.h:43

Member Function Documentation

◆ Execute()

char * DrawStatement::Execute ( )
virtual

Implements StatementNode.

Definition at line 47 of file draw.cpp.

References StatementNode::statementText.

48 {
49 #if 0
51 
52  if (function == nullptr)
53  {
54  return static_cast<char*>("Function does not exists." NEWLINE);
55  }
56 
57  GraphWindow* graph = Program->Graphs->CreateNewWindow();
58 
59  if (graph == nullptr)
60  {
61  return static_cast<char*>("Graphs are not supported in this version.");
62  }
63 
64  graph->OpenGraphWindow(function);
65  graph->DrawGraph(function);
66 #endif
67  return statementText;
68 }
#define NEWLINE
Definition: amath.h:222
Master control class.
Definition: program.h:55
char * statementText
Definition: node.h:55
char * parameter
Definition: draw.h:44
class FunctionList * Functions
Definition: program.h:78
class GraphList * Graphs
Definition: program.h:79
A user defined function.
Definition: userfunction.h:44
char * name
Definition: draw.h:43
UserFunction * GetFunctionDef(const char *name)

Member Data Documentation

◆ name

char* DrawStatement::name
private

Definition at line 43 of file draw.h.

Referenced by DrawStatement(), and ~DrawStatement().

◆ parameter

char* DrawStatement::parameter
private

Definition at line 44 of file draw.h.

Referenced by DrawStatement(), and ~DrawStatement().


The documentation for this class was generated from the following files: