summaryrefslogtreecommitdiffstats
path: root/Sencha-lang
diff options
context:
space:
mode:
Diffstat (limited to 'Sencha-lang')
-rw-r--r--Sencha-lang/AST/ASTNode.h2
-rw-r--r--Sencha-lang/ASTInspector.cpp18
-rw-r--r--Sencha-lang/ASTInspector.h19
-rw-r--r--Sencha-lang/Visitor.cpp18
-rw-r--r--Sencha-lang/Visitor.h19
5 files changed, 76 insertions, 0 deletions
diff --git a/Sencha-lang/AST/ASTNode.h b/Sencha-lang/AST/ASTNode.h
index 7afe190..feee8bd 100644
--- a/Sencha-lang/AST/ASTNode.h
+++ b/Sencha-lang/AST/ASTNode.h
@@ -10,6 +10,7 @@
#include <vector>
#include <string>
#include "SenchaObject.h"
+#include "../Visitor.h"
class ASTNode {
public:
@@ -17,6 +18,7 @@ public:
ASTNode * parent;
std::vector<ASTNode *> children;
+ virtual void accept(Visitor *) = 0;
virtual std::string debug() = 0;
virtual void execute() = 0;
diff --git a/Sencha-lang/ASTInspector.cpp b/Sencha-lang/ASTInspector.cpp
new file mode 100644
index 0000000..de4edbe
--- /dev/null
+++ b/Sencha-lang/ASTInspector.cpp
@@ -0,0 +1,18 @@
+/*
+ * ASTInspector.cpp
+ *
+ * Created on: Dec 17, 2012
+ * Author: att
+ */
+
+#include "ASTInspector.h"
+
+ASTInspector::ASTInspector() {
+ // TODO Auto-generated constructor stub
+
+}
+
+ASTInspector::~ASTInspector() {
+ // TODO Auto-generated destructor stub
+}
+
diff --git a/Sencha-lang/ASTInspector.h b/Sencha-lang/ASTInspector.h
new file mode 100644
index 0000000..941c82e
--- /dev/null
+++ b/Sencha-lang/ASTInspector.h
@@ -0,0 +1,19 @@
+/*
+ * ASTInspector.h
+ *
+ * Created on: Dec 17, 2012
+ * Author: att
+ */
+
+#ifndef ASTINSPECTOR_H_
+#define ASTINSPECTOR_H_
+
+#include "Visitor.h"
+
+class ASTInspector: public Visitor {
+public:
+ ASTInspector();
+ virtual ~ASTInspector();
+};
+
+#endif /* ASTINSPECTOR_H_ */
diff --git a/Sencha-lang/Visitor.cpp b/Sencha-lang/Visitor.cpp
new file mode 100644
index 0000000..1fa2479
--- /dev/null
+++ b/Sencha-lang/Visitor.cpp
@@ -0,0 +1,18 @@
+/*
+ * Visitor.cpp
+ *
+ * Created on: Dec 17, 2012
+ * Author: att
+ */
+
+#include "Visitor.h"
+
+Visitor::Visitor() {
+ // TODO Auto-generated constructor stub
+
+}
+
+Visitor::~Visitor() {
+ // TODO Auto-generated destructor stub
+}
+
diff --git a/Sencha-lang/Visitor.h b/Sencha-lang/Visitor.h
new file mode 100644
index 0000000..85d4dfa
--- /dev/null
+++ b/Sencha-lang/Visitor.h
@@ -0,0 +1,19 @@
+/*
+ * Visitor.h
+ *
+ * Created on: Dec 17, 2012
+ * Author: att
+ */
+
+#ifndef VISITOR_H_
+#define VISITOR_H_
+#include "AST/ASTNode.h"
+
+class Visitor {
+public:
+ Visitor();
+ virtual void visit(ASTNode * node/*something*/) = 0;
+ virtual ~Visitor();
+};
+
+#endif /* VISITOR_H_ */