From cb1450b796eff3c8830616e2e9a3d83d4dfb4900 Mon Sep 17 00:00:00 2001
From: Paul Buetow
Date: Sat, 18 Oct 2008 22:47:31 +0000
Subject: backdowngrade
---
Makefile | 2 +-
README | 392 ++++++++++++++++++++++------------------------
docs/header.txt | 2 +-
docs/help.txt | 2 +-
docs/pod/fype.1.gz | Bin 6302 -> 6105 bytes
docs/pod/fype.html | 191 ++++++++++------------
docs/pod/fype.man | 157 ++++++++-----------
docs/pod/fype.pod | 142 +++++++----------
docs/pod/fype.tex | 154 ++++++++----------
docs/pod/fype.txt | 392 ++++++++++++++++++++++------------------------
docs/stats.txt | 4 +-
docs/version.txt | 2 +-
examples/all-examples.txt | 335 +++++++++++++++++++++++++++++++++++++++
examples/conditionals.fy | 2 +
examples/types.fy | 4 -
fype | Bin 0 -> 47628 bytes
src/build.h | 2 +-
src/core/convert.c | 23 ---
src/core/function.c | 97 ++++--------
src/core/garbage.c | 15 +-
src/core/interpret.c | 84 +++-------
src/core/scanner.c | 12 +-
src/core/scanner.h | 1 +
src/core/scope.c | 33 +---
src/core/symbol.c | 14 --
src/core/token.c | 133 ++++------------
src/core/token.h | 13 +-
src/data/array.c | 50 ++----
src/data/array.h | 2 -
src/data/hash.c | 4 +-
src/data/stack.c | 17 +-
src/data/stack.h | 3 +-
src/defines.h | 5 +-
src/fype.c | 4 +-
tags | 289 ++++++++++++++++++++++++++++++++++
tmp/test.fy | 25 +--
tmp/test.out | 113 +------------
37 files changed, 1404 insertions(+), 1316 deletions(-)
create mode 100644 examples/all-examples.txt
create mode 100755 fype
create mode 100644 tags
diff --git a/Makefile b/Makefile
index 719200c..5624b2e 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ SRCS!=find ./src -name '*.c'
OBJS=$(SRCS:.c=.o)
CC?=cc
#CC=mingw32-gcc
-DEBUG=-g3 -ggdb3
+#DEBUG=-g3 -ggdb3
CFLAGS+=-c -Wall -std=c99 -pedantic $(DEBUG)
LDADD+=
HEADER?=docs/header.txt
diff --git a/README b/README
index b6f6969..66a9695 100644
--- a/README
+++ b/README
@@ -75,6 +75,42 @@ GETTING STARTED
See the ./examples subdir of the Fype source distribution for examples!
See also fype -h for a list of all options.
+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.
+
+ The basic data types
+ *integer*
+ Specifies an integer number
+
+ *double*
+ Specifies a double number
+
+ *string*
+ Specifies a string
+
+ *number*
+ May be an integer or a double number
+
+ *any*
+ May be of any type above
+
+ *void*
+ No type
+
+ *identifier*
+ It's a variable name or a procedure name or a function name
+
+ Explicit type conversions
+ (*integer*) integer *any*
+ Converts any type to an integer
+
+ (*double*) double *any*
+ Converts any type to a double
+
+ (*string*) string *any*
+ Converts any type to a string
+
SYNTAX
Comments
Text from a # character until the end of the current line is considered
@@ -90,8 +126,8 @@ SYNTAX
say foo;
exit foo - bar;
- Parenthesis
- All parenthesis of function calls are optional. They help to make the
+ Paranthesis
+ All paranthesis of function calls are optional. They help to make the
code better readable. They also help to force precedences of
expressions.
@@ -139,270 +175,216 @@ SYNTAX
Runs the statements as long as the the expression evaluates to a
false value.
-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.
-
- The basic data types
- *integer*
- (Internal name TT_INTEGER)
-
- *double*
- (Internal name TT_DOUBLE)
-
- *string*
- (Internal name TT_STRING)
-
- *array*
- (Internal name TT_ARRAY)
-
- *number*
- May be an integer or a double number
-
- *any*
- May be of any type above
-
- *void*
- No type
-
- *identifier*
- It's a variable name or a procedure name or a function name
-
- Explicit type conversions
- The data types inside the brackets are only showing the return types of
- each function.
-
- (*integer*) integer *any*
- Converts any type to an integer.
-
- (*double*) double *any*
- Converts any type to a double.
-
- (*string*) string *any*
- Converts any type to a string.
-
- (*array*) array *any*
- Converts any type to an array. This function is not yet implemented.
-
- More functions for data types
- (*string*) type *any*
- Returns the name of the current type. Examples:
-
- my foo = 1;
- put type foo; # Prints "TT_INTEGER"
- put type 1.2; # Prints "TT_DOUBLE"
-
VARIABLES
- Variables can be defined with the 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 undef keyword! Example of defining variables:
+ Variables can be defined with the 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 undef keyword! Example of defining variables:
- my foo = 1 + 2;
- say foo;
+ my foo = 1 + 2;
+ say foo;
- my bar = 12, baz = foo;
- say 1 + bar;
- say bar;
+ my bar = 12, baz = foo;
+ say 1 + bar;
+ say bar;
- my baz;
- say baz; # Will print out 0
+ my baz;
+ say baz; # Will print out 0
- You may use the defined keyword to check if an identifier has been
- defined or not.
+ You may use the defined keyword to check if an identifier has been
+ defined or not.
- ifnot defined foo {
- say "No foo yet defined";
- }
+ ifnot defined foo {
+ say "No foo yet defined";
+ }
- my foo = 1;
+ my foo = 1;
- if defined foo {
- put "foo is defined and has the value ";
- say foo;
- }
+ if defined foo {
+ put "foo is defined and has the value ";
+ say foo;
+ }
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.
+ 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.
Math
- (*any*) *any* + *any*
- Special string behavior: A string will get auto convertet into
- an *integer*.
+ (*any*) *any* + *any*
+ Special string behavior: A string will get auto convertet into an
+ *integer*.
- (*any*) *any* - *any*
- Special string behavior: A string will get auto convertet into
- an *integer*.
+ (*any*) *any* - *any*
+ Special string behavior: A string will get auto convertet into an
+ *integer*.
- (*any*) *any* * *any*
- Special string behavior: A string will get auto convertet into
- an *integer*.
+ (*any*) *any* * *any*
+ Special string behavior: A string will get auto convertet into an
+ *integer*.
- (*any*) *any* / *any*
- Special string behavior: A string will get auto convertet into
- an *integer*.
+ (*any*) *any* / *any*
+ Special string behavior: A string will get auto convertet into an
+ *integer*.
Conditional
- (*integer*) *any* == *any*
- (*integer*) *any* != *any*
- (*integer*) *any* <= *any*
- (*integer*) *any* >= *any*
- (*integer*) *any* < *any*
- (*integer*) *any* > *any*
- (*integer*) not *any*
+ (*integer*) *any* == *any*
+ (*integer*) *any* != *any*
+ (*integer*) *any* <= *any*
+ (*integer*) *any* >= *any*
+ (*integer*) *any* < *any*
+ (*integer*) *any* > *any*
+ (*integer*) not *any*
Definedness
- (*integer*) defined *identifier*
- Returns 1 if *identifier* has been defined. Returns 0 else.
+ (*integer*) defined *identifier*
+ Returns 1 if *identifier* has been defined. Returns 0 else.
- (*integer*) undef *identifier*
- Tries to undefine/delete the *identifier*. Returns 1 if success,
- otherwise 0 is returned.
+ (*integer*) undef *identifier*
+ Tries to undefine/delete the *identifier*. Returns 1 if success,
+ otherwise 0 is returned.
Bitwise
- (*integer*) *any* :< *any*
- (*integer*) *any* :> *any*
- (*integer*) *any* and *any*
- (*integer*) *any* or *any*
- (*integer*) *any* xor *any*
+ (*integer*) *any* :< *any*
+ (*integer*) *any* :> *any*
+ (*integer*) *any* and *any*
+ (*integer*) *any* or *any*
+ (*integer*) *any* xor *any*
Numeric
- (*number*) neg *number*
- This function returns the negative value of *any*
+ (*number*) neg *number*
+ This function returns the negative value of *any*
- (*integer*) no [*integer*]
- This function returns 1 if the argument is 0, otherwise it will
- return 0! If no argument is given, then 0 is returned!
+ (*integer*) no [*integer*]
+ This function returns 1 if the argument is 0, otherwise it will
+ return 0! If no argument is given, then 0 is returned!
- (*integer*) yes [*integer*]
- This function always returns 1. The parameter is optional.
+ (*integer*) yes [*integer*]
+ This function always returns 1. The parameter is optional.
- # Prints out 1, because foo is not defined
- if yes { say no defined foo; }
+ # Prints out 1, because foo is not defined
+ if yes { say no defined foo; }
System
- (*void*) end
- Exits the program with the exit status of 0
+ (*void*) end
+ Exits the program with the exit status of 0
- (*void*) exit *integer*
- Exits the program with the specified exit status
+ (*void*) exit *integer*
+ Exits the program with the specified exit status
- (*integer*) fork
- Fork forks a subprocess. It returns 0 for the child process and
- the pid of the child process otherwise! Example:
+ (*integer*) fork
+ Fork forks a subprocess. It returns 0 for the child process and the
+ pid of the child process otherwise! Example:
- my pid = fork;
+ my pid = fork;
- if pid {
- put "I am the parent process; child has the pid ";
- say pid;
+ if pid {
+ put "I am the parent process; child has the pid ";
+ say pid;
- } ifnot pid {
- say "I am the child process";
- }
+ } ifnot pid {
+ say "I am the child process";
+ }
- (*integer*) 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!
+ (*integer*) 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!
I/O
- (*any*) put *any*
- Prints out the argument
+ (*any*) put *any*
+ Prints out the argument
- (*any*) say *any*
- Same as put, but also includes an ending newline
+ (*any*) say *any*
+ Same as put, but also includes an ending newline
- (*void*) ln
- Just prints a newline
+ (*void*) ln
+ Just prints a newline
SELF DEFINING PROCEDURES AND FUNCTIONS
Procedures
- A procedure can be defined with the proc keyword and deleted with
- the 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;
- }
+ A procedure can be defined with the proc keyword and deleted with the
+ 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;
+ my a = 2, b = 4;
- foo; # Run the procedure. Print out "11\n"
- say c; # Print out "6\n";
+ foo; # Run the procedure. Print out "11\n"
+ say c; # Print out "6\n";
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 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";
- }
- }
+ 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 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;
+ # 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!
+ 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!
Functions
- A function should be defined with the func keyword and deleted with
- the 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;
- }
+ A function should be defined with the func keyword and deleted with the
+ 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;
+ 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!
+ foo; # Run the procedure. Print out "11\n"
+ say c; # Will produce an error, because c is out of scoped!
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!
+ 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";
- }
+ func foo {
+ func bar {
+ say "Hello i am nested";
+ }
- bar; # Calling nested
- }
+ bar; # Calling nested
+ }
- foo;
- bar; # Will produce an error, because bar is out of scope!
+ foo;
+ bar; # Will produce an error, because bar is out of scope!
AUTHOR
- Paul C. Buetow (http://paul.buetow.org)
+ Paul C. Buetow (http://paul.buetow.org)
WEBSITE
- The Fype Language (http://fype.buetow.org)
+ The Fype Language (http://fype.buetow.org)
SEE ALSO
- awk(1) cc(1)
+ awk(1) cc(1) make(1)
diff --git a/docs/header.txt b/docs/header.txt
index 651e6e9..d673a17 100644
--- a/docs/header.txt
+++ b/docs/header.txt
@@ -1,5 +1,5 @@
File: ${FILE}
-A simple interpreter
+A simple interpreter
WWW : http://fype.buetow.org
E-Mail : fype@dev.buetow.org
diff --git a/docs/help.txt b/docs/help.txt
index 66881ef..b99470f 100644
--- a/docs/help.txt
+++ b/docs/help.txt
@@ -1,4 +1,4 @@
-Fype v0.1-devel Build 9640
+Fype v0.1-devel Build 9213
Copyright by Paul C. Buetow (2005 - 2008)
-e Executes given code string (see synopses)
-h Prints this help
diff --git a/docs/pod/fype.1.gz b/docs/pod/fype.1.gz
index 29ae39d..e05d4c5 100644
Binary files a/docs/pod/fype.1.gz and b/docs/pod/fype.1.gz differ
diff --git a/docs/pod/fype.html b/docs/pod/fype.html
index 47397a4..b88a1b4 100644
--- a/docs/pod/fype.html
+++ b/docs/pod/fype.html
@@ -20,24 +20,23 @@
PARSING / CODE GENERATION
REQUIREMENTS
GETTING STARTED
+ DATA TYPES
+
+
SYNTAX
- DATA TYPES
-
-
VARIABLES
BUILT IN FUNCTIONS
@@ -133,81 +132,6 @@ TODO file of the source distribution of Fype!
-
-
-
-
-Text from a # character until the end of the current line is considered being a comment. Multi line comments may start with an #* and and with an *# anywhere. Exceptions are if those signs are inside of strings.
-
-
-
-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;
-
-
-
-All parenthesis of function calls are optional. They help to make the code better readable. They also help to force precedences of expressions.
-
-
-
-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. Here is a small example how to use scopes:
-
- my foo = 1;
-
- {
- # Prints out 1
- put defined foo;
- {
- my bar = 2;
-
- # Prints out 1
- put defined bar;
- }
-
- # Prints out 0
- put defined bar;
-
- my baz = 3;
- }
-
- # Prints out 0
- say defined bar;
-
-
-
-Fype knows the following control statements:
-
-- if <expression> { <statements> }
-
-
-
-
Runs the statements if the expression evaluates to a true value.
-
-
-- ifnot <expression> { <statements> }
-
-
-
-
Runs the statements if the expression evaluates to a false value.
-
-
-- while <expression> { <statements> }
-
-
-
-
Runs the statements as long as the the expression evaluates to a true value.
-
-
-- until <expression> { <statements> }
-
-
-
-
Runs the statements as long as the the expression evaluates to a false value.
-
-
-
-
-
-
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.
@@ -217,25 +141,19 @@ TODO file of the source distribution of Fype!
integer
-(Internal name TT_INTEGER)
+Specifies an integer number
double
-(Internal name TT_DOUBLE)
+Specifies a double number
string
-(Internal name TT_STRING)
-
-
-array
-
-
-(Internal name TT_ARRAY)
+Specifies a string
number
@@ -266,47 +184,98 @@ TODO file of the source distribution of Fype!
-The data types inside the brackets are only showing the return types of each function.
- (integer) integer any
-
-
Converts any type to an integer.
+Converts any type to an integer
- (double) double any
-
-
Converts any type to a double.
+Converts any type to a double
- (string) string any
-
-
Converts any type to a string.
-
-
-- (array) array any
-
-
-
-
Converts any type to an array. This function is not yet implemented.
+Converts any type to a string
-
+
+
+
+
+
+Text from a # character until the end of the current line is considered being a comment. Multi line comments may start with an #* and and with an *# anywhere. Exceptions are if those signs are inside of strings.
+
+
+
+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;
+
+
+
+All paranthesis of function calls are optional. They help to make the code better readable. They also help to force precedences of expressions.
+
+
+
+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. Here is a small example how to use scopes:
+
+ my foo = 1;
+
+ {
+ # Prints out 1
+ put defined foo;
+ {
+ my bar = 2;
+
+ # Prints out 1
+ put defined bar;
+ }
+
+ # Prints out 0
+ put defined bar;
+
+ my baz = 3;
+ }
+
+ # Prints out 0
+ say defined bar;
+
+
+
+Fype knows the following control statements:
-- (string) type any
+
- if <expression> { <statements> }
-
-
Returns the name of the current type. Examples:
+Runs the statements if the expression evaluates to a true value.
+
+- ifnot <expression> { <statements> }
+
-
-
- my foo = 1;
- put type foo; # Prints "TT_INTEGER"
- put type 1.2; # Prints "TT_DOUBLE"
+Runs the statements if the expression evaluates to a false value.
+
+
+- while <expression> { <statements> }
+
+
-
+
Runs the statements as long as the the expression evaluates to a true value.
+
+
+- until <expression> { <statements> }
+
+
-
+
Runs the statements as long as the the expression evaluates to a false value.
@@ -611,7 +580,7 @@ keyword in order to check if a procedure has been defined or not.
-awk(1) cc(1)
+
awk(1) cc(1) make(1)
diff --git a/docs/pod/fype.man b/docs/pod/fype.man
index 1be72ec..b3d89bf 100644
--- a/docs/pod/fype.man
+++ b/docs/pod/fype.man
@@ -129,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title "FYPE 1"
-.TH FYPE 1 "2008-09-16" "Fype v0.1-devel Build 9269" "The Fype Users Manual Page"
+.TH FYPE 1 "2008-09-06" "Fype v0.1-devel Build 9208" "The Fype Users Manual Page"
.SH "NAME"
\&\fBFype\fR is \fBF\fRor \fBY\fRour \fBP\fRrogram \fBE\fRxecution
.PP
@@ -201,6 +201,43 @@ Run a .fy file:
.Ve
.PP
See the ./examples subdir of the Fype source distribution for examples! See also fype \-h for a list of all options.
+.SH "DATA TYPES"
+.IX Header "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.
+.Sh "The basic data types"
+.IX Subsection "The basic data types"
+.IP "\fIinteger\fR" 4
+.IX Item "integer"
+Specifies an integer number
+.IP "\fIdouble\fR" 4
+.IX Item "double"
+Specifies a double number
+.IP "\fIstring\fR" 4
+.IX Item "string"
+Specifies a string
+.IP "\fInumber\fR" 4
+.IX Item "number"
+May be an integer or a double number
+.IP "\fIany\fR" 4
+.IX Item "any"
+May be of any type above
+.IP "\fIvoid\fR" 4
+.IX Item "void"
+No type
+.IP "\fIidentifier\fR" 4
+.IX Item "identifier"
+It's a variable name or a procedure name or a function name
+.Sh "Explicit type conversions"
+.IX Subsection "Explicit type conversions"
+.IP "(\fIinteger\fR) \fBinteger\fR \fIany\fR" 4
+.IX Item "(integer) integer any"
+Converts any type to an integer
+.IP "(\fIdouble\fR) \fBdouble\fR \fIany\fR" 4
+.IX Item "(double) double any"
+Converts any type to a double
+.IP "(\fIstring\fR) \fBstring\fR \fIany\fR" 4
+.IX Item "(string) string any"
+Converts any type to a string
.SH "SYNTAX"
.IX Header "SYNTAX"
.Sh "Comments"
@@ -215,9 +252,9 @@ A Fype program is a list of statements. Each keyword, expression or function cal
\& say foo;
\& exit foo - bar;
.Ve
-.Sh "Parenthesis"
-.IX Subsection "Parenthesis"
-All parenthesis of function calls are optional. They help to make the code better readable. They also help to force precedences of expressions.
+.Sh "Paranthesis"
+.IX Subsection "Paranthesis"
+All paranthesis of function calls are optional. They help to make the code better readable. They also help to force precedences of expressions.
.Sh "Scopeing"
.IX Subsection "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. Here is a small example how to use scopes:
@@ -269,94 +306,39 @@ Runs the statements as long as the the expression evaluates to a true value.
.IP "until \fI { \fI }" 4
.IX Item "until { }"
Runs the statements as long as the the expression evaluates to a false value.
-.SH "DATA TYPES"
-.IX Header "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.
-.Sh "The basic data types"
-.IX Subsection "The basic data types"
-.IP "\fIinteger\fR" 4
-.IX Item "integer"
-(Internal name \s-1TT_INTEGER\s0)
-.IP "\fIdouble\fR" 4
-.IX Item "double"
-(Internal name \s-1TT_DOUBLE\s0)
-.IP "\fIstring\fR" 4
-.IX Item "string"
-(Internal name \s-1TT_STRING\s0)
-.IP "\fIarray\fR" 4
-.IX Item "array"
-(Internal name \s-1TT_ARRAY\s0)
-.IP "\fInumber\fR" 4
-.IX Item "number"
-May be an integer or a double number
-.IP "\fIany\fR" 4
-.IX Item "any"
-May be of any type above
-.IP "\fIvoid\fR" 4
-.IX Item "void"
-No type
-.IP "\fIidentifier\fR" 4
-.IX Item "identifier"
-It's a variable name or a procedure name or a function name
-.Sh "Explicit type conversions"
-.IX Subsection "Explicit type conversions"
-The data types inside the brackets are only showing the return types of each function.
-.IP "(\fIinteger\fR) \fBinteger\fR \fIany\fR" 4
-.IX Item "(integer) integer any"
-Converts any type to an integer.
-.IP "(\fIdouble\fR) \fBdouble\fR \fIany\fR" 4
-.IX Item "(double) double any"
-Converts any type to a double.
-.IP "(\fIstring\fR) \fBstring\fR \fIany\fR" 4
-.IX Item "(string) string any"
-Converts any type to a string.
-.IP "(\fIarray\fR) \fBarray\fR \fIany\fR" 4
-.IX Item "(array) array any"
-Converts any type to an array. This function is not yet implemented.
-.Sh "More functions for data types"
-.IX Subsection "More functions for data types"
-.IP "(\fIstring\fR) \fBtype\fR \fIany\fR" 4
-.IX Item "(string) type any"
-Returns the name of the current type. Examples:
-.Sp
-.Vb 3
-\& my foo = 1;
-\& put type foo; # Prints "TT_INTEGER"
-\& put type 1.2; # Prints "TT_DOUBLE"
-.Ve
.SH "VARIABLES"
.IX Header "VARIABLES"
Variables can be defined with the \fBmy\fR 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 \fBundef\fR keyword! Example of defining variables:
-.Sp
+.PP
.Vb 2
\& my foo = 1 + 2;
\& say foo;
.Ve
-.Sp
+.PP
.Vb 3
\& my bar = 12, baz = foo;
\& say 1 + bar;
\& say bar;
.Ve
-.Sp
+.PP
.Vb 2
\& my baz;
\& say baz; # Will print out 0
.Ve
-.Sp
+.PP
You may use the \fBdefined\fR keyword to check if an identifier has been defined or
not.
-.Sp
+.PP
.Vb 3
\& ifnot defined foo {
\& say "No foo yet defined";
\& }
.Ve
-.Sp
+.PP
.Vb 1
\& my foo = 1;
.Ve
-.Sp
+.PP
.Vb 4
\& if defined foo {
\& put "foo is defined and has the value ";
@@ -368,7 +350,6 @@ not.
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.
.Sh "Math"
.IX Subsection "Math"
-.RS 4
.IP "(\fIany\fR) \fIany\fR \fB+\fR \fIany\fR" 4
.IX Item "(any) any + any"
Special string behavior: A string will get auto convertet into an \fIinteger\fR.
@@ -381,8 +362,6 @@ Special string behavior: A string will get auto convertet into an \fIinteger\fR.
.IP "(\fIany\fR) \fIany\fR \fB/\fR \fIany\fR" 4
.IX Item "(any) any / any"
Special string behavior: A string will get auto convertet into an \fIinteger\fR.
-.RE
-.RS 4
.Sh "Conditional"
.IX Subsection "Conditional"
.IP "(\fIinteger\fR) \fIany\fR \fB==\fR \fIany\fR" 4
@@ -400,8 +379,6 @@ Special string behavior: A string will get auto convertet into an \fIinteger\fR.
.IX Item "(integer) any > any"
.IP "(\fIinteger\fR) \fBnot\fR \fIany\fR" 4
.IX Item "(integer) not any"
-.RE
-.RS 4
.PD
.Sh "Definedness"
.IX Subsection "Definedness"
@@ -411,8 +388,6 @@ Returns 1 if \fIidentifier\fR has been defined. Returns 0 else.
.IP "(\fIinteger\fR) \fBundef\fR \fIidentifier\fR" 4
.IX Item "(integer) undef identifier"
Tries to undefine/delete the \fIidentifier\fR. Returns 1 if success, otherwise 0 is returned.
-.RE
-.RS 4
.Sh "Bitwise"
.IX Subsection "Bitwise"
.IP "(\fIinteger\fR) \fIany\fR \fB:<\fR \fIany\fR" 4
@@ -426,8 +401,6 @@ Tries to undefine/delete the \fIidentifier\fR. Returns 1 if success, otherwise 0
.IX Item "(integer) any or any"
.IP "(\fIinteger\fR) \fIany\fR \fBxor\fR \fIany\fR" 4
.IX Item "(integer) any xor any"
-.RE
-.RS 4
.PD
.Sh "Numeric"
.IX Subsection "Numeric"
@@ -446,8 +419,6 @@ This function always returns 1. The parameter is optional.
\& # Prints out 1, because foo is not defined
\& if yes { say no defined foo; }
.Ve
-.RE
-.RS 4
.Sh "System"
.IX Subsection "System"
.IP "(\fIvoid\fR) \fBend\fR" 4
@@ -482,8 +453,6 @@ 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!
-.RE
-.RS 4
.Sh "I/O"
.IX Subsection "I/O"
.IP "(\fIany\fR) \fBput\fR \fIany\fR" 4
@@ -495,25 +464,23 @@ Same as put, but also includes an ending newline
.IP "(\fIvoid\fR) \fBln\fR" 4
.IX Item "(void) ln"
Just prints a newline
-.RE
-.RS 4
.SH "SELF DEFINING PROCEDURES AND FUNCTIONS"
.IX Header "SELF DEFINING PROCEDURES AND FUNCTIONS"
.Sh "Procedures"
.IX Subsection "Procedures"
A procedure can be defined with the \fBproc\fR keyword and deleted with the \fBundef\fR 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.
-.Sp
+.PP
.Vb 4
\& proc foo {
\& say 1 + a * 3 + b;
\& my c = 6;
\& }
.Ve
-.Sp
+.PP
.Vb 1
\& my a = 2, b = 4;
.Ve
-.Sp
+.PP
.Vb 2
\& foo; # Run the procedure. Print out "11\en"
\& say c; # Print out "6\en";
@@ -524,12 +491,12 @@ 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 \fBdefined\fR
keyword in order to check if a procedure has been defined or not.
-.Sp
+.PP
.Vb 2
\& proc foo {
\& say "I am foo";
.Ve
-.Sp
+.PP
.Vb 5
\& undef bar;
\& proc bar {
@@ -537,13 +504,13 @@ keyword in order to check if a procedure has been defined or not.
\& }
\& }
.Ve
-.Sp
+.PP
.Vb 3
\& # Here bar would produce an error because
\& # the proc is not yet defined!
\& # bar;
.Ve
-.Sp
+.PP
.Vb 3
\& foo; # Here the procedure foo will define the procedure bar!
\& bar; # Now the procedure bar is defined!
@@ -552,18 +519,18 @@ keyword in order to check if a procedure has been defined or not.
.Sh "Functions"
.IX Subsection "Functions"
A function should be defined with the \fBfunc\fR keyword and deleted with the \fBundef\fR 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).
-.Sp
+.PP
.Vb 4
\& func foo {
\& say 1 + a * 3 + b;
\& my c = 6;
\& }
.Ve
-.Sp
+.PP
.Vb 1
\& my a = 2, b = 4;
.Ve
-.Sp
+.PP
.Vb 2
\& foo; # Run the procedure. Print out "11\en"
\& say c; # Will produce an error, because c is out of scoped!
@@ -571,19 +538,19 @@ A function should be defined with the \fBfunc\fR keyword and deleted with the \f
.Sh "Nested functions"
.IX Subsection "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!
-.Sp
+.PP
.Vb 4
\& func foo {
\& func bar {
\& say "Hello i am nested";
\& }
.Ve
-.Sp
+.PP
.Vb 2
\& bar; # Calling nested
\& }
.Ve
-.Sp
+.PP
.Vb 2
\& foo;
\& bar; # Will produce an error, because bar is out of scope!
@@ -596,4 +563,4 @@ Paul C. Buetow (http://paul.buetow.org)
The Fype Language (http://fype.buetow.org)
.SH "SEE ALSO"
.IX Header "SEE ALSO"
-\&\fIawk\fR\|(1) \fIcc\fR\|(1)
+\&\fIawk\fR\|(1) \fIcc\fR\|(1) \fImake\fR\|(1)
diff --git a/docs/pod/fype.pod b/docs/pod/fype.pod
index 6ec8061..2e41645 100644
--- a/docs/pod/fype.pod
+++ b/docs/pod/fype.pod
@@ -68,6 +68,62 @@ Run a .fy file:
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
+
+Specifies an integer number
+
+=item I
+
+Specifies a double number
+
+=item I
+
+Specifies a string
+
+=item I
+
+May be an integer or a double number
+
+=item I
+
+May be of any type above
+
+=item I
+
+No type
+
+=item I
+
+It's a variable name or a procedure name or a function name
+
+=back
+
+=head2 Explicit type conversions
+
+=over
+
+=item (I) B I
+
+Converts any type to an integer
+
+=item (I) B I
+
+Converts any type to a double
+
+=item (I) B I
+
+Converts any type to a string
+
+=back
+
=head1 SYNTAX
=head2 Comments
@@ -82,9 +138,9 @@ A Fype program is a list of statements. Each keyword, expression or function cal
say foo;
exit foo - bar;
-=head2 Parenthesis
+=head2 Paranthesis
-All parenthesis of function calls are optional. They help to make the code better readable. They also help to force precedences of expressions.
+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
@@ -135,84 +191,6 @@ Runs the statements as long as the the expression evaluates to a false value.
=back
-=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
-
-(Internal name TT_INTEGER)
-
-=item I
-
-(Internal name TT_DOUBLE)
-
-=item I
-
-(Internal name TT_STRING)
-
-=item I
-
-(Internal name TT_ARRAY)
-
-=item I
-
-May be an integer or a double number
-
-=item I
-
-May be of any type above
-
-=item I
-
-No type
-
-=item I
-
-It's a variable name or a procedure name or a function name
-
-=back
-
-=head2 Explicit type conversions
-
-The data types inside the brackets are only showing the return types of each function.
-
-=over
-
-=item (I) B I
-
-Converts any type to an integer.
-
-=item (I) B I
-
-Converts any type to a double.
-
-=item (I) B I
-
-Converts any type to a string.
-
-=item (I) B I
-
-Converts any type to an array. This function is not yet implemented.
-
-=back
-
-=head2 More functions for data types
-
-=over
-
-=item (I) B I
-
-Returns the name of the current type. Examples:
-
- my foo = 1;
- put type foo; # Prints "TT_INTEGER"
- put type 1.2; # Prints "TT_DOUBLE"
-
=head1 VARIABLES
Variables can be defined with the B 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 keyword! Example of defining variables:
@@ -445,7 +423,7 @@ A function should be defined with the B keyword and deleted with the B= *any*
- (*integer*) *any* < *any*
- (*integer*) *any* > *any*
- (*integer*) not *any*
+ (*integer*) *any* == *any*
+ (*integer*) *any* != *any*
+ (*integer*) *any* <= *any*
+ (*integer*) *any* >= *any*
+ (*integer*) *any* < *any*
+ (*integer*) *any* > *any*
+ (*integer*) not *any*
Definedness
- (*integer*) defined *identifier*
- Returns 1 if *identifier* has been defined. Returns 0 else.
+ (*integer*) defined *identifier*
+ Returns 1 if *identifier* has been defined. Returns 0 else.
- (*integer*) undef *identifier*
- Tries to undefine/delete the *identifier*. Returns 1 if success,
- otherwise 0 is returned.
+ (*integer*) undef *identifier*
+ Tries to undefine/delete the *identifier*. Returns 1 if success,
+ otherwise 0 is returned.
Bitwise
- (*integer*) *any* :< *any*
- (*integer*) *any* :> *any*
- (*integer*) *any* and *any*
- (*integer*) *any* or *any*
- (*integer*) *any* xor *any*
+ (*integer*) *any* :< *any*
+ (*integer*) *any* :> *any*
+ (*integer*) *any* and *any*
+ (*integer*) *any* or *any*
+ (*integer*) *any* xor *any*
Numeric
- (*number*) neg *number*
- This function returns the negative value of *any*
+ (*number*) neg *number*
+ This function returns the negative value of *any*
- (*integer*) no [*integer*]
- This function returns 1 if the argument is 0, otherwise it will
- return 0! If no argument is given, then 0 is returned!
+ (*integer*) no [*integer*]
+ This function returns 1 if the argument is 0, otherwise it will
+ return 0! If no argument is given, then 0 is returned!
- (*integer*) yes [*integer*]
- This function always returns 1. The parameter is optional.
+ (*integer*) yes [*integer*]
+ This function always returns 1. The parameter is optional.
- # Prints out 1, because foo is not defined
- if yes { say no defined foo; }
+ # Prints out 1, because foo is not defined
+ if yes { say no defined foo; }
System
- (*void*) end
- Exits the program with the exit status of 0
+ (*void*) end
+ Exits the program with the exit status of 0
- (*void*) exit *integer*
- Exits the program with the specified exit status
+ (*void*) exit *integer*
+ Exits the program with the specified exit status
- (*integer*) fork
- Fork forks a subprocess. It returns 0 for the child process and
- the pid of the child process otherwise! Example:
+ (*integer*) fork
+ Fork forks a subprocess. It returns 0 for the child process and the
+ pid of the child process otherwise! Example:
- my pid = fork;
+ my pid = fork;
- if pid {
- put "I am the parent process; child has the pid ";
- say pid;
+ if pid {
+ put "I am the parent process; child has the pid ";
+ say pid;
- } ifnot pid {
- say "I am the child process";
- }
+ } ifnot pid {
+ say "I am the child process";
+ }
- (*integer*) 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!
+ (*integer*) 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!
I/O
- (*any*) put *any*
- Prints out the argument
+ (*any*) put *any*
+ Prints out the argument
- (*any*) say *any*
- Same as put, but also includes an ending newline
+ (*any*) say *any*
+ Same as put, but also includes an ending newline
- (*void*) ln
- Just prints a newline
+ (*void*) ln
+ Just prints a newline
SELF DEFINING PROCEDURES AND FUNCTIONS
Procedures
- A procedure can be defined with the proc keyword and deleted with
- the 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;
- }
+ A procedure can be defined with the proc keyword and deleted with the
+ 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;
+ my a = 2, b = 4;
- foo; # Run the procedure. Print out "11\n"
- say c; # Print out "6\n";
+ foo; # Run the procedure. Print out "11\n"
+ say c; # Print out "6\n";
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 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";
- }
- }
+ 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 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;
+ # 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!
+ 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!
Functions
- A function should be defined with the func keyword and deleted with
- the 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;
- }
+ A function should be defined with the func keyword and deleted with the
+ 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;
+ 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!
+ foo; # Run the procedure. Print out "11\n"
+ say c; # Will produce an error, because c is out of scoped!
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!
+ 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";
- }
+ func foo {
+ func bar {
+ say "Hello i am nested";
+ }
- bar; # Calling nested
- }
+ bar; # Calling nested
+ }
- foo;
- bar; # Will produce an error, because bar is out of scope!
+ foo;
+ bar; # Will produce an error, because bar is out of scope!
AUTHOR
- Paul C. Buetow (http://paul.buetow.org)
+ Paul C. Buetow (http://paul.buetow.org)
WEBSITE
- The Fype Language (http://fype.buetow.org)
+ The Fype Language (http://fype.buetow.org)
SEE ALSO
- awk(1) cc(1)
+ awk(1) cc(1) make(1)
diff --git a/docs/stats.txt b/docs/stats.txt
index 207f2b8..b49fcc8 100644
--- a/docs/stats.txt
+++ b/docs/stats.txt
@@ -1,4 +1,4 @@
===> Num of C source files : 42
-===> Num of C source lines : 7714
+===> Num of C source lines : 7460
===> Num of Fype source examples : 13
-===> Num of Fype source lines : 323
+===> Num of Fype source lines : 321
diff --git a/docs/version.txt b/docs/version.txt
index 549fead..10949e7 100644
--- a/docs/version.txt
+++ b/docs/version.txt
@@ -1 +1 @@
-Fype v0.1-devel Build 9640
+Fype v0.1-devel Build 9213
diff --git a/examples/all-examples.txt b/examples/all-examples.txt
new file mode 100644
index 0000000..bdf199f
--- /dev/null
+++ b/examples/all-examples.txt
@@ -0,0 +1,335 @@
+
+#*
+ * 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 0
+ assert 0 == (put defined bar);
+
+ my baz = 3;
+}
+
+# Prints out 0
+assert 0 == (say defined bar);
+
+
+
+#*
+ * 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/conditionals.fy b/examples/conditionals.fy
index 2dc027f..1260ae2 100644
--- a/examples/conditionals.fy
+++ b/examples/conditionals.fy
@@ -37,3 +37,5 @@ assert 1 == (put 1 >= 1);
assert 1 == (put 1 >= 0);
assert 0 == (put 0 >= 1);
assert 1 == (say 0 >= 0);
+
+
diff --git a/examples/types.fy b/examples/types.fy
index 1ac9751..1b9a0ac 100644
--- a/examples/types.fy
+++ b/examples/types.fy
@@ -12,7 +12,3 @@ assert 2 == say integer 2.8; # Rounds down to the Integer 2
assert say integer double string put say neg 12; # Nonsense but working :)
-assert "TT_INTEGER" == say type 1;
-assert "TT_DOUBLE" == say type 1.0;
-assert "TT_STRING" == say type "1";
-assert "TT_ARRAY" == say type [1 2 3];
diff --git a/fype b/fype
new file mode 100755
index 0000000..fdb0ae5
Binary files /dev/null and b/fype differ
diff --git a/src/build.h b/src/build.h
index cb7e720..ced3b51 100644
--- a/src/build.h
+++ b/src/build.h
@@ -35,7 +35,7 @@
#ifndef BUILD_H
#define BUILD_H
-#define BUILDNR 9654
+#define BUILDNR 9214
#define OS_FREEBSD
#endif
diff --git a/src/core/convert.c b/src/core/convert.c
index fa1282d..73fb8a2 100644
--- a/src/core/convert.c
+++ b/src/core/convert.c
@@ -33,7 +33,6 @@
*:*/
#include "convert.h"
-#include "../data/array.h"
void
convert_to_integer(Token *p_token) {
@@ -48,10 +47,6 @@ convert_to_integer(Token *p_token) {
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)-1);
- break;
default:
ERROR("Ouups(%s)", tt_get_name(token_get_tt(p_token)));
break;
@@ -67,9 +62,6 @@ convert_to_integer_get(Token *p_token) {
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)-1);
- break;
default:
ERROR("Ouups(%s)", tt_get_name(token_get_tt(p_token)));
}
@@ -90,10 +82,6 @@ convert_to_double(Token *p_token) {
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)-1);
- break;
default:
token_print_val(p_token);
ERROR("Datatype conversion error '%s'", token_get_val(p_token));
@@ -127,17 +115,6 @@ convert_to_string(Token *p_token) {
}
break;
case TT_STRING:
- break;
- 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)-1);
- 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;
- //array_iterate(p_token->p_array, token_delete_cb);
-
break;
default:
ERROR("Datatype conversion error");
diff --git a/src/core/function.c b/src/core/function.c
index fdbf308..fda40b8 100644
--- a/src/core/function.c
+++ b/src/core/function.c
@@ -51,34 +51,6 @@
token_get_val(t) \
)
-void
-_print_val(Token *p_token) {
- 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;
- case TT_ARRAY:
- {
- Array *p_array = p_token->p_array;
- ArrayIterator *p_iter = arrayiterator_new(p_array);
- while (arrayiterator_has_next(p_iter)) {
- Token *p_next = arrayiterator_next(p_iter);
- _print_val(p_next);
- printf(" ");
- }
- arrayiterator_delete(p_iter);
- }
- break;
- NO_DEFAULT;
- }
-}
-
void
_process(Interpret *p_interpret, Token *p_token_store, Token *p_token_op,
Token *p_token_op2, Token *p_token_next) {
@@ -95,8 +67,10 @@ _process(Interpret *p_interpret, Token *p_token_store, Token *p_token_op,
printf("PROCESS OPERATOR %s %s\n", tt_get_name(tt_op),
tt_get_name(tt_op2));
- token_print_ln(p_token_next);
- token_print_ln(p_token_store);
+ token_print(p_token_next);
+ printf("\n");
+ token_print(p_token_store);
+ printf("\n");
#endif /* DEBUG_FUNCTION_PROCESS */
if (p_token_op2 != NULL) {
@@ -525,10 +499,11 @@ _process(Interpret *p_interpret, Token *p_token_store, Token *p_token_op,
}
#ifdef DEBUG_FUNCTION_PROCESS
- token_print_ln(p_token_store);
+ token_print(p_token_store);
+ printf("\n\n");
#endif /* DEBUG_FUNCTION_PROCESS */
- //token_delete(p_token_next);
+ token_delete(p_token_next);
}
void
@@ -600,9 +575,6 @@ function_is_buildin(Token *p_token_ident) {
if (strcmp("not", token_get_val(p_token_ident)) == 0)
return (true);
- if (strcmp("type", token_get_val(p_token_ident)) == 0)
- return (true);
-
return (false);
}
@@ -762,7 +734,18 @@ function_process_buildin(Interpret *p_interpret, Token *p_token_ident,
StackIterator *p_iter = stackiterator_new(p_stack_args);
while (stackiterator_has_next(p_iter)) {
Token *p_token = stackiterator_next(p_iter);
- _print_val(p_token);
+ 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);
@@ -770,7 +753,18 @@ function_process_buildin(Interpret *p_interpret, Token *p_token_ident,
StackIterator *p_iter = stackiterator_new(p_stack_args);
while (stackiterator_has_next(p_iter)) {
Token *p_token = stackiterator_next(p_iter);
- _print_val(p_token);
+ 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);
printf("\n");
@@ -818,35 +812,6 @@ function_process_buildin(Interpret *p_interpret, Token *p_token_ident,
break;
NO_DEFAULT;
}
- } else if (strcmp("not", token_get_val(p_token_ident)) == 0) {
- if (0 == stack_size(p_stack_args))
- _FUNCTION_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("type", token_get_val(p_token_ident)) == 0) {
- if (0 == stack_size(p_stack_args))
- _FUNCTION_ERROR("No argument given", p_token_ident);
-
- Token *p_token = stack_pop(p_stack_args);
- TokenType tt = token_get_tt(p_token);
-
- Token *p_token_type = token_new_string(tt_get_name(tt));
- stack_push(p_stack_args, p_token_type);
}
}
diff --git a/src/core/garbage.c b/src/core/garbage.c
index 3820144..aba19c4 100644
--- a/src/core/garbage.c
+++ b/src/core/garbage.c
@@ -64,12 +64,6 @@ _garbage_print(_Garbage *p_garbage) {
}
}
-void
-_garbage_free(_Garbage *p_garbage) {
- (*p_garbage->p_func) (p_garbage->p_2free);
- free(p_garbage);
-}
-
void
garbage_destroy() {
garbage_collect();
@@ -93,18 +87,17 @@ garbage_destroy() {
int
garbage_collect() {
- //printf("GARBAGE_COLLECT\n");
ListIterator *p_iter = listiterator_new(LIST_GARBAGE);
List *p_list_garbage_new = list_new();
int i_count = 0;
- //printf("size %d\n", list_size(LIST_GARBAGE));
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) {
- //_garbage_print(p_garbage);
- _garbage_free(p_garbage);
+ // _garbage_print(p_garbage);
+ (*p_garbage->p_func) (p_garbage->p_2free);
+ free(p_garbage);
++i_count;
} else {
@@ -113,9 +106,9 @@ garbage_collect() {
}
listiterator_delete(p_iter);
+
list_delete(LIST_GARBAGE);
LIST_GARBAGE = p_list_garbage_new;
- //printf("GARBAGE_COLLECT_END\n");
return (i_count);
}
diff --git a/src/core/interpret.c b/src/core/interpret.c
index 86d5a36..5aa07ef 100644
--- a/src/core/interpret.c
+++ b/src/core/interpret.c
@@ -54,16 +54,15 @@
#define _NEXT_TT _next_tt(p_interpret)
#define _SKIP _next(p_interpret);
-int __expression_get(Interpret *p_interpret, List *p_list_block);
-int __array_get(Interpret *p_interpret, Token *p_token_arr);
-void __print_lookahead(Interpret *p_interpret);
+void _print_lookahead(Interpret *p_interpret);
int _next(Interpret *p_interpret);
int _program(Interpret *p_interpret);
int _var_decl(Interpret *p_interpret);
int _var_assign(Interpret *p_interpret);
int _var_list(Interpret *p_interpret);
+int _expression_get(Interpret *p_interpret, List *p_list_block);
int _block_get(Interpret *p_interpret, List *p_list_block);
-int __block_skip(Interpret *p_interpret);
+int _block_skip(Interpret *p_interpret);
int _proc_decl(Interpret *p_interpret);
int _func_decl(Interpret *p_interpret);
int _statement(Interpret *p_interpret);
@@ -104,7 +103,7 @@ interpret_new(List *p_list_token, Hash *p_hash_syms) {
void
interpret_delete(Interpret *p_interpret) {
- if (p_interpret == NULL)
+ if (!p_interpret)
return;
if (p_interpret->b_scope_delete)
@@ -115,7 +114,7 @@ interpret_delete(Interpret *p_interpret) {
}
void
-__print_lookahead(Interpret *p_interpret) {
+_print_lookahead(Interpret *p_interpret) {
ListIterator *p_iter = p_interpret->p_iter;
ListIteratorState *p_state = listiterator_get_state(p_iter);
@@ -165,13 +164,8 @@ int
_program(Interpret *p_interpret) {
_CHECK TRACK
- int i_count = 0;
- while (_statement(p_interpret) == 1) {
- if (++i_count == 50) {
- garbage_collect();
- i_count = 0;
- }
- }
+ while (_statement(p_interpret) == 1)
+ garbage_collect();
return (1);
}
@@ -181,6 +175,7 @@ _var_decl(Interpret *p_interpret) {
_CHECK TRACK
switch (p_interpret->tt) {
+ //case TT_ARR: //TODO cleanup TT_ARR
case TT_MY:
{
if (_NEXT_TT != TT_IDENT)
@@ -205,7 +200,7 @@ _var_decl(Interpret *p_interpret) {
}
}
default:
- break;
+ break;
}
return (0);
@@ -231,8 +226,8 @@ _var_assign(Interpret *p_interpret) {
p_interpret->p_stack = stack_new();
if (_expression_(p_interpret)) {
- function_process_buildin(p_interpret, p_token,
- p_interpret->p_stack);
+ function_process_buildin(p_interpret, p_token,
+ p_interpret->p_stack);
stack_merge(p_stack, p_interpret->p_stack);
stack_delete(p_interpret->p_stack);
@@ -241,6 +236,7 @@ _var_assign(Interpret *p_interpret) {
p_token = stack_top(p_interpret->p_stack);
Symbol *p_symbol = symbol_new(SYM_VARIABLE, p_token);
scope_newset(p_interpret->p_scope, c_name, p_symbol);
+
} else {
return (0);
}
@@ -302,10 +298,11 @@ _block_get(Interpret *p_interpret, List *p_list_block) {
}
int
-__expression_get(Interpret *p_interpret, List *p_list_expression) {
+_expression_get(Interpret *p_interpret, List *p_list_expression) {
for (;;) {
- if (p_interpret->tt == TT_PARANT_CL)
+ if (p_interpret->tt == TT_PARANT_CL) {
break; /* for */
+ }
list_add_back(p_list_expression, p_interpret->p_token);
@@ -322,36 +319,7 @@ __expression_get(Interpret *p_interpret, List *p_list_expression) {
}
int
-__array_get(Interpret *p_interpret, Token *p_token_arr) {
-#ifdef DEBUG_ARRAY_GET
- printf("====> ARRAY\n");
-#endif /* DEBUG_ARRAY_GET */
- Array *p_array = p_token_arr->p_array;
-
- do {
- Token *p_token = p_interpret->p_token;
-
-#ifdef DEBUG_ARRAY_GET
- printf("Insert: ");
- token_print_ln(p_token);
-#endif /* DEBUG_ARRAY_GET */
-
- array_unshift(p_array, p_token);
- token_ref_up(p_token);
- _NEXT
- } while (p_interpret->tt != TT_PARANT_AR);
-
-#ifdef DEBUG_ARRAY_GET
- printf("<==== ARRAY\n");
-#endif /* DEBUG_ARRAY_GET */
- /* Ignore TT_PARANT_AR */
- _NEXT
-
- return (0);
-}
-
-int
-__block_skip(Interpret *p_interpret) {
+_block_skip(Interpret *p_interpret) {
if (p_interpret->tt != TT_PARANT_CL)
_INTERPRET_ERROR("Expected '{'", p_interpret->p_token);
_NEXT
@@ -523,16 +491,16 @@ _control(Interpret *p_interpret) {
switch (tt) {
case TT_IF:
if (convert_to_integer_get(p_token_top)) {
- //scope_up(p_interpret->p_scope);
+ scope_up(p_interpret->p_scope);
ret = interpret_subprocess(p_interpret, p_list_block);
- //scope_down(p_interpret->p_scope);
+ scope_down(p_interpret->p_scope);
}
break;
case TT_IFNOT:
if (!convert_to_integer_get(p_token_top)) {
- //scope_up(p_interpret->p_scope);
+ scope_up(p_interpret->p_scope);
ret = interpret_subprocess(p_interpret, p_list_block);
- //scope_down(p_interpret->p_scope);
+ scope_down(p_interpret->p_scope);
}
break;
NO_DEFAULT;
@@ -555,7 +523,7 @@ _control(Interpret *p_interpret) {
_NEXT
- __expression_get(p_interpret, p_list_expr);
+ _expression_get(p_interpret, p_list_expr);
_block_get(p_interpret, p_list_block);
Token *p_token_backup = p_interpret->p_token;
@@ -573,6 +541,7 @@ _control(Interpret *p_interpret) {
Token *p_token_top = stack_pop(p_interpret->p_stack);
if (p_token_top == NULL) {
+ printf("FOO\n");
exit(0);
}
if (tt == TT_WHILE) {
@@ -817,7 +786,6 @@ _term(Interpret *p_interpret) {
case TT_INTEGER:
case TT_DOUBLE:
case TT_STRING:
- case TT_ARRAY:
stack_push(p_interpret->p_stack, p_interpret->p_token);
_NEXT
return (1);
@@ -949,13 +917,9 @@ _term(Interpret *p_interpret) {
Token *p_token = p_interpret->p_token;
_NEXT
- Token *p_token_arr = token_new_array(ARRAY_SIZE);
+ Token *p_token_arr = token_new_array(ARRAY_SIZE);
stack_push(p_interpret->p_stack, p_token_arr);
-
- if (__array_get(p_interpret, p_token_arr) != 0)
- _INTERPRET_ERROR("Array syntax error", p_token);
-
- return (1);
+ _INTERPRET_ERROR("arrays not yet fully implemented", p_token_arr);
}
break;
diff --git a/src/core/scanner.c b/src/core/scanner.c
index 5190175..49026c2 100644
--- a/src/core/scanner.c
+++ b/src/core/scanner.c
@@ -108,8 +108,8 @@ scanner_post_task(Scanner *p_scanner) {
if (tt_cur == TT_INTEGER && tt_last[1] == TT_DOT
&& tt_last[0] == TT_INTEGER) {
- //token_ref_down(pt_last[0]);
- //token_ref_down(pt_last[1]);
+ token_ref_down(pt_last[0]);
+ token_ref_down(pt_last[1]);
char *c_2 = token_get_val(p_token);
char *c_0 = token_get_val(pt_last[0]);
@@ -338,9 +338,9 @@ scanner_add_token(Scanner *p_scanner, char **cc_token, int *p_token_len,
List *p_list_token = scanner_get_list_token(p_scanner);
Token *p_token = token_new(*cc_token, tt_cur, p_scanner->i_current_line_nr,
p_scanner->i_current_pos_nr, p_scanner->c_filename);
- p_token->b_source_token = true;
list_add_back(p_list_token, p_token);
+ token_ref_up(p_token);
*cc_token = malloc(sizeof(char));
(*cc_token)[0] = 0;
@@ -361,3 +361,9 @@ scanner_get_tt_cur(char *c_token) {
return tt_cur == TT_NONE ? TT_IDENT : tt_cur;
}
+
+void
+scanner_cleanup_list_token_cb(void *p_void) {
+ Token *p_token = p_void;
+ token_delete(p_token);
+}
diff --git a/src/core/scanner.h b/src/core/scanner.h
index c4e15fa..4626595 100644
--- a/src/core/scanner.h
+++ b/src/core/scanner.h
@@ -65,5 +65,6 @@ void scanner_run(Fype *p_fype);
void scanner_add_token(Scanner *p_scanner, char **cc_token, int *p_token_len,
TokenType tt_cur);
TokenType scanner_get_tt_cur(char *c_token);
+void scanner_cleanup_list_token_cb(void *p_void);
#endif
diff --git a/src/core/scope.c b/src/core/scope.c
index ecf5933..1bf8dd2 100644
--- a/src/core/scope.c
+++ b/src/core/scope.c
@@ -36,9 +36,6 @@
#include "scope.h"
#include "symbol.h"
-#define _SCOPE_ERROR(m) \
- ERROR("%s: Scope error", m)
-
Scope*
scope_new(Hash *p_hash_syms) {
Scope *p_scope = malloc(sizeof(Scope));
@@ -61,42 +58,14 @@ scope_delete(Scope *p_scope) {
void
scope_up(Scope *p_scope) {
-#ifdef EXTRA_CHECKS
- int i_before = (int) stack_size(p_scope->p_stack_scopes);
-#elif DEBUG_SCOPE_UPDOWN
- int i_before = (int) stack_size(p_scope->p_stack_scopes);
-#endif
- stack_push(p_scope->p_stack_scopes, hash_new(24));
-#ifdef DEBUG_SCOPE_UPDOWN
- printf("SCOPE UPPED %d => %d\n",
- i_before,
- (int) stack_size(p_scope->p_stack_scopes));
-#endif /* DEBUG_SCOPE_UPDOWN */
-#ifdef EXTRA_CHECKS
- if (i_before >= (int) stack_size(p_scope->p_stack_scopes))
- _SCOPE_ERROR("Scope should be higher");
-#endif /* EXTRA_CHECKS */
+ stack_push(p_scope->p_stack_scopes, hash_new(1024));
}
void
scope_down(Scope *p_scope) {
-#ifdef EXTRA_CHECKS
- int i_before = (int) stack_size(p_scope->p_stack_scopes);
-#elif DEBUG_SCOPE_UPDOWN
- int i_before = (int) stack_size(p_scope->p_stack_scopes);
-#endif
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);
-#ifdef DEBUG_SCOPE_UPDOWN
- printf("SCOPE DOWNED %d => %d\n",
- i_before,
- (int) stack_size(p_scope->p_stack_scopes));
-#endif /* DEBUG_SCOPE_UPDOWN */
-#ifdef EXTRA_CHECKS
- if (i_before <= (int) stack_size(p_scope->p_stack_scopes))
- _SCOPE_ERROR("Scope should be lower");
-#endif /* EXTRA_CHECKS */
}
static Hash*
diff --git a/src/core/symbol.c b/src/core/symbol.c
index 7c8a8f7..2343cdb 100644
--- a/src/core/symbol.c
+++ b/src/core/symbol.c
@@ -33,9 +33,7 @@
*:*/
#include "symbol.h"
-#include "token.h"
-#include "../data/array.h"
#include "../data/list.h"
Symbol*
@@ -57,20 +55,8 @@ symbol_delete(Symbol *p_symbol) {
list_delete(p_list_token);
}
break;
- case SYM_VARIABLE:
- {
- Token *p_token = symbol_get_val(p_symbol);
- switch (token_get_tt(p_token)) {
- case TT_ARRAY:
- //array_iterate(p_token->p_array, token_delete_cb);
- break;
- NO_DEFAULT;
- }
- }
- break;
NO_DEFAULT;
}
-
free(p_symbol);
}
diff --git a/src/core/token.c b/src/core/token.c
index 4bed0e0..1a2aec9 100644
--- a/src/core/token.c
+++ b/src/core/token.c
@@ -57,6 +57,7 @@ get_tt(char *c_token) {
CHECK("proc") TT_PROC;
CHECK("func") TT_FUNC;
CHECK("my") TT_MY;
+ CHECK("arr") TT_ARR;
CHECK("!") TT_NOT;
CHECK("!=") TT_NEQ;
CHECK("=~") TT_RE;
@@ -122,6 +123,7 @@ tt_get_name(TokenType tt_cur) {
CASE(TT_PROC,"TT_PROC")
CASE(TT_FUNC,"TT_FUNC")
CASE(TT_MY,"TT_MY")
+ CASE(TT_ARR,"TT_ARR")
CASE(TT_WHILE,"TT_WHILE")
CASE(TT_UNTIL,"TT_UNTIL")
CASE(TT_NEXT,"TT_NEXT")
@@ -181,8 +183,7 @@ tt_get_name(TokenType tt_cur) {
}
Token*
-token_new(char *c_val, TokenType tt_cur, int i_line_nr, int i_pos_nr,
- char *c_filename) {
+token_new(char *c_val, TokenType tt_cur, int i_line_nr, int i_pos_nr, char *c_filename) {
Token *p_token = token_new_dummy();
p_token->c_val = c_val;
@@ -193,7 +194,6 @@ token_new(char *c_val, TokenType tt_cur, int i_line_nr, int i_pos_nr,
p_token->i_pos_nr = i_pos_nr;
p_token->c_filename = c_filename;
p_token->p_array = NULL;
- p_token->b_source_token = false;
switch (tt_cur) {
case TT_INTEGER:
@@ -212,7 +212,7 @@ token_new(char *c_val, TokenType tt_cur, int i_line_nr, int i_pos_nr,
NO_DEFAULT;
}
- return (p_token);
+ return p_token;
}
Token*
@@ -248,11 +248,7 @@ Token*
token_new_array(int i_size) {
Token *p_token = token_new_dummy();
token_set_tt(p_token, TT_ARRAY);
-
- if (p_token->p_array == NULL)
- p_token->p_array = array_new();
-
- //array_resize(p_token->p_array, i_size);
+ array_resize(p_token->p_array, i_size);
return (p_token);
}
@@ -273,7 +269,7 @@ token_new_dummy() {
p_token->i_pos_nr = -1;
p_token->c_filename = NULL;
p_token->u_token_id = TOKEN_ID_COUNTER++;
- p_token->i_ref_count = 1;
+ p_token->i_ref_count = 0;
/* Register the token in the garbage collector */
garbage_add_token(p_token);
@@ -284,7 +280,7 @@ token_new_dummy() {
Token*
token_new_copy(Token *p_token) {
Token *p_token_copy = malloc(sizeof(Token));
- p_token_copy->u_token_id = TOKEN_ID_COUNTER++;
+ p_token->u_token_id = TOKEN_ID_COUNTER++;
if (p_token_copy == NULL)
ERROR("Memory alloc error");
@@ -298,36 +294,21 @@ token_new_copy(Token *p_token) {
return (p_token_copy);
}
-void
-token_copy_vals(Token *p_token_to, Token *p_token_from) {
+void token_copy_vals(Token *p_token_to, Token *p_token_from) {
int i_len;
// TODO: Check against mem leak
- if (p_token_to->c_val)
- free(p_token_to->c_val);
+ // if (p_token_to->c_val)
+ // free(p_token_to->c_val);
if (p_token_from->c_val) {
i_len = strlen(p_token_from->c_val);
p_token_to->c_val = calloc(i_len+1, sizeof(char));
strcpy(p_token_to->c_val, p_token_from->c_val);
-
} else {
p_token_to->c_val = NULL;
}
- if (p_token_from->tt_cur == TT_ARRAY) {
- p_token_to->p_array = array_new();
- ArrayIterator *p_iter = arrayiterator_new(p_token_from->p_array);
- while (arrayiterator_has_next(p_iter)) {
- Token *p_token = arrayiterator_next(p_iter);
- token_ref_up(p_token);
- array_unshift(p_token_to->p_array, p_token);
- }
- arrayiterator_delete(p_iter);
- } else {
- p_token_to->p_array = NULL;
- }
-
p_token_to->tt_cur = p_token_from->tt_cur;
p_token_to->i_val = p_token_from->i_val;
p_token_to->d_val = p_token_from->d_val;
@@ -341,11 +322,6 @@ token_delete_cb(void *p_void) {
token_delete(p_void);
}
-void
-token_delete_force_cb(void *p_void) {
- token_delete_force(p_void);
-}
-
void
token_ref_down_cb(void *p_void) {
Token *p_token = p_void;
@@ -357,92 +333,49 @@ token_copy_cb(void *p_void) {
return (token_new_copy(p_void));
}
-int
-token_ref_down(Token *p_token) {
-// if (p_token->i_ref_count > 0)
- p_token->i_ref_count--;
-
- return (p_token->i_ref_count);
-}
-
-void
-_token_free(Token *p_token) {
- if (p_token->c_val)
- free(p_token->c_val);
- p_token->c_val = NULL;
-
- if (p_token->p_array) {
- array_iterate(p_token->p_array, token_delete_cb);
- array_delete(p_token->p_array);
- }
- p_token->p_array = NULL;
-
- free(p_token);
-}
-
void
token_delete(Token *p_token) {
- if (IS_SOURCE_TOKEN(p_token))
- return;
-
- token_ref_down(p_token);
-
- if (p_token->i_ref_count == 0) {
+ if (token_ref_down(p_token) <= 0) {
+ if (p_token->i_ref_count == 0) {
#ifdef DEBUG_TOKEN_REFCOUNT
- printf("Token refcount debug: Token ref count is 0 == %d\n",
- p_token->i_ref_count);
- token_print_ln(p_token);
+ printf("Token refcount debug: Token ref count is 0 == %d\n",
+ p_token->i_ref_count);
#endif /* DEBUG_TOKEN_REFCOUNT */
+ if (p_token->c_val)
+ free(p_token->c_val);
- _token_free(p_token);
+ if (p_token->p_array)
+ array_delete(p_token->p_array);
- }
+ free(p_token);
+ }
#ifdef DEBUG_TOKEN_REFCOUNT
- else if (p_token->i_ref_count < 0) {
- token_print_ln(p_token);
- printf("Token ref count is 0 > %d\n",
- p_token->i_ref_count);
+ else {
+ printf("Token refcount debug: Token ref count is 0 > %d\n",
+ p_token->i_ref_count);
+ }
+#endif /* DEBUG_TOKEN_REFCOUNT */
}
+#ifdef DEBUG_TOKEN_REFCOUNT
else {
printf("Token refcount debug: Token ref count is 0 < %d\n",
p_token->i_ref_count);
- token_print_ln(p_token);
}
#endif /* DEBUG_TOKEN_REFCOUNT */
}
-void
-token_delete_force(Token *p_token) {
- token_ref_down(p_token);
- //printf("FORCE DEL ");
- //token_print_ln(p_token);
- _token_free(p_token);
-}
-
void
token_print(Token *p_token) {
- printf("(org=%d, id=%05u, line=%05d, pos=%04d, type=%s",
- (int) p_token->b_source_token,
+ printf("(id=%05u, line=%05d, pos=%04d, type=%s, val=%s, ival=%d, dval=%f,"
+ " refs=%d)",
p_token->u_token_id,
p_token->i_line_nr,
p_token->i_pos_nr,
- tt_get_name(p_token->tt_cur));
-
- if (IS_ARRAY(p_token)) {
- } else {
- printf(", val=%s, ival=%d, dval=%f",
- p_token->c_val,
- p_token->i_val,
- p_token->d_val);
- }
-
- printf(", refs=%d)", p_token->i_ref_count);
-}
-
-void
-token_print_ln(Token *p_token) {
- token_print(p_token);
- printf("\n");
+ tt_get_name(p_token->tt_cur),
+ p_token->c_val,
+ p_token->i_val,
+ p_token->d_val,
+ p_token->i_ref_count);
}
void
diff --git a/src/core/token.h b/src/core/token.h
index e683e01..caf4854 100644
--- a/src/core/token.h
+++ b/src/core/token.h
@@ -53,10 +53,6 @@
#define IS_ASSIGNABLE(t) (START_ASSIGNABLES < t && t < END_ASSIGNABLES)
#define IS_NUMERICAL(t) (START_NUMERICAL < t && t < END_NUMERICAL)
#define IS_NOT_NUMERICAL(t) !(IS_NUMERICAL(t))
-#define IS_ARRAY(t) (t->tt_cur == TT_ARRAY)
-#define IS_NOT_ARRAY(t) !(IS_ARRAY(t))
-#define IS_SOURCE_TOKEN(t) (t->b_source_token == true)
-#define IS_NOT_SOURCE_TOKEN(t) (t->b_source_token == false)
#define token_get_filename(t) \
(t->c_filename != NULL ? t->c_filename : "Code string")
@@ -74,6 +70,7 @@
#define token_get_posnr(t) t->i_pos_nr
#define token_get_linenr(t) t->i_line_nr
#define token_ref_up(t) ++t->i_ref_count
+#define token_ref_down(t) --t->i_ref_count
typedef enum {
// Diverse
@@ -89,8 +86,8 @@ typedef enum {
TT_INTEGER,
TT_DOUBLE,
END_NUMERICAL,
- TT_ARRAY,
TT_STRING,
+ TT_ARRAY,
END_ASSIGNABLES,
TT_IDENT,
END_TYPES,
@@ -106,6 +103,7 @@ typedef enum {
TT_PROC,
TT_FUNC,
TT_MY,
+ TT_ARR,
TT_WHILE,
TT_UNTIL,
TT_NEXT,
@@ -167,7 +165,6 @@ typedef struct {
char *c_filename;
unsigned int u_token_id;
int i_ref_count;
- _Bool b_source_token;
Array *p_array;
} Token;
@@ -181,17 +178,13 @@ Token* token_new_(char *c_val, TokenType tt_cur, char *c_filename);
Token* token_new_dummy();
void token_copy_vals(Token *p_token_to, Token *p_token_from);
void token_delete(Token *p_token);
-void token_delete_force(Token *p_token);
-void token_delete_force_cb(void *p_token);
void token_delete_cb(void *p_token);
void token_ref_down_cb(void *p_token);
void* token_copy_cb(void *p_token);
char* tt_get_name(TokenType tt_cur);
void token_print_cb(void *p_void);
void token_print(Token *p_token);
-void token_print_ln(Token *p_token);
void token_print_val(Token *p_token);
-int token_ref_down(Token *p_token);
TokenType get_tt(char *c_token);
#endif
diff --git a/src/data/array.c b/src/data/array.c
index da5bee8..2ae4ece 100644
--- a/src/data/array.c
+++ b/src/data/array.c
@@ -41,7 +41,7 @@ array_new() {
p_array->i_size = 0;
p_array->pp_ae = NULL;
- return (p_array);
+ return p_array;
}
@@ -92,7 +92,7 @@ array_insert(Array *p_array, int i_index, void *p_val) {
void*
array_remove(Array *p_array, int i_index) {
if (p_array->i_size <= i_index)
- return (NULL);
+ return NULL;
ArrayElement *p_ae = p_array->pp_ae[i_index];
void *p_ret = p_ae->p_val;
@@ -105,7 +105,7 @@ array_remove(Array *p_array, int i_index) {
array_resize(p_array, p_array->i_size - 1);
- return (p_ret);
+ return p_ret;
}
void
@@ -147,17 +147,17 @@ array_resize(Array *p_array, int i_size) {
void*
array_get(Array *p_array, int i_index) {
if (p_array->i_size > i_index)
- return (p_array->pp_ae[i_index]->p_val);
+ return p_array->pp_ae[i_index]->p_val;
- return (NULL);
+ return NULL;
}
_Bool
array_defined(Array *p_array, int i_index) {
if (i_index >= p_array->i_size)
- return (false);
+ return false;
- return (p_array->pp_ae[i_index]->p_val != NULL);
+ return p_array->pp_ae[i_index]->p_val != NULL;
}
void
@@ -222,7 +222,7 @@ arrayelement_new(void *p_val) {
p_ae->p_val = p_val;
- return (p_ae);
+ return p_ae;
}
void
@@ -235,27 +235,14 @@ arrayelement_delete(ArrayElement *p_ae) {
ArrayIterator*
arrayiterator_new(Array *p_array) {
- if (p_array == NULL)
- return (NULL);
+ if (!p_array)
+ return NULL;
ArrayIterator *p_arrayiterator = malloc(sizeof(ArrayIterator));
p_arrayiterator->p_array = p_array;
p_arrayiterator->i_cur_pos = 0;
- p_arrayiterator->b_is_reverse = false;
-
- return (p_arrayiterator);
-}
-
-ArrayIterator*
-arrayiterator_new_reverse(Array *p_array) {
- ArrayIterator *p_arrayiterator = arrayiterator_new(p_array);
- if (p_arrayiterator == NULL)
- return (NULL);
-
- p_arrayiterator->b_is_reverse = true;
- p_arrayiterator->i_cur_pos = p_array->i_size;
- return (p_arrayiterator);
+ return p_arrayiterator;
}
void
@@ -266,21 +253,14 @@ arrayiterator_delete(ArrayIterator *p_arrayiterator) {
_Bool
arrayiterator_has_next(ArrayIterator *p_arrayiterator) {
- if (p_arrayiterator->b_is_reverse)
- return (p_arrayiterator->i_cur_pos >= 0);
-
- return (p_arrayiterator->i_cur_pos <
- array_get_size(p_arrayiterator->p_array));
+ return p_arrayiterator->i_cur_pos <
+ array_get_size(p_arrayiterator->p_array);
}
void*
arrayiterator_next(ArrayIterator *p_arrayiterator) {
if (!arrayiterator_has_next(p_arrayiterator))
- return (NULL);
-
- if (p_arrayiterator->b_is_reverse)
- return (array_get(p_arrayiterator->p_array,
- p_arrayiterator->i_cur_pos--));
+ return NULL;
- return (array_get(p_arrayiterator->p_array, p_arrayiterator->i_cur_pos++));
+ return array_get(p_arrayiterator->p_array, p_arrayiterator->i_cur_pos++);
}
diff --git a/src/data/array.h b/src/data/array.h
index 6170c29..b343521 100644
--- a/src/data/array.h
+++ b/src/data/array.h
@@ -58,7 +58,6 @@ typedef struct {
typedef struct {
Array *p_array;
int i_cur_pos;
- _Bool b_is_reverse;
} ArrayIterator;
Array *array_new();
@@ -81,7 +80,6 @@ ArrayElement *arrayelement_new(void *p_val);
void arrayelement_delete(ArrayElement *p_ae);
ArrayIterator *arrayiterator_new(Array *p_array);
-ArrayIterator *arrayiterator_new_reverse(Array *p_array);
void arrayiterator_delete(ArrayIterator *p_arrayiterator);
_Bool arrayiterator_has_next(ArrayIterator *p_arrayiterator);
void *arrayiterator_next(ArrayIterator *p_arrayiterator);
diff --git a/src/data/hash.c b/src/data/hash.c
index d3f7634..5555eb1 100644
--- a/src/data/hash.c
+++ b/src/data/hash.c
@@ -44,13 +44,13 @@ hash_new(unsigned i_size) {
p_hash->i_size = i_size;
p_hash->i_cur_size = 0;
- p_hash->p_elems = (HashElem *) calloc((int)i_size, sizeof(HashElem));
+ p_hash->p_elems = (HashElem *) calloc(i_size, sizeof(HashElem));
/*Set all positions as "free" */
for (int i = 0; i < i_size; ++i)
p_hash->p_elems[i].flag = 'f';
- return (p_hash);
+ return p_hash;
}
void
diff --git a/src/data/stack.c b/src/data/stack.c
index 0f5f58e..9afb9b4 100644
--- a/src/data/stack.c
+++ b/src/data/stack.c
@@ -62,8 +62,7 @@ stack_empty(Stack *p_stack) {
}
void
-stack_debug(Stack *p_stack, void *p_val) {
- printf("bPUSH %d %d\n", stack_size(p_stack), (int)p_stack);
+stack_push(Stack *p_stack, void *p_val) {
StackElem *p_elem = stackelem_new();
p_elem->p_val = p_val;
@@ -74,20 +73,6 @@ stack_debug(Stack *p_stack, void *p_val) {
p_stack->p_last = p_stack->p_first;
++p_stack->i_size;
- printf("aPUSH %d %d\n", stack_size(p_stack), (int)p_stack);
-}
-
-unsigned
-stack_push(Stack *p_stack, void *p_val) {
- StackElem *p_elem = stackelem_new();
- p_elem->p_val = p_val;
- p_elem->p_next = p_stack->p_first;
- p_stack->p_first = p_elem;
-
- if (p_stack->p_last == NULL)
- p_stack->p_last = p_stack->p_first;
-
- return (++p_stack->i_size);
}
void*
diff --git a/src/data/stack.h b/src/data/stack.h
index e9fafea..4774cef 100644
--- a/src/data/stack.h
+++ b/src/data/stack.h
@@ -59,8 +59,7 @@ Stack *stack_new();
StackElem *stackelem_new();
_Bool stack_empty(Stack *p_stack);
void stack_iterate(Stack *p_stack, void (*func)(void *p_void));
-unsigned stack_push(Stack *p_stack, void *p_val);
-void stack_debug(Stack *p_stack, void *p_val);
+void stack_push(Stack *p_stack, void *p_val);
void *stack_pop(Stack *p_stack);
void stack_clear(Stack *p_stack);
void stack_delete(Stack *p_stack);
diff --git a/src/defines.h b/src/defines.h
index 29df2c2..569d20a 100644
--- a/src/defines.h
+++ b/src/defines.h
@@ -75,14 +75,11 @@
exit(1); }
#define DPRINTF(...) printf("DEBUG("); printf(__VA_ARGS__); printf(")\n");
-#define EXTRA_CHECKS
-#define DEBUG_SCOPE_UPDOWN
//#define DEBUG_TOKEN_REFCOUNT
//#define DEBUG_FUNCTION_PROCESS
-#define DEBUG_TRACK
+//#define DEBUG_TRACK
//#define DEBUG_BLOCK_GET
//#define DEBUG_EXPRESSION_GET
-//#define DEBUG_ARRAY_GET
#ifdef DEBUG_TRACK
#define TRACK \
diff --git a/src/fype.c b/src/fype.c
index 1b6d975..af61c1d 100644
--- a/src/fype.c
+++ b/src/fype.c
@@ -61,7 +61,9 @@ fype_delete(Fype *p_fype) {
hash_iterate(p_fype->p_hash_syms, symbol_cleanup_hash_syms_cb);
hash_delete(p_fype->p_hash_syms);
- list_iterate(p_fype->p_list_token, token_delete_force_cb);
+ //list_iterate(p_fype->p_list_token, token_print_cb);
+ list_iterate(p_fype->p_list_token, token_ref_down_cb);
+ //list_iterate(p_fype->p_list_token, token_print_cb);
list_delete(p_fype->p_list_token);
if (p_fype->c_basename)
diff --git a/tags b/tags
new file mode 100644
index 0000000..19d561e
--- /dev/null
+++ b/tags
@@ -0,0 +1,289 @@
+CASE ./src/core/token.c /^#define CASE(t,r) case t: return r;$/
+CHECK ./src/core/token.c /^#define CHECK(...) if (!strcmp(c_token, __VA_ARGS_/
+Mmain ./src/main.c /^main(int i_argc, char **pc_argv) {$/
+_FUNCTION_ERROR ./src/core/function.c /^#define _FUNCTION_ERROR(m,t) \\$/
+_GARBAGE_ERROR ./src/core/garbage.c /^#define _GARBAGE_ERROR(m) \\$/
+_Garbage ./src/core/garbage.c /^} _Garbage;$/
+_INTERPRET_ERROR ./src/core/interpret.c /^#define _INTERPRET_ERROR(m,t) \\$/
+_add_semicolon_to_list ./src/core/scanner.c /^_add_semicolon_to_list(Scanner *p_scanner) {$/
+_block ./src/core/interpret.c /^_block(Interpret *p_interpret) {$/
+_block_get ./src/core/interpret.c /^_block_get(Interpret *p_interpret, List *p_list_bl/
+_block_skip ./src/core/interpret.c /^_block_skip(Interpret *p_interpret) {$/
+_compare ./src/core/interpret.c /^_compare(Interpret *p_interpret) {$/
+_control ./src/core/interpret.c /^_control(Interpret *p_interpret) {$/
+_expression ./src/core/interpret.c /^_expression(Interpret *p_interpret) {$/
+_expression_ ./src/core/interpret.c /^_expression_(Interpret *p_interpret) {$/
+_expression_get ./src/core/interpret.c /^_expression_get(Interpret *p_interpret, List *p_li/
+_func_decl ./src/core/interpret.c /^_func_decl(Interpret *p_interpret) {$/
+_garbage_print ./src/core/garbage.c /^_garbage_print(_Garbage *p_garbage) {$/
+_indent ./src/data/tree.c /^void _indent(int i_indent) {$/
+_list_copy_cb ./src/data/list.c /^_list_copy_cb(void *p_void1, void *p_cpy) {$/
+_next ./src/core/interpret.c /^_next(Interpret *p_interpret) {$/
+_next_tt ./src/core/interpret.c /^_next_tt(Interpret *p_interpret) {$/
+_print_lookahead ./src/core/interpret.c /^_print_lookahead(Interpret *p_interpret) {$/
+_proc_decl ./src/core/interpret.c /^_proc_decl(Interpret *p_interpret) {$/
+_process ./src/core/function.c /^_process(Interpret *p_interpret, Token *p_token_st/
+_product ./src/core/interpret.c /^_product(Interpret *p_interpret) {$/
+_product2 ./src/core/interpret.c /^_product2(Interpret *p_interpret) {$/
+_program ./src/core/interpret.c /^_program(Interpret *p_interpret) {$/
+_scanner_get_next_char ./src/core/scanner.c /^_scanner_get_next_char(Scanner *p_scanner) {$/
+_scanner_has_next_char ./src/core/scanner.c /^_scanner_has_next_char(Scanner *p_scanner) {$/
+_scope_get_hash ./src/core/scope.c /^_scope_get_hash(Scope *p_scope, char *c_key) {$/
+_statement ./src/core/interpret.c /^_statement(Interpret *p_interpret) {$/
+_sum ./src/core/interpret.c /^_sum(Interpret *p_interpret) {$/
+_term ./src/core/interpret.c /^_term(Interpret *p_interpret) {$/
+_tree_print ./src/data/tree.c /^_tree_print(TreeNode *p_treenode, int i_indent) {$/
+_tree_print_cb ./src/data/tree.c /^_tree_print_cb(void *p_void, void *p_indent) {$/
+_tree_print_cb2 ./src/data/tree.c /^_tree_print_cb2(void *p_void, void *p_indent) {$/
+_var_assign ./src/core/interpret.c /^_var_assign(Interpret *p_interpret) {$/
+_var_decl ./src/core/interpret.c /^_var_decl(Interpret *p_interpret) {$/
+_var_list ./src/core/interpret.c /^_var_list(Interpret *p_interpret) {$/
+argv_addopt ./src/argv.c /^argv_addopt(char c_opt, Tupel *p_tupel_argv) {$/
+argv_check_argc ./src/argv.c /^argv_check_argc(int i_required, unsigned i_argc_le/
+argv_checkopt ./src/argv.c /^argv_checkopt(char c_opt, Tupel *p_tupel_argv) {$/
+argv_checkopts ./src/argv.c /^argv_checkopts(char *c_opts, Tupel *p_tupel_argv) /
+argv_help ./src/argv.c /^argv_help() {$/
+argv_run ./src/argv.c /^argv_run(Fype *p_fype, int i_argc, char **pc_argv)/
+argv_switch ./src/argv.c /^argv_switch(char c_arg, Tupel *p_tupel_argv, unsig/
+argv_synopsis ./src/argv.c /^argv_synopsis(Tupel *p_tupel_argv) {$/
+argv_tupel_delete ./src/argv.c /^argv_tupel_delete(Tupel *p_tupel_argv) {$/
+array_defined ./src/data/array.c /^array_defined(Array *p_array, int i_index) {$/
+array_delete ./src/data/array.c /^array_delete(Array *p_array) {$/
+array_get ./src/data/array.c /^array_get(Array *p_array, int i_index) {$/
+array_insert ./src/data/array.c /^array_insert(Array *p_array, int i_index, void *p_/
+array_iterate ./src/data/array.c /^array_iterate(Array *p_array, void (*func)(void *)/
+array_iterate2 ./src/data/array.c /^array_iterate2(Array *p_array, void (*func)(void */
+array_new ./src/data/array.c /^array_new() {$/
+array_print_int ./src/data/array.c /^array_print_int(Array *p_array) {$/
+array_push ./src/data/array.c /^array_push(Array *p_array, void *p_void) {$/
+array_remove ./src/data/array.c /^array_remove(Array *p_array, int i_index) {$/
+array_resize ./src/data/array.c /^array_resize(Array *p_array, int i_size) {$/
+array_set ./src/data/array.c /^array_set(Array *p_array, int i_index, void *p_val/
+array_splice ./src/data/array.c /^array_splice(Array *p_array, int i_index, Array *p/
+array_unshift ./src/data/array.c /^array_unshift(Array *p_array, void *p_void) {$/
+arrayelement_delete ./src/data/array.c /^arrayelement_delete(ArrayElement *p_ae) {$/
+arrayelement_new ./src/data/array.c /^arrayelement_new(void *p_val) {$/
+arrayiterator_delete ./src/data/array.c /^arrayiterator_delete(ArrayIterator *p_arrayiterato/
+arrayiterator_has_next ./src/data/array.c /^arrayiterator_has_next(ArrayIterator *p_arrayitera/
+arrayiterator_new ./src/data/array.c /^arrayiterator_new(Array *p_array) {$/
+arrayiterator_next ./src/data/array.c /^arrayiterator_next(ArrayIterator *p_arrayiterator)/
+convert_function_arg_types_to_highest ./src/core/convert.c /^convert_function_arg_types_to_highest(Stack *p_sta/
+convert_to_double ./src/core/convert.c /^convert_to_double(Token *p_token) {$/
+convert_to_highest ./src/core/convert.c /^convert_to_highest(Token *p_token1, Token *p_token/
+convert_to_integer ./src/core/convert.c /^convert_to_integer(Token *p_token) {$/
+convert_to_integer_get ./src/core/convert.c /^convert_to_integer_get(Token *p_token) {$/
+convert_to_string ./src/core/convert.c /^convert_to_string(Token *p_token) {$/
+convert_to_tt ./src/core/convert.c /^convert_to_tt(Token *p_token, TokenType tt) {$/
+dat_clear ./src/data/dat.c /^dat_clear(Dat *p_dat) {$/
+dat_delete ./src/data/dat.c /^dat_delete(Dat *p_dat) {$/
+dat_empty ./src/data/dat.c /^dat_empty(Dat *p_dat) {$/
+dat_first ./src/data/dat.c /^dat_first(Dat *p_dat) {$/
+dat_first_t ./src/data/dat.c /^dat_first_t(Dat *p_dat, TYPE *p_type) {$/
+dat_iterate ./src/data/dat.c /^dat_iterate(Dat *p_dat, void (*func)(void *)) {$/
+dat_iterate_t ./src/data/dat.c /^dat_iterate_t(Dat *p_dat, void (*func)(void *, TYP/
+dat_iterate_tl ./src/data/dat.c /^dat_iterate_tl(Dat *p_dat, void (*func)(void *, TY/
+dat_last ./src/data/dat.c /^dat_last(Dat *p_dat) {$/
+dat_last_t ./src/data/dat.c /^dat_last_t(Dat *p_dat, TYPE *p_type) {$/
+dat_new ./src/data/dat.c /^dat_new() {$/
+dat_pop ./src/data/dat.c /^dat_pop(Dat *p_dat) {$/
+dat_pop_t ./src/data/dat.c /^dat_pop_t(Dat *p_dat, TYPE *p_type) {$/
+dat_push ./src/data/dat.c /^dat_push(Dat *p_dat, void *p_val) {$/
+dat_push_t ./src/data/dat.c /^dat_push_t(Dat *p_dat, void *p_val, TYPE type) {$/
+dat_second ./src/data/dat.c /^dat_second(Dat *p_dat) {$/
+dat_second_t ./src/data/dat.c /^dat_second_t(Dat *p_dat, TYPE *p_type) {$/
+dat_size ./src/data/dat.c /^dat_size(Dat *p_dat) {$/
+datelem_new ./src/data/dat.c /^datelem_new() {$/
+datelem_new_t ./src/data/dat.c /^datelem_new_t(TYPE type) {$/
+datiter_dat ./src/data/dat.c /^datiter_dat(DatIter *p_iter) {$/
+datiter_delete ./src/data/dat.c /^datiter_delete(DatIter *p_iter) {$/
+datiter_left ./src/data/dat.c /^datiter_left(DatIter *p_iter) {$/
+datiter_new ./src/data/dat.c /^datiter_new(Dat *p_dat) {$/
+datiter_next ./src/data/dat.c /^datiter_next(DatIter *p_iter) {$/
+datiter_next_t ./src/data/dat.c /^datiter_next_t(DatIter *p_iter, TYPE *p_type) {$/
+datiter_skip ./src/data/dat.c /^datiter_skip(DatIter *p_iter, unsigned i_num) {$/
+function_is_buildin ./src/core/function.c /^function_is_buildin(Token *p_token_ident) {$/
+function_is_self_defined ./src/core/function.c /^function_is_self_defined(Interpret *p_interpret) {/
+function_process ./src/core/function.c /^function_process(Interpret *p_interpret, Token *p_/
+function_process_buildin ./src/core/function.c /^function_process_buildin(Interpret *p_interpret, T/
+function_process_self_defined ./src/core/function.c /^function_process_self_defined(Interpret *p_interpr/
+fype_delete ./src/fype.c /^fype_delete(Fype *p_fype) {$/
+fype_new ./src/fype.c /^fype_new() {$/
+fype_run ./src/fype.c /^fype_run(int i_argc, char **pc_argv) {$/
+garbage_add ./src/core/garbage.c /^garbage_add(void *p, GarbageType type) {$/
+garbage_add2 ./src/core/garbage.c /^garbage_add2(void *p, void (*p_func)(void*), int */
+garbage_add_token ./src/core/garbage.c /^garbage_add_token(Token *p_token) {$/
+garbage_collect ./src/core/garbage.c /^garbage_collect() {$/
+garbage_destroy ./src/core/garbage.c /^garbage_destroy() {$/
+garbage_init ./src/core/garbage.c /^garbage_init() {$/
+get_tt ./src/core/token.c /^get_tt(char *c_token) {$/
+hash_addrisfree ./src/data/hash.c /^hash_addrisfree(Hash *p_hash, int i_addr) {$/
+hash_addrisocc ./src/data/hash.c /^hash_addrisocc(Hash *p_hash, int i_addr, char *c_k/
+hash_delete ./src/data/hash.c /^hash_delete(Hash *p_hash) {$/
+hash_get ./src/data/hash.c /^hash_get(Hash *p_hash, char *c_key) {$/
+hash_get_ht ./src/data/hash.c /^hash_get_ht(Hash *p_hash, char *c_key, TYPE *p_typ/
+hash_get_ht_addr ./src/data/hash.c /^hash_get_ht_addr(Hash *p_hash, char *c_key, TYPE */
+hash_getaddr ./src/data/hash.c /^hash_getaddr(Hash *p_hash, char *c_key, HASH_OP OP/
+hash_insert ./src/data/hash.c /^hash_insert(Hash *p_hash, char *c_key, void *p_val/
+hash_insert_ht ./src/data/hash.c /^hash_insert_ht(Hash *p_hash, char *c_key, void *p_/
+hash_iterate ./src/data/hash.c /^hash_iterate(Hash *p_hash, void (*func)(void *)) {/
+hash_new ./src/data/hash.c /^hash_new(unsigned i_size) {$/
+hash_nextaddr ./src/data/hash.c /^hash_nextaddr(Hash *p_hash, int i_max_tries, char /
+hash_print ./src/data/hash.c /^hash_print(Hash *p_hash) {$/
+hash_print_addrval ./src/data/hash.c /^hash_print_addrval(Hash *p_hash, int i_addr) {$/
+hash_remove ./src/data/hash.c /^hash_remove(Hash *p_hash, char *c_key) {$/
+hash_size ./src/data/hash.c /^hash_size(Hash *p_hash, int i_size) {$/
+interpret_delete ./src/core/interpret.c /^interpret_delete(Interpret *p_interpret) {$/
+interpret_new ./src/core/interpret.c /^interpret_new(List *p_list_token, Hash *p_hash_sym/
+interpret_process ./src/core/interpret.c /^interpret_process(Interpret *p_interpret) {$/
+interpret_run ./src/core/interpret.c /^interpret_run(Fype *p_fype) {$/
+interpret_subprocess ./src/core/interpret.c /^interpret_subprocess(Interpret *p_interpret, List /
+list_add_back ./src/data/list.c /^list_add_back(List *p_list, void *p_val) {$/
+list_add_front ./src/data/list.c /^list_add_front(List *p_list, void *p_val) {$/
+list_clear ./src/data/list.c /^list_clear(List *p_list) {$/
+list_clear_and_free_vals ./src/data/list.c /^list_clear_and_free_vals(List *p_list) {$/
+list_concat_back ./src/data/list.c /^list_concat_back(List *p_list1, List *p_list2) {$/
+list_concat_front ./src/data/list.c /^list_concat_front(List *p_list1, List *p_list2) {$/
+list_copy ./src/data/list.c /^list_copy(List *p_list) {$/
+list_copy2 ./src/data/list.c /^list_copy2(List *p_list, void* (*func)(void *)) {$/
+list_delete ./src/data/list.c /^list_delete(List *p_list) {$/
+list_delete_and_free_vals ./src/data/list.c /^list_delete_and_free_vals(List *p_list) {$/
+list_delete_cb ./src/data/list.c /^list_delete_cb(void *p_list) {$/
+list_empty ./src/data/list.c /^list_empty(List *p_list) {$/
+list_iterate ./src/data/list.c /^list_iterate(List *p_list, void (*func)(void *)) {/
+list_iterate2 ./src/data/list.c /^list_iterate2(List *p_list, void (*func)(void *, v/
+list_iterate2_ptr ./src/data/list.c /^list_iterate2_ptr(List *p_list, void (*func)(void /
+list_iterate3 ./src/data/list.c /^list_iterate3(List *p_list, void (*func)(void *, v/
+list_iterate3_ptr ./src/data/list.c /^list_iterate3_ptr(List *p_list, void (*func)(void /
+list_new ./src/data/list.c /^list_new() {$/
+list_remove_back ./src/data/list.c /^list_remove_back(List *p_list) {$/
+list_remove_elem ./src/data/list.c /^list_remove_elem(List *p_list, ListElem *p_elem_re/
+list_remove_front ./src/data/list.c /^list_remove_front(List *p_list) {$/
+list_size ./src/data/list.c /^list_size(List *p_list) {$/
+listelem_new ./src/data/list.c /^listelem_new() {$/
+listiterator_current ./src/data/list.c /^listiterator_current(ListIterator *p_iter) {$/
+listiterator_delete ./src/data/list.c /^listiterator_delete(ListIterator *p_iter) {$/
+listiterator_end ./src/data/list.c /^listiterator_end(ListIterator *p_iter) {$/
+listiterator_get_state ./src/data/list.c /^listiterator_get_state(ListIterator *p_iter) {$/
+listiterator_has_next ./src/data/list.c /^listiterator_has_next(ListIterator *p_iter) {$/
+listiterator_new ./src/data/list.c /^listiterator_new(List *p_list) {$/
+listiterator_new_reverse ./src/data/list.c /^listiterator_new_reverse(List *p_list) {$/
+listiterator_next ./src/data/list.c /^listiterator_next(ListIterator *p_iter) {$/
+listiterator_next_elem ./src/data/list.c /^listiterator_next_elem(ListIterator *p_iter) {$/
+listiterator_prev ./src/data/list.c /^listiterator_prev(ListIterator *p_iter) {$/
+listiterator_set_state ./src/data/list.c /^listiterator_set_state(ListIterator *p_iter, ListI/
+listiteratorstate_delete ./src/data/list.c /^listiteratorstate_delete(ListIteratorState *p_stat/
+map_clear ./src/data/map.c /^map_clear(Map *p_map) {$/
+map_clear_and_free_vals ./src/data/map.c /^map_clear_and_free_vals(Map *p_map) {$/
+map_delete ./src/data/map.c /^map_delete(Map *p_map) {$/
+map_delete_and_free_vals ./src/data/map.c /^map_delete_and_free_vals(Map *p_map) {$/
+map_empty ./src/data/map.c /^map_empty(Map *p_map) {$/
+map_exists ./src/data/map.c /^map_exists(Map *p_map, char *c_key) {$/
+map_exists2 ./src/data/map.c /^map_exists2(Map *p_map, char *c_key1, char *c_key2/
+map_full ./src/data/map.c /^map_full(Map *p_map) {$/
+map_get ./src/data/map.c /^map_get(Map *p_map, char *c_key) {$/
+map_get2 ./src/data/map.c /^map_get2(Map *p_map, char *c_key1, char *c_key2) {/
+map_get_addr ./src/data/map.c /^map_get_addr(Map *p_map, char *c_key) {$/
+map_get_key ./src/data/map.c /^map_get_key(Map *p_map, void *p_val) {$/
+map_insert ./src/data/map.c /^map_insert(Map *p_map, char *c_key, void *p_val) {/
+map_insert2 ./src/data/map.c /^map_insert2(Map *p_map, char *c_key1, char *c_key2/
+map_insert_if_not_exists ./src/data/map.c /^map_insert_if_not_exists(Map *p_map, char *c_key, /
+map_iterate ./src/data/map.c /^map_iterate(Map *p_map, void (*func) (void *)) {$/
+map_iterate2 ./src/data/map.c /^map_iterate2(Map *p_map, void (*func) (void *, voi/
+map_iterate2_keys ./src/data/map.c /^map_iterate2_keys(Map *p_map, void (*func) (void */
+map_iterate3 ./src/data/map.c /^map_iterate3(Map *p_map, void (*func) (void *, voi/
+map_iterate3_keys ./src/data/map.c /^map_iterate3_keys(Map *p_map, void (*func) (void */
+map_iterate_keys ./src/data/map.c /^map_iterate_keys(Map *p_map, void (*func) (void *,/
+map_new ./src/data/map.c /^map_new(int i_max_size) {$/
+map_new_named ./src/data/map.c /^map_new_named(int i_max_size, char *c_name) {$/
+map_next_free_addr ./src/data/map.c /^map_next_free_addr(Map *p_map) {$/
+map_print ./src/data/map.c /^map_print(Map *p_map) {$/
+map_remove ./src/data/map.c /^map_remove(Map *p_map, char *c_key) {$/
+queue_clear ./src/data/queue.c /^queue_clear(Queue *p_queue) {$/
+queue_delete ./src/data/queue.c /^queue_delete(Queue *p_queue) {$/
+queue_empty ./src/data/queue.c /^queue_empty(Queue *p_queue) {$/
+queue_iterate ./src/data/queue.c /^queue_iterate(Queue *p_queue, void (*func)(void *)/
+queue_iterate_t ./src/data/queue.c /^queue_iterate_t(Queue *p_queue, void (*func)(void /
+queue_iterate_tl ./src/data/queue.c /^queue_iterate_tl(Queue *p_queue, void (*func)(void/
+queue_new ./src/data/queue.c /^queue_new() {$/
+queue_pop ./src/data/queue.c /^queue_pop(Queue *p_queue) {$/
+queue_pop_t ./src/data/queue.c /^queue_pop_t(Queue *p_queue, TYPE *p_type) {$/
+queue_push ./src/data/queue.c /^queue_push(Queue *p_queue, void *p_val) {$/
+queue_push_t ./src/data/queue.c /^queue_push_t(Queue *p_queue, void *p_val, TYPE typ/
+queue_size ./src/data/queue.c /^queue_size(Queue *p_queue) {$/
+queueelem_new ./src/data/queue.c /^queueelem_new() {$/
+queueelem_new_t ./src/data/queue.c /^queueelem_new_t(TYPE type) {$/
+queueiter_delete ./src/data/queue.c /^queueiter_delete(QueueIter *p_iter) {$/
+queueiter_left ./src/data/queue.c /^queueiter_left(QueueIter *p_iter) {$/
+queueiter_new ./src/data/queue.c /^queueiter_new(Queue *p_queue) {$/
+queueiter_next ./src/data/queue.c /^queueiter_next(QueueIter *p_iter) {$/
+queueiter_next_t ./src/data/queue.c /^queueiter_next_t(QueueIter *p_iter, TYPE *p_type) /
+queueiter_queue ./src/data/queue.c /^queueiter_queue(QueueIter *p_iter) {$/
+scanner_add_token ./src/core/scanner.c /^scanner_add_token(Scanner *p_scanner, char **cc_to/
+scanner_cleanup_list_token_cb ./src/core/scanner.c /^scanner_cleanup_list_token_cb(void *p_void) {$/
+scanner_delete ./src/core/scanner.c /^scanner_delete(Scanner *p_scanner) {$/
+scanner_get_tt_cur ./src/core/scanner.c /^scanner_get_tt_cur(char *c_token) {$/
+scanner_new ./src/core/scanner.c /^scanner_new(List *p_list_token, Tupel *p_tupel_arg/
+scanner_post_task ./src/core/scanner.c /^scanner_post_task(Scanner *p_scanner) {$/
+scanner_run ./src/core/scanner.c /^scanner_run(Fype *p_fype) {$/
+scope_delete ./src/core/scope.c /^scope_delete(Scope *p_scope) {$/
+scope_down ./src/core/scope.c /^scope_down(Scope *p_scope) {$/
+scope_exists ./src/core/scope.c /^scope_exists(Scope *p_scope, char *c_key) {$/
+scope_get ./src/core/scope.c /^scope_get(Scope *p_scope, char *c_key) {$/
+scope_new ./src/core/scope.c /^scope_new(Hash *p_hash_syms) {$/
+scope_newset ./src/core/scope.c /^scope_newset(Scope *p_scope, char *c_key, Symbol */
+scope_remove ./src/core/scope.c /^scope_remove(Scope *p_scope, char *c_key) {$/
+scope_reset ./src/core/scope.c /^scope_reset(Scope *p_scope, char *c_key, Symbol *p/
+scope_up ./src/core/scope.c /^scope_up(Scope *p_scope) {$/
+stack_clear ./src/data/stack.c /^stack_clear(Stack *p_stack) {$/
+stack_concat ./src/data/stack.c /^stack_concat(Stack *p_stack, Stack *p_stack_concat/
+stack_delete ./src/data/stack.c /^stack_delete(Stack *p_stack) {$/
+stack_delete_and_free ./src/data/stack.c /^stack_delete_and_free(Stack *p_stack) {$/
+stack_empty ./src/data/stack.c /^stack_empty(Stack *p_stack) {$/
+stack_iterate ./src/data/stack.c /^stack_iterate(Stack *p_stack, void (*func)(void *p/
+stack_merge ./src/data/stack.c /^stack_merge(Stack *p_stack, Stack *p_stack_merge) /
+stack_new ./src/data/stack.c /^stack_new() {$/
+stack_pop ./src/data/stack.c /^stack_pop(Stack *p_stack) {$/
+stack_push ./src/data/stack.c /^stack_push(Stack *p_stack, void *p_val) {$/
+stack_size ./src/data/stack.c /^stack_size(Stack *p_stack) {$/
+stackelem_new ./src/data/stack.c /^stackelem_new() {$/
+stackiterator_delete ./src/data/stack.c /^stackiterator_delete(StackIterator *p_iter) {$/
+stackiterator_has_next ./src/data/stack.c /^stackiterator_has_next(StackIterator *p_iter) {$/
+stackiterator_new ./src/data/stack.c /^stackiterator_new(Stack *p_stack) {$/
+stackiterator_next ./src/data/stack.c /^stackiterator_next(StackIterator *p_iter) {$/
+stackiterator_remove_prev ./src/data/stack.c /^stackiterator_remove_prev(StackIterator *p_iter) {/
+symbol_cleanup_hash_syms_cb ./src/core/symbol.c /^symbol_cleanup_hash_syms_cb(void *p_void) {$/
+symbol_delete ./src/core/symbol.c /^symbol_delete(Symbol *p_symbol) {$/
+symbol_new ./src/core/symbol.c /^symbol_new(SymbolType sym, void *p_val) {$/
+token_copy_cb ./src/core/token.c /^token_copy_cb(void *p_void) {$/
+token_copy_vals ./src/core/token.c /^void token_copy_vals(Token *p_token_to, Token *p_t/
+token_delete ./src/core/token.c /^token_delete(Token *p_token) {$/
+token_delete_cb ./src/core/token.c /^token_delete_cb(void *p_void) {$/
+token_new ./src/core/token.c /^token_new(char *c_val, TokenType tt_cur, int i_lin/
+token_new_ ./src/core/token.c /^token_new_(char *c_val, TokenType tt_cur, char *c_/
+token_new_array ./src/core/token.c /^token_new_array(int i_size) {$/
+token_new_copy ./src/core/token.c /^token_new_copy(Token *p_token) {$/
+token_new_double ./src/core/token.c /^token_new_double(double d_val) {$/
+token_new_dummy ./src/core/token.c /^token_new_dummy() {$/
+token_new_integer ./src/core/token.c /^token_new_integer(int i_val) {$/
+token_new_string ./src/core/token.c /^token_new_string(char *c_val) {$/
+token_print ./src/core/token.c /^token_print(Token *p_token) {$/
+token_print_cb ./src/core/token.c /^token_print_cb(void *p_void) {$/
+token_print_val ./src/core/token.c /^token_print_val(Token *p_token) {$/
+token_ref_down_cb ./src/core/token.c /^token_ref_down_cb(void *p_void) {$/
+tree_delete ./src/data/tree.c /^tree_delete(Tree *p_tree) {$/
+tree_new ./src/data/tree.c /^tree_new() {$/
+tree_print ./src/data/tree.c /^tree_print(Tree *p_tree) {$/
+treeiterator_delete ./src/data/tree.c /^treeiterator_delete(TreeIterator *p_iter) {$/
+treeiterator_has_next ./src/data/tree.c /^treeiterator_has_next(TreeIterator *p_iter) {$/
+treeiterator_new ./src/data/tree.c /^treeiterator_new(Tree *p_tree) {$/
+treeiterator_next ./src/data/tree.c /^treeiterator_next(TreeIterator *p_iter) {$/
+treeiteratorstate_delete ./src/data/tree.c /^treeiteratorstate_delete(TreeIteratorState *p_stat/
+treeiteratorstate_new ./src/data/tree.c /^treeiteratorstate_new(TreeNode *ptn) {$/
+treenode_delete ./src/data/tree.c /^treenode_delete(TreeNode *p_treenode) {$/
+treenode_insert_left ./src/data/tree.c /^treenode_insert_left(TreeNode *p_treenode, TreeNod/
+treenode_insert_right ./src/data/tree.c /^treenode_insert_right(TreeNode *p_treenode, TreeNo/
+treenode_new ./src/data/tree.c /^treenode_new(void *p_val) {$/
+treenode_new2 ./src/data/tree.c /^treenode_new2(void *p_val, void *p_val2) {$/
+tt_get_name ./src/core/token.c /^tt_get_name(TokenType tt_cur) {$/
+tupel_delete ./src/data/tupel.c /^tupel_delete(Tupel *p_tupel) {$/
+tupel_new ./src/data/tupel.c /^tupel_new() {$/
diff --git a/tmp/test.fy b/tmp/test.fy
index da59a2a..afe2cec 100644
--- a/tmp/test.fy
+++ b/tmp/test.fy
@@ -1,26 +1,3 @@
-my foo = 1;
-if 1 {
- say foo;
-}
-
-say 1 + 1;
-
-
-#my foo = [1 2 3];
-# Prints num of elements in foo
-#assert "TT_INTEGER" == type say integer foo;
-
-#my bar = [1 2 3];
-# Prints num of elements in bar
-#assert "TT_DOUBLE" == type say double bar;
-
-#my baz = [1 2 3];
-# Prints num of elements in baz
-#assert "TT_STRING" == type say string baz;
-
-# Prints "1 3 5 6\n"
-#say [1 3 5 6];
-
-#my foo = 2 * 3 + 1.2;
+my foo = [1, 2.2, "3"];
diff --git a/tmp/test.out b/tmp/test.out
index 9028487..afe2cec 100644
--- a/tmp/test.out
+++ b/tmp/test.out
@@ -1,114 +1,3 @@
-my foo = 1;
-if 1 {
- say foo;
-}
-
-say 1 + 1;
-
-
-#my foo = [1 2 3];
-# Prints num of elements in foo
-#assert "TT_INTEGER" == type say integer foo;
-
-#my bar = [1 2 3];
-# Prints num of elements in bar
-#assert "TT_DOUBLE" == type say double bar;
-
-#my baz = [1 2 3];
-# Prints num of elements in baz
-#assert "TT_STRING" == type say string baz;
-
-# Prints "1 3 5 6\n"
-#say [1 3 5 6];
-
-#my foo = 2 * 3 + 1.2;
-Token (org=1, id=00000, line=00002, pos=0003, type=TT_MY, val=my, ival=0, dval=0.000000, refs=1)
-Token (org=1, id=00001, line=00002, pos=0007, type=TT_IDENT, val=foo, ival=0, dval=0.000000, refs=1)
-Token (org=1, id=00002, line=00002, pos=0009, type=TT_ASSIGN, val==, ival=0, dval=0.000000, refs=1)
-Token (org=1, id=00003, line=00002, pos=0011, type=TT_INTEGER, val=1, ival=1, dval=0.000000, refs=1)
-Token (org=1, id=00004, line=00002, pos=0012, type=TT_SEMICOLON, val=;, ival=0, dval=0.000000, refs=1)
-Token (org=1, id=00005, line=00004, pos=0003, type=TT_IF, val=if, ival=0, dval=0.000000, refs=1)
-Token (org=1, id=00006, line=00004, pos=0005, type=TT_INTEGER, val=1, ival=1, dval=0.000000, refs=1)
-Token (org=1, id=00007, line=00004, pos=0007, type=TT_PARANT_CL, val={, ival=0, dval=0.000000, refs=1)
-Token (org=1, id=00008, line=00005, pos=0005, type=TT_IDENT, val=say, ival=0, dval=0.000000, refs=1)
-Token (org=1, id=00009, line=00005, pos=0009, type=TT_IDENT, val=foo, ival=0, dval=0.000000, refs=1)
-Token (org=1, id=00010, line=00005, pos=0010, type=TT_SEMICOLON, val=;, ival=0, dval=0.000000, refs=1)
-Token (org=1, id=00011, line=00006, pos=0002, type=TT_PARANT_CR, val=}, ival=0, dval=0.000000, refs=1)
-Token (org=1, id=00012, line=00008, pos=0004, type=TT_IDENT, val=say, ival=0, dval=0.000000, refs=1)
-Token (org=1, id=00013, line=00008, pos=0006, type=TT_INTEGER, val=1, ival=1, dval=0.000000, refs=1)
-Token (org=1, id=00014, line=00008, pos=0008, type=TT_ADD, val=+, ival=0, dval=0.000000, refs=1)
-Token (org=1, id=00015, line=00008, pos=0010, type=TT_INTEGER, val=1, ival=1, dval=0.000000, refs=1)
-Token (org=1, id=00016, line=00008, pos=0011, type=TT_SEMICOLON, val=;, ival=0, dval=0.000000, refs=1)
-DEBUG(Track: ./src/core/interpret.c:_program:166)
-DEBUG(Token: my)
-DEBUG(Track: ./src/core/interpret.c:_statement:448)
-DEBUG(Token: my)
-DEBUG(Track: ./src/core/interpret.c:_proc_decl:380)
-DEBUG(Token: my)
-DEBUG(Track: ./src/core/interpret.c:_func_decl:414)
-DEBUG(Token: my)
-DEBUG(Track: ./src/core/interpret.c:_var_decl:181)
-DEBUG(Token: my)
-DEBUG(Track: ./src/core/interpret.c:_var_assign:216)
-DEBUG(Token: foo)
-DEBUG(Track: ./src/core/interpret.c:_compare:640)
-DEBUG(Token: 1)
-DEBUG(Track: ./src/core/interpret.c:_sum:691)
-DEBUG(Token: 1)
-DEBUG(Track: ./src/core/interpret.c:_product:742)
-DEBUG(Token: 1)
-DEBUG(Track: ./src/core/interpret.c:_product2:780)
-DEBUG(Token: 1)
-DEBUG(Track: ./src/core/interpret.c:_term:814)
-DEBUG(Token: 1)
-DEBUG(Track: ./src/core/interpret.c:_var_list:260)
-DEBUG(Token: ;)
-DEBUG(Track: ./src/core/interpret.c:_statement:448)
-DEBUG(Token: if)
-DEBUG(Track: ./src/core/interpret.c:_proc_decl:380)
-DEBUG(Token: if)
-DEBUG(Track: ./src/core/interpret.c:_func_decl:414)
-DEBUG(Token: if)
-DEBUG(Track: ./src/core/interpret.c:_var_decl:181)
-DEBUG(Token: if)
-DEBUG(Track: ./src/core/interpret.c:_control:507)
-DEBUG(Token: if)
-DEBUG(Track: ./src/core/interpret.c:_compare:640)
-DEBUG(Token: 1)
-DEBUG(Track: ./src/core/interpret.c:_sum:691)
-DEBUG(Token: 1)
-DEBUG(Track: ./src/core/interpret.c:_product:742)
-DEBUG(Token: 1)
-DEBUG(Track: ./src/core/interpret.c:_product2:780)
-DEBUG(Token: 1)
-DEBUG(Track: ./src/core/interpret.c:_term:814)
-DEBUG(Token: 1)
-DEBUG(Track: ./src/core/interpret.c:_program:166)
-DEBUG(Token: say)
-DEBUG(Track: ./src/core/interpret.c:_statement:448)
-DEBUG(Token: say)
-DEBUG(Track: ./src/core/interpret.c:_proc_decl:380)
-DEBUG(Token: say)
-DEBUG(Track: ./src/core/interpret.c:_func_decl:414)
-DEBUG(Token: say)
-DEBUG(Track: ./src/core/interpret.c:_var_decl:181)
-DEBUG(Token: say)
-DEBUG(Track: ./src/core/interpret.c:_control:507)
-DEBUG(Token: say)
-DEBUG(Track: ./src/core/interpret.c:_expression:483)
-DEBUG(Token: say)
-DEBUG(Track: ./src/core/interpret.c:_compare:640)
-DEBUG(Token: say)
-DEBUG(Track: ./src/core/interpret.c:_sum:691)
-DEBUG(Token: say)
-DEBUG(Track: ./src/core/interpret.c:_product:742)
-DEBUG(Token: say)
-DEBUG(Track: ./src/core/interpret.c:_product2:780)
-DEBUG(Token: say)
-DEBUG(Track: ./src/core/interpret.c:_term:814)
-DEBUG(Token: say)
-DEBUG(Track: ./src/core/interpret.c:_compare:640)
-DEBUG(Token: foo)
-DEBUG(Track: ./src/core/
\ No newline at end of file
+my foo = [1, 2.2, "3"];
--
cgit v1.2.3