summaryrefslogtreecommitdiffstats
path: root/sencha
diff options
context:
space:
mode:
authorJustyna Att Ilczuk <justyna.ilczuk@gmail.com>2012-11-03 00:07:00 +0100
committerJustyna Att Ilczuk <justyna.ilczuk@gmail.com>2012-11-03 00:07:00 +0100
commite8018808e184818ccb1e99593d674d79ceaac2e6 (patch)
tree693211dcba668c0be498cb2ac57f6a8e62e76223 /sencha
parent67b2379d0383e1d389e98b0313bb317211c7dd5a (diff)
downloadsencha-lang-e8018808e184818ccb1e99593d674d79ceaac2e6.tar.gz
sencha-lang-e8018808e184818ccb1e99593d674d79ceaac2e6.tar.bz2
sencha-lang-e8018808e184818ccb1e99593d674d79ceaac2e6.tar.xz
sencha-lang-e8018808e184818ccb1e99593d674d79ceaac2e6.zip
I did some migration to eclipse. Old code-blocks version still exists. I installed new very simple test framework called minunit. If eclipse doesn't explode, I will use it as main IDE.
Diffstat (limited to 'sencha')
-rw-r--r--sencha/.cproject59
-rw-r--r--sencha/.project27
-rw-r--r--sencha/Object.cpp12
-rw-r--r--sencha/Object.h21
-rw-r--r--sencha/Parser.cpp3
-rw-r--r--sencha/Parser.h2
-rwxr-xr-xsencha/bin/Debug/senchabin323499 -> 376485 bytes
-rw-r--r--sencha/lexer_tests.cpp33
-rw-r--r--sencha/main.cpp2
-rw-r--r--sencha/minunit.h17
-rw-r--r--sencha/obj/Debug/AppleTree.obin0 -> 5864 bytes
-rw-r--r--sencha/obj/Debug/Fruit.obin0 -> 38648 bytes
-rw-r--r--sencha/obj/Debug/FruitBasket.obin0 -> 54008 bytes
-rw-r--r--sencha/obj/Debug/Parser.obin220480 -> 255064 bytes
-rw-r--r--sencha/obj/Debug/main.obin264592 -> 264608 bytes
-rw-r--r--sencha/sencha.cbp6
-rw-r--r--sencha/sencha.depend21
-rw-r--r--sencha/sencha.layout18
18 files changed, 210 insertions, 11 deletions
diff --git a/sencha/.cproject b/sencha/.cproject
new file mode 100644
index 0000000..9b14996
--- /dev/null
+++ b/sencha/.cproject
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.1709733272">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.1709733272" moduleId="org.eclipse.cdt.core.settings" name="Build (GNU)">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.MachO64" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration buildProperties="" id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.1709733272" name="Build (GNU)" parent="org.eclipse.cdt.build.core.emptycfg">
+ <folderInfo id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.1709733272.940433689" name="/" resourcePath="">
+ <toolChain id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.1507619182" name="org.eclipse.linuxtools.cdt.autotools.core.toolChain" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolChain">
+ <targetPlatform id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.targetPlatform.594452659" isAbstract="false" name="GNU Autotools Target Platform" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.targetPlatform"/>
+ <builder id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.builder.2141841484" managedBuildOn="false" name="null.Build (GNU)" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.builder"/>
+ <tool id="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure.447184730" name="configure" superClass="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure">
+ <option id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name.605453349" superClass="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name" value="org.eclipse.linuxtools.cdt.autotools.core.toolChain.1709733272" valueType="string"/>
+ </tool>
+ <tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen.2024332737" name="autogen.sh" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen"/>
+ <tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc.890759014" name="GCC C Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc">
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1879953934" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gpp.1902945035" name="GCC C++ Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gpp">
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1269568410" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="sencha.null.770789515" name="sencha"/>
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+ <storageModule moduleId="refreshScope"/>
+ <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
+ <buildTargets>
+ <target name="sencha" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>sencha</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>true</runAllBuilders>
+ </target>
+ </buildTargets>
+ </storageModule>
+</cproject>
diff --git a/sencha/.project b/sencha/.project
new file mode 100644
index 0000000..c28b133
--- /dev/null
+++ b/sencha/.project
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>sencha</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ </natures>
+</projectDescription>
diff --git a/sencha/Object.cpp b/sencha/Object.cpp
new file mode 100644
index 0000000..0badd08
--- /dev/null
+++ b/sencha/Object.cpp
@@ -0,0 +1,12 @@
+#include "Object.h"
+
+Object::Object()
+{
+ number_value = 0;
+ //ctor
+}
+
+Object::~Object()
+{
+ //dtor
+}
diff --git a/sencha/Object.h b/sencha/Object.h
new file mode 100644
index 0000000..563cf7d
--- /dev/null
+++ b/sencha/Object.h
@@ -0,0 +1,21 @@
+#ifndef OBJECT_H
+#define OBJECT_H
+#include <string>
+//I don't know how should it look like!
+class Object
+{
+ public:
+ Object();
+ virtual ~Object();
+ //Representation of the object
+ std::string str();
+ //Type
+ std::string type();
+ //Possible values
+ double number_value;
+ std::string characters;
+ protected:
+ private:
+};
+
+#endif // OBJECT_H
diff --git a/sencha/Parser.cpp b/sencha/Parser.cpp
index 8819368..f0ef0dd 100644
--- a/sencha/Parser.cpp
+++ b/sencha/Parser.cpp
@@ -90,7 +90,8 @@ void Parser::interpret()
statement();
}
}
-}
+}
+
bool Parser::peek(string s)
{
return tok_value == s;
diff --git a/sencha/Parser.h b/sencha/Parser.h
index 67c2a8a..a60d7b1 100644
--- a/sencha/Parser.h
+++ b/sencha/Parser.h
@@ -4,6 +4,7 @@
#include <vector>
#include "Token.h"
+
using namespace std;
class Parser
{
@@ -13,6 +14,7 @@ class Parser
void interpret();
string report_message;
string error_message;
+
protected:
private:
diff --git a/sencha/bin/Debug/sencha b/sencha/bin/Debug/sencha
index 01afe6b..3a9a346 100755
--- a/sencha/bin/Debug/sencha
+++ b/sencha/bin/Debug/sencha
Binary files differ
diff --git a/sencha/lexer_tests.cpp b/sencha/lexer_tests.cpp
new file mode 100644
index 0000000..0e60145
--- /dev/null
+++ b/sencha/lexer_tests.cpp
@@ -0,0 +1,33 @@
+/*
+ * lexer_tests.cpp
+ *
+ * Created on: Nov 2, 2012
+ * Author: attero
+ */
+
+#include <cstdio>
+ #include "minunit.h"
+
+ int tests_run = 0;
+
+ int foo = 7;
+ int bar = 4;
+
+ static char * test_foo() {
+ mu_assert("error, foo != 7", foo == 7);
+ return 0;
+ }
+
+ static char * test_bar() {
+ mu_assert("error, bar != 5", bar == 5);
+ return 0;
+ }
+
+ static char * all_tests() {
+ mu_run_test(test_foo);
+ mu_run_test(test_bar);
+ return 0;
+ }
+
+
+
diff --git a/sencha/main.cpp b/sencha/main.cpp
index ffac51e..a16febd 100644
--- a/sencha/main.cpp
+++ b/sencha/main.cpp
@@ -53,6 +53,6 @@ int main()
{
cout << "Hello world!" << endl;
//test_parser();
- test_lexer();
+ //test_lexer();
return 0;
}
diff --git a/sencha/minunit.h b/sencha/minunit.h
new file mode 100644
index 0000000..948933e
--- /dev/null
+++ b/sencha/minunit.h
@@ -0,0 +1,17 @@
+/*
+ * 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/obj/Debug/AppleTree.o b/sencha/obj/Debug/AppleTree.o
new file mode 100644
index 0000000..09f8c83
--- /dev/null
+++ b/sencha/obj/Debug/AppleTree.o
Binary files differ
diff --git a/sencha/obj/Debug/Fruit.o b/sencha/obj/Debug/Fruit.o
new file mode 100644
index 0000000..06e5613
--- /dev/null
+++ b/sencha/obj/Debug/Fruit.o
Binary files differ
diff --git a/sencha/obj/Debug/FruitBasket.o b/sencha/obj/Debug/FruitBasket.o
new file mode 100644
index 0000000..3d30ad4
--- /dev/null
+++ b/sencha/obj/Debug/FruitBasket.o
Binary files differ
diff --git a/sencha/obj/Debug/Parser.o b/sencha/obj/Debug/Parser.o
index bc1546e..d66f6f1 100644
--- a/sencha/obj/Debug/Parser.o
+++ b/sencha/obj/Debug/Parser.o
Binary files differ
diff --git a/sencha/obj/Debug/main.o b/sencha/obj/Debug/main.o
index 6b14372..9283049 100644
--- a/sencha/obj/Debug/main.o
+++ b/sencha/obj/Debug/main.o
Binary files differ
diff --git a/sencha/sencha.cbp b/sencha/sencha.cbp
index 74f90a5..0fca531 100644
--- a/sencha/sencha.cbp
+++ b/sencha/sencha.cbp
@@ -32,6 +32,12 @@
<Add option="-Wall" />
<Add option="-fexceptions" />
</Compiler>
+ <Unit filename="AppleTree.cpp" />
+ <Unit filename="AppleTree.h" />
+ <Unit filename="Fruit.cpp" />
+ <Unit filename="Fruit.h" />
+ <Unit filename="FruitBasket.cpp" />
+ <Unit filename="FruitBasket.h" />
<Unit filename="Lexer.cpp" />
<Unit filename="Lexer.h" />
<Unit filename="Parser.cpp" />
diff --git a/sencha/sencha.depend b/sencha/sencha.depend
index 15329e2..2c7fa6d 100644
--- a/sencha/sencha.depend
+++ b/sencha/sencha.depend
@@ -5,7 +5,7 @@
1351424620 /home/attero/development/sencha-lang/sencha/Token.h
<string>
-1351540082 source:/home/attero/development/sencha-lang/sencha/Lexer.cpp
+1351540959 source:/home/attero/development/sencha-lang/sencha/Lexer.cpp
"Lexer.h"
1351539503 /home/attero/development/sencha-lang/sencha/Lexer.h
@@ -16,7 +16,7 @@
<iostream>
"Token.h"
-1351539590 source:/home/attero/development/sencha-lang/sencha/main.cpp
+1351541355 source:/home/attero/development/sencha-lang/sencha/main.cpp
<iostream>
<string>
"Token.h"
@@ -27,13 +27,28 @@
"Parser.h"
"iostream"
-1351539525 /home/attero/development/sencha-lang/sencha/Parser.h
+1351543306 /home/attero/development/sencha-lang/sencha/Parser.h
<string>
<vector>
"Token.h"
+ "Fruit.h"
+ "FruitBasket.h"
1351512311 source:/home/attero/development/sencha-lang/sencha/AppleTree.cpp
"AppleTree.h"
1351512311 /home/attero/development/sencha-lang/sencha/AppleTree.h
+1351543287 /home/attero/development/sencha-lang/sencha/Fruit.h
+ <string>
+
+1351543266 source:/home/attero/development/sencha-lang/sencha/Fruit.cpp
+ "Fruit.h"
+
+1351542956 source:/home/attero/development/sencha-lang/sencha/FruitBasket.cpp
+ "FruitBasket.h"
+
+1351543037 /home/attero/development/sencha-lang/sencha/FruitBasket.h
+ <vector>
+ "Fruit.h"
+
diff --git a/sencha/sencha.layout b/sencha/sencha.layout
index cd2740c..3c31c4a 100644
--- a/sencha/sencha.layout
+++ b/sencha/sencha.layout
@@ -1,14 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
<ActiveTarget name="Debug" />
+ <File name="Fruit.h" open="1" top="0" tabpos="10">
+ <Cursor position="199" topLine="0" />
+ </File>
<File name="Lexer.cpp" open="1" top="0" tabpos="4">
- <Cursor position="1850" topLine="57" />
+ <Cursor position="2314" topLine="88" />
</File>
<File name="Lexer.h" open="1" top="0" tabpos="5">
- <Cursor position="378" topLine="8" />
+ <Cursor position="525" topLine="11" />
+ </File>
+ <File name="Parser.cpp" open="1" top="1" tabpos="6">
+ <Cursor position="258" topLine="0" />
</File>
- <File name="Parser.cpp" open="1" top="0" tabpos="7">
- <Cursor position="2767" topLine="98" />
+ <File name="Parser.h" open="1" top="0" tabpos="7">
+ <Cursor position="136" topLine="0" />
</File>
<File name="Token.cpp" open="1" top="0" tabpos="3">
<Cursor position="22" topLine="0" />
@@ -16,7 +22,7 @@
<File name="Token.h" open="1" top="0" tabpos="2">
<Cursor position="416" topLine="0" />
</File>
- <File name="main.cpp" open="1" top="1" tabpos="1">
- <Cursor position="1265" topLine="29" />
+ <File name="main.cpp" open="1" top="0" tabpos="1">
+ <Cursor position="1282" topLine="23" />
</File>
</CodeBlocks_layout_file>