summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--Sencha-lang/.cproject114
-rw-r--r--Sencha-lang/.project27
-rw-r--r--Sencha-lang/Debug/Lexer.d5
-rw-r--r--Sencha-lang/Debug/Lexer.obin0 -> 465808 bytes
-rw-r--r--Sencha-lang/Debug/Object.d3
-rw-r--r--Sencha-lang/Debug/Object.obin0 -> 132032 bytes
-rw-r--r--Sencha-lang/Debug/Parser.d5
-rw-r--r--Sencha-lang/Debug/Parser.obin0 -> 317184 bytes
-rwxr-xr-xSencha-lang/Debug/Sencha-langbin0 -> 399669 bytes
-rw-r--r--Sencha-lang/Debug/Token.d3
-rw-r--r--Sencha-lang/Debug/Token.obin0 -> 104688 bytes
-rw-r--r--Sencha-lang/Debug/lexer_tests.d3
-rw-r--r--Sencha-lang/Debug/lexer_tests.obin0 -> 70984 bytes
-rw-r--r--Sencha-lang/Debug/main.d7
-rw-r--r--Sencha-lang/Debug/main.obin0 -> 361520 bytes
-rw-r--r--Sencha-lang/Debug/makefile58
-rw-r--r--Sencha-lang/Debug/objects.mk8
-rw-r--r--Sencha-lang/Debug/sources.mk27
-rw-r--r--Sencha-lang/Debug/subdir.mk39
-rw-r--r--Sencha-lang/Lexer.cpp189
-rw-r--r--Sencha-lang/Lexer.h39
-rw-r--r--Sencha-lang/Object.cpp12
-rw-r--r--Sencha-lang/Object.h21
-rw-r--r--Sencha-lang/Parser.cpp295
-rw-r--r--Sencha-lang/Parser.h45
-rw-r--r--Sencha-lang/Token.cpp2
-rw-r--r--Sencha-lang/Token.h25
-rw-r--r--Sencha-lang/main.cpp58
-rw-r--r--Sencha-lang/minunit.h17
-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
47 files changed, 1212 insertions, 11 deletions
diff --git a/Sencha-lang/.cproject b/Sencha-lang/.cproject
new file mode 100644
index 0000000..789856b
--- /dev/null
+++ b/Sencha-lang/.cproject
@@ -0,0 +1,114 @@
+<?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="cdt.managedbuild.config.gnu.cross.exe.debug.1544392496">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.exe.debug.1544392496" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.exe.debug.1544392496" name="Debug" parent="cdt.managedbuild.config.gnu.cross.exe.debug">
+ <folderInfo id="cdt.managedbuild.config.gnu.cross.exe.debug.1544392496." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.cross.exe.debug.2045041315" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.exe.debug">
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1733237476" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
+ <builder buildPath="${workspace_loc:/Sencha-lang/Debug}" id="cdt.managedbuild.builder.gnu.cross.2091580062" managedBuildOn="true" name="Gnu Make Builder.Debug" superClass="cdt.managedbuild.builder.gnu.cross"/>
+ <tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1055356392" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.758256537" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.debugging.level.1319397326" superClass="gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.809384772" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.495732557" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
+ <option id="gnu.cpp.compiler.option.optimization.level.793014755" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.debugging.level.1513381051" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.859439950" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.c.linker.693029150" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
+ <tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.1545256246" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1240442083" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.archiver.973026492" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
+ <tool id="cdt.managedbuild.tool.gnu.cross.assembler.1898223694" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.415327363" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="cdt.managedbuild.config.gnu.cross.exe.release.1985450505">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.exe.release.1985450505" moduleId="org.eclipse.cdt.core.settings" name="Release">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.exe.release.1985450505" name="Release" parent="cdt.managedbuild.config.gnu.cross.exe.release">
+ <folderInfo id="cdt.managedbuild.config.gnu.cross.exe.release.1985450505." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.cross.exe.release.1226114014" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.exe.release">
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.676474921" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
+ <builder buildPath="${workspace_loc:/Sencha-lang/Release}" id="cdt.managedbuild.builder.gnu.cross.23375219" managedBuildOn="true" name="Gnu Make Builder.Release" superClass="cdt.managedbuild.builder.gnu.cross"/>
+ <tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.671993191" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
+ <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.1104799874" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.debugging.level.1423670337" superClass="gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1507898701" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.938543294" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
+ <option id="gnu.cpp.compiler.option.optimization.level.491096180" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.debugging.level.1816198684" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.599623873" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1203418436" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
+ <tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.860949532" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.124143498" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.archiver.1698336651" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
+ <tool id="cdt.managedbuild.tool.gnu.cross.assembler.1350015407" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.949134942" superClass="cdt.managedbuild.tool.gnu.assembler.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-lang.cdt.managedbuild.target.gnu.cross.exe.1970449863" name="Executable" projectType="cdt.managedbuild.target.gnu.cross.exe"/>
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.release.1985450505;cdt.managedbuild.config.gnu.cross.exe.release.1985450505.;cdt.managedbuild.tool.gnu.cross.c.compiler.671993191;cdt.managedbuild.tool.gnu.c.compiler.input.1507898701">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.release.1985450505;cdt.managedbuild.config.gnu.cross.exe.release.1985450505.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.938543294;cdt.managedbuild.tool.gnu.cpp.compiler.input.599623873">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.debug.1544392496;cdt.managedbuild.config.gnu.cross.exe.debug.1544392496.;cdt.managedbuild.tool.gnu.cross.c.compiler.1055356392;cdt.managedbuild.tool.gnu.c.compiler.input.809384772">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.debug.1544392496;cdt.managedbuild.config.gnu.cross.exe.debug.1544392496.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.495732557;cdt.managedbuild.tool.gnu.cpp.compiler.input.859439950">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
+ </scannerConfigBuildInfo>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+</cproject>
diff --git a/Sencha-lang/.project b/Sencha-lang/.project
new file mode 100644
index 0000000..bf8cb98
--- /dev/null
+++ b/Sencha-lang/.project
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Sencha-lang</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-lang/Debug/Lexer.d b/Sencha-lang/Debug/Lexer.d
new file mode 100644
index 0000000..b18b56a
--- /dev/null
+++ b/Sencha-lang/Debug/Lexer.d
@@ -0,0 +1,5 @@
+Lexer.d: ../Lexer.cpp ../Lexer.h ../Token.h
+
+../Lexer.h:
+
+../Token.h:
diff --git a/Sencha-lang/Debug/Lexer.o b/Sencha-lang/Debug/Lexer.o
new file mode 100644
index 0000000..5669ddb
--- /dev/null
+++ b/Sencha-lang/Debug/Lexer.o
Binary files differ
diff --git a/Sencha-lang/Debug/Object.d b/Sencha-lang/Debug/Object.d
new file mode 100644
index 0000000..686a90d
--- /dev/null
+++ b/Sencha-lang/Debug/Object.d
@@ -0,0 +1,3 @@
+Object.d: ../Object.cpp ../Object.h
+
+../Object.h:
diff --git a/Sencha-lang/Debug/Object.o b/Sencha-lang/Debug/Object.o
new file mode 100644
index 0000000..27258de
--- /dev/null
+++ b/Sencha-lang/Debug/Object.o
Binary files differ
diff --git a/Sencha-lang/Debug/Parser.d b/Sencha-lang/Debug/Parser.d
new file mode 100644
index 0000000..764149f
--- /dev/null
+++ b/Sencha-lang/Debug/Parser.d
@@ -0,0 +1,5 @@
+Parser.d: ../Parser.cpp ../Parser.h ../Token.h
+
+../Parser.h:
+
+../Token.h:
diff --git a/Sencha-lang/Debug/Parser.o b/Sencha-lang/Debug/Parser.o
new file mode 100644
index 0000000..fe289e9
--- /dev/null
+++ b/Sencha-lang/Debug/Parser.o
Binary files differ
diff --git a/Sencha-lang/Debug/Sencha-lang b/Sencha-lang/Debug/Sencha-lang
new file mode 100755
index 0000000..0af2ca9
--- /dev/null
+++ b/Sencha-lang/Debug/Sencha-lang
Binary files differ
diff --git a/Sencha-lang/Debug/Token.d b/Sencha-lang/Debug/Token.d
new file mode 100644
index 0000000..36ba899
--- /dev/null
+++ b/Sencha-lang/Debug/Token.d
@@ -0,0 +1,3 @@
+Token.d: ../Token.cpp ../Token.h
+
+../Token.h:
diff --git a/Sencha-lang/Debug/Token.o b/Sencha-lang/Debug/Token.o
new file mode 100644
index 0000000..f39c463
--- /dev/null
+++ b/Sencha-lang/Debug/Token.o
Binary files differ
diff --git a/Sencha-lang/Debug/lexer_tests.d b/Sencha-lang/Debug/lexer_tests.d
new file mode 100644
index 0000000..3a73bf9
--- /dev/null
+++ b/Sencha-lang/Debug/lexer_tests.d
@@ -0,0 +1,3 @@
+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
new file mode 100644
index 0000000..4d75f09
--- /dev/null
+++ b/Sencha-lang/Debug/lexer_tests.o
Binary files differ
diff --git a/Sencha-lang/Debug/main.d b/Sencha-lang/Debug/main.d
new file mode 100644
index 0000000..c96f175
--- /dev/null
+++ b/Sencha-lang/Debug/main.d
@@ -0,0 +1,7 @@
+main.d: ../main.cpp ../Token.h ../Lexer.h ../Parser.h
+
+../Token.h:
+
+../Lexer.h:
+
+../Parser.h:
diff --git a/Sencha-lang/Debug/main.o b/Sencha-lang/Debug/main.o
new file mode 100644
index 0000000..8f998ca
--- /dev/null
+++ b/Sencha-lang/Debug/main.o
Binary files differ
diff --git a/Sencha-lang/Debug/makefile b/Sencha-lang/Debug/makefile
new file mode 100644
index 0000000..1e20382
--- /dev/null
+++ b/Sencha-lang/Debug/makefile
@@ -0,0 +1,58 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+-include ../makefile.init
+
+RM := rm -rf
+
+# All of the sources participating in the build are defined here
+-include sources.mk
+-include subdir.mk
+-include objects.mk
+
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(strip $(C++_DEPS)),)
+-include $(C++_DEPS)
+endif
+ifneq ($(strip $(C_DEPS)),)
+-include $(C_DEPS)
+endif
+ifneq ($(strip $(CC_DEPS)),)
+-include $(CC_DEPS)
+endif
+ifneq ($(strip $(CPP_DEPS)),)
+-include $(CPP_DEPS)
+endif
+ifneq ($(strip $(CXX_DEPS)),)
+-include $(CXX_DEPS)
+endif
+ifneq ($(strip $(C_UPPER_DEPS)),)
+-include $(C_UPPER_DEPS)
+endif
+endif
+
+-include ../makefile.defs
+
+# Add inputs and outputs from these tool invocations to the build variables
+
+# All Target
+all: Sencha-lang
+
+# Tool invocations
+Sencha-lang: $(OBJS) $(USER_OBJS)
+ @echo 'Building target: $@'
+ @echo 'Invoking: Cross G++ Linker'
+ g++ -o "Sencha-lang" $(OBJS) $(USER_OBJS) $(LIBS)
+ @echo 'Finished building target: $@'
+ @echo ' '
+
+# Other Targets
+clean:
+ -$(RM) $(C++_DEPS)$(OBJS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) Sencha-lang
+ -@echo ' '
+
+.PHONY: all clean dependents
+.SECONDARY:
+
+-include ../makefile.targets
diff --git a/Sencha-lang/Debug/objects.mk b/Sencha-lang/Debug/objects.mk
new file mode 100644
index 0000000..742c2da
--- /dev/null
+++ b/Sencha-lang/Debug/objects.mk
@@ -0,0 +1,8 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+USER_OBJS :=
+
+LIBS :=
+
diff --git a/Sencha-lang/Debug/sources.mk b/Sencha-lang/Debug/sources.mk
new file mode 100644
index 0000000..c1514fd
--- /dev/null
+++ b/Sencha-lang/Debug/sources.mk
@@ -0,0 +1,27 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+O_SRCS :=
+CPP_SRCS :=
+C_UPPER_SRCS :=
+C_SRCS :=
+S_UPPER_SRCS :=
+OBJ_SRCS :=
+ASM_SRCS :=
+CXX_SRCS :=
+C++_SRCS :=
+CC_SRCS :=
+C++_DEPS :=
+OBJS :=
+C_DEPS :=
+CC_DEPS :=
+CPP_DEPS :=
+EXECUTABLES :=
+CXX_DEPS :=
+C_UPPER_DEPS :=
+
+# Every subdirectory with source files must be described here
+SUBDIRS := \
+. \
+
diff --git a/Sencha-lang/Debug/subdir.mk b/Sencha-lang/Debug/subdir.mk
new file mode 100644
index 0000000..e26a52c
--- /dev/null
+++ b/Sencha-lang/Debug/subdir.mk
@@ -0,0 +1,39 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables
+CPP_SRCS += \
+../Lexer.cpp \
+../Object.cpp \
+../Parser.cpp \
+../Token.cpp \
+../lexer_tests.cpp \
+../main.cpp
+
+OBJS += \
+./Lexer.o \
+./Object.o \
+./Parser.o \
+./Token.o \
+./lexer_tests.o \
+./main.o
+
+CPP_DEPS += \
+./Lexer.d \
+./Object.d \
+./Parser.d \
+./Token.d \
+./lexer_tests.d \
+./main.d
+
+
+# Each subdirectory must supply rules for building sources it contributes
+%.o: ../%.cpp
+ @echo 'Building file: $<'
+ @echo 'Invoking: Cross G++ Compiler'
+ g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+ @echo 'Finished building: $<'
+ @echo ' '
+
+
diff --git a/Sencha-lang/Lexer.cpp b/Sencha-lang/Lexer.cpp
new file mode 100644
index 0000000..830066d
--- /dev/null
+++ b/Sencha-lang/Lexer.cpp
@@ -0,0 +1,189 @@
+#include "Lexer.h"
+
+Lexer::Lexer()
+{
+ string keys[] = {"function", "class", "for", "while", "if", "else"};
+ keywords.assign(keys, keys+6);
+
+ char punct[] = {'.', ',', ';', '{', '}', '[', ']', '(', ')'};
+ punctuation.assign(punct, punct+9);
+
+ string oper[] = {"<", ">", "+", "-", "/", "*", "%", "&", "|", "=", ":", "==", "+=", "-=", "<=", ">=", "!=", "&&", "||"};
+ operators.assign(oper, oper +19);
+}
+
+Lexer::~Lexer()
+{
+ //dtor
+}
+
+void Lexer::add_keyword(string word)
+{
+ if(!is_keyword(word))
+ {
+ keywords.push_back(word);
+ }
+}
+void Lexer::add_punctuation_char(char c)
+{
+ if(!is_punctuation(c))
+ {
+ punctuation.push_back(c);
+ }
+}
+
+void Lexer::add_operator(string oper)
+{
+ if(!is_operator(oper))
+ {
+ operators.push_back(oper);
+ }
+}
+
+
+vector<Token> Lexer::parse_line(string line)
+{
+ vector<Token> tokens;
+ while(line != "")
+ {
+ pair<string, Token> result_of_parsing = parse_token(line);
+ line = result_of_parsing.first;
+ Token token = result_of_parsing.second;
+ if(token.get_value() != "")
+ {
+ tokens.push_back(token);
+ }
+ }
+ return tokens;
+
+}
+
+pair<string, Token> Lexer::parse_token(string line)
+{
+ string token_value = "";
+ unsigned int i;
+ bool in_char_literal = false;
+ for(i=0; i< line.size(); i++)
+ {
+ if(token_value == "" && isspace(line[i])) continue;
+
+ if(isalnum(line[i]) || line[i] == '\"' || line[i]== '_')
+ {
+ token_value += line[i];
+ if(line[i] == '\"')
+ {
+ if(in_char_literal)
+ {
+ in_char_literal = false;
+ }
+ else in_char_literal = true;
+ }
+ }
+ else if(ispunct(line[i]))
+ {
+ if(token_value=="")
+ {
+ token_value=line[i];
+ i++;
+ if(i<line.size())
+ {
+ if(line[i] == '=')
+ {
+ token_value+=line[i];
+ i++;
+ }
+
+ }
+ }
+ break;
+ }
+ else if (in_char_literal && isspace(line[i]))
+ {
+ token_value += line[i];
+ }
+ else break;
+ }
+
+ Token token = Token(guess_type(token_value), token_value);
+ string truncated_line = line.substr(i);
+
+ return pair<string, Token>(truncated_line, token);
+}
+
+bool Lexer::is_keyword(string value)
+{
+ for(int i=0; i< keywords.size(); i++)
+ {
+ if(value == keywords[i]) return true;
+ }
+ return false;
+}
+
+bool Lexer::is_punctuation(char c)
+{
+
+ for(int i=0; i< punctuation.size(); i++)
+ {
+ if(c == punctuation[i]) return true;
+ }
+ return false;
+}
+
+bool Lexer::is_operator(string value)
+{
+ for(int i=0; i< operators.size(); i++)
+ {
+ if(value == operators[i]) return true;
+ }
+ return false;
+}
+
+type_of_token Lexer::guess_type(string value) //TODO, hey wouldn't it be nice, to implement it?
+{
+ /* I can have one of these types:
+ typedef enum { t_invalid_token=0, t_symbol, t_integer, t_literal,
+ t_punctuation, t_keyword } type_of_token;
+
+ */
+
+ if(value == "") return t_invalid_token;
+ if(isdigit(value[0]))
+ {
+ bool is_integer = true;
+ for(int i=1; i<value.size(); i++)
+ {
+ if(!isdigit(value[i])) is_integer = false;
+ }
+
+ if(is_integer) return t_integer;
+ else return t_invalid_token;
+ }
+ if(isalpha(value[0]))
+ {
+ if(is_keyword(value)) return t_keyword;
+ else return t_symbol;
+
+ }
+
+ if(value[0]=='\"')
+ {
+ if(value[value.size()-1] == '\"') return t_literal;
+ else return t_invalid_token;
+ }
+
+ if(value.size() == 1 )
+ {
+ if(is_punctuation(value[0])) return t_punctuation;
+ else
+ {
+ if(is_operator(value)) return t_operator;
+ }
+ }
+ if(value.size() == 2 && is_operator(value)) return t_operator;
+
+ //If any...
+ return t_invalid_token;
+}
+
+
+
diff --git a/Sencha-lang/Lexer.h b/Sencha-lang/Lexer.h
new file mode 100644
index 0000000..c7e2906
--- /dev/null
+++ b/Sencha-lang/Lexer.h
@@ -0,0 +1,39 @@
+#ifndef LEXER_H
+#define LEXER_H
+#include <vector>
+#include <string>
+#include <utility>
+#include <cctype>
+#include <iostream>
+#include "Token.h"
+
+using namespace std;
+class Lexer
+{
+ public:
+ Lexer();
+ virtual ~Lexer();
+
+
+
+ void add_keyword(string word);
+ void add_punctuation_char(char c);
+ void add_operator(string oper);
+
+ vector<Token> parse_line(string line);
+ pair<string, Token> parse_token(string line);
+ type_of_token guess_type(string value);
+
+ protected:
+ private:
+
+ bool is_keyword(string value);
+ bool is_punctuation(char c);
+ bool is_operator(string value );
+
+ vector<string> keywords;
+ vector<char> punctuation;
+ vector<string> operators;
+};
+
+#endif // LEXER_H
diff --git a/Sencha-lang/Object.cpp b/Sencha-lang/Object.cpp
new file mode 100644
index 0000000..0badd08
--- /dev/null
+++ b/Sencha-lang/Object.cpp
@@ -0,0 +1,12 @@
+#include "Object.h"
+
+Object::Object()
+{
+ number_value = 0;
+ //ctor
+}
+
+Object::~Object()
+{
+ //dtor
+}
diff --git a/Sencha-lang/Object.h b/Sencha-lang/Object.h
new file mode 100644
index 0000000..563cf7d
--- /dev/null
+++ b/Sencha-lang/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-lang/Parser.cpp b/Sencha-lang/Parser.cpp
new file mode 100644
index 0000000..f0ef0dd
--- /dev/null
+++ b/Sencha-lang/Parser.cpp
@@ -0,0 +1,295 @@
+#include "Parser.h"
+#include "iostream"
+
+Parser::Parser(vector<Token> tokens)
+{
+ error_message = "***ERRORS DURING PARSING***\n";
+ report_message = "***PARSER REPORT***\n";
+ token_stream = tokens;
+ position_in_stream = 0;
+ read_next();
+}
+
+Parser::~Parser()
+{
+ //dtor
+}
+
+void Parser::report(string s)
+{
+ report_message += s ;
+}
+
+void Parser::error(string s)
+{
+ error_message += s ;
+}
+
+bool Parser::read_next()
+{
+ if(position_in_stream < token_stream.size())
+ {
+ current_token = token_stream[position_in_stream];
+ tok_value = current_token.get_value();
+ position_in_stream++;
+ return true;
+ }
+ else
+ {
+ current_token = Token(t_invalid_token, "");
+ tok_value = current_token.get_value();
+ return false;
+ }
+}
+
+void Parser::interpret()
+{
+ while(tok_value!= "")
+ {
+ if(is_type())
+ {
+ report("Identifier: " + tok_value + "\n");
+ read_next();
+
+ if(accept("="))
+ {
+ expr();
+ report(" :=\n");
+ }
+ if(accept(";"))
+ {
+ report("Variable definition\n");
+ continue;
+ }
+
+ expect("(");
+ int argc = 0;
+ while(true)
+ {
+ argc++;
+ is_type();
+ report("function argument: " + tok_value + "\n");
+ read_next();
+ if(peek(")"))
+ {
+ break;
+ }
+ expect(",");
+ }
+ expect(")");
+
+ if(!accept(";"))
+ {
+ report("function body:\n");
+ statement();
+ }
+ }
+
+ else {
+ report("Regular statement:\n");
+ statement();
+ }
+ }
+}
+
+bool Parser::peek(string s)
+{
+ return tok_value == s;
+}
+
+bool Parser::accept(string s)
+{
+ if(peek(s))
+ {
+ read_next();
+ return true;
+ }
+ else return false;
+}
+
+bool Parser::expect(string s)
+{
+ if(!accept(s))
+ {
+ string error_message = "Error: expected ";
+ error_message += s;
+ error_message += " but received: " + tok_value + "\n";
+
+ error(error_message);
+ return false;
+ }
+ else return true;
+}
+
+bool Parser::is_type()
+{
+ if(current_token.get_type() == t_symbol || current_token.get_type() == t_keyword)
+ {
+ if(tok_value == "def" || tok_value == "string" || tok_value == "num")
+ {
+ read_next();
+ return true;
+ }
+ else return false;
+
+ }
+ else return false;
+}
+
+void Parser::statement()
+{
+ if(accept("{"))
+ {
+ while(!accept("}"))
+ {
+ statement();
+ }
+ }
+ else if(is_type())
+ {
+ report("Local variable: " + tok_value + "\n");
+ read_next();
+ if(accept("="))
+ {
+ expr();
+ report(" :=\n");
+ }
+ expect(";");
+ }
+ else if(accept("if"))
+ {
+ //stuff
+ //TODO implement that
+ }
+ else if(accept("while"))
+ {
+ //similar stuff
+ }
+ else if(accept("return"))
+ {
+
+ if(!peek(";"))
+ {
+ expr();
+ }
+ expect(";");
+ report("RETURN\n");
+
+ }
+ else
+ {
+ expr();
+ while(!expect(";")) read_next();
+
+ }
+}
+
+void Parser::prim_expr()
+{
+ if(current_token.get_type() == t_integer)
+ {
+ report("Number: " + tok_value + "\n");
+ }
+ else if(current_token.get_type() == t_symbol)
+ {
+ report("Variable: " + tok_value + "\n");
+ }
+ else if(current_token.get_type() == t_literal)
+ {
+ report("Character literal: " + tok_value + "\n");
+ }
+ else if(accept("("))
+ {
+ expr();
+ expect(")");
+ }
+ else
+ {
+ error("ERROR: unexpected primary expression" + tok_value + "\n");
+
+ }
+ read_next();
+}
+
+void Parser::postfix_expr()
+{
+ prim_expr();
+ if(accept("["))
+ {
+ expr();
+ expect("]");
+ report(" [] ");
+
+ }
+ else if(accept("("))
+ {
+ if(!accept(")"))
+ {
+ expr();
+ report("function argument\n");
+ while(accept(","))
+ {
+ expr();
+ report("function argument\n");
+ }
+ expect(")");
+ }
+ report("FUNC_CALL\n");
+ }
+}
+
+void Parser::add_expr()
+{
+ postfix_expr();
+ while(peek("+") || peek("-"))
+ {
+ if(accept("+"))
+ {
+ postfix_expr();
+ report(" +\n");
+ } else if(accept("-"))
+ {
+ postfix_expr();
+ report(" -\n");
+ }
+ }
+}
+
+void Parser::rel_expr()
+{
+ add_expr();
+ while(peek("<"))
+ {
+ accept("<");
+ add_expr();
+ report(" <\n");
+ }
+}
+
+void Parser::eq_expr()
+{
+ rel_expr();
+ while(peek("==") || peek("!="))
+ {
+ if(accept("=="))
+ {
+ rel_expr();
+ report("==\n");
+ }
+ else if(accept("!="))
+ {
+ rel_expr();
+ report("!=\n");
+ }
+ }
+}
+
+void Parser::expr()
+{
+ eq_expr();
+ if(accept("="))
+ {
+ expr();
+ report(" := ");
+ }
+}
diff --git a/Sencha-lang/Parser.h b/Sencha-lang/Parser.h
new file mode 100644
index 0000000..a60d7b1
--- /dev/null
+++ b/Sencha-lang/Parser.h
@@ -0,0 +1,45 @@
+#ifndef PARSER_H
+#define PARSER_H
+#include <string>
+#include <vector>
+#include "Token.h"
+
+
+using namespace std;
+class Parser
+{
+ public:
+ Parser(vector<Token> tokens);
+ virtual ~Parser();
+ void interpret();
+ string report_message;
+ string error_message;
+
+
+ protected:
+ private:
+ Token current_token;
+ string tok_value;
+ vector<Token> token_stream;
+ int position_in_stream;
+
+ bool read_next();
+ bool peek(string s);
+ bool accept(string s);
+ bool expect(string s);
+ bool is_type();
+
+ void error(string s);
+ void report(string s);
+
+ void statement();
+
+ void add_expr();
+ void prim_expr();
+ void postfix_expr();
+ void rel_expr();
+ void eq_expr();
+ void expr();
+};
+
+#endif // PARSER_H
diff --git a/Sencha-lang/Token.cpp b/Sencha-lang/Token.cpp
new file mode 100644
index 0000000..873f4e7
--- /dev/null
+++ b/Sencha-lang/Token.cpp
@@ -0,0 +1,2 @@
+#include "Token.h"
+
diff --git a/Sencha-lang/Token.h b/Sencha-lang/Token.h
new file mode 100644
index 0000000..7c3552f
--- /dev/null
+++ b/Sencha-lang/Token.h
@@ -0,0 +1,25 @@
+#ifndef TOKEN_H
+#define TOKEN_H
+#include <string>
+
+
+using namespace std;
+
+typedef enum { t_invalid_token=0, t_symbol, t_integer, t_literal,
+ t_punctuation, t_keyword, t_operator, t_float } type_of_token; //t_float not implemented
+ //TODO implement t_float in lexer
+
+
+class Token
+{
+ public:
+ type_of_token type;
+ string value;
+ Token() : type(t_invalid_token), value("") {};
+ Token(type_of_token type, string value) : type(type), value(value) { };
+ type_of_token get_type() { return type; };
+ string get_value() { return value; };
+
+};
+
+#endif // TOKEN_H
diff --git a/Sencha-lang/main.cpp b/Sencha-lang/main.cpp
new file mode 100644
index 0000000..a0fea6d
--- /dev/null
+++ b/Sencha-lang/main.cpp
@@ -0,0 +1,58 @@
+#include <iostream>
+#include <string>
+#include "Token.h"
+#include "Lexer.h"
+#include "Parser.h"
+
+using namespace std;
+
+void test_lexer()
+{
+ string test_line = "def i; bulb; i + 3; string banan; banan = \"banan and other stuff\"; string kaboom(num how_many_times) { def z; }";
+ string test_line2 = "def how_many_trees = 1; how_many_trees + 3 == 2; num cut_tree( num how_many) {return how_many -1; != <=}";
+ Lexer lexer;
+ vector<Token> tokens = lexer.parse_line(test_line);
+
+
+ for(int i=0; i< tokens.size(); i++)
+ {
+ cout << tokens[i].get_value() << " type: " << tokens[i].get_type() << endl;
+ }
+
+
+ tokens = lexer.parse_line(test_line2);
+
+ /*for(int i=0; i< tokens.size(); i++)
+ {
+ cout << tokens[i].get_value() << " type: " << tokens[i].get_type() << endl;
+ }*/
+}
+
+void test_parser()
+{
+ vector<string> lines;
+ lines.push_back("def i; bulb; i + 3; string banan = \"kartofel\"; banan = \"banan\"; string kaboom(num how_many_times) { def z; }");
+ lines.push_back("{ i like bananas; string hello = \"hello\"; hello(); }");
+ lines.push_back("def how_many_trees = 1; how_many_trees + 3 == 2; num cut_tree(num how_many) {return how_many -1;}");
+ Lexer lexer;
+ vector<Token> tokens;
+ for(int i=0; i<lines.size(); i++)
+ {
+ tokens = lexer.parse_line(lines[i]);
+ Parser parser = Parser(tokens);
+ parser.interpret();
+ cout << "<<<Parsing number: " << i << " >>>" << endl;
+ cout << "Instructions: " << endl ;
+ cout << lines[i] << endl << endl;
+ cout << parser.report_message;
+ cout << parser.error_message << endl;
+ }
+
+}
+int main()
+{
+ cout << "Hello world!" << endl;
+ test_parser();
+ //test_lexer();
+ return 0;
+}
diff --git a/Sencha-lang/minunit.h b/Sencha-lang/minunit.h
new file mode 100644
index 0000000..948933e
--- /dev/null
+++ b/Sencha-lang/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/.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>