diff options
| author | admin (centauri.fritz.box) <puppet@mx.buetow.org> | 2014-06-30 23:53:04 +0200 |
|---|---|---|
| committer | admin (centauri.fritz.box) <puppet@mx.buetow.org> | 2014-06-30 23:53:04 +0200 |
| commit | adc4b59a3e7c9db6f33670164490830d87331228 (patch) | |
| tree | adc5d21856852bfb5c3cca794a9c07ad476d877e | |
| parent | 63cf3028445d8d213ffc774f77aafd7283cb4fbd (diff) | |
| parent | 5ab5de91eb0ae6ed9db78a2c8c47ec67f105e504 (diff) | |
Mergebuild-010393-lambda
93 files changed, 720 insertions, 4792 deletions
@@ -5,7 +5,7 @@ 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 +The Fype Language; (c) 2005 - 2010 Paul Buetow Redistribution and use in source and binary forms, with or without modi- fication, are permitted provided that the following conditions are met: @@ -6,6 +6,6 @@ How to install fype: How to read the docu: - man pbsc + man fype Examples can be found in the ./examples directory. @@ -1,6 +0,0 @@ -keywords: - refs - -functions: - ind - len @@ -1,11 +0,0 @@ -Todo's (not in any specific order) - -Functions should be handled via hash and ptrs not if/else (in progress) -Arrays (in progress) -Closures -Function arguments and return values -Interactive shell -Labels -String operators/functions -loop, next, break, do - diff --git a/docs/fype.txt b/docs/fype.txt new file mode 100644 index 0000000..004652e --- /dev/null +++ b/docs/fype.txt @@ -0,0 +1,31 @@ +Lambda Rules: + +(1) x ϵ V => x ϵ Λ +(2) M,N ϵ Λ => (M N) ϵ Λ (Application) +(3) M ϵ Λ and x ϵ V => (λx.M) ϵ Λ (Abstraction) +(4) No further Terms in Λ existent + +Examples: + +(λx.(λy.x)) ≡ λx.λy.x ≡ λx y.x ≡ false +(λx.(λy.y)) ≡ λx.λy.y ≡ λx y.y ≡ true +λx.λy.((x y) false) ≡ λx y.((x y) false) ≡ and + +Syntax: + +(λx . (λy.x)) ≡ λx.λy.x ≡ λx y . x ≡ false +true: x y = x; + +(λx.(λy.y)) ≡ λx.λy.y ≡ λx y . y ≡ true +false: x y = y; + +λx.λy.((x y) false) ≡ λx y.((x y) false) ≡ and +and: x y = (x y) false; + +id: x = x; + +greet: x = say (~ "Hello " x); + + + + diff --git a/docs/header.txt b/docs/header.txt index 83638b8..aeb1b4e 100644 --- a/docs/header.txt +++ b/docs/header.txt @@ -5,7 +5,7 @@ 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 +The Fype Language; (c) 2005 - 2010 Paul Buetow Redistribution and use in source and binary forms, with or without modi- fication, are permitted provided that the following conditions are met: diff --git a/docs/help.txt b/docs/help.txt index 0033293..29fbc7c 100644 --- a/docs/help.txt +++ b/docs/help.txt @@ -1,5 +1,5 @@ -Fype2 Alpha Build 10387 -(c) Paul C. Buetow (2005 - 2010) <fype@dev.buetow.org> +LambdaFype Alpha Build 10393 +(c) Paul Buetow (2005 - 2010) <fype@dev.buetow.org> -e Executes given code string (see synopses) -h Prints this help -s Prints the synopsis diff --git a/docs/pbsc.txt b/docs/pbsc.txt deleted file mode 100644 index 3a2726c..0000000 --- a/docs/pbsc.txt +++ /dev/null @@ -1,43 +0,0 @@ -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/pod/Makefile b/docs/pod/Makefile deleted file mode 100644 index ddc6de4..0000000 --- a/docs/pod/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# THIS MAKEFILE MAY WORK ONLY WITH (NET)BSD MAKE AKA PMAKE! - -all: man html latex txt -html: - pod2html fype.pod > fype.html -latex: - pod2latex fype.pod > fype.tex -man: - pod2man --release "`cat ../version.txt`" --center "The Fype Users Manual Page" fype.pod > fype.man - cp fype.man fype.1 - if [ -f fype.1.gz ]; then rm fype.1.gz; fi - gzip fype.1 -txt: - pod2text fype.pod | tee ../../README > fype.txt -pdf: - pod2pdf --footer-text="This document describes `cat ../version.txt`" fype.pod > fype.pdf -clean: - for i in html tex man 1.gz pdf; do \ - if [ -f $$i ]; then rm $$i; fi \ - done diff --git a/docs/pod/fype.pod b/docs/pod/fype.pod deleted file mode 100644 index 5006345..0000000 --- a/docs/pod/fype.pod +++ /dev/null @@ -1,495 +0,0 @@ -=head1 NAME - -B<Fype> is B<F>or B<Y>our B<P>rogram B<E>xecution - -B<Fype> is B<F>ree B<Y>ak B<P>rogramed for B<E>LF - -It's not a hype - it's B<Fype>! - -=head1 SYNOPSES - -=over - -=item B<fype> [-[hsvTV]] file.fy - -=item B<fype> -e "fype code string;" - -=back - -=head1 ABOUT - -Fype is not yet released! Lots of basic stuff is still missing! See the -TODO file of the source distribution of Fype! - -Fype is a 32 bit scripting language created for fun. You can use it and comment on it if you like. You could also write patches and mail them to fype at dev dot buetow dot org! Or go visit the IRC channel #coding at irc.german-elite.net and ask rantanplan. - -Fype is developed under the BSD license. See the COPYING file which is included in the source tree. - -Fype should be "at least as good as AWK". This does not mean it will be a replacement for AWK but it should support functions, loops and arrays like AWK does but with a different syntax. It should also get extension support like AWK has. I am not talking about GNU AWK but about New AWK, which is included in the *BSD distributions! Fype already has a few features which are not available in AWK. However, AWK has still many features which are not available in Fype as well ;) - -Fancy stuff like OOP or unicode or threading is not yet planed. But fancy stuff like function pointers and closures may be considered for one of the first releases of Fype :) - -=head1 PARSING / CODE GENERATION - -The Fype syntax is very simple and is using a maximum look ahead of 1 and a very easy top down parsing. Fype is parsing and interpreting its code simultaneous. This means, that syntax errors are only detected during program runtime. - -=head1 REQUIREMENTS - -Fype only has been tested on FreeBSD 7.0. Linux may work too. Windows support is not planned. But may work using Cygwin or SFU. Linux users have to install pmake before compiling Fype! - -You will need: - - GNU GCC C Compiler (gcc.gnu.org) - NetBSD Make aka pmake (GNU Make will not work) - -NetBSD Make is included in any *BSD and can be run with just B<make>. - -=head1 GETTING STARTED - -On Linux: Extract, compile and install Fype: - - tar xvjf fype.tar.bz2 - cd fype - pmake - sudo pmake install - pmake clean - -On FreeBSD: Extract, compile and install Fype: - - tar xvjf fype.tar.bz2 - cd fype - make - sudo make install - make clean - -Run a .fy file: - - fype test.fy - -See the ./examples subdir of the Fype source distribution for examples! See also fype -h for a list of all options. - -=head1 DATA TYPES - -Fype uses auto type conversion. However, if you want to know what's going on you may take a look at the provided basic datatypes. - -=head2 The basic data types - -=over - -=item I<integer> - -Specifies an integer number - -=item I<double> - -Specifies a double number - -=item I<string> - -Specifies a string - -=item I<number> - -May be an integer or a double number - -=item I<any> - -May be of any type above - -=item I<void> - -No type - -=item I<identifier> - -It's a variable name or a procedure name or a function name - -=back - -=head2 Explicit type conversions - -=over - -=item (I<integer>) B<integer> I<any> - -Converts any type to an integer - -=item (I<double>) B<double> I<any> - -Converts any type to a double - -=item (I<string>) B<string> I<any> - -Converts any type to a string - -=back - -=head1 SYNTAX - -=head2 Comments - -Text from a B<#> character until the end of the current line is considered being a comment. Multi line comments may start with an B<#*> and and with an B<*#> anywhere. Exceptions are if those signs are inside of strings. - -=head2 Statements - -A Fype program is a list of statements. Each keyword, expression or function call is part of a statement. Each statement is ended with a semicolon. Example: - - my bar = 3, foo = 1 + 2; - say foo; - exit foo - bar; - -=head2 Paranthesis - -All paranthesis of function calls are optional. They help to make the code better readable. They also help to force precedences of expressions. - -=head2 Scopeing - -A new scope starts with an { and ends with an }. An exception is a procedure, which does not use its own scope (see later in this manual). Control statements and functions support scopeings. The B<scope> function will print out all available symbols at the current position. Here is a small example of how to use scopes: - - my foo = 1; - - { - # Prints out 1 - put defined foo; - { - my bar = 2; - - # Prints out 1 - put defined bar; - - # Prints out all available symbols at this - # point to stdout. Those are: bar and foo - scope; - } - - # Prints out 0 - put defined bar; - - my baz = 3; - } - - # Prints out 0 - say defined bar; - -=head2 Control statements - -Fype knows the following control statements: - -=over - -=item if I<<expression>> { I<<statements>> } - -Runs the statements if the expression evaluates to a true value. - -=item ifnot I<<expression>> { I<<statements>> } - -Runs the statements if the expression evaluates to a false value. - -=item while I<<expression>> { I<<statements>> } - -Runs the statements as long as the the expression evaluates to a true value. - -=item until I<<expression>> { I<<statements>> } - -Runs the statements as long as the the expression evaluates to a false value. - -=back - -=head1 VARIABLES - -Variables can be defined with the B<my> keyword. If you don't assign a value during declaration, then it's using the default integer value 0. Variables may be changed during program runtime. Variables may be deleted using the B<undef> keyword! Example of defining variables: - - my foo = 1 + 2; - say foo; - - my bar = 12, baz = foo; - say 1 + bar; - say bar; - - my baz; - say baz; # Will print out 0 - -You may use the B<defined> keyword to check if an identifier has been defined or -not. - - ifnot defined foo { - say "No foo yet defined"; - } - - my foo = 1; - - if defined foo { - put "foo is defined and has the value "; - say foo; - } - -=head1 SYNONYMS - -Each variable can have as many synonyms as wished. A synonym is another name to access the content of a specific variable. Here is an example of how to use synomyms: - - my foo = "foo"; - my bar = \foo; - foo = "bar"; - - # The synonym variable should now also set to "bar" - assert "bar" == bar; - -Synonyms can be used for all kind of identifiers. It's not limited to normal variables but can be also used for function and procedure names etc. - - # Create a new procedure baz - proc baz { say "I am baz"; } - - # Make a synonym baz, and undefine baz - my bay = \baz; - - undef baz; - - # bay still has a reference of the original procedure baz - bay; # this prints aut "I am baz" - -The B<syms> keyword gives you the total number of synonyms pointing to a specific value: - - my foo = 1; - say syms foo; # Prints 1 - - my baz = \foo; - say syms foo; # Prints 2 - say syms baz; # Prints 2 - - undef baz; - say syms foo; # Prints 1 - - -=head1 BUILT IN FUNCTIONS - -In Fype, operators are built in functions as well. The difference is, that they may be written in infix notation instead in front of the arguments. The types inside the () specify the return types. - -=head2 Math - -=over - -=item (I<any>) I<any> B<+> I<any> - -Special string behavior: A string will get auto convertet into an I<integer>. - -=item (I<any>) I<any> B<-> I<any> - -Special string behavior: A string will get auto convertet into an I<integer>. - -=item (I<any>) I<any> B<*> I<any> - -Special string behavior: A string will get auto convertet into an I<integer>. - -=item (I<any>) I<any> B</> I<any> - -Special string behavior: A string will get auto convertet into an I<integer>. - -=back - -=head2 Conditional - -=over - -=item (I<integer>) I<any> B<==> I<any> - -=item (I<integer>) I<any> B<!=> I<any> - -=item (I<integer>) I<any> B<<=> I<any> - -=item (I<integer>) I<any> B<E<gt>=> I<any> - -=item (I<integer>) I<any> B<<> I<any> - -=item (I<integer>) I<any> B<E<gt>> I<any> - -=item (I<integer>) B<not> I<any> - -=back - -=head2 Definedness - -=over - -=item (I<integer>) B<defined> I<identifier> - -Returns 1 if I<identifier> has been defined. Returns 0 else. - -=item (I<integer>) B<undef> I<identifier> - -Tries to undefine/delete the I<identifier>. Returns 1 if success, otherwise 0 is returned. - -=back - -=head2 Bitwise - -=over - -=item (I<integer>) I<any> B<:<> I<any> - -=item (I<integer>) I<any> B<:E<gt>> I<any> - -=item (I<integer>) I<any> B<and> I<any> - -=item (I<integer>) I<any> B<or> I<any> - -=item (I<integer>) I<any> B<xor> I<any> - -=back - -=head2 Numeric - -=over - -=item (I<number>) B<neg> I<number> - -This function returns the negative value of I<any> - -=item (I<integer>) B<no> [I<integer>] - -This function returns 1 if the argument is 0, otherwise it will return 0! If no -argument is given, then 0 is returned! - -=item (I<integer>) B<yes> [I<integer>] - -This function always returns 1. The parameter is optional. - - # Prints out 1, because foo is not defined - if yes { say no defined foo; } - -=back - -=head2 System - -=over - -=item (I<void>) B<end> - -Exits the program with the exit status of 0 - -=item (I<void>) B<exit> I<integer> - -Exits the program with the specified exit status - -=item (I<integer>) B<fork> - -Fork forks a subprocess. It returns 0 for the child process and the pid of the -child process otherwise! Example: - - my pid = fork; - - if pid { - put "I am the parent process; child has the pid "; - say pid; - - } ifnot pid { - say "I am the child process"; - } - -=item (I<integer>) B<gc> - -Executes the garbage collector and returns the number of items freed! You may -wonder why most of the time it will return a value of 0! Fype tries to free not -needed memory asap. This may change in future versions in order to gain faster -execution of scripts! - -=back - -=head2 I/O - -=over - -=item (I<any>) B<put> I<any> - -Prints out the argument - -=item (I<any>) B<say> I<any> - -Same as put, but also includes an ending newline - -=item (I<void>) B<ln> - -Just prints a newline - -=back - -=head1 SELF DEFINING PROCEDURES AND FUNCTIONS - -=head2 Procedures - -A procedure can be defined with the B<proc> keyword and deleted with the B<undef> keyword. A procedure does not return any value and does not support parameter passing. It's using already defined variables (e.g. global variables). A procedure does not have its own namespace. It's using the calling namespace. It is possible to define new variabes inside of a procedure in the current namespace. - - proc foo { - say 1 + a * 3 + b; - my c = 6; - } - - my a = 2, b = 4; - - foo; # Run the procedure. Print out "11\n" - say c; # Print out "6\n"; - -=head2 Nested procedures - -It's possible to define procedures inside of procedures. Since procedures don't -have its own scope, nested procedures will be available to the current scope as -soon as the main procedure has run the first time. You may use the B<defined> -keyword in order to check if a procedure has been defined or not. - - proc foo { - say "I am foo"; - - undef bar; - proc bar { - say "I am bar"; - } - } - - # Here bar would produce an error because - # the proc is not yet defined! - # bar; - - foo; # Here the procedure foo will define the procedure bar! - bar; # Now the procedure bar is defined! - foo; # Here the procedure foo will redefine bar again! - -=head2 Functions - -A function should be defined with the B<func> keyword and deleted with the B<undef> keyword. Function not yet return values (will be changed in future versions) and supports not yet parameter passing (will be changed in future versions). It's using local (lexical scoped) variables. If a certain variable does not exist It's using already defined variables (e.g. one scope above). - - func foo { - say 1 + a * 3 + b; - my c = 6; - } - - my a = 2, b = 4; - - foo; # Run the procedure. Print out "11\n" - say c; # Will produce an error, because c is out of scoped! - -=head2 Nested functions - -Nested functions work the same way the nested procedures work, with the exception that nested functions will not be available any more after the function has been left! - - func foo { - func bar { - say "Hello i am nested"; - } - - bar; # Calling nested - } - - foo; - bar; # Will produce an error, because bar is out of scope! - -=head1 AUTHOR - -Paul C. Buetow (http://paul.buetow.org) - -=head1 WEBSITE - -The Fype Language (http://fype.buetow.org) - -=head1 SEE ALSO - -awk(1) cc(1) make(1) - diff --git a/docs/pod/fype.tex b/docs/pod/fype.tex deleted file mode 100644 index 7609a00..0000000 --- a/docs/pod/fype.tex +++ /dev/null @@ -1,569 +0,0 @@ -\section{NAME\label{NAME}\index{NAME}} - - -\textbf{Fype} is \textbf{F}or \textbf{Y}our \textbf{P}rogram \textbf{E}xecution - - - -\textbf{Fype} is \textbf{F}ree \textbf{Y}ak \textbf{P}rogramed for \textbf{E}LF - - - -It's not a hype - it's \textbf{Fype}! - -\section{SYNOPSES\label{SYNOPSES}\index{SYNOPSES}} -\begin{description} - -\item[{\textbf{fype} [-[hsvTV]] file.fy}] \mbox{} -\item[{\textbf{fype} -e "fype code string;"}] \mbox{}\end{description} -\section{ABOUT\label{ABOUT}\index{ABOUT}} - - -Fype is not yet released! Lots of basic stuff is still missing! See the -TODO file of the source distribution of Fype! - - - -Fype is a 32 bit scripting language created for fun. You can use it and comment on it if you like. You could also write patches and mail them to fype at dev dot buetow dot org! Or go visit the IRC channel \#coding at irc.german-elite.net and ask rantanplan. - - - -Fype is developed under the BSD license. See the COPYING file which is included in the source tree. - - - -Fype should be "at least as good as AWK". This does not mean it will be a replacement for AWK but it should support functions, loops and arrays like AWK does but with a different syntax. It should also get extension support like AWK has. I am not talking about GNU AWK but about New AWK, which is included in the *BSD distributions! Fype already has a few features which are not available in AWK. However, AWK has still many features which are not available in Fype as well ;) - - - -Fancy stuff like OOP or unicode or threading is not yet planed. But fancy stuff like function pointers and closures may be considered for one of the first releases of Fype :) - -\section{PARSING / CODE GENERATION\label{PARSING_CODE_GENERATION}\index{PARSING / CODE GENERATION}} - - -The Fype syntax is very simple and is using a maximum look ahead of 1 and a very easy top down parsing. Fype is parsing and interpreting its code simultaneous. This means, that syntax errors are only detected during program runtime. - -\section{REQUIREMENTS\label{REQUIREMENTS}\index{REQUIREMENTS}} - - -Fype only has been tested on FreeBSD 7.0. Linux may work too. Windows support is not planned. But may work using Cygwin or SFU. Linux users have to install pmake before compiling Fype! - - - -You will need: - -\begin{verbatim} - GNU GCC C Compiler (gcc.gnu.org) - NetBSD Make aka pmake (GNU Make will not work) -\end{verbatim} - - -NetBSD Make is included in any *BSD and can be run with just \textbf{make}. - -\section{GETTING STARTED\label{GETTING_STARTED}\index{GETTING STARTED}} - - -On Linux: Extract, compile and install Fype: - -\begin{verbatim} - tar xvjf fype.tar.bz2 - cd fype - pmake - sudo pmake install - pmake clean -\end{verbatim} - - -On FreeBSD: Extract, compile and install Fype: - -\begin{verbatim} - tar xvjf fype.tar.bz2 - cd fype - make - sudo make install - make clean -\end{verbatim} - - -Run a .fy file: - -\begin{verbatim} - fype test.fy -\end{verbatim} - - -See the ./examples subdir of the Fype source distribution for examples! See also fype -h for a list of all options. - -\section{DATA TYPES\label{DATA_TYPES}\index{DATA TYPES}} - - -Fype uses auto type conversion. However, if you want to know what's going on you may take a look at the provided basic datatypes. - -\subsection*{The basic data types\label{The_basic_data_types}\index{The basic data types}} -\begin{description} - -\item[{\textit{integer}}] \mbox{} - -Specifies an integer number - - -\item[{\textit{double}}] \mbox{} - -Specifies a double number - - -\item[{\textit{string}}] \mbox{} - -Specifies a string - - -\item[{\textit{number}}] \mbox{} - -May be an integer or a double number - - -\item[{\textit{any}}] \mbox{} - -May be of any type above - - -\item[{\textit{void}}] \mbox{} - -No type - - -\item[{\textit{identifier}}] \mbox{} - -It's a variable name or a procedure name or a function name - -\end{description} -\subsection*{Explicit type conversions\label{Explicit_type_conversions}\index{Explicit type conversions}} -\begin{description} - -\item[{(\textit{integer}) \textbf{integer} \textit{any}}] \mbox{} - -Converts any type to an integer - - -\item[{(\textit{double}) \textbf{double} \textit{any}}] \mbox{} - -Converts any type to a double - - -\item[{(\textit{string}) \textbf{string} \textit{any}}] \mbox{} - -Converts any type to a string - -\end{description} -\section{SYNTAX\label{SYNTAX}\index{SYNTAX}} -\subsection*{Comments\label{Comments}\index{Comments}} - - -Text from a \textbf{\#} character until the end of the current line is considered being a comment. Multi line comments may start with an \textbf{\#*} and and with an \textbf{*\#} anywhere. Exceptions are if those signs are inside of strings. - -\subsection*{Statements\label{Statements}\index{Statements}} - - -A Fype program is a list of statements. Each keyword, expression or function call is part of a statement. Each statement is ended with a semicolon. Example: - -\begin{verbatim} - my bar = 3, foo = 1 + 2; - say foo; - exit foo - bar; -\end{verbatim} -\subsection*{Paranthesis\label{Paranthesis}\index{Paranthesis}} - - -All paranthesis of function calls are optional. They help to make the code better readable. They also help to force precedences of expressions. - -\subsection*{Scopeing\label{Scopeing}\index{Scopeing}} - - -A new scope starts with an \{ and ends with an \}. An exception is a procedure, which does not use its own scope (see later in this manual). Control statements and functions support scopeings. The \textbf{scope} function will print out all available symbols at the current position. Here is a small example of how to use scopes: - -\begin{verbatim} - my foo = 1; -\end{verbatim} -\begin{verbatim} - { - # Prints out 1 - put defined foo; - { - my bar = 2; -\end{verbatim} -\begin{verbatim} - # Prints out 1 - put defined bar; -\end{verbatim} -\begin{verbatim} - # Prints out all available symbols at this - # point to stdout. Those are: bar and foo - scope; - } -\end{verbatim} -\begin{verbatim} - # Prints out 0 - put defined bar; -\end{verbatim} -\begin{verbatim} - my baz = 3; - } -\end{verbatim} -\begin{verbatim} - # Prints out 0 - say defined bar; -\end{verbatim} -\subsection*{Control statements\label{Control_statements}\index{Control statements}} - - -Fype knows the following control statements: - -\begin{description} - -\item[{if \textit{$<$expression}$>$ \{ \textit{$<$statements}$>$ \}}] \mbox{} - -Runs the statements if the expression evaluates to a true value. - - -\item[{ifnot \textit{$<$expression}$>$ \{ \textit{$<$statements}$>$ \}}] \mbox{} - -Runs the statements if the expression evaluates to a false value. - - -\item[{while \textit{$<$expression}$>$ \{ \textit{$<$statements}$>$ \}}] \mbox{} - -Runs the statements as long as the the expression evaluates to a true value. - - -\item[{until \textit{$<$expression}$>$ \{ \textit{$<$statements}$>$ \}}] \mbox{} - -Runs the statements as long as the the expression evaluates to a false value. - -\end{description} -\section{VARIABLES\label{VARIABLES}\index{VARIABLES}} - - -Variables can be defined with the \textbf{my} keyword. If you don't assign a value during declaration, then it's using the default integer value 0. Variables may be changed during program runtime. Variables may be deleted using the \textbf{undef} keyword! Example of defining variables: - -\begin{verbatim} - my foo = 1 + 2; - say foo; -\end{verbatim} -\begin{verbatim} - my bar = 12, baz = foo; - say 1 + bar; - say bar; -\end{verbatim} -\begin{verbatim} - my baz; - say baz; # Will print out 0 -\end{verbatim} - - -You may use the \textbf{defined} keyword to check if an identifier has been defined or -not. - -\begin{verbatim} - ifnot defined foo { - say "No foo yet defined"; - } -\end{verbatim} -\begin{verbatim} - my foo = 1; -\end{verbatim} -\begin{verbatim} - if defined foo { - put "foo is defined and has the value "; - say foo; - } -\end{verbatim} -\section{SYNONYMS\label{SYNONYMS}\index{SYNONYMS}} - - -Each variable can have as many synonyms as wished. A synonym is another name to access the content of a specific variable. Here is an example of how to use synomyms: - -\begin{verbatim} - my foo = "foo"; - my bar = \foo; - foo = "bar"; -\end{verbatim} -\begin{verbatim} - # The synonym variable should now also set to "bar" - assert "bar" == bar; -\end{verbatim} - - -Synonyms can be used for all kind of identifiers. It's not limited to normal variables but can be also used for function and procedure names etc. - -\begin{verbatim} - # Create a new procedure baz - proc baz { say "I am baz"; } -\end{verbatim} -\begin{verbatim} - # Make a synonym baz, and undefine baz - my bay = \baz; -\end{verbatim} -\begin{verbatim} - undef baz; -\end{verbatim} -\begin{verbatim} - # bay still has a reference of the original procedure baz - bay; # this prints aut "I am baz" -\end{verbatim} - - -The \textbf{syms} keyword gives you the total number of synonyms pointing to a specific value: - -\begin{verbatim} - my foo = 1; - say syms foo; # Prints 1 -\end{verbatim} -\begin{verbatim} - my baz = \foo; - say syms foo; # Prints 2 - say syms baz; # Prints 2 -\end{verbatim} -\begin{verbatim} - undef baz; - say syms foo; # Prints 1 -\end{verbatim} -\section{BUILT IN FUNCTIONS\label{BUILT_IN_FUNCTIONS}\index{BUILT IN FUNCTIONS}} - - -In Fype, operators are built in functions as well. The difference is, that they may be written in infix notation instead in front of the arguments. The types inside the () specify the return types. - -\subsection*{Math\label{Math}\index{Math}} -\begin{description} - -\item[{(\textit{any}) \textit{any} \textbf{+} \textit{any}}] \mbox{} - -Special string behavior: A string will get auto convertet into an \textit{integer}. - - -\item[{(\textit{any}) \textit{any} \textbf{-} \textit{any}}] \mbox{} - -Special string behavior: A string will get auto convertet into an \textit{integer}. - - -\item[{(\textit{any}) \textit{any} \textbf{*} \textit{any}}] \mbox{} - -Special string behavior: A string will get auto convertet into an \textit{integer}. - - -\item[{(\textit{any}) \textit{any} \textbf{/} \textit{any}}] \mbox{} - -Special string behavior: A string will get auto convertet into an \textit{integer}. - -\end{description} -\subsection*{Conditional\label{Conditional}\index{Conditional}} -\begin{description} - -\item[{(\textit{integer}) \textit{any} \textbf{==}}] \textbf{\textit{any}} -\item[{(\textit{integer}) \textit{any} \textbf{!=}}] \textbf{\textit{any}} -\item[{(\textit{integer}) \textit{any} \textbf{$<$=}}] \textbf{\textit{any}} -\item[{(\textit{integer}) \textit{any} \textbf{$>$=}}] \textbf{\textit{any}} -\item[{(\textit{integer}) \textit{any} \textbf{$<$}}] \textbf{\textit{any}} -\item[{(\textit{integer}) \textit{any} \textbf{$>$}}] \textbf{\textit{any}} -\item[{(\textit{integer}) \textbf{not} \textit{any}}] \mbox{}\end{description} -\subsection*{Definedness\label{Definedness}\index{Definedness}} -\begin{description} - -\item[{(\textit{integer}) \textbf{defined} \textit{identifier}}] \mbox{} - -Returns 1 if \textit{identifier} has been defined. Returns 0 else. - - -\item[{(\textit{integer}) \textbf{undef} \textit{identifier}}] \mbox{} - -Tries to undefine/delete the \textit{identifier}. Returns 1 if success, otherwise 0 is returned. - -\end{description} -\subsection*{Bitwise\label{Bitwise}\index{Bitwise}} -\begin{description} - -\item[{(\textit{integer}) \textit{any} \textbf{:$<$}}] \textbf{\textit{any}} -\item[{(\textit{integer}) \textit{any} \textbf{:$>$}}] \textbf{\textit{any}} -\item[{(\textit{integer}) \textit{any} \textbf{and}}] \textbf{\textit{any}} -\item[{(\textit{integer}) \textit{any} \textbf{or}}] \textbf{\textit{any}} -\item[{(\textit{integer}) \textit{any} \textbf{xor}}] \textbf{\textit{any}}\end{description} -\subsection*{Numeric\label{Numeric}\index{Numeric}} -\begin{description} - -\item[{(\textit{number}) \textbf{neg} \textit{number}}] \mbox{} - -This function returns the negative value of \textit{any} - - -\item[{(\textit{integer}) \textbf{no} [\textit{integer}]}] \mbox{} - -This function returns 1 if the argument is 0, otherwise it will return 0! If no -argument is given, then 0 is returned! - - -\item[{(\textit{integer}) \textbf{yes} [\textit{integer}]}] \mbox{} - -This function always returns 1. The parameter is optional. - -\begin{verbatim} - # Prints out 1, because foo is not defined - if yes { say no defined foo; } -\end{verbatim} -\end{description} -\subsection*{System\label{System}\index{System}} -\begin{description} - -\item[{(\textit{void}) \textbf{end}}] \mbox{} - -Exits the program with the exit status of 0 - - -\item[{(\textit{void}) \textbf{exit} \textit{integer}}] \mbox{} - -Exits the program with the specified exit status - - -\item[{(\textit{integer}) \textbf{fork}}] \mbox{} - -Fork forks a subprocess. It returns 0 for the child process and the pid of the -child process otherwise! Example: - -\begin{verbatim} - my pid = fork; -\end{verbatim} -\begin{verbatim} - if pid { - put "I am the parent process; child has the pid "; - say pid; -\end{verbatim} -\begin{verbatim} - } ifnot pid { - say "I am the child process"; - } -\end{verbatim} - -\item[{(\textit{integer}) \textbf{gc}}] \mbox{} - -Executes the garbage collector and returns the number of items freed! You may -wonder why most of the time it will return a value of 0! Fype tries to free not -needed memory asap. This may change in future versions in order to gain faster -execution of scripts! - -\end{description} -\subsection*{I/O\label{I_O}\index{I/O}} -\begin{description} - -\item[{(\textit{any}) \textbf{put} \textit{any}}] \mbox{} - -Prints out the argument - - -\item[{(\textit{any}) \textbf{say} \textit{any}}] \mbox{} - -Same as put, but also includes an ending newline - - -\item[{(\textit{void}) \textbf{ln}}] \mbox{} - -Just prints a newline - -\end{description} -\section{SELF DEFINING PROCEDURES AND FUNCTIONS\label{SELF_DEFINING_PROCEDURES_AND_FUNCTIONS}\index{SELF DEFINING PROCEDURES AND FUNCTIONS}} -\subsection*{Procedures\label{Procedures}\index{Procedures}} - - -A procedure can be defined with the \textbf{proc} keyword and deleted with the \textbf{undef} keyword. A procedure does not return any value and does not support parameter passing. It's using already defined variables (e.g. global variables). A procedure does not have its own namespace. It's using the calling namespace. It is possible to define new variabes inside of a procedure in the current namespace. - -\begin{verbatim} - proc foo { - say 1 + a * 3 + b; - my c = 6; - } -\end{verbatim} -\begin{verbatim} - my a = 2, b = 4; -\end{verbatim} -\begin{verbatim} - foo; # Run the procedure. Print out "11\n" - say c; # Print out "6\n"; -\end{verbatim} -\subsection*{Nested procedures\label{Nested_procedures}\index{Nested procedures}} - - -It's possible to define procedures inside of procedures. Since procedures don't -have its own scope, nested procedures will be available to the current scope as -soon as the main procedure has run the first time. You may use the \textbf{defined} -keyword in order to check if a procedure has been defined or not. - -\begin{verbatim} - proc foo { - say "I am foo"; -\end{verbatim} -\begin{verbatim} - undef bar; - proc bar { - say "I am bar"; - } - } -\end{verbatim} -\begin{verbatim} - # Here bar would produce an error because - # the proc is not yet defined! - # bar; -\end{verbatim} -\begin{verbatim} - foo; # Here the procedure foo will define the procedure bar! - bar; # Now the procedure bar is defined! - foo; # Here the procedure foo will redefine bar again! -\end{verbatim} -\subsection*{Functions\label{Functions}\index{Functions}} - - -A function should be defined with the \textbf{func} keyword and deleted with the \textbf{undef} keyword. Function not yet return values (will be changed in future versions) and supports not yet parameter passing (will be changed in future versions). It's using local (lexical scoped) variables. If a certain variable does not exist It's using already defined variables (e.g. one scope above). - -\begin{verbatim} - func foo { - say 1 + a * 3 + b; - my c = 6; - } -\end{verbatim} -\begin{verbatim} - my a = 2, b = 4; -\end{verbatim} -\begin{verbatim} - foo; # Run the procedure. Print out "11\n" - say c; # Will produce an error, because c is out of scoped! -\end{verbatim} -\subsection*{Nested functions\label{Nested_functions}\index{Nested functions}} - - -Nested functions work the same way the nested procedures work, with the exception that nested functions will not be available any more after the function has been left! - -\begin{verbatim} - func foo { - func bar { - say "Hello i am nested"; - } -\end{verbatim} -\begin{verbatim} - bar; # Calling nested - } -\end{verbatim} -\begin{verbatim} - foo; - bar; # Will produce an error, because bar is out of scope! -\end{verbatim} -\section{AUTHOR\label{AUTHOR}\index{AUTHOR}} - - -Paul C. Buetow (http://paul.buetow.org) - -\section{WEBSITE\label{WEBSITE}\index{WEBSITE}} - - -The Fype Language (http://fype.buetow.org) - -\section{SEE ALSO\label{SEE_ALSO}\index{SEE ALSO}} - - -awk(1) cc(1) make(1) - diff --git a/docs/stats.txt b/docs/stats.txt index 50cbda1..fd266c1 100644 --- a/docs/stats.txt +++ b/docs/stats.txt @@ -1,4 +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 +===> Num of Fype source examples : 0 +===> Num of Fype source lines : 0 diff --git a/docs/version.txt b/docs/version.txt index d2c768b..107b1be 100644 --- a/docs/version.txt +++ b/docs/version.txt @@ -1 +1 @@ -Fype2 Alpha Build 10387 +LambdaFype Alpha Build 10393 diff --git a/examples/all-examples.txt b/examples/all-examples.txt deleted file mode 100644 index f71e8a2..0000000 --- a/examples/all-examples.txt +++ /dev/null @@ -1,377 +0,0 @@ - -#* - * Examples of how to use bitwise operators - *# - -# Prints "01\n" -assert 0 == (put 1 and 0); -assert 1 == (say 1 and 1); - -# Prints "01\n" -assert 0 == (put 0 or 0); -assert 1 == (say 0 or 1); - -# Prints "01\n" -assert 0 == (put 1 xor 1); -assert 1 == (say 1 xor 0); - -# Prints "82\n" -assert 8 == (put 2 :< 2); -assert 2 == (say 8 :> 2); - -# A bit more complex, prints "9\n" -assert 9 == (say 1 :< 5 :> 5 or 2 and 5 xor 8); - -# Same result, but with parenthesis: -assert 9 == (say ((((1 :< 5) :> 5) or 2) and 5) xor 8); - -# Different parenthesis, different result: "1\n" -assert 1 == (say 1 :< 5 :> 5 or 2 and (5 xor 8)); - -# Prints "-1" -assert (neg 1) == (say neg not 0); - - -#* - * Simple examples how to write comments - *# - -# This is a single lined comment - -say 1 + 1; # This is a comment at the end of the line - -say 1 #* This is an embedded comment *# + 1; - -#* This is - a - multiline - comment *# - -#* - * This is - * a nicer looking - * multiline comment - *# - - -#* - * Simple conditional tests - *# - -# "0010\n" -assert 0 == (put 1 < 1); -assert 0 == (put 1 < 0); -assert 1 == (put 0 < 1); -assert 0 == (say 0 < 0); - -# "0100\n" -assert 0 == (put 1 > 1); -assert 1 == (put 1 > 0); -assert 0 == (put 0 > 1); -assert 0 == (say 0 > 0); - -# "1001\n" -assert 1 == (put 1 == 1); -assert 0 == (put 1 == 0); -assert 0 == (put 0 == 1); -assert 1 == (say 0 == 0); - -# "0110\n" -assert 0 == (put 1 != 1); -assert 1 == (put 1 != 0); -assert 1 == (put 0 != 1); -assert 0 == (say 0 != 0); - -# "1011\n" -assert 1 == (put 1 <= 1); -assert 0 == (put 1 <= 0); -assert 1 == (put 0 <= 1); -assert 1 == (say 0 <= 0); - -## "1101\n" -assert 1 == (put 1 >= 1); -assert 1 == (put 1 >= 0); -assert 0 == (put 0 >= 1); -assert 1 == (say 0 >= 0); - - - -#* - * Examples of how to use control statements - *# - -if 1 { - say "if 1"; -} - -ifnot 0 == 1 { - say "ifnot 0 == 1"; -} - -# Calculate 10! - -my n = 10, fac = 0; - -while n > 1 { - ifnot fac { - fac = 1; - } - say fac = (fac * n); - decr n; -} - -# Count up to 10 - -n = 0; - -until n == 10 { - say incr n; -} - - -#* - * Simple expression tests - *# - -# Result 10 -assert 10 == say (8 / 2) + 2 * 3; - -# Result 12 -assert 12 == say 2 * (4 + 2); - -# Result 4 -assert 4 == say 2 * (4 / 2); - -# Result 4 -assert 4 == say 2 * (4 / 2); - -# Result 4 -assert 4 == say 2 * (4 / 2); - -# Result 46 -assert 46 == say "12" + "34"; - -# Result 1231 -assert 1231 == say "1234" - "3"; - -# Result 24 -assert "24" == say "2ab" * "12"; - -# Result 5.0 -assert 5 == say "10 bla" / 2; - - -#* - * Examples of how to use fork - *# - -my pid = fork; - -if pid { - put "I am the parent process and the child has the pid "; - say pid; -} - -ifnot pid { - say "I am the child process"; -} - -#* - * Examples of how to use functions - *# - -func foo { - say 1 + a * 3 + b; - - func bar { - say "Hello i am nested"; - } - - bar; # Calling nested -} - -my a = 2, b = 4; # Create global variables -foo; -assert 0 == (defined bar); # bar is not available anymore - -func baz { - say "I am baz"; - undef baz; -} - -baz; # Baz deletes itself -assert 0 == (defined baz); # baz is not available anymore - -#* - * Simple builtin function tests - *# - -# Print "-20\n" -assert (neg 20) == (say neg 20); - -# Print "30\n" -assert 30 == (say 10 - neg 20); - -# Print "-30\n" -assert (neg 30) == (say neg neg neg 10 - neg 20); - -# Print "Hello\n" -put "Hello"; -ln; - -# Exit with exit code 0 -exit 10 + 10 - 5 - 15; - - -#* - * Simple I/O examples. Currently only output is supported. - *# - -# Print out 10 followed by a newline -say 10; - -# Print out 20 without a newline followed -put 20; - -# Print out a newline -ln; - - -#* - * Examples of how to use procedures - *# - -proc foo { - say 1 + a * 3 + b; - my c = 6; -} - -my a = 2, b = 4; - -foo; # Run the procedure. Print out "11\n" -say c; # Print out "6\n"; - -proc bar { - say "I am bar"; - - undef baz; - - proc baz { - say "I am baz"; - } -} - -# Here bar would produce an error because the proc is not yet defined! -# bar; - -bar; # Here the procedure bar will define the procedure baz! -baz; # Now the procedure baz is defined! -bar; # Here the procedure bar will redefine baz again! - -#* - * Examples of how to use scopeing - *# - -my foo = 1; - -{ - # Prints out 1 - assert 1 == (put defined foo); - - { - my bar = 2; - - # Prints out 1 - assert 1 == (put defined bar); - - # Prints out all available symbols at - # the current program position. - scope; - } - - # Prints out 0 - assert 0 == (put defined bar); - - my baz = 3; -} - -# Prints out 0 -assert 0 == (say defined bar); - - - -#* - * Examples of how to use synonyms - *# - -# Create a variable foo, and bar is a synonym for foo -my foo = "foo"; -my bar = \foo; - -# Reset the value of foo -foo = "bar"; - -# The synonym variable should now also set to "bar" -assert "bar" == say bar; - -# Create a new procedure baz -proc baz { - say "I am baz"; -} - -# Make a synonym baz, and undefine baz -my bay = \baz; - -# Should be the num of syms for the same value -assert 2 == syms baz; -assert 2 == syms bay; -undef baz; -assert 1 == syms bay; - -# bay still has a reference of the original procedure baz -bay; # this prints aut "I am baz" - -assert 0 == defined baz; -assert 1 == defined bay; - -# This removes the procedure from memory -undef bay; - - -#* - * Examples how to convert types - *# - -assert 1 == say 1; # Integer output - -assert 1 == say double 1; # Double output - -assert 14 == say 1 + string 13; # Implicit type conversion to Integer - -assert 2 == say integer 2.8; # Rounds down to the Integer 2 - -assert say integer double string put say neg 12; # Nonsense but working :) - - -#* - * Examples of how to define variables - *# - -# Defines the variables -my foo = 1 + 1; -my bar = 4 - 1, baz = 100 + 1, bay; - -# bay has been initialized with the default value of 0 -say bay; - -# Prints out "5\n" -assert 5 == (say foo + bar); - -# Pritns out "51101\n" -assert 51 == (put baz - 50); -assert 101 == (say baz); - -# Change the value of the variable to 99 and print it out -assert 99 == (baz = 99); -say baz; - diff --git a/examples/assert.fy b/examples/assert.fy deleted file mode 100644 index d9871f5..0000000 --- a/examples/assert.fy +++ /dev/null @@ -1,14 +0,0 @@ -#* - * Examples of how to use asserts - *# - -# The built in function assert checks if a condition evaluates to true -# and aborts the interpreter if it evaluates to false. - -# Evaluates to true -assert 0 == 0 -assert 6 == 2 * 3 - -# Evaluates to false -# assert 1 == 0 - diff --git a/examples/bitwise.fy b/examples/bitwise.fy deleted file mode 100644 index 03fda6c..0000000 --- a/examples/bitwise.fy +++ /dev/null @@ -1,32 +0,0 @@ -#* - * Examples of how to use bitwise operators - *# - -# Prints "01\n" -assert 0 == (put 1 and 0); -assert 1 == (say 1 and 1); - -# Prints "01\n" -assert 0 == (put 0 or 0); -assert 1 == (say 0 or 1); - -# Prints "01\n" -assert 0 == (put 1 xor 1); -assert 1 == (say 1 xor 0); - -# Prints "82\n" -assert 8 == (put 2 :< 2); -assert 2 == (say 8 :> 2); - -# A bit more complex, prints "9\n" -assert 9 == (say 1 :< 5 :> 5 or 2 and 5 xor 8); - -# Same result, but with parenthesis: -assert 9 == (say ((((1 :< 5) :> 5) or 2) and 5) xor 8); - -# Different parenthesis, different result: "1\n" -assert 1 == (say 1 :< 5 :> 5 or 2 and (5 xor 8)); - -# Prints "-1" -assert (neg 1) == (say neg not 0); - diff --git a/examples/comments.fy b/examples/comments.fy deleted file mode 100644 index 216e41b..0000000 --- a/examples/comments.fy +++ /dev/null @@ -1,21 +0,0 @@ -#* - * Simple examples how to write comments - *# - -# This is a single lined comment - -say 1 + 1; # This is a comment at the end of the line - -say 1 #* This is an embedded comment *# + 1; - -#* This is - a - multiline - comment *# - -#* - * This is - * a nicer looking - * multiline comment - *# - diff --git a/examples/conditionals.fy b/examples/conditionals.fy deleted file mode 100644 index 1260ae2..0000000 --- a/examples/conditionals.fy +++ /dev/null @@ -1,41 +0,0 @@ -#* - * Simple conditional tests - *# - -# "0010\n" -assert 0 == (put 1 < 1); -assert 0 == (put 1 < 0); -assert 1 == (put 0 < 1); -assert 0 == (say 0 < 0); - -# "0100\n" -assert 0 == (put 1 > 1); -assert 1 == (put 1 > 0); -assert 0 == (put 0 > 1); -assert 0 == (say 0 > 0); - -# "1001\n" -assert 1 == (put 1 == 1); -assert 0 == (put 1 == 0); -assert 0 == (put 0 == 1); -assert 1 == (say 0 == 0); - -# "0110\n" -assert 0 == (put 1 != 1); -assert 1 == (put 1 != 0); -assert 1 == (put 0 != 1); -assert 0 == (say 0 != 0); - -# "1011\n" -assert 1 == (put 1 <= 1); -assert 0 == (put 1 <= 0); -assert 1 == (put 0 <= 1); -assert 1 == (say 0 <= 0); - -## "1101\n" -assert 1 == (put 1 >= 1); -assert 1 == (put 1 >= 0); -assert 0 == (put 0 >= 1); -assert 1 == (say 0 >= 0); - - diff --git a/examples/control.fy b/examples/control.fy deleted file mode 100644 index 0deac78..0000000 --- a/examples/control.fy +++ /dev/null @@ -1,32 +0,0 @@ -#* - * Examples of how to use control statements - *# - -if 1 { - say "if 1"; -} - -ifnot 0 == 1 { - say "ifnot 0 == 1"; -} - -# Calculate 10! - -my n = 10, fac = 0; - -while n > 1 { - ifnot fac { - fac = 1; - } - say fac = (fac * n); - decr n; -} - -# Count up to 10 - -n = 0; - -until n == 10 { - say incr n; -} - diff --git a/examples/expressions.fy b/examples/expressions.fy deleted file mode 100644 index 93a278f..0000000 --- a/examples/expressions.fy +++ /dev/null @@ -1,31 +0,0 @@ -#* - * Simple expression tests - *# - -# Result 10 -assert 10 == say (8 / 2) + 2 * 3; - -# Result 12 -assert 12 == say 2 * (4 + 2); - -# Result 4 -assert 4 == say 2 * (4 / 2); - -# Result 4 -assert 4 == say 2 * (4 / 2); - -# Result 4 -assert 4 == say 2 * (4 / 2); - -# Result 46 -assert 46 == say "12" + "34"; - -# Result 1231 -assert 1231 == say "1234" - "3"; - -# Result 24 -assert "24" == say "2ab" * "12"; - -# Result 5.0 -assert 5 == say "10 bla" / 2; - diff --git a/examples/fork.fy b/examples/fork.fy deleted file mode 100644 index c49c878..0000000 --- a/examples/fork.fy +++ /dev/null @@ -1,14 +0,0 @@ -#* - * Examples of how to use fork - *# - -my pid = fork; - -if pid { - put "I am the parent process and the child has the pid "; - say pid; -} - -ifnot pid { - say "I am the child process"; -} diff --git a/examples/functions.fy b/examples/functions.fy deleted file mode 100644 index 15856a0..0000000 --- a/examples/functions.fy +++ /dev/null @@ -1,25 +0,0 @@ -#* - * Examples of how to use functions - *# - -func foo { - say 1 + a * 3 + b; - - func bar { - say "Hello i am nested"; - } - - bar; # Calling nested -} - -my a = 2, b = 4; # Create global variables -foo; -assert 0 == (defined bar); # bar is not available anymore - -func baz { - say "I am baz"; - undef baz; -} - -baz; # Baz deletes itself -assert 0 == (defined baz); # baz is not available anymore diff --git a/examples/inlinefunctions.fy b/examples/inlinefunctions.fy deleted file mode 100644 index 81848ce..0000000 --- a/examples/inlinefunctions.fy +++ /dev/null @@ -1,20 +0,0 @@ -#* - * Simple builtin function tests - *# - -# Print "-20\n" -assert (neg 20) == (say neg 20); - -# Print "30\n" -assert 30 == (say 10 - neg 20); - -# Print "-30\n" -assert (neg 30) == (say neg neg neg 10 - neg 20); - -# Print "Hello\n" -put "Hello"; -ln; - -# Exit with exit code 0 -exit 10 + 10 - 5 - 15; - diff --git a/examples/io.fy b/examples/io.fy deleted file mode 100644 index fda514d..0000000 --- a/examples/io.fy +++ /dev/null @@ -1,13 +0,0 @@ -#* - * Simple I/O examples. Currently only output is supported. - *# - -# Print out 10 followed by a newline -say 10; - -# Print out 20 without a newline followed -put 20; - -# Print out a newline -ln; - diff --git a/examples/netsted.fype b/examples/netsted.fype deleted file mode 100644 index 2ddf89f..0000000 --- a/examples/netsted.fype +++ /dev/null @@ -1,11 +0,0 @@ -(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/procedures.fy b/examples/procedures.fy deleted file mode 100644 index cbe2121..0000000 --- a/examples/procedures.fy +++ /dev/null @@ -1,30 +0,0 @@ -#* - * Examples of how to use procedures - *# - -proc foo { - say 1 + a * 3 + b; - my c = 6; -} - -my a = 2, b = 4; - -foo; # Run the procedure. Print out "11\n" -say c; # Print out "6\n"; - -proc bar { - say "I am bar"; - - undef baz; - - proc baz { - say "I am baz"; - } -} - -# Here bar would produce an error because the proc is not yet defined! -# bar; - -bar; # Here the procedure bar will define the procedure baz! -baz; # Now the procedure baz is defined! -bar; # Here the procedure bar will redefine baz again! diff --git a/examples/reverse.fype b/examples/reverse.fype deleted file mode 100644 index a4384b6..0000000 --- a/examples/reverse.fype +++ /dev/null @@ -1,7 +0,0 @@ -(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/examples/scopeing.fy b/examples/scopeing.fy deleted file mode 100644 index 434f38f..0000000 --- a/examples/scopeing.fy +++ /dev/null @@ -1,31 +0,0 @@ -#* - * Examples of how to use scopeing - *# - -my foo = 1; - -{ - # Prints out 1 - assert 1 == (put defined foo); - - { - my bar = 2; - - # Prints out 1 - assert 1 == (put defined bar); - - # Prints out all available symbols at - # the current program position. - scope; - } - - # Prints out 0 - assert 0 == (put defined bar); - - my baz = 3; -} - -# Prints out 0 -assert 0 == (say defined bar); - - diff --git a/examples/synonyms.fy b/examples/synonyms.fy deleted file mode 100644 index 0dd30f5..0000000 --- a/examples/synonyms.fy +++ /dev/null @@ -1,37 +0,0 @@ -#* - * Examples of how to use synonyms - *# - -# Create a variable foo, and bar is a synonym for foo -my foo = "foo"; -my bar = \foo; - -# Reset the value of foo -foo = "bar"; - -# The synonym variable should now also set to "bar" -assert "bar" == say bar; - -# Create a new procedure baz -proc baz { - say "I am baz"; -} - -# Make a synonym baz, and undefine baz -my bay = \baz; - -# Should be the num of syms for the same value -assert 2 == syms baz; -assert 2 == syms bay; -undef baz; -assert 1 == syms bay; - -# bay still has a reference of the original procedure baz -bay; # this prints aut "I am baz" - -assert 0 == defined baz; -assert 1 == defined bay; - -# This removes the procedure from memory -undef bay; - diff --git a/examples/types.fy b/examples/types.fy deleted file mode 100644 index 1b9a0ac..0000000 --- a/examples/types.fy +++ /dev/null @@ -1,14 +0,0 @@ -#* - * Examples how to convert types - *# - -assert 1 == say 1; # Integer output - -assert 1 == say double 1; # Double output - -assert 14 == say 1 + string 13; # Implicit type conversion to Integer - -assert 2 == say integer 2.8; # Rounds down to the Integer 2 - -assert say integer double string put say neg 12; # Nonsense but working :) - diff --git a/examples/variables.fy b/examples/variables.fy deleted file mode 100644 index ac619c9..0000000 --- a/examples/variables.fy +++ /dev/null @@ -1,21 +0,0 @@ -#* - * Examples of how to define variables - *# - -# Defines the variables -my foo = 1 + 1; -my bar = 4 - 1, baz = 100 + 1, bay; - -# bay has been initialized with the default value of 0 -say bay; - -# Prints out "5\n" -assert 5 == (say foo + bar); - -# Pritns out "51101\n" -assert 51 == (put baz - 50); -assert 101 == (say baz); - -# Change the value of the variable to 99 and print it out -assert 99 == (baz = 99); -say baz; Binary files differ@@ -1,13 +1,13 @@ /*:* *: 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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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. *:*/ @@ -46,7 +46,7 @@ char *BINARY; void -argv_run(PBSc *p_fype, int i_argc, char **pc_argv) { +argv_run(Fype *p_fype, int i_argc, char **pc_argv) { Dat *p_dat_string = dat_new(); BINARY = pc_argv[0]; @@ -1,13 +1,13 @@ /*:* *: 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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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. *:*/ @@ -38,7 +38,7 @@ #include "data/tupel.h" #include "fype.h" -void argv_run(PBSc *p_fype, int i_argc, char **pc_argv); +void argv_run(Fype *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(); diff --git a/src/build.h b/src/build.h index 1e6006e..26f3009 100644 --- a/src/build.h +++ b/src/build.h @@ -1,13 +1,13 @@ /*:* *: 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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,27 +15,27 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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 BUILDNR 10393 #define OS_LINUX #endif diff --git a/src/core/convert.c b/src/core/convert.c deleted file mode 100644 index cf8987e..0000000 --- a/src/core/convert.c +++ /dev/null @@ -1,216 +0,0 @@ -/*:* - *: File: ./src/core/convert.c - *: A simple interpreter - *: - *: WWW : http://fype.buetow.org - *: AUTHOR : http://paul.buetow.org - *: E-Mail : fype at dev.buetow.org - *: - *: Copyright (c) 2005 - 2009, Dipl.-Inform. (FH) Paul C. Buetow - *: All rights reserved. - *: - *: 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 "convert.h" -#include "../data/array.h" - -void -convert_to_integer(Token *p_token) { - switch (token_get_tt(p_token)) { - case TT_INTEGER: - break; - case TT_DOUBLE: - token_set_tt(p_token, TT_INTEGER); - token_set_ival(p_token, (int)token_get_dval(p_token)); - break; - case TT_STRING: - token_set_tt(p_token, TT_INTEGER); - token_set_ival(p_token, atoi(token_get_val(p_token))); - break; - case TT_ARRAY: - token_set_tt(p_token, TT_INTEGER); - token_set_ival(p_token, array_get_size(p_token->p_array)); - break; - default: - ERROR("Ouups(%s)", tt_get_name(token_get_tt(p_token))); - break; - } -} - -int -convert_to_integer_get(Token *p_token) { - switch (token_get_tt(p_token)) { - case TT_INTEGER: - return (token_get_ival(p_token)); - case TT_DOUBLE: - return ((int) token_get_dval(p_token)); - case TT_STRING: - return (atoi(token_get_val(p_token))); - case TT_ARRAY: - return (array_get_size(p_token->p_array)); - break; - default: - ERROR("Ouups(%s)", tt_get_name(token_get_tt(p_token))); - } - - return (0); /* Never reach this point */ -} - -void -convert_to_double(Token *p_token) { - switch (token_get_tt(p_token)) { - case TT_INTEGER: - token_set_tt(p_token, TT_DOUBLE); - token_set_dval(p_token, token_get_ival(p_token)); - break; - case TT_DOUBLE: - break; - case TT_STRING: - token_set_tt(p_token, TT_DOUBLE); - token_set_dval(p_token, atof(token_get_val(p_token))); - break; - case TT_ARRAY: - token_set_tt(p_token, TT_DOUBLE); - token_set_dval(p_token, array_get_size(p_token->p_array)); - break; - default: - token_print_val(p_token); - ERROR("Datatype conversion error '%s'", token_get_val(p_token)); - break; - } -} - -void -convert_to_string(Token *p_token) { - switch (token_get_tt(p_token)) { - case TT_INTEGER: - { - token_set_tt(p_token, TT_STRING); - char c_tmp[1024]; - sprintf(c_tmp, "%d", token_get_ival(p_token)); - int i_len = strlen(c_tmp); - p_token->c_val = realloc(p_token->c_val, sizeof(char) * (i_len + 1)); - strcpy(p_token->c_val, c_tmp); - p_token->c_val[i_len] = 0; - } - break; - case TT_DOUBLE: - { - token_set_tt(p_token, TT_STRING); - char c_tmp[1024]; - sprintf(c_tmp, "%f", token_get_dval(p_token)); - int i_len = strlen(c_tmp); - p_token->c_val = realloc(p_token->c_val, sizeof(char) * (i_len + 1)); - strcpy(p_token->c_val, c_tmp); - p_token->c_val[i_len] = 0; - } - case TT_ARRAY: - { - token_set_tt(p_token, TT_STRING); - char c_tmp[1024]; - sprintf(c_tmp, "%d", array_get_size(p_token->p_array)); - int i_len = strlen(c_tmp); - p_token->c_val = realloc(p_token->c_val, sizeof(char) * (i_len + 1)); - strcpy(p_token->c_val, c_tmp); - p_token->c_val[i_len] = 0; - } - break; - case TT_STRING: - break; - default: - ERROR("Datatype conversion error"); - break; - } -} - -void -convert_to_array(Token *p_token) { - ERROR("not yet implemented"); -} - -void -convert_to_tt(Token *p_token, TokenType tt) { - switch (tt) { - case TT_INTEGER: - convert_to_integer(p_token); - break; - case TT_DOUBLE: - convert_to_double(p_token); - break; - case TT_STRING: - convert_to_string(p_token); - break; - case TT_ARRAY: - convert_to_array(p_token); - break; - default: - ERROR("Ouups!"); - } -} - -TokenType -convert_to_highest(Token *p_token1, Token *p_token2) { - TokenType tt_highest = token_get_tt(p_token1); - - if (tt_highest < token_get_tt(p_token2)) { - tt_highest = token_get_tt(p_token2); - - convert_to_tt(p_token1, tt_highest); - - } else { - convert_to_tt(p_token2, tt_highest); - } - - return (tt_highest); -} - -TokenType -convert_function_arg_types_to_highest(Stack *p_stack_args, int i_args) { - - if (i_args <= 0) - i_args = stack_size(p_stack_args); - - StackIterator *p_iter = stackiterator_new(p_stack_args); - TokenType tt_highest = TT_INTEGER; - - for (int i = 0; i < i_args && stackiterator_has_next(p_iter); ++i) { - Token *p_token = stackiterator_next(p_iter); - if (token_get_tt(p_token) > tt_highest) - tt_highest = token_get_tt(p_token); - } - - stackiterator_delete(p_iter); - p_iter = stackiterator_new(p_stack_args); - - for (int i = 0; i < i_args && stackiterator_has_next(p_iter); ++i) { - Token *p_token = stackiterator_next(p_iter); - convert_to_tt(p_token, tt_highest); - } - - stackiterator_delete(p_iter); - - return (tt_highest); -} - diff --git a/src/core/convert.h b/src/core/convert.h deleted file mode 100644 index 9dcf23e..0000000 --- a/src/core/convert.h +++ /dev/null @@ -1,55 +0,0 @@ -/*:* - *: File: ./src/core/convert.h - *: A simple interpreter - *: - *: WWW : http://fype.buetow.org - *: AUTHOR : http://paul.buetow.org - *: E-Mail : fype at dev.buetow.org - *: - *: Copyright (c) 2005 - 2009, Dipl.-Inform. (FH) Paul C. Buetow - *: All rights reserved. - *: - *: 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 CONVERT_H -#define CONVERT_H - -#include "../defines.h" - -#include "../data/stack.h" - -#include "token.h" - -int convert_to_integer_get(Token *p_token); -void convert_to_integer(Token *p_token); -void convert_to_double(Token *p_token); -void convert_to_string(Token *p_token); -void convert_to_array(Token *p_token); -void convert_to_tt(Token *p_token, TokenType tt); -TokenType convert_to_highest(Token *p_token1, Token *p_token2); -TokenType convert_function_arg_types_to_highest(Stack *p_stack_args, int - i_args); - -#endif diff --git a/src/core/frame.c b/src/core/frame.c index 9143a0d..fb4665d 100644 --- a/src/core/frame.c +++ b/src/core/frame.c @@ -1,13 +1,13 @@ /*:* *: 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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/core/frame.h b/src/core/frame.h index d1e01f5..d9d3970 100644 --- a/src/core/frame.h +++ b/src/core/frame.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/core/frame.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/core/function.c b/src/core/function.c deleted file mode 100644 index 70166ed..0000000 --- a/src/core/function.c +++ /dev/null @@ -1,51 +0,0 @@ -/*:* - *: File: ./src/core/function.c - *: A simple interpreter - *: - *: WWW : http://fype.buetow.org - *: AUTHOR : http://paul.buetow.org - *: E-Mail : fype at dev.buetow.org - *: - *: Copyright (c) 2005 - 2009, Dipl.-Inform. (FH) Paul C. Buetow - *: All rights reserved. - *: - *: 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 "../defines.h" - -#include "function.h" - -Function* -function_new() { - Function *p_function = malloc(sizeof(Function)); - - return (p_function); -} - -void -function_delete(Function *p_function) { - free(p_function); -} - diff --git a/src/core/function.h b/src/core/function.h deleted file mode 100644 index 748ebce..0000000 --- a/src/core/function.h +++ /dev/null @@ -1,46 +0,0 @@ -/*:* - *: File: ./src/core/function.h - *: A simple interpreter - *: - *: WWW : http://fype.buetow.org - *: AUTHOR : http://paul.buetow.org - *: E-Mail : fype at dev.buetow.org - *: - *: Copyright (c) 2005 - 2009, Dipl.-Inform. (FH) Paul C. Buetow - *: All rights reserved. - *: - *: 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 FUNCTION_H -#define FUNCTION_H - -typedef struct { - char *c_name; -} Function; - -Function* function_new(); -void function_delete(Function *p_function); - -#endif /* FUNCTION_H */ diff --git a/src/core/functions.c b/src/core/functions.c deleted file mode 100644 index 82efc4f..0000000 --- a/src/core/functions.c +++ /dev/null @@ -1,985 +0,0 @@ -/*:* - *: File: ./src/core/functions.c - *: A simple interpreter - *: - *: WWW : http://fype.buetow.org - *: AUTHOR : http://paul.buetow.org - *: E-Mail : fype at dev.buetow.org - *: - *: Copyright (c) 2005 - 2009, Dipl.-Inform. (FH) Paul C. Buetow - *: All rights reserved. - *: - *: 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 <stdlib.h> -#include <sys/types.h> -#include <unistd.h> - -#include "functions.h" - -#include "convert.h" -#include "scope.h" -#include "symbol.h" - -#define _FUNCTIONS_ERROR(m,t) \ - ERROR(\ - "%s: Function error in %s line %d pos %d near '%s'", m, \ - token_get_filename(t), \ - token_get_line_nr(t), \ - token_get_pos_nr(t), \ - token_get_val(t) \ - ) - -Functions* -functions_new() { - Functions *p_functions = malloc(sizeof(Functions)); - - p_functions->p_hash_functions = hash_new(1024); - functions_init(p_functions); - - return (p_functions); -} - -void -functions_delete(Functions *p_functions) { - hash_delete(p_functions->p_hash_functions); - free(p_functions); -} - - -void -_process(Interpret *p_interpret, Token *p_token_store, Token *p_token_op, - Token *p_token_op2, Token *p_token_next) { - - TokenType tt_op = token_get_tt(p_token_op); - TokenType tt_op2 = p_token_op2 == NULL - ? TT_NONE - : token_get_tt(p_token_op2); - -#ifdef DEBUG_FUNCTION_PROCESS - if (p_token_op2 == NULL) - printf("DEBUG::FUNCTION::PROCESS: Operator %s\n", tt_get_name(tt_op)); - else - printf("DEBUG::FUNCTION::PROCESS: Operator %s %s\n", tt_get_name(tt_op), - tt_get_name(tt_op2)); - - token_print(p_token_next); - printf("\n"); - token_print(p_token_store); - printf("\n"); -#endif /* DEBUG_FUNCTION_PROCESS */ - - if (p_token_op2 != NULL) { - switch (tt_op) { - case TT_NOT: - switch (tt_op2) { - case TT_ASSIGN: - tt_op = TT_NEQ; - break; - default: - break; - } - break; - case TT_ASSIGN: - switch (tt_op2) { - case TT_ASSIGN: - tt_op = TT_EQ; - break; - default: - break; - } - break; - case TT_LT: - switch (tt_op2) { - case TT_ASSIGN: - tt_op = TT_LE; - break; - default: - break; - } - break; - case TT_GT: - switch (tt_op2) { - case TT_ASSIGN: - tt_op = TT_GE; - break; - default: - break; - } - break; - case TT_DDOT: - switch (tt_op2) { - case TT_LT: - tt_op = TT_LSHIFT; - break; - case TT_GT: - tt_op = TT_RSHIFT; - break; - default: - break; - } - break; - default: - break; - } - } else { - switch (tt_op) { - case TT_ASSIGN: - { - Token *p_token_assign = p_interpret->p_token_temp; - TokenType tt_assign = token_get_tt(p_token_assign); - - if (tt_assign != TT_IDENT) { - _FUNCTIONS_ERROR("Can only assign to symbols", - p_token_store); - } - - Symbol *p_symbol = scope_get(p_interpret->p_scope, - token_get_val(p_token_assign)); - - if (p_symbol == NULL) { - _FUNCTIONS_ERROR("No such symbol", - p_token_assign); - } - - symbol_set_val(p_symbol, p_token_store); - symbol_set_sym(p_symbol, SYM_VARIABLE); - - return; - } - - break; - NO_DEFAULT; - } - } - - p_token_next = token_new_copy(p_token_next); - TokenType tt_highest = convert_to_highest(p_token_store, p_token_next); - -#ifdef DEBUG_FUNCTION_PROCESS - printf("DEBUG::FUNCTION::PROCESS: ===> %s %s %s\n", - tt_get_name(tt_highest), - tt_get_name(tt_op), - tt_get_name(tt_highest)); -#endif /* DEBUG_FUNCTION_PROCESS */ - - switch (tt_op) { - case TT_ADD: - switch (tt_highest) { - case TT_INTEGER: - token_set_ival(p_token_store, - token_get_ival(p_token_next) + - token_get_ival(p_token_store)); - break; - case TT_DOUBLE: - token_set_dval(p_token_store, - token_get_dval(p_token_next) + - token_get_dval(p_token_store)); - break; - case TT_STRING: - token_set_ival(p_token_store, - atoi(token_get_val(p_token_next)) + - atoi(token_get_val(p_token_store))); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_ARRAY: - array_append(p_token_store->p_array, - p_token_next->p_array); - break; - NO_DEFAULT; - } - break; - case TT_SUB: - switch (tt_highest) { - case TT_INTEGER: - token_set_ival(p_token_store, - token_get_ival(p_token_next) - - token_get_ival(p_token_store)); - break; - case TT_DOUBLE: - token_set_dval(p_token_store, - token_get_dval(p_token_next) - - token_get_dval(p_token_store)); - break; - case TT_STRING: - token_set_ival(p_token_store, - atoi(token_get_val(p_token_next)) - - atoi(token_get_val(p_token_store))); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_ARRAY: - ERROR("TT_ARRAY - TT_ARRAY not yet implemented"); - break; - NO_DEFAULT; - } - break; - case TT_MULT: - switch (tt_highest) { - case TT_INTEGER: - token_set_ival(p_token_store, - token_get_ival(p_token_next) * - token_get_ival(p_token_store)); - break; - case TT_DOUBLE: - token_set_dval(p_token_store, - token_get_dval(p_token_next) * - token_get_dval(p_token_store)); - break; - case TT_STRING: - token_set_ival(p_token_store, - atoi(token_get_val(p_token_next)) * - atoi(token_get_val(p_token_store))); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_ARRAY: - ERROR("TT_ARRAY * TT_ARRAY not yet implemented"); - break; - NO_DEFAULT; - } - break; - case TT_DIV: - switch (tt_highest) { - case TT_INTEGER: - token_set_ival(p_token_store, - (int) token_get_ival(p_token_next) / - token_get_ival(p_token_store)); - break; - case TT_DOUBLE: - token_set_dval(p_token_store, - token_get_dval(p_token_next) / - token_get_dval(p_token_store)); - break; - case TT_STRING: - token_set_dval(p_token_store, - atof(token_get_val(p_token_next)) / - atof(token_get_val(p_token_store))); - token_set_tt(p_token_store, TT_DOUBLE); - break; - case TT_ARRAY: - ERROR("TT_ARRAY / TT_ARRAY not yet implemented"); - break; - NO_DEFAULT; - } - break; - case TT_EQ: - switch (tt_highest) { - case TT_INTEGER: - token_set_ival(p_token_store, - (int) token_get_ival(p_token_next) == - token_get_ival(p_token_store)); - break; - case TT_DOUBLE: - token_set_ival(p_token_store, - token_get_dval(p_token_next) == - token_get_dval(p_token_store)); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_STRING: - token_set_ival(p_token_store, - strcmp(token_get_val(p_token_next), - token_get_val(p_token_store)) == 0); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_ARRAY: - ERROR("TT_ARRAY eq TT_ARRAY not yet implemented"); - break; - NO_DEFAULT; - } - break; - case TT_NEQ: - switch (tt_highest) { - case TT_INTEGER: - token_set_ival(p_token_store, - (int) token_get_ival(p_token_next) != - token_get_ival(p_token_store)); - break; - case TT_DOUBLE: - token_set_ival(p_token_store, - token_get_dval(p_token_next) != - token_get_dval(p_token_store)); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_STRING: - token_set_ival(p_token_store, - strcmp(token_get_val(p_token_next), - token_get_val(p_token_store)) != 0); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_ARRAY: - ERROR("ARRAY bla yet implemented"); - break; - NO_DEFAULT; - } - break; - case TT_LE: - switch (tt_highest) { - case TT_INTEGER: - token_set_ival(p_token_store, - (int) token_get_ival(p_token_next) <= - token_get_ival(p_token_store)); - break; - case TT_DOUBLE: - token_set_ival(p_token_store, - token_get_dval(p_token_next) <= - token_get_dval(p_token_store)); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_STRING: - token_set_ival(p_token_store, - strcmp(token_get_val(p_token_next), - token_get_val(p_token_store)) <= 0); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_ARRAY: - ERROR("ARRAY bla yet implemented"); - break; - NO_DEFAULT; - } - break; - case TT_GE: - switch (tt_highest) { - case TT_INTEGER: - token_set_ival(p_token_store, - (int) token_get_ival(p_token_next) >= - token_get_ival(p_token_store)); - break; - case TT_DOUBLE: - token_set_ival(p_token_store, - token_get_dval(p_token_next) >= - token_get_dval(p_token_store)); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_STRING: - token_set_ival(p_token_store, - strcmp(token_get_val(p_token_next), - token_get_val(p_token_store)) >= 0); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_ARRAY: - ERROR("ARRAY bla yet implemented"); - break; - NO_DEFAULT; - } - break; - case TT_LT: - switch (tt_highest) { - case TT_INTEGER: - token_set_ival(p_token_store, - (int) token_get_ival(p_token_next) < - token_get_ival(p_token_store)); - break; - case TT_DOUBLE: - token_set_ival(p_token_store, - token_get_dval(p_token_next) < - token_get_dval(p_token_store)); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_STRING: - token_set_ival(p_token_store, - strcmp(token_get_val(p_token_next), - token_get_val(p_token_store)) < 0); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_ARRAY: - ERROR("ARRAY bla yet implemented"); - break; - NO_DEFAULT; - } - break; - case TT_GT: - switch (tt_highest) { - case TT_INTEGER: - token_set_ival(p_token_store, - (int) token_get_ival(p_token_next) > - token_get_ival(p_token_store)); - break; - case TT_DOUBLE: - token_set_ival(p_token_store, - token_get_dval(p_token_next) > - token_get_dval(p_token_store)); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_STRING: - token_set_ival(p_token_store, - strcmp(token_get_val(p_token_next), - token_get_val(p_token_store)) > 0); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_ARRAY: - ERROR("ARRAY bla yet implemented"); - break; - NO_DEFAULT; - } - break; - case TT_AND: - switch (tt_highest) { - case TT_INTEGER: - token_set_ival(p_token_store, - (int) token_get_ival(p_token_next) & - token_get_ival(p_token_store)); - break; - case TT_DOUBLE: - token_set_ival(p_token_store, - (int) token_get_dval(p_token_next) & - (int) token_get_dval(p_token_store)); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_STRING: - token_set_ival(p_token_store, - atoi(token_get_val(p_token_next)) & - atoi(token_get_val(p_token_store))); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_ARRAY: - ERROR("ARRAY bla yet implemented"); - break; - NO_DEFAULT; - } - break; - case TT_OR: - switch (tt_highest) { - case TT_INTEGER: - token_set_ival(p_token_store, - (int) token_get_ival(p_token_next) | - token_get_ival(p_token_store)); - break; - case TT_DOUBLE: - token_set_ival(p_token_store, - (int) token_get_dval(p_token_next) | - (int) token_get_dval(p_token_store)); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_STRING: - token_set_ival(p_token_store, - atoi(token_get_val(p_token_next)) | - atoi(token_get_val(p_token_store))); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_ARRAY: - ERROR("ARRAY bla yet implemented"); - break; - NO_DEFAULT; - } - break; - case TT_XOR: - switch (tt_highest) { - case TT_INTEGER: - token_set_ival(p_token_store, - (int) token_get_ival(p_token_next) ^ - token_get_ival(p_token_store)); - break; - case TT_DOUBLE: - token_set_ival(p_token_store, - (int) token_get_dval(p_token_next) ^ - (int) token_get_dval(p_token_store)); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_STRING: - token_set_ival(p_token_store, - atoi(token_get_val(p_token_next)) ^ - atoi(token_get_val(p_token_store))); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_ARRAY: - ERROR("ARRAY bla yet implemented"); - break; - NO_DEFAULT; - } - break; - case TT_LSHIFT: - switch (tt_highest) { - case TT_INTEGER: - token_set_ival(p_token_store, - (int) token_get_ival(p_token_next) << - token_get_ival(p_token_store)); - break; - case TT_DOUBLE: - token_set_ival(p_token_store, - (int) token_get_dval(p_token_next) << - (int) token_get_dval(p_token_store)); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_STRING: - token_set_ival(p_token_store, - atoi(token_get_val(p_token_next)) << - atoi(token_get_val(p_token_store))); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_ARRAY: - ERROR("ARRAY bla yet implemented"); - break; - NO_DEFAULT; - } - break; - case TT_RSHIFT: - switch (tt_highest) { - case TT_INTEGER: - token_set_ival(p_token_store, - (int) token_get_ival(p_token_next) >> - token_get_ival(p_token_store)); - break; - case TT_DOUBLE: - token_set_ival(p_token_store, - (int) token_get_dval(p_token_next) >> - (int) token_get_dval(p_token_store)); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_STRING: - token_set_ival(p_token_store, - atoi(token_get_val(p_token_next)) >> - atoi(token_get_val(p_token_store))); - token_set_tt(p_token_store, TT_INTEGER); - break; - case TT_ARRAY: - ERROR("ARRAY bla yet implemented"); - break; - NO_DEFAULT; - } - break; - - default: - _FUNCTIONS_ERROR("No such function/operator", p_token_op); - } - -#ifdef DEBUG_FUNCTION_PROCESS - token_print(p_token_store); - printf("\n\n"); -#endif /* DEBUG_FUNCTION_PROCESS */ - - token_delete(p_token_next); -} - -void -function_process(Interpret *p_interpret, Token *p_token_op, - Token *p_token_op2, Stack *p_stack_args, int i_args) { - - Token *p_token_store = token_new_copy(stack_pop(p_stack_args)); - - for (int i = 0; i < i_args -1 && !stack_empty(p_stack_args); ++i) { - Token *p_token_next = stack_pop(p_stack_args); - - _process(p_interpret, p_token_store, p_token_op, - p_token_op2, p_token_next); - } - - stack_push(p_stack_args, p_token_store); -} - -_Bool -function_is_buildin(Token *p_token_ident) { - /* TODO: optimize this function */ - if (strcmp("assert", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("decr", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("double", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("end", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("exit", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("fork", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("gc", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("incr", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("ind", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("integer", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("len", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("ln", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("neg", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("no", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("put", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("scope", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("say", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("string", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("yes", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("not", token_get_val(p_token_ident)) == 0) - return (true); - - if (strcmp("refs", token_get_val(p_token_ident)) == 0) - return (true); - - return (false); -} - -void -function_process_buildin(Interpret *p_interpret, Token *p_token_ident, - Stack *p_stack_args) { - - Token *p_token = stack_top(p_stack_args); - - if (token_get_tt(p_token) == TT_ARRAY) { - if (strcmp("len", token_get_val(p_token_ident)) == 0) { - stack_pop(p_stack_args); - stack_push(p_stack_args, - token_new_integer(array_get_used(p_token->p_array))); - - } else if (strcmp("ind", token_get_val(p_token_ident)) == 0) { - stack_pop(p_stack_args); - stack_push(p_stack_args, - token_new_integer(array_get_ind(p_token->p_array))); - - } else { - ArrayIterator *p_iter = arrayiterator_new(p_token->p_array); - - while (arrayiterator_has_next(p_iter)) { - stack_push(p_stack_args, arrayiterator_next(p_iter)); - function_process_buildin(p_interpret, p_token_ident, - p_stack_args); - stack_pop(p_stack_args); - } - - arrayiterator_delete(p_iter); - } - - return; - } - - if (strcmp("assert", token_get_val(p_token_ident)) == 0) { - if (0 == stack_size(p_stack_args)) - _FUNCTIONS_ERROR("No argument given", p_token_ident); - - switch (token_get_tt(p_token)) { - case TT_INTEGER: - if (token_get_ival(p_token) == 0) - _FUNCTIONS_ERROR("Assert failed", p_token); - break; - case TT_DOUBLE: - if (token_get_dval(p_token) == 0) - _FUNCTIONS_ERROR("Assert failed", p_token); - break; - case TT_STRING: - if (atoi(token_get_val(p_token)) == 0) - _FUNCTIONS_ERROR("Assert failed", p_token); - break; - NO_DEFAULT; - } - - } else if (strcmp("decr", token_get_val(p_token_ident)) == 0) { - if (0 == stack_size(p_stack_args)) - _FUNCTIONS_ERROR("No argument given", p_token_ident); - - switch (token_get_tt(p_token)) { - case TT_INTEGER: - token_set_ival(p_token, token_get_ival(p_token) - 1); - break; - case TT_DOUBLE: - token_set_dval(p_token, token_get_dval(p_token) - 1); - break; - case TT_STRING: - convert_to_integer(p_token); - token_set_ival(p_token, token_get_ival(p_token) - 1); - break; - NO_DEFAULT; - } - - } else if (strcmp("double", token_get_val(p_token_ident)) == 0) { - if (0 == stack_size(p_stack_args)) - _FUNCTIONS_ERROR("No argument given", p_token_ident); - - Token *p_token = token_new_copy(stack_pop(p_stack_args)); - convert_to_double(p_token); - stack_push(p_stack_args, p_token); - - } else if (strcmp("end", token_get_val(p_token_ident)) == 0) { - exit(0); - - } else if (strcmp("fork", token_get_val(p_token_ident)) == 0) { - Token *p_token = token_new_integer((int) fork()); - stack_push(p_stack_args, p_token); - - } else if (strcmp("gc", token_get_val(p_token_ident)) == 0) { - int i_count = garbage_collect(); - Token *p_token = token_new_integer(i_count); - stack_push(p_stack_args, p_token); - - } else if (strcmp("exit", token_get_val(p_token_ident)) == 0) { - if (0 == stack_size(p_stack_args)) - _FUNCTIONS_ERROR("No argument given", p_token_ident); - - p_token = token_new_copy(p_token); - convert_to_integer(p_token); - exit(token_get_ival(p_token)); - - } else if (strcmp("incr", token_get_val(p_token_ident)) == 0) { - if (0 == stack_size(p_stack_args)) - _FUNCTIONS_ERROR("No argument given", p_token_ident); - - switch (token_get_tt(p_token)) { - case TT_INTEGER: - token_set_ival(p_token, token_get_ival(p_token) + 1); - break; - case TT_DOUBLE: - token_set_dval(p_token, token_get_dval(p_token) + 1); - break; - case TT_STRING: - convert_to_integer(p_token); - token_set_ival(p_token, token_get_ival(p_token) + 1); - break; - NO_DEFAULT; - } - - } else if (strcmp("ind", token_get_val(p_token_ident)) == 0) { - _FUNCTIONS_ERROR("Expected array", p_token_ident); - - } else if (strcmp("integer", token_get_val(p_token_ident)) == 0) { - if (0 == stack_size(p_stack_args)) - _FUNCTIONS_ERROR("No argument given", p_token_ident); - - Token *p_token = token_new_copy(stack_pop(p_stack_args)); - convert_to_integer(p_token); - stack_push(p_stack_args, p_token); - - } else if (strcmp("len", token_get_val(p_token_ident)) == 0) { - if (0 == stack_size(p_stack_args)) - _FUNCTIONS_ERROR("No argument given", p_token_ident); - - Token *p_token = token_new_copy(stack_pop(p_stack_args)); - convert_to_string(p_token); - token_set_tt(p_token, TT_INTEGER); - token_set_ival(p_token, strlen(token_get_val(p_token))); - stack_push(p_stack_args, p_token); - - } else if (strcmp("ln", token_get_val(p_token_ident)) == 0) { - printf("\n"); - - } else if (strcmp("neg", token_get_val(p_token_ident)) == 0) { - if (0 == stack_size(p_stack_args)) - _FUNCTIONS_ERROR("No argument given", p_token_ident); - - Token *p_token = token_new_copy(stack_pop(p_stack_args)); - stack_push(p_stack_args, p_token); - - switch (token_get_tt(p_token)) { - case TT_INTEGER: - token_set_ival(p_token, -token_get_ival(p_token)); - break; - case TT_DOUBLE: - token_set_dval(p_token, -token_get_dval(p_token)); - break; - case TT_STRING: - token_set_ival(p_token, -atoi(token_get_val(p_token))); - token_set_tt(p_token, TT_INTEGER); - break; - NO_DEFAULT; - } - - } else if (strcmp("no", token_get_val(p_token_ident)) == 0) { - Token *p_token = NULL; - - if (0 == stack_size(p_stack_args)) { - p_token = token_new_integer(0); - - } else { - p_token = token_new_copy(stack_pop(p_stack_args)); - - switch (token_get_tt(p_token)) { - case TT_INTEGER: - token_set_ival(p_token, !token_get_ival(p_token)); - break; - case TT_DOUBLE: - token_set_dval(p_token, !token_get_dval(p_token)); - break; - case TT_STRING: - token_set_ival(p_token, !atoi(token_get_val(p_token))); - token_set_tt(p_token, TT_INTEGER); - break; - NO_DEFAULT; - } - } - - stack_push(p_stack_args, p_token); - - } else if (strcmp("put", token_get_val(p_token_ident)) == 0) { - StackIterator *p_iter = stackiterator_new(p_stack_args); - while (stackiterator_has_next(p_iter)) { - Token *p_token = stackiterator_next(p_iter); - switch (token_get_tt(p_token)) { - case TT_INTEGER: - printf("%d", token_get_ival(p_token)); - break; - case TT_DOUBLE: - printf("%f", token_get_dval(p_token)); - break; - case TT_STRING: - printf("%s", token_get_val(p_token)); - break; - NO_DEFAULT; - } - } - stackiterator_delete(p_iter); - - } else if (strcmp("scope", token_get_val(p_token_ident)) == 0) { - scope_print(p_interpret->p_scope); - - } else if (strcmp("say", token_get_val(p_token_ident)) == 0) { - StackIterator *p_iter = stackiterator_new(p_stack_args); - while (stackiterator_has_next(p_iter)) { - Token *p_token = stackiterator_next(p_iter); - switch (token_get_tt(p_token)) { - case TT_INTEGER: - printf("%d", token_get_ival(p_token)); - break; - case TT_DOUBLE: - printf("%f", token_get_dval(p_token)); - break; - case TT_STRING: - printf("%s", token_get_val(p_token)); - break; - } - } - stackiterator_delete(p_iter); - printf("\n"); - - } else if (strcmp("string", token_get_val(p_token_ident)) == 0) { - if (0 == stack_size(p_stack_args)) - _FUNCTIONS_ERROR("No argument given", p_token_ident); - - Token *p_token = token_new_copy(stack_pop(p_stack_args)); - convert_to_string(p_token); - stack_push(p_stack_args, p_token); - - } else if (strcmp("yes", token_get_val(p_token_ident)) == 0) { - Token *p_token = NULL; - - if (0 == stack_size(p_stack_args)) { - p_token = token_new_integer(1); - - } else { - p_token = token_new_copy(stack_pop(p_stack_args)); - token_set_ival(p_token, 1); - token_set_tt(p_token, TT_INTEGER); - - } - - stack_push(p_stack_args, p_token); - - } else if (strcmp("not", token_get_val(p_token_ident)) == 0) { - if (0 == stack_size(p_stack_args)) - _FUNCTIONS_ERROR("No argument given", p_token_ident); - - Token *p_token = token_new_copy(stack_pop(p_stack_args)); - stack_push(p_stack_args, p_token); - - switch (token_get_tt(p_token)) { - case TT_INTEGER: - token_set_ival(p_token, !token_get_ival(p_token)); - break; - case TT_DOUBLE: - token_set_dval(p_token, !token_get_dval(p_token)); - break; - case TT_STRING: - token_set_ival(p_token, !atoi(token_get_val(p_token))); - token_set_tt(p_token, TT_INTEGER); - break; - NO_DEFAULT; - } - - } else if (strcmp("refs", token_get_val(p_token_ident)) == 0) { - if (0 == stack_size(p_stack_args)) - _FUNCTIONS_ERROR("No argument given", p_token_ident); - - Token *p_token_top = stack_pop(p_stack_args); - Token *p_token = token_new_integer(p_token_top->i_ref_count); - stack_push(p_stack_args, p_token); - } -} - -_Bool -function_is_self_defined(Interpret *p_interpret) { - Symbol *p_symbol = scope_get(p_interpret->p_scope, - token_get_val(p_interpret->p_token)); - - if (p_symbol == NULL) - return (false); - - switch (symbol_get_sym(p_symbol)) { - case SYM_PROCEDURE: - case SYM_FUNCTION: - return (true); - NO_DEFAULT; - } - - return (false); -} - -void -function_process_self_defined(Interpret *p_interpret, Token *p_token_ident) { - Symbol *p_symbol = scope_get(p_interpret->p_scope, - token_get_val(p_token_ident)); - - switch (symbol_get_sym(p_symbol)) { - case SYM_PROCEDURE: - { - List *p_list_token = symbol_get_val(p_symbol); - interpret_subprocess(p_interpret, p_list_token); - } - break; - case SYM_FUNCTION: - { - List *p_list_token = symbol_get_val(p_symbol); - scope_up(p_interpret->p_scope); - interpret_subprocess(p_interpret, p_list_token); - scope_down(p_interpret->p_scope); - } - NO_DEFAULT; - } -} - -void -functions_init(Functions *p_functions) { -} diff --git a/src/core/functions.h b/src/core/functions.h deleted file mode 100644 index 4e00dc2..0000000 --- a/src/core/functions.h +++ /dev/null @@ -1,64 +0,0 @@ -/*:* - *: File: ./src/core/functions.h - *: A simple interpreter - *: - *: WWW : http://fype.buetow.org - *: AUTHOR : http://paul.buetow.org - *: E-Mail : fype at dev.buetow.org - *: - *: Copyright (c) 2005 - 2009, Dipl.-Inform. (FH) Paul C. Buetow - *: All rights reserved. - *: - *: 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 FUNCTIONS_H -#define FUNCTIONS_H - -#include "token.h" - -#include "interpret.h" -#include "../data/stack.h" -#include "../data/hash.h" - -typedef struct { - Hash *p_hash_functions; -} Functions; - -Functions* functions_new(); -void functions_delete(Functions *p_functions); -void functions_init(Functions *p_functions); - -void function_process(Interpret *p_interp, Token *p_token_op, - Token *p_token_op2, Stack *p_stack_args, - int i_args); -_Bool function_is_buildin(Token *p_token_ident); -void function_process_buildin(Interpret *p_interpret, - Token *p_token_ident, - Stack *p_stack_args); -_Bool function_is_self_defined(Interpret *p_interpret); -void function_process_self_defined(Interpret *p_interpret, - Token *p_token_ident); - -#endif /* FUNCTIONS_H */ diff --git a/src/core/garbage.c b/src/core/garbage.c deleted file mode 100644 index 23c73b8..0000000 --- a/src/core/garbage.c +++ /dev/null @@ -1,144 +0,0 @@ -/*:* - *: File: ./src/core/garbage.c - *: A simple interpreter - *: - *: WWW : http://fype.buetow.org - *: AUTHOR : http://paul.buetow.org - *: E-Mail : fype at dev.buetow.org - *: - *: Copyright (c) 2005 - 2009, Dipl.-Inform. (FH) Paul C. Buetow - *: All rights reserved. - *: - *: 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 "garbage.h" - -#define _GARBAGE_ERROR(m) \ - ERROR("%s: Garbage error", m); - -List *LIST_GARBAGE = NULL; - -typedef struct { - void (*p_func)(void*); - void (*p_print)(void*); - int *p_ref_count; - void *p_2free; - GarbageType type; -} _Garbage; - -void -garbage_init() { - LIST_GARBAGE = list_new(); -} - -void -garbage_destroy() { - garbage_collect(); - if (!list_empty(LIST_GARBAGE)) { - EPRINTF("The garbage collector still has %d registered items " - " which don't have a zero ref count!\n", - list_size(LIST_GARBAGE)); - - _GARBAGE_ERROR("Garbage left"); - } - - list_delete(LIST_GARBAGE); -} - -int -garbage_collect() { - ListIterator *p_iter = listiterator_new(LIST_GARBAGE); - List *p_list_garbage_new = list_new(); - int i_count = 0; - - while (listiterator_has_next(p_iter)) { - _Garbage *p_garbage = listiterator_next(p_iter); - - if (p_garbage->p_ref_count == NULL || *p_garbage->p_ref_count <= 0) { -#ifdef DEBUG_GC - printf("DEBUG::GC: Freeing "); - if (NULL != p_garbage->p_print) - (*p_garbage->p_print) (p_garbage->p_2free); - else - printf("0x%x\n", (int) p_garbage->p_2free); -#endif /* DEBUG_GC */ - (*p_garbage->p_func) (p_garbage->p_2free); - free(p_garbage); - ++i_count; - - } else { - list_add_back(p_list_garbage_new, p_garbage); - } - } - - listiterator_delete(p_iter); - - list_delete(LIST_GARBAGE); - LIST_GARBAGE = p_list_garbage_new; -#ifdef DEBUG_GC - printf("DEBUG::GC: Freed %d items\n", i_count); -#endif /* DEBUG_GC */ - - return (i_count); -} - -void -garbage_add(void *p, GarbageType type) { - garbage_add2(p, free, NULL, type); -} - -void -garbage_add2(void *p, - void (*p_func)(void*), - int *p_ref_count, - GarbageType type) { - garbage_add3(p, free, p_func, NULL, type); -} - -void -garbage_add3(void *p, - void (*p_func)(void*), - void (*p_print)(void*), - int *p_ref_count, - GarbageType type) { - - _Garbage *p_garbage = malloc(sizeof(_Garbage)); - - p_garbage->p_2free = p; - p_garbage->p_func = p_func; - p_garbage->p_print = p_print; - p_garbage->p_ref_count = p_ref_count; - p_garbage->type = type; - - list_add_back(LIST_GARBAGE, p_garbage); -} - -void -garbage_add_token(Token *p_token) { - garbage_add3(p_token, - token_delete_cb, - token_print_cb, - &p_token->i_ref_count, GC_TOKEN); -} diff --git a/src/core/garbage.h b/src/core/garbage.h deleted file mode 100644 index f7533eb..0000000 --- a/src/core/garbage.h +++ /dev/null @@ -1,60 +0,0 @@ -/*:* - *: File: ./src/core/garbage.h - *: A simple interpreter - *: - *: WWW : http://fype.buetow.org - *: AUTHOR : http://paul.buetow.org - *: E-Mail : fype at dev.buetow.org - *: - *: Copyright (c) 2005 - 2009, Dipl.-Inform. (FH) Paul C. Buetow - *: All rights reserved. - *: - *: 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 GARBAGE_H -#define GARBAGE_H - -#include "../defines.h" -#include "../data/list.h" -#include "token.h" - -typedef enum { - GC_TOKEN, -} GarbageType; - -void garbage_init(); -void garbage_destroy(); -int garbage_collect(); -void garbage_add(void *p, GarbageType type); -void garbage_add2(void *p, void (*p_func)(void*), - int *p_ref_count, - GarbageType type); -void garbage_add3(void *p, void (*p_func)(void*), - void (*p_print)(void*), - int *p_ref_count, - GarbageType type); -void garbage_add_token(Token *p_token); - -#endif diff --git a/src/core/interpret.c b/src/core/interpret.c index 28239ef..3dea81a 100644 --- a/src/core/interpret.c +++ b/src/core/interpret.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/core/interpret.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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. *:*/ @@ -77,7 +77,7 @@ interpret_delete(Interpret *p_inter) { } void -interpret_run(PBSc *p_fype) { +interpret_run(Fype *p_fype) { Interpret *p_inter = interpret_new(p_fype->p_list_token); diff --git a/src/core/interpret.h b/src/core/interpret.h index 6d3a4a5..7834ef6 100644 --- a/src/core/interpret.h +++ b/src/core/interpret.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/core/interpret.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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. *:*/ @@ -53,6 +53,6 @@ typedef struct _Interpret { Interpret* interpret_new(List *p_list_token); Interpret* interpret_new_lambda(Interpret *p_inter, Lambda *p_lambda); void interpret_delete(Interpret *p_inter); -void interpret_run(PBSc *p_fype); +void interpret_run(Fype *p_fype); #endif /* INTERPRET_H */ diff --git a/src/core/lambda.c b/src/core/lambda.c index c6ad9a2..cbd2928 100644 --- a/src/core/lambda.c +++ b/src/core/lambda.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/core/lambda.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/core/lambda.h b/src/core/lambda.h index 8377c30..6d75bbe 100644 --- a/src/core/lambda.h +++ b/src/core/lambda.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/core/lambda.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/core/promise.c b/src/core/promise.c index fa50e78..e21c584 100644 --- a/src/core/promise.c +++ b/src/core/promise.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/core/promise.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/core/promise.h b/src/core/promise.h index 76cd162..668f155 100644 --- a/src/core/promise.h +++ b/src/core/promise.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/core/promise.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/core/reference.c b/src/core/reference.c deleted file mode 100644 index 3eccaaa..0000000 --- a/src/core/reference.c +++ /dev/null @@ -1,57 +0,0 @@ -/*:* - *: File: ./src/core/reference.c - *: A simple interpreter - *: - *: WWW : http://fype.buetow.org - *: AUTHOR : http://paul.buetow.org - *: E-Mail : fype at dev.buetow.org - *: - *: Copyright (c) 2005 - 2009, Dipl.-Inform. (FH) Paul C. Buetow - *: All rights reserved. - *: - *: 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 "reference.h" - -Reference* -reference_new(Symbol *p_symbol) { - Reference *p_reference = malloc(sizeof(Reference)); - - symbol_ref_up(p_symbol); - p_reference->p_symbol = p_symbol; - - return (p_reference); -} - -void -reference_delete_cb(void *p_void) { - reference_delete(p_void); -} - -void -reference_delete(Reference *p_reference) { - symbol_delete(p_reference->p_symbol); - free(p_reference); -} diff --git a/src/core/reference.h b/src/core/reference.h deleted file mode 100644 index 6cda63d..0000000 --- a/src/core/reference.h +++ /dev/null @@ -1,52 +0,0 @@ -/*:* - *: File: ./src/core/reference.h - *: A simple interpreter - *: - *: WWW : http://fype.buetow.org - *: AUTHOR : http://paul.buetow.org - *: E-Mail : fype at dev.buetow.org - *: - *: Copyright (c) 2005 - 2009, Dipl.-Inform. (FH) Paul C. Buetow - *: All rights reserved. - *: - *: 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 REFERENCE_H -#define REFERENCE_H - -#include "../defines.h" -#include "symbol.h" - -#define reference_get_sym(r) (r->p_symbol) - -typedef struct { - Symbol *p_symbol; -} Reference; - -Reference* reference_new(Symbol *p_symbol); -void reference_delete_cb(void *p_void); -void reference_delete(Reference *p_reference); - -#endif /* REFERENCE_H */ diff --git a/src/core/scanner.c b/src/core/scanner.c index a2b2b10..8b4c373 100644 --- a/src/core/scanner.c +++ b/src/core/scanner.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/core/scanner.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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. *:*/ @@ -98,7 +98,7 @@ _scanner_get_next_char(Scanner *p_scanner) { } void -scanner_run(PBSc *p_fype) { +scanner_run(Fype *p_fype) { Scanner *p_scanner = scanner_new(p_fype->p_list_token, p_fype->p_tupel_argv); diff --git a/src/core/scanner.h b/src/core/scanner.h index b15707b..6a729bc 100644 --- a/src/core/scanner.h +++ b/src/core/scanner.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/core/scanner.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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. *:*/ @@ -58,7 +58,7 @@ typedef struct { TokenType tt_last; } Scanner; -void scanner_run(PBSc *p_fype); +void scanner_run(Fype *p_fype); Scanner *scanner_new(List *p_list_token, Tupel *p_tupel_argv); void scanner_delete(Scanner *p_scanner); void scanner_add_token(Scanner *p_scanner, char **cc_token, int *p_token_len, diff --git a/src/core/scope.c b/src/core/scope.c deleted file mode 100644 index a9098a9..0000000 --- a/src/core/scope.c +++ /dev/null @@ -1,169 +0,0 @@ -/*:* - *: File: ./src/core/scope.c - *: A simple interpreter - *: - *: WWW : http://fype.buetow.org - *: AUTHOR : http://paul.buetow.org - *: E-Mail : fype at dev.buetow.org - *: - *: Copyright (c) 2005 - 2009, Dipl.-Inform. (FH) Paul C. Buetow - *: All rights reserved. - *: - *: 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 "garbage.h" -#include "scope.h" -#include "symbol.h" - -Scope* -scope_new(Hash *p_hash_syms) { - Scope *p_scope = malloc(sizeof(Scope)); - - p_scope->p_hash_global = p_hash_syms; - p_scope->p_stack_scopes = stack_new(); - - return (p_scope); -} - -void -scope_delete(Scope *p_scope) { - while (!stack_empty(p_scope->p_stack_scopes)) - scope_down(p_scope); - - stack_delete(p_scope->p_stack_scopes); - - free(p_scope); -} - -void -scope_up(Scope *p_scope) { - stack_push(p_scope->p_stack_scopes, hash_new(1024)); -} - -void -scope_down(Scope *p_scope) { - Hash *p_hash_syms = stack_pop(p_scope->p_stack_scopes); - hash_iterate(p_hash_syms, symbol_cleanup_hash_syms_cb); - hash_delete(p_hash_syms); -} - -static Hash* -_scope_get_hash(Scope *p_scope, char *c_key) { - StackIterator *p_iter = stackiterator_new(p_scope->p_stack_scopes); - - while (stackiterator_has_next(p_iter)) { - Hash *p_hash_syms = stackiterator_next(p_iter); - Symbol *p_symbol = hash_get(p_hash_syms, c_key); - - if (p_symbol != NULL) { - stackiterator_delete(p_iter); - return (p_hash_syms); - } - } - - stackiterator_delete(p_iter); - - if (hash_get(p_scope->p_hash_global, c_key)) - return (p_scope->p_hash_global); - - return (NULL); -} - -Symbol* -scope_get(Scope *p_scope, char *c_key) { - Hash *p_hash_syms = _scope_get_hash(p_scope, c_key); - - if (p_hash_syms == NULL) - return (NULL); - - return (hash_get(p_hash_syms, c_key)); -} - -Symbol* -scope_remove(Scope *p_scope, char *c_key) { - Hash *p_hash_syms = _scope_get_hash(p_scope, c_key); - - if (p_hash_syms == NULL) - return (NULL); - - Symbol *p_symbol = hash_remove(p_hash_syms, c_key); - - return (p_symbol); -} - -_Bool -scope_exists(Scope *p_scope, char *c_key) { - return (scope_get(p_scope, c_key) != NULL); -} - -_Bool -scope_reset(Scope *p_scope, char *c_key, Symbol *p_symbol) { - Hash *p_hash_syms = _scope_get_hash(p_scope, c_key); - - if (p_hash_syms == NULL) - return (false); - - hash_remove(p_hash_syms, c_key); - hash_insert(p_hash_syms, c_key, p_symbol); - - return (true); -} - -_Bool -scope_newset(Scope *p_scope, char *c_key, Symbol *p_symbol) { - Hash *p_hash_syms = NULL; - - if (stack_empty(p_scope->p_stack_scopes)) { - if (hash_get(p_scope->p_hash_global, c_key) != NULL) - return (false); - - p_hash_syms = p_scope->p_hash_global; - - } else { - p_hash_syms = stack_top(p_scope->p_stack_scopes); - } - - hash_insert(p_hash_syms, c_key, p_symbol); - - return (true); -} - -void -_scope_print_cb(void *p_void, int i_level) { - Hash *p_hash_syms = p_void; - if (i_level > 0) - printf("%d level(s) up:\n", i_level); - hash_iterate_key(p_hash_syms, symbol_print_cb); -} - -void -scope_print(Scope *p_scope) { - printf("Scopes:\n"); - printf("Scope stack size: %d\n", stack_size(p_scope->p_stack_scopes)); - printf("Global symbols:\n"); - hash_iterate_key(p_scope->p_hash_global, symbol_print_cb); - printf("Local symbols:\n"); - stack_iterate_level(p_scope->p_stack_scopes, _scope_print_cb); -} diff --git a/src/core/scope.h b/src/core/scope.h deleted file mode 100644 index c1193c9..0000000 --- a/src/core/scope.h +++ /dev/null @@ -1,60 +0,0 @@ -/*:* - *: File: ./src/core/scope.h - *: A simple interpreter - *: - *: WWW : http://fype.buetow.org - *: AUTHOR : http://paul.buetow.org - *: E-Mail : fype at dev.buetow.org - *: - *: Copyright (c) 2005 - 2009, Dipl.-Inform. (FH) Paul C. Buetow - *: All rights reserved. - *: - *: 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 SCOPE_H -#define SCOPE_H - -#include "../data/hash.h" -#include "../data/stack.h" -#include "../defines.h" -#include "symbol.h" - -typedef struct { - Hash *p_hash_global; - Stack *p_stack_scopes; -} Scope; - -Scope* scope_new(Hash *p_hash_syms); -void scope_delete(Scope *p_scope); -Symbol *scope_get(Scope *p_scope, char *c_key); -Symbol *scope_remove(Scope *p_scope, char *c_key); -_Bool scope_exists(Scope *p_scope, char *c_key); -_Bool scope_newset(Scope *p_scope, char *c_key, Symbol *p_symbol); -_Bool scope_reset(Scope *p_scope, char *c_key, Symbol *p_symbol); -void scope_down(Scope *p_scope); -void scope_up(Scope *p_scope); -void scope_print(Scope *p_scope); - -#endif /* SCOPE_H */ diff --git a/src/core/symbol.c b/src/core/symbol.c deleted file mode 100644 index f4ad990..0000000 --- a/src/core/symbol.c +++ /dev/null @@ -1,122 +0,0 @@ -/*:* - *: File: ./src/core/symbol.c - *: A simple interpreter - *: - *: WWW : http://fype.buetow.org - *: AUTHOR : http://paul.buetow.org - *: E-Mail : fype at dev.buetow.org - *: - *: Copyright (c) 2005 - 2009, Dipl.-Inform. (FH) Paul C. Buetow - *: All rights reserved. - *: - *: 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 "symbol.h" - -#include "../data/list.h" -#include "token.h" - -Symbol* -symbol_new(SymbolType sym, void *p_val) { - Symbol *p_symbol = malloc(sizeof(Symbol)); - - p_symbol->sym = sym; - p_symbol->p_val = p_val; - p_symbol->i_refs = 1; - - return p_symbol; -} - -void -symbol_delete(Symbol *p_symbol) { - if (--p_symbol->i_refs == 0) { - switch (symbol_get_sym(p_symbol)) { - case SYM_PROCEDURE: - { - List *p_list_token = symbol_get_val(p_symbol); - list_delete(p_list_token); - } - case SYM_ARRAY: - symbol_delete(symbol_get_val(p_symbol)); - break; - NO_DEFAULT; - } - free(p_symbol); - } -} - -void -symbol_cleanup_hash_syms_cb(void *p_void) { - symbol_delete(p_void); -} - -void -symbol_print(Symbol *p_symbol, char *c_key) { - printf("%s: %s", sym_get_name(p_symbol->sym), c_key); - - switch (p_symbol->sym) { - case SYM_BUILDIN: - case SYM_CONSTANT: - break; - case SYM_PROCEDURE: - case SYM_FUNCTION: - //list_iterate(symbol_get_val(p_symbol), token_print_cb); - break; - case SYM_ARRAY: - break; - case SYM_VARIABLE: - printf(" "); - token_print(symbol_get_val(p_symbol)); - break; - } - - printf("\n"); -} - -void -symbol_print_cb(void *p_void, char *c_key) { - symbol_print(p_void, c_key); -} - -char* -sym_get_name(SymbolType sym) { - switch (sym) { - case SYM_CONSTANT: - return ("SYM_CONSTANT"); - case SYM_ARRAY: - return ("SYM_ARRAY"); - case SYM_VARIABLE: - return ("SYM_VARIABLE"); - case SYM_BUILDIN: - return ("SYM_BUILDIN"); - case SYM_PROCEDURE: - return ("SYM_PROCEDURE"); - case SYM_FUNCTION: - return ("SYM_FUNCTION"); - } - - // Never reach this point - return ("NONE"); -} diff --git a/src/core/symbol.h b/src/core/symbol.h deleted file mode 100644 index 56f0e44..0000000 --- a/src/core/symbol.h +++ /dev/null @@ -1,71 +0,0 @@ -/*:* - *: File: ./src/core/symbol.h - *: A simple interpreter - *: - *: WWW : http://fype.buetow.org - *: AUTHOR : http://paul.buetow.org - *: E-Mail : fype at dev.buetow.org - *: - *: Copyright (c) 2005 - 2009, Dipl.-Inform. (FH) Paul C. Buetow - *: All rights reserved. - *: - *: 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 SYMBOL_H -#define SYMBOL_H - -#include "../defines.h" - -#define symbol_set_val(s,v) s->p_val = v -#define symbol_set_sym(s,st) s->sym = st -#define symbol_get_val(s) s->p_val -#define symbol_get_sym(s) s->sym -#define symbol_ref_up(s) ++s->i_refs -#define IS_A_FUNCTION(s) (s == SYM_INLINEFUNCTION || s == SYM_FUNCTION) -#define IS_NOT_A_FUNCTION(s) !IS_A_FUNCTION(s) - -typedef enum { - SYM_BUILDIN, - SYM_CONSTANT, - SYM_FUNCTION, - SYM_PROCEDURE, - SYM_ARRAY, - SYM_VARIABLE, -} SymbolType; - -typedef struct { - SymbolType sym; - void *p_val; - unsigned i_refs; -} Symbol; - -Symbol* symbol_new(SymbolType sym, void *p_val); -void symbol_delete(Symbol *p_symbol); -void symbol_cleanup_hash_syms_cb(void *p_void); -void symbol_print(Symbol *p_symbol, char *c_key); -void symbol_print_cb(void *p_void, char *c_key); -char* sym_get_name(SymbolType sym); - -#endif diff --git a/src/core/token.c b/src/core/token.c index a0a6ad0..dd3f327 100644 --- a/src/core/token.c +++ b/src/core/token.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/core/token.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/core/token.h b/src/core/token.h index 8f1ab53..ae3f146 100644 --- a/src/core/token.h +++ b/src/core/token.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/core/token.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/core/tools.c b/src/core/tools.c index 6b6dbab..ed36af5 100644 --- a/src/core/tools.c +++ b/src/core/tools.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/core/tools.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/core/tools.h b/src/core/tools.h index 19d9fa6..6c61eec 100644 --- a/src/core/tools.h +++ b/src/core/tools.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/core/tools.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/core/variable.c b/src/core/variable.c index 2b924a5..0cd9f34 100644 --- a/src/core/variable.c +++ b/src/core/variable.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/core/variable.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/core/variable.h b/src/core/variable.h index 7a7d27c..aa06630 100644 --- a/src/core/variable.h +++ b/src/core/variable.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/core/variable.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/array.c b/src/data/array.c index f50e998..5ae7d3b 100644 --- a/src/data/array.c +++ b/src/data/array.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/array.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/array.h b/src/data/array.h index 6800061..f136c67 100644 --- a/src/data/array.h +++ b/src/data/array.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/array.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/cons.c b/src/data/cons.c index 7331167..8f9d666 100644 --- a/src/data/cons.c +++ b/src/data/cons.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/cons.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/cons.h b/src/data/cons.h index 130415b..c756e58 100644 --- a/src/data/cons.h +++ b/src/data/cons.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/cons.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/dat.c b/src/data/dat.c index b448cdc..9bdbe70 100644 --- a/src/data/dat.c +++ b/src/data/dat.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/dat.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/dat.h b/src/data/dat.h index dcc7928..17f4384 100644 --- a/src/data/dat.h +++ b/src/data/dat.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/dat.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/hash.c b/src/data/hash.c index e196840..81c6470 100644 --- a/src/data/hash.c +++ b/src/data/hash.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/hash.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/hash.h b/src/data/hash.h index 8bf0a49..c7ced44 100644 --- a/src/data/hash.h +++ b/src/data/hash.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/hash.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/list.c b/src/data/list.c index e641133..c90b5d4 100644 --- a/src/data/list.c +++ b/src/data/list.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/list.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/list.h b/src/data/list.h index fb6a9b8..4a9bc80 100644 --- a/src/data/list.h +++ b/src/data/list.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/list.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/map.c b/src/data/map.c index 3c95dc2..bfeb97e 100644 --- a/src/data/map.c +++ b/src/data/map.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/map.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/map.h b/src/data/map.h index c01dbe1..5201800 100644 --- a/src/data/map.h +++ b/src/data/map.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/map.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/queue.c b/src/data/queue.c index 63987a0..8eae930 100644 --- a/src/data/queue.c +++ b/src/data/queue.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/queue.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/queue.h b/src/data/queue.h index 227ce29..a4a45c3 100644 --- a/src/data/queue.h +++ b/src/data/queue.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/queue.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/stack.c b/src/data/stack.c index e6a60a4..7a1910c 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/stack.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/stack.h b/src/data/stack.h index 395dd32..0eb2c95 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/stack.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/tree.c b/src/data/tree.c index c55dcf1..efc2651 100644 --- a/src/data/tree.c +++ b/src/data/tree.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/tree.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/tree.h b/src/data/tree.h index ce9ecc4..24cb892 100644 --- a/src/data/tree.h +++ b/src/data/tree.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/tree.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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. *:*/ @@ -39,7 +39,7 @@ #include "array.h" #include "stack.h" -#ifdef PBSC +#ifdef FYPE #include "../core/token.h" #endif diff --git a/src/data/tupel.c b/src/data/tupel.c index 68c0247..b6463dc 100644 --- a/src/data/tupel.c +++ b/src/data/tupel.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/tupel.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/tupel.h b/src/data/tupel.h index e5d0fe7..ee2a3c4 100644 --- a/src/data/tupel.h +++ b/src/data/tupel.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/tupel.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/data/types.h b/src/data/types.h index 2899dfe..ddfbe5e 100644 --- a/src/data/types.h +++ b/src/data/types.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/types.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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/src/defines.h b/src/defines.h index 9484784..b8d34f8 100644 --- a/src/defines.h +++ b/src/defines.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/defines.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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. *:*/ @@ -42,14 +42,14 @@ #include "build.h" -#define COPYRIGHT "(c) Paul C. Buetow (2005 - 2010) <fype@dev.buetow.org>" +#define COPYRIGHT "(c) Paul Buetow (2005 - 2010) <fype@dev.buetow.org>" #define FYPE #define GRAMMAR_MAP_SIZES 128 #define ARRAY_SIZE 16 #define HASH_MAXOCC 5 #define HASH_MKEYLEN 32 #define HASH_SCALE 10 -#define NAME "Fype2" +#define NAME "LambdaFype" #define LINKER "cc" #define SCANNER_BUFSIZE 512 #define URL "<http://fype.buetow.org>" @@ -1,13 +1,13 @@ /*:* *: File: ./src/fype.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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. *:*/ @@ -39,9 +39,9 @@ #include "core/token.h" #include "core/interpret.h" -PBSc* +Fype* fype_new() { - PBSc *p_fype = malloc(sizeof(PBSc)); + Fype *p_fype = malloc(sizeof(Fype)); p_fype->p_hash_syms = hash_new(512); p_fype->p_list_token = list_new(); @@ -52,7 +52,7 @@ fype_new() { } void -fype_delete(PBSc *p_fype) { +fype_delete(Fype *p_fype) { argv_tupel_delete(p_fype->p_tupel_argv); hash_delete(p_fype->p_hash_syms); @@ -66,7 +66,7 @@ fype_delete(PBSc *p_fype) { int fype_run(int i_argc, char **pc_argv) { - PBSc *p_fype = fype_new(); + Fype *p_fype = fype_new(); // argv: Maintains command line options argv_run(p_fype, i_argc, pc_argv); @@ -1,13 +1,13 @@ /*:* *: File: ./src/fype.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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. *:*/ @@ -48,10 +48,10 @@ typedef struct { List *p_list_token; // Initial list of tokens Hash *p_hash_syms; // Symbol table char *c_basename; -} PBSc; +} Fype; -PBSc *fype_new(); -void fype_delete(PBSc *p_fype); +Fype *fype_new(); +void fype_delete(Fype *p_fype); int fype_run(int i_argc, char **pc_argv); #endif /* FYPE_H */ @@ -1,13 +1,13 @@ /*:* *: File: ./src/main.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 - *: + *: + *: The Fype Language; (c) 2005 - 2010 Paul 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 @@ -15,20 +15,20 @@ *: * 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 + *: * 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 + *: + *: 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) + *: 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 + *: 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. *:*/ @@ -35,7 +35,7 @@ argv_check_argc ./src/argv.c /^argv_check_argc(int i_required, unsigned i_argc_l argv_checkopt ./src/argv.c /^argv_checkopt(char c_opt, Tupel *p_tupel_argv) {$/;" f argv_checkopts ./src/argv.c /^argv_checkopts(char *c_opts, Tupel *p_tupel_argv) {$/;" f argv_help ./src/argv.c /^argv_help() {$/;" f -argv_run ./src/argv.c /^argv_run(PBSc *p_fype, int i_argc, char **pc_argv) {$/;" f +argv_run ./src/argv.c /^argv_run(Fype *p_fype, int i_argc, char **pc_argv) {$/;" f argv_switch ./src/argv.c /^argv_switch(char c_arg, Tupel *p_tupel_argv, unsigned i_argc_left) {$/;" f argv_synopsis ./src/argv.c /^argv_synopsis(Tupel *p_tupel_argv) {$/;" f argv_tupel_delete ./src/argv.c /^argv_tupel_delete(Tupel *p_tupel_argv) {$/;" f @@ -103,7 +103,7 @@ frame_delete ./src/core/frame.c /^frame_delete(Frame *p_frame) {$/;" f frame_get_symbol ./src/core/frame.c /^frame_get_symbol(Frame *p_frame, char *c_name) {$/;" f frame_new ./src/core/frame.c /^frame_new(Frame *p_parent_frame) {$/;" f frame_print ./src/core/frame.c /^frame_print(Frame *p_frame) {$/;" f -fype_delete ./src/fype.c /^fype_delete(PBSc *p_fype) {$/;" f +fype_delete ./src/fype.c /^fype_delete(Fype *p_fype) {$/;" f fype_new ./src/fype.c /^fype_new() {$/;" f fype_run ./src/fype.c /^fype_run(int i_argc, char **pc_argv) {$/;" f get_tt ./src/core/token.c /^get_tt(char *c_token) {$/;" f @@ -128,7 +128,7 @@ hash_size ./src/data/hash.c /^hash_size(Hash *p_hash, int i_size) {$/;" f interpret_delete ./src/core/interpret.c /^interpret_delete(Interpret *p_inter) {$/;" f interpret_new ./src/core/interpret.c /^interpret_new(List *p_list_token) {$/;" f interpret_new_lambda ./src/core/interpret.c /^interpret_new_lambda(Interpret *p_inter, Lambda *p_lambda) {$/;" f -interpret_run ./src/core/interpret.c /^interpret_run(PBSc *p_fype) {$/;" f +interpret_run ./src/core/interpret.c /^interpret_run(Fype *p_fype) {$/;" f lambda_delete ./src/core/lambda.c /^lambda_delete(Lambda *p_lambda) {$/;" f lambda_new ./src/core/lambda.c /^lambda_new(char *c_name, List *p_list_args, ListElem *p_listelem, ListElem *p_listelem_end, Frame *p_frame) {$/;" f lambda_print ./src/core/lambda.c /^lambda_print(Lambda *p_lambda) {$/;" f @@ -226,7 +226,7 @@ scanner_cleanup_list_token_cb ./src/core/scanner.c /^scanner_cleanup_list_token_ scanner_delete ./src/core/scanner.c /^scanner_delete(Scanner *p_scanner) {$/;" f scanner_get_tt_cur ./src/core/scanner.c /^scanner_get_tt_cur(char *c_token) {$/;" f scanner_new ./src/core/scanner.c /^scanner_new(List *p_list_token, Tupel *p_tupel_argv) {$/;" f -scanner_run ./src/core/scanner.c /^scanner_run(PBSc *p_fype) {$/;" f +scanner_run ./src/core/scanner.c /^scanner_run(Fype *p_fype) {$/;" f stack_clear ./src/data/stack.c /^stack_clear(Stack *p_stack) {$/;" f stack_concat ./src/data/stack.c /^stack_concat(Stack *p_stack, Stack *p_stack_concat) {$/;" f stack_delete ./src/data/stack.c /^stack_delete(Stack *p_stack) {$/;" f diff --git a/test.fy b/test.fy deleted file mode 100644 index 4f9af9b..0000000 --- a/test.fy +++ /dev/null @@ -1,23 +0,0 @@ -#* - * Examples of how to use arrays - *# - -# Create a function bar, returns 0 by default -func bar { say "bar" } - -# Create a multi dimensional array foo -my foo = [bar, 1, 4/2, double "3", ["A", ["BA", "BB"]]]; - -# Run on each element of foo recursive 'say' -say foo; - -# Print the length of the array -assert 5 == say len foo; - -# Print the last index of the array -assert 4 == say ind foo; - -# Print the 3rd element of the array -say foo[3]; - -#say "bla"; @@ -1,13 +0,0 @@ -(def (test a) - (def (test2 a2) - (def (test3 a3) - (BEEP)) - (test3 a2)) - (def foo bar) - (def (barrr) foo) - (def (barr) (foo baz)) - (def (bar x) (foo baz)) - (test2 a)) -(test (foo bar baz)) -(say "hello world" 1.2) - |
