diff options
author | David Robillard <d@drobilla.net> | 2010-04-08 20:09:16 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-04-08 20:09:16 +0000 |
commit | 55b6a3f313670d2cb13847d1f1b04fe3e4b21d63 (patch) | |
tree | 200b7dbe00107507e8111b07747bef2cd3f6a958 | |
parent | 9d9fa6162295f3813d20f7a3ad4e07ccd6087c3c (diff) | |
download | resp-55b6a3f313670d2cb13847d1f1b04fe3e4b21d63.tar.gz resp-55b6a3f313670d2cb13847d1f1b04fe3e4b21d63.tar.bz2 resp-55b6a3f313670d2cb13847d1f1b04fe3e4b21d63.zip |
Tuplr -> Resp (RESource Processing).
git-svn-id: http://svn.drobilla.net/resp/resp@252 ad02d1e2-f140-0410-9f75-f8b11f17cedd
-rw-r--r-- | Makefile | 20 | ||||
-rw-r--r-- | resp.dox (renamed from tuplr.dox) | 8 | ||||
-rwxr-xr-x | resp_highlight.py (renamed from tuplr_highlight.py) | 22 | ||||
-rw-r--r-- | src/c.cpp | 14 | ||||
-rw-r--r-- | src/compile.cpp | 10 | ||||
-rw-r--r-- | src/constrain.cpp | 10 | ||||
-rw-r--r-- | src/cps.cpp | 34 | ||||
-rw-r--r-- | src/gc.cpp | 10 | ||||
-rw-r--r-- | src/lex.cpp | 10 | ||||
-rw-r--r-- | src/lift.cpp | 10 | ||||
-rw-r--r-- | src/llvm.cpp | 16 | ||||
-rw-r--r-- | src/parse.cpp | 10 | ||||
-rw-r--r-- | src/pprint.cpp | 10 | ||||
-rw-r--r-- | src/repl.cpp | 10 | ||||
-rw-r--r-- | src/resp.cpp (renamed from src/tuplr.cpp) | 16 | ||||
-rw-r--r-- | src/resp.hpp (renamed from src/tuplr.hpp) | 34 | ||||
-rw-r--r-- | src/resp_gc.cpp (renamed from src/tuplr_gc.cpp) | 12 | ||||
-rw-r--r-- | src/unify.cpp | 10 | ||||
-rwxr-xr-x | test.sh | 14 | ||||
-rw-r--r-- | test/ack.resp (renamed from test/ack.tpr) | 0 | ||||
-rw-r--r-- | test/def.resp (renamed from test/def.tpr) | 0 | ||||
-rw-r--r-- | test/fac.resp (renamed from test/fac.tpr) | 0 | ||||
-rw-r--r-- | test/intro.resp (renamed from test/intro.tpr) | 4 | ||||
-rw-r--r-- | test/nest.resp (renamed from test/nest.tpr) | 0 | ||||
-rw-r--r-- | test/poly.resp (renamed from test/poly.tpr) | 0 | ||||
-rw-r--r-- | test/tup.resp (renamed from test/tup.tpr) | 0 |
26 files changed, 142 insertions, 142 deletions
@@ -16,7 +16,7 @@ LDFLAGS=-rdynamic -lm -ldl #COMMON_FLAGS+=-fprofile-arcs -ftest-coverage #LDFLAGS+=-lgcov -all: builddir build/tuplr +all: builddir build/resp builddir: mkdir -p build @@ -33,26 +33,26 @@ OBJECTS = \ build/pprint.o \ build/repl.o \ build/tlsf.o \ - build/tuplr.o \ + build/resp.o \ build/unify.o \ - build/tuplr_gc.o + build/resp_gc.o LLVM_OBJECTS = build/llvm.o #LLVM_OBJECTS = -build/tuplr: $(OBJECTS) $(LLVM_OBJECTS) +build/resp: $(OBJECTS) $(LLVM_OBJECTS) g++ -o $@ $(OBJECTS) $(LLVM_OBJECTS) $(LDFLAGS) $(LLVM_LDFLAGS) -build/%.o: src/%.cpp src/tuplr.hpp +build/%.o: src/%.cpp src/resp.hpp g++ $(CXXFLAGS) -o $@ -c $< build/tlsf.o: src/tlsf.c src/tlsf.h gcc $(CFLAGS) -o $@ -c $< -build/llvm.o: src/llvm.cpp src/tuplr.hpp +build/llvm.o: src/llvm.cpp src/resp.hpp g++ $(CXXFLAGS) $(LLVM_CXXFLAGS) -o $@ -c src/llvm.cpp -build/%.so: src/%.cpp src/tuplr.hpp +build/%.so: src/%.cpp src/resp.hpp g++ -shared $(CXXFLAGS) -o $@ $^ clean: @@ -62,9 +62,9 @@ check: ./test.sh doc: - doxygen ./tuplr.dox + doxygen ./resp.dox install-support: install -d ~/.vim/indent ~/.vim/syntax - install -m 644 ./support/vim/indent/tuplr.vim ~/.vim/indent/tuplr.vim - install -m 644 ./support/vim/syntax/tuplr.vim ~/.vim/syntax/tuplr.vim + install -m 644 ./support/vim/indent/resp.vim ~/.vim/indent/resp.vim + install -m 644 ./support/vim/syntax/resp.vim ~/.vim/syntax/resp.vim @@ -25,7 +25,7 @@ DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. -PROJECT_NAME = Tuplr +PROJECT_NAME = Resp # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or @@ -573,9 +573,9 @@ INPUT = \ src/parse.cpp \ src/pprint.cpp \ src/repl.cpp \ - src/tuplr.cpp \ - src/tuplr.hpp \ - src/tuplr_gc.cpp \ + src/resp.cpp \ + src/resp.hpp \ + src/resp_gc.cpp \ src/unify.cpp # This tag can be used to specify the character encoding of the source files diff --git a/tuplr_highlight.py b/resp_highlight.py index c48831d..11ae298 100755 --- a/tuplr_highlight.py +++ b/resp_highlight.py @@ -13,11 +13,11 @@ from pygments.style import Style #from pygments.styles import STYLE_MAP #print STYLE_MAP.keys() -class TuplrLexer(RegexLexer): - name = 'Tuplr' - aliases = ['tuplr', 'tpr'] - filenames = ['*.tpr'] - mimetypes = ['text/x-tuplr', 'application/x-tuplr'] +class RespLexer(RegexLexer): + name = 'Resp' + aliases = ['resp'] + filenames = ['*.resp'] + mimetypes = ['text/x-resp', 'application/x-resp'] keywords = [ 'fn', 'def', 'if', 'match', 'ns', 'type' ] builtins = [ 'cons', 'car', 'cdr' ] @@ -70,7 +70,7 @@ class TuplrLexer(RegexLexer): ], } -class TuplrStyleDark(Style): +class RespStyleDark(Style): default_style = "#FFF" background_color = "#222" styles = { @@ -84,7 +84,7 @@ class TuplrStyleDark(Style): Number: '#F88' } -class TuplrStyleLight(Style): +class RespStyleLight(Style): default_style = "#FFF" background_color = "#EEE" styles = { @@ -108,10 +108,10 @@ infile.close() if re.match('.*\.html$', sys.argv[2]): - style = TuplrStyleDark + style = RespStyleDark formatter = HtmlFormatter(style=style) elif re.match('.*\.tex$', sys.argv[2]): - style = TuplrStyleLight + style = RespStyleLight formatter = LatexFormatter(style=style) if re.match('.*\.html$', sys.argv[2]): @@ -128,7 +128,7 @@ if re.match('.*\.html$', sys.argv[2]): </head> <body> ''' - print >>outfile, highlight(text, TuplrLexer(), formatter) + print >>outfile, highlight(text, RespLexer(), formatter) print >>outfile, '''</body> </html> ''' @@ -143,7 +143,7 @@ if re.match('.*\.tex$', sys.argv[2]): print >>outfile, '\\newcommand\\PYlambda{$\\lambda$}' print >>outfile, '\\newcommand\\PYbiglambda{$\\Lambda$}' print >>outfile, '\\begin{document}' - out = highlight(text, TuplrLexer(), formatter) + out = highlight(text, RespLexer(), formatter) out = out.replace('[fn', '[@PYlambda') out = out.replace('[Fn', '[@PYbiglambda') print >>outfile, out @@ -1,18 +1,18 @@ -/* Tuplr: A programming language +/* Resp: A programming language * Copyright (C) 2008-2009 David Robillard <dave@drobilla.net> * - * Tuplr is free software: you can redistribute it and/or modify it under + * Resp is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * - * Tuplr is distributed in the hope that it will be useful, but WITHOUT + * Resp is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General * Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with Tuplr. If not, see <http://www.gnu.org/licenses/>. + * along with Resp. If not, see <http://www.gnu.org/licenses/>. */ /** @file @@ -22,7 +22,7 @@ #include <map> #include <sstream> #include <boost/format.hpp> -#include "tuplr.hpp" +#include "resp.hpp" using namespace std; using boost::format; @@ -80,7 +80,7 @@ struct CEngine : public Engine { : out( "#include <stdint.h>\n" "#include <stdbool.h>\n" - "void* tuplr_gc_allocate(unsigned size, uint8_t tag);\n\n") + "void* resp_gc_allocate(unsigned size, uint8_t tag);\n\n") { } @@ -157,7 +157,7 @@ struct CEngine : public Engine { }; Engine* -tuplr_new_c_engine() +resp_new_c_engine() { return new CEngine(); } diff --git a/src/compile.cpp b/src/compile.cpp index 977ab27..2cf3b74 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -1,25 +1,25 @@ -/* Tuplr: A programming language +/* Resp: A programming language * Copyright (C) 2008-2009 David Robillard <dave@drobilla.net> * - * Tuplr is free software: you can redistribute it and/or modify it under + * Resp is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * - * Tuplr is distributed in the hope that it will be useful, but WITHOUT + * Resp is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General * Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with Tuplr. If not, see <http://www.gnu.org/licenses/>. + * along with Resp. If not, see <http://www.gnu.org/licenses/>. */ /** @file * @brief Compile all code (compilation pass 2) */ -#include "tuplr.hpp" +#include "resp.hpp" using namespace std; diff --git a/src/constrain.cpp b/src/constrain.cpp index d419036..4ab3924 100644 --- a/src/constrain.cpp +++ b/src/constrain.cpp @@ -1,18 +1,18 @@ -/* Tuplr Type Inferencing +/* Resp Type Inferencing * Copyright (C) 2008-2009 David Robillard <dave@drobilla.net> * - * Tuplr is free software: you can redistribute it and/or modify it under + * Resp is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * - * Tuplr is distributed in the hope that it will be useful, but WITHOUT + * Resp is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General * Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with Tuplr. If not, see <http://www.gnu.org/licenses/>. + * along with Resp. If not, see <http://www.gnu.org/licenses/>. */ /** @file @@ -20,7 +20,7 @@ */ #include <set> -#include "tuplr.hpp" +#include "resp.hpp" #define CONSTRAIN_LITERAL(CT, NAME) \ template<> void \ diff --git a/src/cps.cpp b/src/cps.cpp index 6711556..831f53f 100644 --- a/src/cps.cpp +++ b/src/cps.cpp @@ -1,18 +1,18 @@ -/* Tuplr Type Inferencing +/* Resp Type Inferencing * Copyright (C) 2008-2009 David Robillard <dave@drobilla.net> * - * Tuplr is free software: you can redistribute it and/or modify it under + * Resp is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * - * Tuplr is distributed in the hope that it will be useful, but WITHOUT + * Resp is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General * Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with Tuplr. If not, see <http://www.gnu.org/licenses/>. + * along with Resp. If not, see <http://www.gnu.org/licenses/>. */ /** @file @@ -20,18 +20,18 @@ */ #include <set> -#include "tuplr.hpp" +#include "resp.hpp" /** (cps x cont) => (cont x) */ AST* -AST::cps(TEnv& tenv, AST* cont) +AST::cps(TEnv& tenv, AST* cont) const { return tup<ACall>(loc, cont, this, 0); } /** (cps (fn (a ...) body) cont) => (cont (fn (a ... k) (cps body k)) */ AST* -AFn::cps(TEnv& tenv, AST* cont) +AFn::cps(TEnv& tenv, AST* cont) const { ATuple* copyProt = new ATuple(*prot()); ASymbol* contArg = tenv.penv.gensym("_k"); @@ -45,14 +45,14 @@ AFn::cps(TEnv& tenv, AST* cont) } AST* -APrimitive::cps(TEnv& tenv, AST* cont) +APrimitive::cps(TEnv& tenv, AST* cont) const { return value() ? tup<ACall>(loc, cont, this, 0) : ACall::cps(tenv, cont); } /** (cps (f a b ...)) => (a (fn (x) (b (fn (y) ... (cont (f x y ...)) */ AST* -ACall::cps(TEnv& tenv, AST* cont) +ACall::cps(TEnv& tenv, AST* cont) const { std::vector< std::pair<AFn*, AST*> > funcs; AFn* fn = NULL; @@ -62,10 +62,10 @@ ACall::cps(TEnv& tenv, AST* cont) // Argument evaluation continuations are not themselves in CPS. // Each makes a tail call to the next, and the last makes a tail // call to the continuation of this call - iterator firstFnIter = end(); - AFn* firstFn = NULL; - ssize_t index = 0; - FOREACHP(iterator, i, this) { + const_iterator firstFnIter = end(); + AFn* firstFn = NULL; + ssize_t index = 0; + FOREACHP(const_iterator, i, this) { if (!(*i)->to<ATuple*>()) { funcs.push_back(make_pair((AFn*)NULL, (*i))); } else { @@ -102,9 +102,9 @@ ACall::cps(TEnv& tenv, AST* cont) } else { assert(head()->value()); ACall* ret = tup<ACall>(loc, 0); - FOREACHP(iterator, i, this) + FOREACHP(const_iterator, i, this) ret->push_back((*i)); - if (!to<APrimitive*>()) + if (!to<const APrimitive*>()) ret->push_back(cont); return ret; } @@ -112,7 +112,7 @@ ACall::cps(TEnv& tenv, AST* cont) /** (cps (def x y)) => (y (fn (x) (cont))) */ AST* -ADef::cps(TEnv& tenv, AST* cont) +ADef::cps(TEnv& tenv, AST* cont) const { AST* val = body()->cps(tenv, cont); ACall* valCall = val->to<ACall*>(); @@ -122,7 +122,7 @@ ADef::cps(TEnv& tenv, AST* cont) /** (cps (if c t ... e)) => */ AST* -AIf::cps(TEnv& tenv, AST* cont) +AIf::cps(TEnv& tenv, AST* cont) const { ASymbol* argSym = tenv.penv.gensym("c"); const_iterator i = begin(); @@ -1,18 +1,18 @@ -/* Tuplr: A programming language +/* Resp: A programming language * Copyright (C) 2008-2009 David Robillard <dave@drobilla.net> * - * Tuplr is free software: you can redistribute it and/or modify it under + * Resp is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * - * Tuplr is distributed in the hope that it will be useful, but WITHOUT + * Resp is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General * Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with Tuplr. If not, see <http://www.gnu.org/licenses/>. + * along with Resp. If not, see <http://www.gnu.org/licenses/>. */ /** @file @@ -22,7 +22,7 @@ #include <cassert> #include <set> #include <iostream> -#include "tuplr.hpp" +#include "resp.hpp" #include "tlsf.h" using namespace std; diff --git a/src/lex.cpp b/src/lex.cpp index 597ca34..0097346 100644 --- a/src/lex.cpp +++ b/src/lex.cpp @@ -1,18 +1,18 @@ -/* Tuplr: A programming language +/* Resp: A programming language * Copyright (C) 2008-2009 David Robillard <dave@drobilla.net> * - * Tuplr is free software: you can redistribute it and/or modify it under + * Resp is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * - * Tuplr is distributed in the hope that it will be useful, but WITHOUT + * Resp is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General * Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with Tuplr. If not, see <http://www.gnu.org/licenses/>. + * along with Resp. If not, see <http://www.gnu.org/licenses/>. */ /** @file @@ -21,7 +21,7 @@ #include <stdio.h> #include <stack> -#include "tuplr.hpp" +#include "resp.hpp" using namespace std; diff --git a/src/lift.cpp b/src/lift.cpp index 636757c..733c7b6 100644 --- a/src/lift.cpp +++ b/src/lift.cpp @@ -1,25 +1,25 @@ -/* Tuplr: A programming language +/* Resp: A programming language * Copyright (C) 2008-2009 David Robillard <dave@drobilla.net> * - * Tuplr is free software: you can redistribute it and/or modify it under + * Resp is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * - * Tuplr is distributed in the hope that it will be useful, but WITHOUT + * Resp is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General * Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with Tuplr. If not, see <http://www.gnu.org/licenses/>. + * along with Resp. If not, see <http://www.gnu.org/licenses/>. */ /** @file * @brief Lift functions (compilation pass 1) */ -#include "tuplr.hpp" +#include "resp.hpp" using namespace std; diff --git a/src/llvm.cpp b/src/llvm.cpp index fdb9783..5b6d69f 100644 --- a/src/llvm.cpp +++ b/src/llvm.cpp @@ -1,18 +1,18 @@ -/* Tuplr: A programming language +/* Resp: A programming language * Copyright (C) 2008-2009 David Robillard <dave@drobilla.net> * - * Tuplr is free software: you can redistribute it and/or modify it under + * Resp is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * - * Tuplr is distributed in the hope that it will be useful, but WITHOUT + * Resp is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General * Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with Tuplr. If not, see <http://www.gnu.org/licenses/>. + * along with Resp. If not, see <http://www.gnu.org/licenses/>. */ /** @file @@ -39,7 +39,7 @@ #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetSelect.h" #include "llvm/Transforms/Scalar.h" -#include "tuplr.hpp" +#include "resp.hpp" using namespace llvm; using namespace std; @@ -54,7 +54,7 @@ struct LLVMEngine : public Engine { : builder(context) { InitializeNativeTarget(); - module = new Module("tuplr", context); + module = new Module("resp", context); emp = new ExistingModuleProvider(module); engine = EngineBuilder(module).create(); opt = new FunctionPassManager(emp); @@ -71,7 +71,7 @@ struct LLVMEngine : public Engine { std::vector<const Type*> argsT(1, Type::getInt32Ty(context)); // unsigned size FunctionType* funcT = FunctionType::get(PointerType::get(Type::getInt8Ty(context), 0), argsT, false); alloc = Function::Create(funcT, Function::ExternalLinkage, - "tuplr_gc_allocate", module); + "resp_gc_allocate", module); } ~LLVMEngine() @@ -227,7 +227,7 @@ struct LLVMEngine : public Engine { }; Engine* -tuplr_new_llvm_engine() +resp_new_llvm_engine() { return new LLVMEngine(); } diff --git a/src/parse.cpp b/src/parse.cpp index 52d3d78..1c448db 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -1,25 +1,25 @@ -/* Tuplr: A programming language +/* Resp: A programming language * Copyright (C) 2008-2009 David Robillard <dave@drobilla.net> * - * Tuplr is free software: you can redistribute it and/or modify it under + * Resp is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * - * Tuplr is distributed in the hope that it will be useful, but WITHOUT + * Resp is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General * Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with Tuplr. If not, see <http://www.gnu.org/licenses/>. + * along with Resp. If not, see <http://www.gnu.org/licenses/>. */ /** @file * @brief Parsing (build a code AST from a textual AST) */ -#include "tuplr.hpp" +#include "resp.hpp" using namespace std; diff --git a/src/pprint.cpp b/src/pprint.cpp index 8f1276d..7dd36c5 100644 --- a/src/pprint.cpp +++ b/src/pprint.cpp @@ -1,25 +1,25 @@ -/* Tuplr Serialisation +/* Resp Serialisation * Copyright (C) 2008-2009 David Robillard <dave@drobilla.net> * - * Tuplr is free software: you can redistribute it and/or modify it under + * Resp is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * - * Tuplr is distributed in the hope that it will be useful, but WITHOUT + * Resp is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General * Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with Tuplr. If not, see <http://www.gnu.org/licenses/>. + * along with Resp. If not, see <http://www.gnu.org/licenses/>. */ /** @file * @brief Pretty-print AST expressions */ -#include "tuplr.hpp" +#include "resp.hpp" ostream& operator<<(ostream& out, const AST* ast) diff --git a/src/repl.cpp b/src/repl.cpp index a5c6adf..9fa5781 100644 --- a/src/repl.cpp +++ b/src/repl.cpp @@ -1,18 +1,18 @@ -/* Tuplr: A programming language +/* Resp: A programming language * Copyright (C) 2008-2009 David Robillard <dave@drobilla.net> * - * Tuplr is free software: you can redistribute it and/or modify it under + * Resp is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * - * Tuplr is distributed in the hope that it will be useful, but WITHOUT + * Resp is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General * Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with Tuplr. If not, see <http://www.gnu.org/licenses/>. + * along with Resp. If not, see <http://www.gnu.org/licenses/>. */ /** @file @@ -22,7 +22,7 @@ #include <cerrno> #include <cstring> #include <fstream> -#include "tuplr.hpp" +#include "resp.hpp" using namespace std; diff --git a/src/tuplr.cpp b/src/resp.cpp index 5f54480..003a76c 100644 --- a/src/tuplr.cpp +++ b/src/resp.cpp @@ -1,18 +1,18 @@ -/* Tuplr: A programming language +/* Resp: A programming language * Copyright (C) 2008-2009 David Robillard <dave@drobilla.net> * - * Tuplr is free software: you can redistribute it and/or modify it under + * Resp is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * - * Tuplr is distributed in the hope that it will be useful, but WITHOUT + * Resp is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General * Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with Tuplr. If not, see <http://www.gnu.org/licenses/>. + * along with Resp. If not, see <http://www.gnu.org/licenses/>. */ /** @file @@ -22,7 +22,7 @@ #include <cerrno> #include <cstring> #include <fstream> -#include "tuplr.hpp" +#include "resp.hpp" using namespace std; @@ -33,7 +33,7 @@ print_usage(char* name, bool error) { ostream& os = error ? cerr : cout; os << "Usage: " << name << " [OPTION]... [FILE]..." << endl; - os << "Evaluate and/or compile Tuplr code" << endl; + os << "Evaluate and/or compile Resp code" << endl; os << endl; os << " -h Display this help and exit" << endl; os << " -r Enter REPL after evaluating files" << endl; @@ -80,9 +80,9 @@ main(int argc, char** argv) const string backend_name = (a != args.end() ? a->second : "llvm"); if (backend_name == "llvm") - engine = tuplr_new_llvm_engine(); + engine = resp_new_llvm_engine(); else if (backend_name == "c") - engine = tuplr_new_c_engine(); + engine = resp_new_c_engine(); if (!engine) { std::cerr << "Unable to open backend " << backend_name << std::endl; diff --git a/src/tuplr.hpp b/src/resp.hpp index 7cebaf4..81574e9 100644 --- a/src/tuplr.hpp +++ b/src/resp.hpp @@ -1,26 +1,26 @@ -/* Tuplr: A programming language +/* Resp: A programming language * Copyright (C) 2008-2009 David Robillard <dave@drobilla.net> * - * Tuplr is free software: you can redistribute it and/or modify it under + * Resp is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * - * Tuplr is distributed in the hope that it will be useful, but WITHOUT + * Resp is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General * Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with Tuplr. If not, see <http://www.gnu.org/licenses/>. + * along with Resp. If not, see <http://www.gnu.org/licenses/>. */ /** @file * @brief Interface and type definitions */ -#ifndef TUPLR_HPP -#define TUPLR_HPP +#ifndef RESP_HPP +#define RESP_HPP #include <stdarg.h> #include <stdint.h> @@ -86,8 +86,8 @@ struct Env : public list< vector< pair<K,V> > > { return &b->second; return NULL; } - bool topLevel(const K& key) { - for (typename Frame::iterator b = this->back().begin(); b != this->back().end(); ++b) + bool topLevel(const K& key) const { + for (typename Frame::const_iterator b = this->back().begin(); b != this->back().end(); ++b) if (b->first == key) return true; return false; @@ -195,7 +195,7 @@ struct AST : public Object { virtual bool operator==(const AST& o) const = 0; virtual bool contains(const AST* child) const { return false; } virtual void constrain(TEnv& tenv, Constraints& c) const {} - virtual AST* cps(TEnv& tenv, AST* cont); + virtual AST* cps(TEnv& tenv, AST* cont) const; virtual void lift(CEnv& cenv) {} virtual CVal compile(CEnv& cenv) = 0; string str() const { ostringstream ss; ss << this; return ss.str(); } @@ -396,7 +396,7 @@ struct AFn : public ATuple { AFn(Cursor c, AST* ast, va_list args) : ATuple(c, ast, args) {} bool operator==(const AST& rhs) const { return this == &rhs; } void constrain(TEnv& tenv, Constraints& c) const; - AST* cps(TEnv& tenv, AST* cont); + AST* cps(TEnv& tenv, AST* cont) const; void lift(CEnv& cenv); CVal compile(CEnv& cenv); const ATuple* prot() const { return (*(begin() + 1))->to<const ATuple*>(); } @@ -419,7 +419,7 @@ struct ACall : public ATuple { ACall(const ATuple* exp) : ATuple(*exp) {} ACall(Cursor c, AST* ast, va_list args) : ATuple(c, ast, args) {} void constrain(TEnv& tenv, Constraints& c) const; - AST* cps(TEnv& tenv, AST* cont); + AST* cps(TEnv& tenv, AST* cont) const; void lift(CEnv& cenv); CVal compile(CEnv& cenv); }; @@ -441,7 +441,7 @@ struct ADef : public ACall { const AST* body() const { return *(begin() + 2); } AST* body() { return *(begin() + 2); } void constrain(TEnv& tenv, Constraints& c) const; - AST* cps(TEnv& tenv, AST* cont); + AST* cps(TEnv& tenv, AST* cont) const; void lift(CEnv& cenv); CVal compile(CEnv& cenv); }; @@ -451,7 +451,7 @@ struct AIf : public ACall { AIf(const ATuple* exp) : ACall(exp) {} AIf(Cursor c, AST* ast, va_list args) : ACall(c, ast, args) {} void constrain(TEnv& tenv, Constraints& c) const; - AST* cps(TEnv& tenv, AST* cont); + AST* cps(TEnv& tenv, AST* cont) const; CVal compile(CEnv& cenv); }; @@ -479,7 +479,7 @@ struct APrimitive : public ACall { return true; } void constrain(TEnv& tenv, Constraints& c) const; - AST* cps(TEnv& tenv, AST* cont); + AST* cps(TEnv& tenv, AST* cont) const; CVal compile(CEnv& cenv); }; @@ -664,8 +664,8 @@ struct Engine { virtual const string call(CEnv& cenv, CFunc f, AType* retT) = 0; }; -Engine* tuplr_new_llvm_engine(); -Engine* tuplr_new_c_engine(); +Engine* resp_new_llvm_engine(); +Engine* resp_new_c_engine(); /// Compile-Time Environment struct CEnv { @@ -724,4 +724,4 @@ void initLang(PEnv& penv, TEnv& tenv); int eval(CEnv& cenv, const string& name, istream& is, bool execute); int repl(CEnv& cenv); -#endif // TUPLR_HPP +#endif // RESP_HPP diff --git a/src/tuplr_gc.cpp b/src/resp_gc.cpp index 7bd35a4..4be07fb 100644 --- a/src/tuplr_gc.cpp +++ b/src/resp_gc.cpp @@ -1,25 +1,25 @@ -/* Tuplr: A programming language +/* Resp: A programming language * Copyright (C) 2008-2009 David Robillard <dave@drobilla.net> * - * Tuplr is free software: you can redistribute it and/or modify it under + * Resp is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * - * Tuplr is distributed in the hope that it will be useful, but WITHOUT + * Resp is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General * Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with Tuplr. If not, see <http://www.gnu.org/licenses/>. + * along with Resp. If not, see <http://www.gnu.org/licenses/>. */ /** @file * @brief Garbage collection shared library interface */ -#include "tuplr.hpp" +#include "resp.hpp" #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -27,7 +27,7 @@ extern "C" { void* -tuplr_gc_allocate(unsigned size) +resp_gc_allocate(unsigned size) { static const size_t COLLECT_SIZE = 8 * 1024 * 1024; // 8 MiB diff --git a/src/unify.cpp b/src/unify.cpp index dbc938f..3f06868 100644 --- a/src/unify.cpp +++ b/src/unify.cpp @@ -1,18 +1,18 @@ -/* Tuplr Unification +/* Resp Unification * Copyright (C) 2008-2009 David Robillard <dave@drobilla.net> * - * Tuplr is free software: you can redistribute it and/or modify it under + * Resp is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * - * Tuplr is distributed in the hope that it will be useful, but WITHOUT + * Resp is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General * Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with Tuplr. If not, see <http://www.gnu.org/licenses/>. + * along with Resp. If not, see <http://www.gnu.org/licenses/>. */ /** @file @@ -20,7 +20,7 @@ */ #include <set> -#include "tuplr.hpp" +#include "resp.hpp" /** Build a type substitution for calling a generic function type * with a specific set of argument types @@ -3,7 +3,7 @@ run() { prog=$1 desired=$2 - out=`./build/tuplr $prog` + out=`./build/resp $prog` if [ "$out" != "$desired" ]; then echo "FAIL: $prog"; echo " Expected: \"$desired\""; @@ -13,9 +13,9 @@ run() { fi } -run './test/ack.tpr' '8189 : Int' -run './test/def.tpr' '3 : Int' -run './test/fac.tpr' '720 : Int' -run './test/poly.tpr' '#t : Bool' -run './test/nest.tpr' '6 : Int' -run './test/tup.tpr' '5 : Int' +run './test/ack.resp' '8189 : Int' +run './test/def.resp' '3 : Int' +run './test/fac.resp' '720 : Int' +run './test/poly.resp' '#t : Bool' +run './test/nest.resp' '6 : Int' +run './test/tup.resp' '5 : Int' diff --git a/test/ack.tpr b/test/ack.resp index 76fb397..76fb397 100644 --- a/test/ack.tpr +++ b/test/ack.resp diff --git a/test/def.tpr b/test/def.resp index dd9a0c8..dd9a0c8 100644 --- a/test/def.tpr +++ b/test/def.resp diff --git a/test/fac.tpr b/test/fac.resp index 0fb687c..0fb687c 100644 --- a/test/fac.tpr +++ b/test/fac.resp diff --git a/test/intro.tpr b/test/intro.resp index 73a21bb..bf8d8c8 100644 --- a/test/intro.tpr +++ b/test/intro.resp @@ -2,7 +2,7 @@ ;;; Data types -; Tuplr uses algebraic datatypes which can also be used in an +; Resp uses algebraic datatypes which can also be used in an ; object based style with more flexibility than typical of ; languages with algebraic datatypes ; @@ -88,7 +88,7 @@ ;; Everything Is A ... -; Everything in Tuplr is a closure. Records are simply closures with some +; Everything in Resp is a closure. Records are simply closures with some ; internal definitions exposed (much like modules). ; Objects can be created with their constructors: diff --git a/test/nest.tpr b/test/nest.resp index 3085737..3085737 100644 --- a/test/nest.tpr +++ b/test/nest.resp diff --git a/test/poly.tpr b/test/poly.resp index 33922e3..33922e3 100644 --- a/test/poly.tpr +++ b/test/poly.resp diff --git a/test/tup.tpr b/test/tup.resp index 17d59cb..17d59cb 100644 --- a/test/tup.tpr +++ b/test/tup.resp |