diff --git a/.gitignore b/.gitignore index 4ec7f5f..9a41a86 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ bintest.bin .stfolder kraken *.c +kraken_bac +kraken_deprecated diff --git a/captian.sh b/captian.sh new file mode 100755 index 0000000..eb5e422 --- /dev/null +++ b/captian.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +kraken="kraken" + +if [ -s "$kraken" ] +then + #echo "$kraken exists, calling" + echo "$kraken exists!" +else + echo "gotta make $kraken, testing for compilers to do so" + if ! [ -s "${kraken}_bac" ] + then + if ! [ -s "${kraken}_deprecated" ] + then + echo "no ${kraken}_deprecated, using Cephelpod" + cp -r stdlib deprecated_compiler + cp krakenGrammer.kgm deprecated_compiler + cp kraken.krak deprecated_compiler + pushd deprecated_compiler + mkdir build + pushd build + cmake .. + make + popd + mkdir build_kraken + mv kraken.krak build_kraken + pushd build_kraken + ../build/kraken kraken.krak + popd + popd + cp deprecated_compiler/build_kraken/kraken/kraken ./kraken_deprecated + else + echo "${kraken}_deprecated exists, calling" + fi + ./kraken_deprecated kraken.krak kraken_bac + else + echo "${kraken}_bac exists, calling" + fi + ./${kraken}_bac ${kraken}.krak +fi + +#./${kraken} $@ + + diff --git a/deprecated_compiler/.gitignore b/deprecated_compiler/.gitignore new file mode 100644 index 0000000..1200625 --- /dev/null +++ b/deprecated_compiler/.gitignore @@ -0,0 +1,5 @@ +build +build_kraken +krakenGrammer.kgm +krakenGrammer.kgm.comp +stdlib diff --git a/CMakeLists.txt b/deprecated_compiler/CMakeLists.txt similarity index 100% rename from CMakeLists.txt rename to deprecated_compiler/CMakeLists.txt diff --git a/include/ASTData.h b/deprecated_compiler/include/ASTData.h similarity index 100% rename from include/ASTData.h rename to deprecated_compiler/include/ASTData.h diff --git a/include/ASTTransformation.h b/deprecated_compiler/include/ASTTransformation.h similarity index 100% rename from include/ASTTransformation.h rename to deprecated_compiler/include/ASTTransformation.h diff --git a/include/CCodeTriple.h b/deprecated_compiler/include/CCodeTriple.h similarity index 100% rename from include/CCodeTriple.h rename to deprecated_compiler/include/CCodeTriple.h diff --git a/include/CGenerator.h b/deprecated_compiler/include/CGenerator.h similarity index 100% rename from include/CGenerator.h rename to deprecated_compiler/include/CGenerator.h diff --git a/include/CollapseTransformation.h b/deprecated_compiler/include/CollapseTransformation.h similarity index 100% rename from include/CollapseTransformation.h rename to deprecated_compiler/include/CollapseTransformation.h diff --git a/include/DeleteTransformation.h b/deprecated_compiler/include/DeleteTransformation.h similarity index 100% rename from include/DeleteTransformation.h rename to deprecated_compiler/include/DeleteTransformation.h diff --git a/include/GraphStructuredStack.h b/deprecated_compiler/include/GraphStructuredStack.h similarity index 100% rename from include/GraphStructuredStack.h rename to deprecated_compiler/include/GraphStructuredStack.h diff --git a/include/Importer.h b/deprecated_compiler/include/Importer.h similarity index 100% rename from include/Importer.h rename to deprecated_compiler/include/Importer.h diff --git a/include/Lexer.h b/deprecated_compiler/include/Lexer.h similarity index 100% rename from include/Lexer.h rename to deprecated_compiler/include/Lexer.h diff --git a/include/NodeTransformation.h b/deprecated_compiler/include/NodeTransformation.h similarity index 100% rename from include/NodeTransformation.h rename to deprecated_compiler/include/NodeTransformation.h diff --git a/include/NodeTree.h b/deprecated_compiler/include/NodeTree.h similarity index 100% rename from include/NodeTree.h rename to deprecated_compiler/include/NodeTree.h diff --git a/include/ParseAction.h b/deprecated_compiler/include/ParseAction.h similarity index 100% rename from include/ParseAction.h rename to deprecated_compiler/include/ParseAction.h diff --git a/include/ParseRule.h b/deprecated_compiler/include/ParseRule.h similarity index 100% rename from include/ParseRule.h rename to deprecated_compiler/include/ParseRule.h diff --git a/include/Parser.h b/deprecated_compiler/include/Parser.h similarity index 100% rename from include/Parser.h rename to deprecated_compiler/include/Parser.h diff --git a/include/Poset.h b/deprecated_compiler/include/Poset.h similarity index 100% rename from include/Poset.h rename to deprecated_compiler/include/Poset.h diff --git a/include/RNGLRParser.h b/deprecated_compiler/include/RNGLRParser.h similarity index 100% rename from include/RNGLRParser.h rename to deprecated_compiler/include/RNGLRParser.h diff --git a/include/RegEx.h b/deprecated_compiler/include/RegEx.h similarity index 100% rename from include/RegEx.h rename to deprecated_compiler/include/RegEx.h diff --git a/include/RegExState.h b/deprecated_compiler/include/RegExState.h similarity index 100% rename from include/RegExState.h rename to deprecated_compiler/include/RegExState.h diff --git a/include/RemovalTransformation.h b/deprecated_compiler/include/RemovalTransformation.h similarity index 100% rename from include/RemovalTransformation.h rename to deprecated_compiler/include/RemovalTransformation.h diff --git a/include/State.h b/deprecated_compiler/include/State.h similarity index 100% rename from include/State.h rename to deprecated_compiler/include/State.h diff --git a/include/StringReader.h b/deprecated_compiler/include/StringReader.h similarity index 100% rename from include/StringReader.h rename to deprecated_compiler/include/StringReader.h diff --git a/include/Symbol.h b/deprecated_compiler/include/Symbol.h similarity index 100% rename from include/Symbol.h rename to deprecated_compiler/include/Symbol.h diff --git a/include/Table.h b/deprecated_compiler/include/Table.h similarity index 100% rename from include/Table.h rename to deprecated_compiler/include/Table.h diff --git a/include/Tester.h b/deprecated_compiler/include/Tester.h similarity index 100% rename from include/Tester.h rename to deprecated_compiler/include/Tester.h diff --git a/include/Type.h b/deprecated_compiler/include/Type.h similarity index 100% rename from include/Type.h rename to deprecated_compiler/include/Type.h diff --git a/include/util.h b/deprecated_compiler/include/util.h similarity index 100% rename from include/util.h rename to deprecated_compiler/include/util.h diff --git a/main.cpp b/deprecated_compiler/main.cpp similarity index 100% rename from main.cpp rename to deprecated_compiler/main.cpp diff --git a/src/ASTData.cpp b/deprecated_compiler/src/ASTData.cpp similarity index 100% rename from src/ASTData.cpp rename to deprecated_compiler/src/ASTData.cpp diff --git a/src/ASTTransformation.cpp b/deprecated_compiler/src/ASTTransformation.cpp similarity index 100% rename from src/ASTTransformation.cpp rename to deprecated_compiler/src/ASTTransformation.cpp diff --git a/src/CCodeTriple.cpp b/deprecated_compiler/src/CCodeTriple.cpp similarity index 100% rename from src/CCodeTriple.cpp rename to deprecated_compiler/src/CCodeTriple.cpp diff --git a/src/CGenerator.cpp b/deprecated_compiler/src/CGenerator.cpp similarity index 100% rename from src/CGenerator.cpp rename to deprecated_compiler/src/CGenerator.cpp diff --git a/src/GraphStructuredStack.cpp b/deprecated_compiler/src/GraphStructuredStack.cpp similarity index 100% rename from src/GraphStructuredStack.cpp rename to deprecated_compiler/src/GraphStructuredStack.cpp diff --git a/src/Importer.cpp b/deprecated_compiler/src/Importer.cpp similarity index 100% rename from src/Importer.cpp rename to deprecated_compiler/src/Importer.cpp diff --git a/src/Lexer.cpp b/deprecated_compiler/src/Lexer.cpp similarity index 100% rename from src/Lexer.cpp rename to deprecated_compiler/src/Lexer.cpp diff --git a/src/ParseAction.cpp b/deprecated_compiler/src/ParseAction.cpp similarity index 100% rename from src/ParseAction.cpp rename to deprecated_compiler/src/ParseAction.cpp diff --git a/src/ParseRule.cpp b/deprecated_compiler/src/ParseRule.cpp similarity index 100% rename from src/ParseRule.cpp rename to deprecated_compiler/src/ParseRule.cpp diff --git a/src/Parser.cpp b/deprecated_compiler/src/Parser.cpp similarity index 100% rename from src/Parser.cpp rename to deprecated_compiler/src/Parser.cpp diff --git a/src/RNGLRParser.cpp b/deprecated_compiler/src/RNGLRParser.cpp similarity index 100% rename from src/RNGLRParser.cpp rename to deprecated_compiler/src/RNGLRParser.cpp diff --git a/src/RegEx.cpp b/deprecated_compiler/src/RegEx.cpp similarity index 100% rename from src/RegEx.cpp rename to deprecated_compiler/src/RegEx.cpp diff --git a/src/RegExState.cpp b/deprecated_compiler/src/RegExState.cpp similarity index 100% rename from src/RegExState.cpp rename to deprecated_compiler/src/RegExState.cpp diff --git a/src/State.cpp b/deprecated_compiler/src/State.cpp similarity index 100% rename from src/State.cpp rename to deprecated_compiler/src/State.cpp diff --git a/src/StringReader.cpp b/deprecated_compiler/src/StringReader.cpp similarity index 100% rename from src/StringReader.cpp rename to deprecated_compiler/src/StringReader.cpp diff --git a/src/Symbol.cpp b/deprecated_compiler/src/Symbol.cpp similarity index 100% rename from src/Symbol.cpp rename to deprecated_compiler/src/Symbol.cpp diff --git a/src/Table.cpp b/deprecated_compiler/src/Table.cpp similarity index 100% rename from src/Table.cpp rename to deprecated_compiler/src/Table.cpp diff --git a/src/Tester.cpp b/deprecated_compiler/src/Tester.cpp similarity index 100% rename from src/Tester.cpp rename to deprecated_compiler/src/Tester.cpp diff --git a/src/Type.cpp b/deprecated_compiler/src/Type.cpp similarity index 100% rename from src/Type.cpp rename to deprecated_compiler/src/Type.cpp diff --git a/src/util.cpp b/deprecated_compiler/src/util.cpp similarity index 100% rename from src/util.cpp rename to deprecated_compiler/src/util.cpp diff --git a/future_features.txt b/future_features.txt index 0a26ad2..c93fa0e 100644 --- a/future_features.txt +++ b/future_features.txt @@ -3,15 +3,5 @@ correctly importing / running tests is a nightmare with relative paths. Namespaces Imports allow renaming of either entire scope or individual members, and can import from within a scope -correct c genration for triple mutually recursive types across 2 files (wehre -A depends on B depends on C, but two of them are in the same file and there's -also pointers for the other two) Will need splitting into multiple C files to -be cleanest, I think) - -Fix destructors being placed after return. -Fix functions before declaration? (in class? (this is from an old file)) -Template instantiation without explicit type param Fix // comment right before top level function declaration. Something to do with the return as /* comment */ does not have that problem -for in or for each loops -Traits on aliases, maybe that keep their old traits? diff --git a/simplifiedKrakenGrammer.kgm b/simplifiedKrakenGrammer.kgm deleted file mode 100644 index 4763c28..0000000 --- a/simplifiedKrakenGrammer.kgm +++ /dev/null @@ -1,9 +0,0 @@ -Goal = translation_unit ; -translation_unit = function " -" ; - -function = "why" typed_return WS code_block ; -typed_return = WS "bad" | ; -code_block = "{" WS "}" ; - -WS = "( | )+" | ;