Numworks Epsilon  1.4.1
Graphing Calculator Operating System
script_node.h
Go to the documentation of this file.
1 #ifndef CODE_SCRIPT_NODE_H
2 #define CODE_SCRIPT_NODE_H
3 
4 #include <stdint.h>
5 
6 namespace Code {
7 
8 class ScriptNode {
9 public:
10  enum class Type {
11  Function = 0,
12  Variable = 1
13  };
15  m_type(Type::Function), m_name(nullptr), m_scriptIndex(0) {}
18  }
21  }
22  Type type() const { return m_type; }
23  const char * name() const { return m_name; }
24  uint16_t scriptIndex() const { return m_scriptIndex; }
25 private:
26  ScriptNode(Type type, const char * name, uint16_t scriptIndex) :
27  m_type(type), m_name(name), m_scriptIndex(scriptIndex) {}
28  Type m_type;
29  const char * m_name;
30  uint16_t m_scriptIndex;
31 };
32 
33 }
34 
35 #endif
static ScriptNode FunctionNode(const char *name, uint16_t scriptIndex)
Definition: script_node.h:16
const char * name() const
Definition: script_node.h:23
unsigned short uint16_t
Definition: stdint.h:5
Definition: app.cpp:7
uint16_t scriptIndex() const
Definition: script_node.h:24
Type type() const
Definition: script_node.h:22
static ScriptNode VariableNode(const char *name, uint16_t scriptIndex)
Definition: script_node.h:19