summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2010-05-09 09:30:29 +0000
committerPaul Buetow <paul@buetow.org>2010-05-09 09:30:29 +0000
commita90467d4be3bcf91cab299b4521bf5f762abb1d5 (patch)
tree5171d406e6be467807a914ce42923ac997d74858
added the scheme branch
-rw-r--r--COPYING31
-rw-r--r--INSTALL11
-rw-r--r--Makefile118
-rw-r--r--docs/header.txt31
-rw-r--r--docs/help.txt8
-rw-r--r--docs/pbsc.txt43
-rw-r--r--docs/stats.txt4
-rw-r--r--docs/synopses.txt4
-rw-r--r--docs/version.txt1
-rw-r--r--docs/vim-tips.txt2
-rw-r--r--examples/netsted.fype11
-rw-r--r--examples/reverse.fype7
-rw-r--r--src/argv.c181
-rw-r--r--src/argv.h51
-rw-r--r--src/build.h41
-rw-r--r--src/core/frame.c152
-rw-r--r--src/core/frame.h68
-rw-r--r--src/core/interpret.c379
-rw-r--r--src/core/interpret.h58
-rw-r--r--src/core/lambda.c98
-rw-r--r--src/core/lambda.h55
-rw-r--r--src/core/promise.c60
-rw-r--r--src/core/promise.h49
-rw-r--r--src/core/scanner.c297
-rw-r--r--src/core/scanner.h69
-rw-r--r--src/core/token.c135
-rw-r--r--src/core/token.h75
-rw-r--r--src/core/tools.c64
-rw-r--r--src/core/tools.h42
-rw-r--r--src/core/variable.c59
-rw-r--r--src/core/variable.h52
-rw-r--r--src/data/array.c327
-rw-r--r--src/data/array.h94
-rw-r--r--src/data/cons.c88
-rw-r--r--src/data/cons.h55
-rw-r--r--src/data/dat.c268
-rw-r--r--src/data/dat.h88
-rw-r--r--src/data/hash.c306
-rw-r--r--src/data/hash.h84
-rw-r--r--src/data/list.c531
-rw-r--r--src/data/list.h118
-rw-r--r--src/data/map.c289
-rw-r--r--src/data/map.h88
-rw-r--r--src/data/queue.c210
-rw-r--r--src/data/queue.h81
-rw-r--r--src/data/stack.c271
-rw-r--r--src/data/stack.h79
-rw-r--r--src/data/tree.c215
-rw-r--r--src/data/tree.h106
-rw-r--r--src/data/tupel.c53
-rw-r--r--src/data/tupel.h47
-rw-r--r--src/data/types.h64
-rw-r--r--src/defines.h108
-rw-r--r--src/fype.c83
-rw-r--r--src/fype.h57
-rw-r--r--src/main.c45
-rw-r--r--tags282
-rw-r--r--test.fype13
-rw-r--r--test.out116
59 files changed, 6422 insertions, 0 deletions
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..d911f4d
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,31 @@
+File: ./COPYING
+A simple Fype interpreter
+
+WWW: http://fype.buetow.org
+AUTHOR: http://paul.buetow.org
+E-Mail: fype at dev.buetow.org
+
+The Fype Language; (c) 2005 - 2010 - Dipl.-Inform. (FH) Paul C. Buetow
+
+Redistribution and use in source and binary forms, with or without modi-
+fication, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of buetow.org nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY PAUL C. BUETOW AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL PAUL C. BUETOW BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..a8b38a4
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,11 @@
+How to install fype:
+
+ make
+ sudo make install
+ make clean
+
+How to read the docu:
+
+ man pbsc
+
+Examples can be found in the ./examples directory.
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..37568aa
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,118 @@
+# THIS MAKEFILE ONLY WORKS WITH (NET)BSD MAKE AKA PMAKE!
+
+BIN=fype
+SRCS!=find ./src -name '*.c'
+OBJS=$(SRCS:.c=.o)
+CC?=cc
+#CC=mingw32-gcc
+DEBUG=-g3 -ggdb3
+CFLAGS+=-c -Wall -std=c99 -pedantic $(DEBUG)
+LDADD+=
+HEADER?=docs/header.txt
+OSYSTEM!=uname
+PREFIX=/usr/local
+all: build $(OBJS) newline stats-tofile
+ @$(CC) -lm -o $(BIN) $(OBJS) $(LDADD)
+ @awk '$$2 == "BUILDNR" { printf("===> Fype build number % 13s :% 6s%d\n", \
+ "", "", $$3); exit(0); }' src/build.h
+ @echo "===> Fype binary size : `du -hs $(BIN)`"
+ @#echo "===> `./$(BIN) -v | sed 's/Build .*//'`"
+ @./fype -v > ./docs/version.txt
+ @./fype -h > ./docs/help.txt
+ @./fype -s > ./docs/synopses.txt
+ @echo
+$(OBJS):
+ $(CC) $(LDADD) $(CFLAGS) `echo $@ | sed 's/\.o/\.c/'` -o $@
+clean:
+ find ./ -name 1 -exec rm -f {} \;
+ find ./ -name '*.o' -exec rm -f {} \;
+ find ./ -name '*.bin' -exec rm -f {} \;
+ find . -name '*.core' -exec rm -f {} \;
+ if [ -f $(BIN) ]; then rm -f $(BIN); fi
+build: ctags
+ @awk '{ \
+ if ($$2 == "BUILDNR") print $$1,$$2,$$3+1; \
+ else if ($$2 ~ /OS_/) printf("%s OS_%s\n", $$1, \
+ toupper("$(OSYSTEM)")); \
+ else print }' \
+ src/build.h >.tmp && mv -f .tmp src/build.h
+printbuild:
+ @awk '$$2 == "BUILDNR" { printf("%d\n", \
+ $$3); exit(0); }' src/build.h
+ctags:
+ # Generating Source-Tags for Vim
+ ctags `find . -name '*.c'`
+style: astyle check
+astyle:
+ find ./src -name '*.[ch]' -exec sh -c 'astyle -s3 {}; rm -f {}.orig' \;
+check:
+ for f in `find ./src -name '*.[ch]'`; do awk -v f=$$f \
+ '{ if (length($$0) > 80) { \
+ printf "Max line length reached @ %s:%d => %d\n", \
+ f, NR, length($$0) } }' $$f; done
+touch:
+ find ./src -name '*.c' -exec touch {} \;
+stats:
+ @sh -c 'wc=`find ./src -name "*.[ch]" | xargs wc -l`; \
+ echo "===> Num of C source files : `echo \"$$wc\" | \
+ grep -E \"\\.(c|h)$$\" | wc -l`"; \
+ echo "===> Num of C source lines : `echo \"$$wc\" | \
+ tail -n 1 | sed s/total//`"'
+ @sh -c 'wc=`find ./examples -name "*.fype" | xargs wc -l`; \
+ echo "===> Num of Fype source examples : `echo \"$$wc\" | \
+ grep -E \"\\.fype$$\" | wc -l`"; \
+ echo "===> Num of Fype source lines : `echo \"$$wc\" | \
+ tail -n 1 | sed s/total//`"'
+stats-tofile:
+ make stats | tee ./docs/stats.txt
+testrun:
+ cat ./test.fype > ./test.out
+ ./$(BIN) -V ./test.fype | tee -a ./test.out
+tr: testrun
+test: all testrun
+t: test
+run:
+ ./$(BIN) ./test.fype
+core:
+ #gdb $(BIN) $(BIN).core
+ gdb $(BIN) core
+gdb:
+ gdb --args $(BIN) .//
+newline:
+ @echo
+examples: all
+ echo > ./examples/all-examples.txt
+ for i in ./examples/*.fype; do \
+ echo "===> Running $$i"; \
+ ./$(BIN) $$i; \
+ cat $$i >> ./examples/all-examples.txt; \
+ echo >> ./examples/all-examples.txt; \
+ done
+replace:
+ find ./src -name '*.[ch]' -exec sh -c 'sed -n "s/$(FROM)/$(INTO)/g; \
+ w .tmp" {} && mv -f .tmp {}' \;
+headers:
+ @find ./src -name '*.[ch]' -exec sh -c 'export FILE={}; \
+ make header' \;
+ @sh -c '> ./COPYING;export FILE=./COPYING; make header'
+ @# BSD sed does not support the -i (inplace) switch
+ @sed -n '1d;$$d;s/....//; w .tmp' ./COPYING && mv .tmp ./COPYING
+
+header:
+ @echo "===> Processing $(FILE)"
+ @sed -n '/*:/d; w .tmp' $(FILE)
+ @header=`sed 's/\(.*\)/ echo " \*: \1"/' $(HEADER)`; \
+ echo '/*:*' > $(FILE); eval "$$header" >> $(FILE); \
+ echo ' *:*/' >> $(FILE); cat .tmp >> $(FILE); rm -f .tmp
+tar: clean
+ sh -c 'build=`make printbuild`;cd ../;\
+ tar cvjf $(BIN)-$$build.tar.bz2 $(BIN)'
+install: all
+ cp ./$(BIN) $(PREFIX)/bin
+ cp ./docs/pod/fype.1.gz $(PREFIX)/man/man1
+deinstall:
+ rm $(PREFIX)/bin/$(BIN)
+ rm $(PREFIX)/man/man1/fype.1.gz
+uninstall: deinstall
+pod:
+ @cd ./docs/pod; make clean all
diff --git a/docs/header.txt b/docs/header.txt
new file mode 100644
index 0000000..83638b8
--- /dev/null
+++ b/docs/header.txt
@@ -0,0 +1,31 @@
+File: ${FILE}
+A simple Fype interpreter
+
+WWW: http://fype.buetow.org
+AUTHOR: http://paul.buetow.org
+E-Mail: fype at dev.buetow.org
+
+The Fype Language; (c) 2005 - 2010 - Dipl.-Inform. (FH) Paul C. Buetow
+
+Redistribution and use in source and binary forms, with or without modi-
+fication, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of buetow.org nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY PAUL C. BUETOW ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL PAUL C. BUETOW BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/docs/help.txt b/docs/help.txt
new file mode 100644
index 0000000..0033293
--- /dev/null
+++ b/docs/help.txt
@@ -0,0 +1,8 @@
+Fype2 Alpha Build 10387
+(c) Paul C. Buetow (2005 - 2010) <fype@dev.buetow.org>
+ -e Executes given code string (see synopses)
+ -h Prints this help
+ -s Prints the synopsis
+ -v Prints the current version
+ -T Prints token list after scanning
+ -V Verbose mode: Print all possible output
diff --git a/docs/pbsc.txt b/docs/pbsc.txt
new file mode 100644
index 0000000..3a2726c
--- /dev/null
+++ b/docs/pbsc.txt
@@ -0,0 +1,43 @@
+Global Frame
+
+v?: Variables
+p?: Parameters
+b?: Boolean expression (Returns #t or #f)
+t?: Term
+f: Function
+l?: List
+
+(f p1 p2 ...)
+
+(define v1 t1)
+
+(lambda (v1 v2 ...) t1)
+
+(define foo (lambda (v1 v2 ...) t1))
+(define (foo (v1 v2 ...) t1))
+
+(if b1 t1 t2)
+(unless b1 t1 t2)
+(eq? t1 t2)
+(neq? t1 t2)
+(and b1 b2)
+(or b1 b2)
+(xor b1 b2)
+(not b1)
+
+(cond ((b1 t1)
+ (b2 t2)
+ ...
+ (else tn)))
+
+(let ((v1 t1)
+ (v2 t2)
+ ...)
+ t3)
+
+(cons t1 l1)
+(car l1)
+(cdr l1)
+(set-car l1 t1)
+(set-cdr l1 t1)
+(list p1 p2 ...)
diff --git a/docs/stats.txt b/docs/stats.txt
new file mode 100644
index 0000000..50cbda1
--- /dev/null
+++ b/docs/stats.txt
@@ -0,0 +1,4 @@
+===> Num of C source files : 44
+===> Num of C source lines : 5740
+===> Num of Fype source examples : 2
+===> Num of Fype source lines : 18
diff --git a/docs/synopses.txt b/docs/synopses.txt
new file mode 100644
index 0000000..c0842aa
--- /dev/null
+++ b/docs/synopses.txt
@@ -0,0 +1,4 @@
+Synopsis:
+./fype [-[hsvTV]] file.fy
+./fype -e "code string;"
+ (Hint: Try -h for details)
diff --git a/docs/version.txt b/docs/version.txt
new file mode 100644
index 0000000..d2c768b
--- /dev/null
+++ b/docs/version.txt
@@ -0,0 +1 @@
+Fype2 Alpha Build 10387
diff --git a/docs/vim-tips.txt b/docs/vim-tips.txt
new file mode 100644
index 0000000..035b019
--- /dev/null
+++ b/docs/vim-tips.txt
@@ -0,0 +1,2 @@
+line numbers: :se nu :se
+buffers: :ls :bd <NUM> :bd <FILENAME>
diff --git a/examples/netsted.fype b/examples/netsted.fype
new file mode 100644
index 0000000..2ddf89f
--- /dev/null
+++ b/examples/netsted.fype
@@ -0,0 +1,11 @@
+(def (test)
+ (say "This is test")
+ (def (test2)
+ (say "I am in test2" "And test3 will be defined next!")
+ (def (test3)
+ (say "Displaying all frames now:")
+ (show-frames))
+ (test3))
+ (test2))
+(test)
+
diff --git a/examples/reverse.fype b/examples/reverse.fype
new file mode 100644
index 0000000..a4384b6
--- /dev/null
+++ b/examples/reverse.fype
@@ -0,0 +1,7 @@
+(def (reverse x)
+ (def (my-reverse x y)
+ (if (null? x)
+ y
+ (my-reverse (cdr x) (cons (car x) y))))
+ (my-reverse x '()))
+(reverse (list 1 2 3))
diff --git a/src/argv.c b/src/argv.c
new file mode 100644
index 0000000..dc938d9
--- /dev/null
+++ b/src/argv.c
@@ -0,0 +1,181 @@
+/*:*
+ *: File: ./src/argv.c
+ *: A simple Fype interpreter
+ *:
+ *: WWW: http://fype.buetow.org
+ *: AUTHOR: http://paul.buetow.org
+ *: E-Mail: fype at dev.buetow.org
+ *:
+ *: The Fype Language; (c) 2005 - 2010 - Dipl.-Inform. (FH) Paul C. Buetow
+ *:
+ *: Redistribution and use in source and binary forms, with or without modi-
+ *: fication, are permitted provided that the following conditions are met:
+ *: * Redistributions of source code must retain the above copyright
+ *: notice, this list of conditions and the following disclaimer.
+ *: * Redistributions in binary form must reproduce the above copyright
+ *: notice, this list of conditions and the following disclaimer in the
+ *: documentation and/or other materials provided with the distribution.
+ *: * Neither the name of buetow.org nor the names of its contributors may
+ *: be used to endorse or promote products derived from this software
+ *: without specific prior written permission.
+ *:
+ *: THIS SOFTWARE IS PROVIDED BY PAUL C. BUETOW AS IS'' AND ANY EXPRESS OR
+ *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ *: DISCLAIMED. IN NO EVENT SHALL PAUL C. BUETOW BE LIABLE FOR ANY DIRECT,
+ *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ *: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ *: POSSIBILITY OF SUCH DAMAGE.
+ *:*/
+
+#include "argv.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "defines.h"
+#include "data/dat.h"
+
+#define ARGV_OSLEN 128
+
+char *BINARY;
+
+void
+argv_run(PBSc *p_fype, int i_argc, char **pc_argv) {
+ Dat *p_dat_string = dat_new();
+
+ BINARY = pc_argv[0];
+ char *c_tmp = STR_NEW(ARGV_OSLEN);
+ c_tmp[0] = '\0';
+
+ p_fype->p_tupel_argv->a = p_dat_string;
+ p_fype->p_tupel_argv->b = c_tmp;
+
+ if (i_argc <= 1) {
+ argv_synopsis(p_fype->p_tupel_argv);
+ exit(1);
+ }
+
+ for (int i = 1; i < i_argc; ++i) {
+ if (pc_argv[i][0] != '-' && pc_argv[i][0] != '/') {
+ dat_push(p_dat_string, pc_argv[i]);
+ continue;
+ }
+
+ int i_len = strlen(pc_argv[i]);
+ unsigned i_argc_left = i_argc - i + dat_size(p_dat_string);
+
+ for (int j = 1; j < i_len; ++j)
+ argv_switch(pc_argv[i][j], p_fype->p_tupel_argv, i_argc_left);
+ }
+}
+
+void
+argv_switch(char c_arg, Tupel *p_tupel_argv, unsigned i_argc_left) {
+ switch (c_arg) {
+ case 'e':
+ case 'T':
+ case 'V':
+ argv_addopt(c_arg, p_tupel_argv);
+ return;
+ case 'h':
+ argv_help();
+ exit(0);
+ case 's':
+ argv_synopsis(p_tupel_argv);
+ exit(0);
+ case 'v':
+ printf("%s %s %d\n", NAME, VERSION, BUILDNR);
+ exit(0);
+ }
+
+ char buf[2];
+ buf[0] = c_arg;
+ buf[1] = '\0';
+
+ EPRINTF("Error: No such option '%s'!\n", buf);
+ exit(1);
+}
+
+void
+argv_synopsis(Tupel *p_tupel_argv) {
+ printf("Synopsis:\n");
+ printf("%s ", BINARY);
+ printf("[-[hsvTV]] file.fy\n");
+ printf("%s ", BINARY);
+ printf("-e \"code string;\"\n");
+
+ if (!argv_checkopt('h', p_tupel_argv))
+ printf("\t(Hint: Try -h for details)\n");
+}
+
+void
+argv_help() {
+ printf("%s %s %d\n", NAME, VERSION, BUILDNR);
+ printf("%s\n", COPYRIGHT);
+ printf("\t-e\tExecutes given code string (see synopses)\n");
+ printf("\t-h\tPrints this help\n");
+ printf("\t-s\tPrints the synopsis\n");
+ printf("\t-v\tPrints the current version\n");
+ printf("\t-T\tPrints token list after scanning\n");
+ printf("\t-V\tVerbose mode: Print all possible output\n");
+ exit(0);
+}
+
+void
+argv_addopt(char c_opt, Tupel *p_tupel_argv) {
+ char *c_opts = (char *) p_tupel_argv->b;
+ int i_len = strlen(c_opts), i;
+
+ for (i = 0; i < i_len; ++i)
+ if (c_opts[i] == c_opt)
+ return;
+
+ c_opts[i] = c_opt;
+ c_opts[i+1] = '\0';
+}
+
+_Bool
+argv_checkopt(char c_opt, Tupel *p_tupel_argv) {
+ char *c_opts = (char *) p_tupel_argv->b;
+ int i_len = strlen(c_opts);
+
+ for (int i = 0; i < i_len; ++i)
+ if (c_opts[i] == c_opt)
+ return 1;
+
+ return 0;
+}
+
+_Bool
+argv_checkopts(char *c_opts, Tupel *p_tupel_argv) {
+ int i_len = strlen(c_opts);
+
+ for (int i = 0; i < i_len; ++i)
+ if (argv_checkopt(c_opts[i], p_tupel_argv))
+ return 1;
+
+ return 0;
+}
+
+void
+argv_check_argc(int i_required, unsigned i_argc_left, Tupel *p_tupel_argv) {
+ if ((unsigned) ++i_required > i_argc_left) {
+ argv_synopsis(p_tupel_argv);
+ EPRINTF("%d argument(s) missing!\n", i_required-i_argc_left);
+ exit(1);
+ }
+}
+
+void
+argv_tupel_delete(Tupel *p_tupel_argv) {
+ dat_delete(p_tupel_argv->a);
+ free(p_tupel_argv->b);
+ tupel_delete(p_tupel_argv);
+}
+
diff --git a/src/argv.h b/src/argv.h
new file mode 100644
index 0000000..a7575d2
--- /dev/null
+++ b/src/argv.h
@@ -0,0 +1,51 @@
+/*:*
+ *: File: ./src/argv.h
+ *: A simple Fype interpreter
+ *:
+ *: WWW: http://fype.buetow.org
+ *: AUTHOR: http://paul.buetow.org
+ *: E-Mail: fype at dev.buetow.org
+ *:
+ *: The Fype Language; (c) 2005 - 2010 - Dipl.-Inform. (FH) Paul C. Buetow
+ *:
+ *: Redistribution and use in source and binary forms, with or without modi-
+ *: fication, are permitted provided that the following conditions are met:
+ *: * Redistributions of source code must retain the above copyright
+ *: notice, this list of conditions and the following disclaimer.
+ *: * Redistributions in binary form must reproduce the above copyright
+ *: notice, this list of conditions and the following disclaimer in the
+ *: documentation and/or other materials provided with the distribution.
+ *: * Neither the name of buetow.org nor the names of its contributors may
+ *: be used to endorse or promote products derived from this software
+ *: without specific prior written permission.
+ *:
+ *: THIS SOFTWARE IS PROVIDED BY PAUL C. BUETOW AS IS'' AND ANY EXPRESS OR
+ *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ *: DISCLAIMED. IN NO EVENT SHALL PAUL C. BUETOW BE LIABLE FOR ANY DIRECT,
+ *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ *: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ *: POSSIBILITY OF SUCH DAMAGE.
+ *:*/
+
+#ifndef ARGV_H
+#define ARGV_H
+
+#include "data/tupel.h"
+#include "fype.h"
+
+void argv_run(PBSc *p_fype, int i_argc, char **pc_argv);
+void argv_switch(char c_arg, Tupel *p_tupel_argv, unsigned i_argc_left);
+void argv_synopsis(Tupel *p_tupel_argv);
+void argv_help();
+void argv_addopt(char c_opt, Tupel *p_tupel_argv);
+_Bool argv_checkopt(char c_opt, Tupel *p_tupel_argv);
+_Bool argv_checkopts(char *c_opts, Tupel *p_tupel_argv);
+void argv_check_argc(int i_required, unsigned i_argc_left, Tupel *p_tupel_argv);
+void argv_tupel_delete(Tupel *p_tupel_argv);
+
+#endif
diff --git a/src/build.h b/src/build.h
new file mode 100644
index 0000000..1e6006e
--- /dev/null
+++ b/src/build.h
@@ -0,0 +1,41 @@
+/*:*
+ *: File: ./src/build.h
+ *: A simple Fype interpreter
+ *:
+ *: WWW: http://fype.buetow.org
+ *: AUTHOR: http://paul.buetow.org
+ *: E-Mail: fype at dev.buetow.org
+ *:
+ *: The Fype Language; (c) 2005 - 2010 - Dipl.-Inform. (FH) Paul C. Buetow
+ *:
+ *: Redistribution and use in source and binary forms, with or without modi-
+ *: fication, are permitted provided that the following conditions are met:
+ *: * Redistributions of source code must retain the above copyright
+ *: notice, this list of conditions and the following disclaimer.
+ *: * Redistributions in binary form must reproduce the above copyright
+ *: notice, this list of conditions and the following disclaimer in the
+ *: documentation and/or other materials provided with the distribution.
+ *: * Neither the name of buetow.org nor the names of its contributors may
+ *: be used to endorse or promote products derived from this software
+ *: without specific prior written permission.
+ *:
+ *: THIS SOFTWARE IS PROVIDED BY PAUL C. BUETOW AS IS'' AND ANY EXPRESS OR
+ *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ *: DISCLAIMED. IN NO EVENT SHALL PAUL C. BUETOW BE LIABLE FOR ANY DIRECT,
+ *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ *: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ *: POSSIBILITY OF SUCH DAMAGE.
+ *:*/
+
+#ifndef BUILD_H
+#define BUILD_H
+
+#define BUILDNR 10388
+#define OS_LINUX
+
+#endif
diff --git a/src/core/frame.c b/src/core/frame.c
new file mode 100644
index 0000000..9143a0d
--- /dev/null
+++ b/src/core/frame.c
@@ -0,0 +1,152 @@
+/*:*
+ *: File: ./src/core/frame.c
+ *: A simple Fype interpreter
+ *:
+ *: WWW: http://fype.buetow.org
+ *: AUTHOR: http://paul.buetow.org
+ *: E-Mail: fype at dev.buetow.org
+ *:
+ *: The Fype Language; (c) 2005 - 2010 - Dipl.-Inform. (FH) Paul C. Buetow
+ *:
+ *: Redistribution and use in source and binary forms, with or without modi-
+ *: fication, are permitted provided that the followi