summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustyna Att Ilczuk <justyna.ilczuk@gmail.com>2012-11-04 21:13:10 +0100
committerJustyna Att Ilczuk <justyna.ilczuk@gmail.com>2012-11-04 21:13:10 +0100
commit26ea2374adcc4d38e5f29ff1ef304ee3b95aed08 (patch)
treecca117eb4f62acf67bbdf6597519cbcf3ac6fad2
parent4cec6422345e16b31f8b9c2800c9b82c4c79afa9 (diff)
downloadsencha-lang-26ea2374adcc4d38e5f29ff1ef304ee3b95aed08.tar.gz
sencha-lang-26ea2374adcc4d38e5f29ff1ef304ee3b95aed08.tar.bz2
sencha-lang-26ea2374adcc4d38e5f29ff1ef304ee3b95aed08.tar.xz
sencha-lang-26ea2374adcc4d38e5f29ff1ef304ee3b95aed08.zip
Some crap removed. New classes for nodes added.
-rw-r--r--Sencha-lang/AST.cpp18
-rw-r--r--Sencha-lang/AST.h17
-rw-r--r--Sencha-lang/ASTExpression.cpp18
-rw-r--r--Sencha-lang/ASTExpression.h18
-rw-r--r--Sencha-lang/ASTPrimary.cpp9
-rw-r--r--Sencha-lang/ASTPrimary.h9
-rw-r--r--Sencha-lang/ASTStatement.cpp18
-rw-r--r--Sencha-lang/ASTStatement.h18
-rw-r--r--Sencha-lang/Debug/ASTPrimary.obin52616 -> 136232 bytes
-rwxr-xr-xSencha-lang/Debug/Sencha-langbin470096 -> 485521 bytes
-rw-r--r--Sencha-lang/Debug/lexer_tests.d3
-rw-r--r--Sencha-lang/Debug/lexer_tests.obin70984 -> 0 bytes
-rw-r--r--Sencha-lang/Tests/tests_for_lexer.h52
-rw-r--r--Sencha-lang/Tests/tests_for_parser.h14
-rw-r--r--Sencha-lang/minunit.h17
-rw-r--r--sencha/src/token.cpp11
16 files changed, 118 insertions, 104 deletions
diff --git a/Sencha-lang/AST.cpp b/Sencha-lang/AST.cpp
new file mode 100644
index 0000000..68f9b20
--- /dev/null
+++ b/Sencha-lang/AST.cpp
@@ -0,0 +1,18 @@
+/*
+ * AST.cpp
+ *
+ * Created on: Nov 4, 2012
+ * Author: attero
+ */
+
+#include "AST.h"
+
+AST::AST() {
+ // TODO Auto-generated constructor stub
+
+}
+
+AST::~AST() {
+ // TODO Auto-generated destructor stub
+}
+
diff --git a/Sencha-lang/AST.h b/Sencha-lang/AST.h
new file mode 100644
index 0000000..50bfd36
--- /dev/null
+++ b/Sencha-lang/AST.h
@@ -0,0 +1,17 @@
+/*
+ * AST.h
+ *
+ * Created on: Nov 4, 2012
+ * Author: attero
+ */
+
+#ifndef AST_H_
+#define AST_H_
+
+class AST {
+public:
+ AST();
+ virtual ~AST();
+};
+
+#endif /* AST_H_ */
diff --git a/Sencha-lang/ASTExpression.cpp b/Sencha-lang/ASTExpression.cpp
new file mode 100644
index 0000000..32a47d8
--- /dev/null
+++ b/Sencha-lang/ASTExpression.cpp
@@ -0,0 +1,18 @@
+/*
+ * ASTExpression.cpp
+ *
+ * Created on: Nov 4, 2012
+ * Author: attero
+ */
+
+#include "ASTExpression.h"
+
+ASTExpression::ASTExpression() {
+ // TODO Auto-generated constructor stub
+
+}
+
+ASTExpression::~ASTExpression() {
+ // TODO Auto-generated destructor stub
+}
+
diff --git a/Sencha-lang/ASTExpression.h b/Sencha-lang/ASTExpression.h
new file mode 100644
index 0000000..69010ae
--- /dev/null
+++ b/Sencha-lang/ASTExpression.h
@@ -0,0 +1,18 @@
+/*
+ * ASTExpression.h
+ *
+ * Created on: Nov 4, 2012
+ * Author: attero
+ */
+
+#ifndef ASTEXPRESSION_H_
+#define ASTEXPRESSION_H_
+#include "ASTNode.h"
+
+class ASTExpression : public ASTNode {
+public:
+ ASTExpression();
+ virtual ~ASTExpression();
+};
+
+#endif /* ASTEXPRESSION_H_ */
diff --git a/Sencha-lang/ASTPrimary.cpp b/Sencha-lang/ASTPrimary.cpp
index f4a35de..c442ec5 100644
--- a/Sencha-lang/ASTPrimary.cpp
+++ b/Sencha-lang/ASTPrimary.cpp
@@ -6,14 +6,15 @@
*/
#include "ASTPrimary.h"
-/*
-ASTPrimary::ASTPrimary() {
- // TODO Auto-generated constructor stub
+ASTPrimary::ASTPrimary(ASTNode * parent) {
+ // TODO Auto-generated constructor stub
+ value = "";
+ this->parent = parent;
}
ASTPrimary::~ASTPrimary() {
// TODO Auto-generated destructor stub
}
-*/
+
diff --git a/Sencha-lang/ASTPrimary.h b/Sencha-lang/ASTPrimary.h
index dbd3f8e..9387a0a 100644
--- a/Sencha-lang/ASTPrimary.h
+++ b/Sencha-lang/ASTPrimary.h
@@ -8,13 +8,16 @@
#ifndef ASTPRIMARY_H_
#define ASTPRIMARY_H_
#include "ASTNode.h"
-/*
+#include <string>
+
class ASTPrimary : public ASTNode {
public:
- ASTPrimary();
+ ASTPrimary(ASTNode * parent);
+
virtual ~ASTPrimary();
virtual void execute() {};
+ std::string value;
};
-*/
+
#endif /* ASTPRIMARY_H_ */
diff --git a/Sencha-lang/ASTStatement.cpp b/Sencha-lang/ASTStatement.cpp
new file mode 100644
index 0000000..52c5526
--- /dev/null
+++ b/Sencha-lang/ASTStatement.cpp
@@ -0,0 +1,18 @@
+/*
+ * ASTStatement.cpp
+ *
+ * Created on: Nov 4, 2012
+ * Author: attero
+ */
+
+#include "ASTStatement.h"
+
+ASTStatement::ASTStatement() {
+ // TODO Auto-generated constructor stub
+
+}
+
+ASTStatement::~ASTStatement() {
+ // TODO Auto-generated destructor stub
+}
+
diff --git a/Sencha-lang/ASTStatement.h b/Sencha-lang/ASTStatement.h
new file mode 100644
index 0000000..b2bfd84
--- /dev/null
+++ b/Sencha-lang/ASTStatement.h
@@ -0,0 +1,18 @@
+/*
+ * ASTStatement.h
+ *
+ * Created on: Nov 4, 2012
+ * Author: attero
+ */
+
+#ifndef ASTSTATEMENT_H_
+#define ASTSTATEMENT_H_
+#include "ASTNode.h"
+
+class ASTStatement : public ASTNode {
+public:
+ ASTStatement();
+ virtual ~ASTStatement();
+};
+
+#endif /* ASTSTATEMENT_H_ */
diff --git a/Sencha-lang/Debug/ASTPrimary.o b/Sencha-lang/Debug/ASTPrimary.o
index 9a095fe..9d12afe 100644
--- a/Sencha-lang/Debug/ASTPrimary.o
+++ b/Sencha-lang/Debug/ASTPrimary.o
Binary files differ
diff --git a/Sencha-lang/Debug/Sencha-lang b/Sencha-lang/Debug/Sencha-lang
index 332a07c..4571ef3 100755
--- a/Sencha-lang/Debug/Sencha-lang
+++ b/Sencha-lang/Debug/Sencha-lang
Binary files differ
diff --git a/Sencha-lang/Debug/lexer_tests.d b/Sencha-lang/Debug/lexer_tests.d
deleted file mode 100644
index 3a73bf9..0000000
--- a/Sencha-lang/Debug/lexer_tests.d
+++ /dev/null
@@ -1,3 +0,0 @@
-lexer_tests.d: ../lexer_tests.cpp ../minunit.h
-
-../minunit.h:
diff --git a/Sencha-lang/Debug/lexer_tests.o b/Sencha-lang/Debug/lexer_tests.o
deleted file mode 100644
index 4d75f09..0000000
--- a/Sencha-lang/Debug/lexer_tests.o
+++ /dev/null
Binary files differ
diff --git a/Sencha-lang/Tests/tests_for_lexer.h b/Sencha-lang/Tests/tests_for_lexer.h
deleted file mode 100644
index 10e095c..0000000
--- a/Sencha-lang/Tests/tests_for_lexer.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * tests_for_lexer.h
- *
- * Created on: Nov 4, 2012
- * Author: attero
- */
-
-#ifndef TESTS_FOR_LEXER_H_
-#define TESTS_FOR_LEXER_H_
-#include <cstdio>
-#include "minunit.h"
-#include "../Lexer.h"
-#include <string>
-/*
-
-static char* test_searching_keyword_for_not_keyword()
-{
- Lexer lexer;
- mu_assert("Balloon is treated as a keyword.", !lexer.is_keyword("Balloon"));
- return 0;
-}
-
-static char* test_searching_keyword()
-{
- Lexer lexer;
- mu_assert("\"while\" isn't treated as keyword.", lexer.is_keyword("while"));
- return 0;
-}
-
-static char* all_lexer_tests()
-{
- mu_run_test(test_searching_keyword_for_not_keyword);
- mu_run_test(test_searching_keyword);
- return 0;
-}
-
-void run_lexer_tests()
-{
- char* result = all_lexer_tests();
- if(result != 0)
- {
- ::printf("%s\n", result);
- }
- else
- {
- ::printf("ALL TESTS PASSED\n");
- }
- //::printf("Test run: %d\n", test_run);
-
-}*/
-
-#endif /* TESTS_FOR_LEXER_H_ */
diff --git a/Sencha-lang/Tests/tests_for_parser.h b/Sencha-lang/Tests/tests_for_parser.h
deleted file mode 100644
index cb59de6..0000000
--- a/Sencha-lang/Tests/tests_for_parser.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * tests_for_parser.h
- *
- * Created on: Nov 4, 2012
- * Author: attero
- */
-
-#ifndef TESTS_FOR_PARSER_H_
-#define TESTS_FOR_PARSER_H_
-
-
-
-
-#endif /* TESTS_FOR_PARSER_H_ */
diff --git a/Sencha-lang/minunit.h b/Sencha-lang/minunit.h
deleted file mode 100644
index 948933e..0000000
--- a/Sencha-lang/minunit.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * minunit.h
- *
- * Created on: Nov 2, 2012
- * Author: attero
- */
-
-#ifndef MINUNIT_H_
-#define MINUNIT_H_
-
-#define mu_assert(message, test) do { if (!(test)) return message; } while (0)
-#define mu_run_test(test) do { char *message = test(); tests_run++; \
- if (message) return message; } while (0)
-extern int tests_run;
-
-
-#endif /* MINUNIT_H_ */
diff --git a/sencha/src/token.cpp b/sencha/src/token.cpp
deleted file mode 100644
index 84c5d4b..0000000
--- a/sencha/src/token.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "../../Headers/include/token.h"
-
-token::Token()
-{
- //ctor
-}
-
-token::~Token()
-{
- //dtor
-}