From e8e53b0c31cf59eeef6e9f79c7189bd140dbcf47 Mon Sep 17 00:00:00 2001 From: Aleksandr Ryabikov Date: Fri, 24 Jun 2022 12:28:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BD=D1=83=D0=BC=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D1=8E=20=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D1=81=D0=B8=D0=B9=20=D0=B4=D0=BB=D1=8F=20=D1=80?= =?UTF-8?q?=D0=B5=D0=BB=D0=B8=D0=B7=D0=BE=D0=B2=20=D0=B8=20=D0=B2=D1=8B?= =?UTF-8?q?=D0=B2=D0=BE=D0=B4=20=D0=BE=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D1=81=D0=B8=D0=BD=D1=82=D0=B0=D0=BA=D1=81=D0=B8=D1=81?= =?UTF-8?q?=D0=B0=20=D0=B2=20REPL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 7 ++- .gitmodules | 3 ++ contrib/build.sh | 2 +- contrib/text2cpp | 1 + core/Makefile | 82 +++++++++++++++++++++++++++++ core/builtin.cpp | 44 +++++++++------- core/builtin.h | 1 + core/context.cpp | 5 +- core/nbproject/Makefile-Debug.mk | 20 ++++++- core/nbproject/Makefile-GCOV.mk | 14 ++++- core/nbproject/Makefile-LLVM_GCC.mk | 14 ++++- core/nbproject/Makefile-Release.mk | 14 ++++- core/nbproject/Makefile-UnitTest.mk | 14 ++++- core/nbproject/configurations.xml | 80 ++++++++++++++++++++++------ core/nbproject/project.xml | 2 +- 15 files changed, 259 insertions(+), 44 deletions(-) create mode 160000 contrib/text2cpp diff --git a/.gitignore b/.gitignore index b8c2254c..c25360f9 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,11 @@ contrib/* **/DartConfiguration.tcl Makefile +core/syntax_help.cpp +core/version.* +docs/syntax.txt + + # Binaries *.7z *.dmg @@ -328,4 +333,4 @@ dmypy.json .pytype/ # Cython debug symbols -cython_debug/ \ No newline at end of file +cython_debug/ diff --git a/.gitmodules b/.gitmodules index 271a69c7..645748d5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "contrib/libffi"] path = contrib/libffi url = https://github.com/libffi/libffi.git +[submodule "contrib/text2cpp"] + path = contrib/text2cpp + url = https://github.com/lostjared/text2cpp.git diff --git a/contrib/build.sh b/contrib/build.sh index 5f919b97..acd25b6e 100755 --- a/contrib/build.sh +++ b/contrib/build.sh @@ -3,4 +3,4 @@ cd libffi ./configure --prefix=`pwd`/output make make install -cd .. \ No newline at end of file +cd .. diff --git a/contrib/text2cpp b/contrib/text2cpp new file mode 160000 index 00000000..51940c7d --- /dev/null +++ b/contrib/text2cpp @@ -0,0 +1 @@ +Subproject commit 51940c7de7d05b1cae7fa04c6d1085ba41f57cb0 diff --git a/core/Makefile b/core/Makefile index de92deb1..fece1dae 100644 --- a/core/Makefile +++ b/core/Makefile @@ -50,12 +50,94 @@ CP=cp CCADMIN=CCadmin +VERSION_MAJOR=0 +VERSION_MINOR=1 +VERSION_PATCH=0 +VERSION_HEADER="version.h" +VERSION_FILE="version.c" + + +GIT_TAG_VERSION=$(shell git describe --abbrev=0 --tags) +GIT_SHORT_HASH=$(shell git rev-parse --short HEAD) +GIT_SOURCE_ID=$(GIT_TAG_VERSION)-$(GIT_SHORT_HASH) +DATE_BUILD=$(shell date +'%y.%m.%d %H:%M:%S') + # build build: .build-post .build-pre: # Add your pre 'build' code here... + @if [ ! -d "temp" ]; then \ + @mkdir temp; \ + fi + pandoc -t plain ../docs/syntax.md > ../docs/syntax.txt + ../contrib/text2cpp/output/bin/text2cpp ../docs/syntax.txt syntax_help.cpp newlang_syntax_help c + + + @if [ "$(GIT_TAG_VERSION)" != "v$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)" ]; then \ + echo "Git TAG $(GIT_TAG_VERSION) differ version v$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)"; \ + exit 1; \ + fi + @if [ -z $(GIT_SHORT_HASH) ]; then \ + echo Undefined version for build; \ + exit 1; \ + fi + @if [ -f $(VERSION_HEADER) ]; then \ + rm $(VERSION_HEADER); \ + fi + + @echo "/** @file $(VERSION_HEADER)" > $(VERSION_HEADER) + @echo "* Auto generate file for identification current build" >> $(VERSION_HEADER) + @echo "* Date build $(DATE_BUILD)" >> $(VERSION_HEADER) + @echo "*/" >> $(VERSION_HEADER) + @echo "" >> $(VERSION_HEADER) + + @echo "#include " >> $(VERSION_HEADER) + + @echo "extern const uint8_t VERSION_MAJOR;" >> $(VERSION_HEADER) + @echo "extern const uint8_t VERSION_MINOR;" >> $(VERSION_HEADER) + @echo "extern const uint8_t VERSION_PATCH;" >> $(VERSION_HEADER) + @echo "extern const uint16_t VERSION_BUILD;" >> $(VERSION_HEADER) + @echo "" >> $(VERSION_HEADER) + + @echo "#define VERSION ($(VERSION_MAJOR) << 4 | $(VERSION_MINOR))" >> $(VERSION_HEADER) + @echo "#define VERSION_GIT_SOURCE \"$(GIT_SOURCE_ID)\"" >> $(VERSION_HEADER) + @echo "#define VERSION_DATE_BUILD_STR \"$(DATE_BUILD)\"" >> $(VERSION_HEADER) + @echo "#define VERSION_SOURCE_FULL_ID \"$(GIT_SOURCE_ID) $(DATE_BUILD)\"" >> $(VERSION_HEADER) + @echo "" >> $(VERSION_HEADER) + + @echo "extern const char * GIT_SOURCE;" >> $(VERSION_HEADER) + @echo "extern const char * DATE_BUILD_STR;" >> $(VERSION_HEADER) + @echo "extern const char * SOURCE_FULL_ID; " >> $(VERSION_HEADER) + @echo "" >> $(VERSION_HEADER) + + @if [ -f $(VERSION_FILE) ]; then \ + rm $(VERSION_FILE); \ + fi + + @echo "/** @file $(VERSION_FILE)" > $(VERSION_FILE) + @echo "* Auto generate file for identification current build" >> $(VERSION_FILE) + @echo "* Date build $(DATE_BUILD)" >> $(VERSION_FILE) + @echo "*/" >> $(VERSION_FILE) + @echo "" >> $(VERSION_FILE) + + @echo "#include " >> $(VERSION_FILE) + @echo "#include " >> $(VERSION_FILE) + @echo "" >> $(VERSION_FILE) + + @echo "const uint8_t VERSION_MAJOR=$(VERSION_MAJOR);" >> $(VERSION_FILE) + @echo "const uint8_t VERSION_MINOR=$(VERSION_MINOR);" >> $(VERSION_FILE) + @echo "const uint8_t VERSION_PATCH=$(VERSION_PATCH);" >> $(VERSION_FILE) + @echo "" >> $(VERSION_FILE) + + @echo "const char * GIT_SOURCE = VERSION_GIT_SOURCE;" >> $(VERSION_FILE) + @echo "const char * DATE_BUILD_STR = VERSION_DATE_BUILD_STR;" >> $(VERSION_FILE) + @echo "const char * SOURCE_FULL_ID = VERSION_SOURCE_FULL_ID;" >> $(VERSION_FILE) + @echo "" >> $(VERSION_FILE) + + @echo Mark version $(GIT_SOURCE_ID) $(DATE_BUILD) + .build-post: .build-impl # Add your post 'build' code here... diff --git a/core/builtin.cpp b/core/builtin.cpp index 053e9183..359914a6 100644 --- a/core/builtin.cpp +++ b/core/builtin.cpp @@ -1,5 +1,7 @@ #include "pch.h" +#include + #include #include @@ -11,12 +13,12 @@ using namespace newlang; namespace newlang { NEWLANG_TRANSPARENT(min) { - if(in.size() < 2) { + if (in.size() < 2) { LOG_RUNTIME("Empty argument list parameter!"); } ObjPtr out = in.at(1).second; for (size_t i = 2; i < in.size(); i++) { - if(*in.at(i).second < out) { + if (*in.at(i).second < out) { out = in.at(i).second; } } @@ -24,12 +26,12 @@ namespace newlang { } NEWLANG_TRANSPARENT(max) { - if(in.size() < 2) { + if (in.size() < 2) { LOG_RUNTIME("Empty argument list parameter!"); } ObjPtr out = in.at(1).second; for (size_t i = 2; i < in.size(); i++) { - if(*in.at(i).second > out) { + if (*in.at(i).second > out) { out = in.at(i).second; } } @@ -37,28 +39,28 @@ namespace newlang { } NEWLANG_FUNCTION(clone) { - if(in.size() != 2) { + if (in.size() != 2) { LOG_RUNTIME("Bad argument count parameter!"); } return in[1]->Clone(nullptr); } NEWLANG_FUNCTION(const_) { - if(in.size() != 2) { + if (in.size() != 2) { LOG_RUNTIME("Bad argument count parameter!"); } return in[1]->MakeConst(); } NEWLANG_FUNCTION(mutable_) { - if(in.size() != 2) { + if (in.size() != 2) { LOG_RUNTIME("Bad argument count parameter!"); } return in[1]->MakeMutable(); } NEWLANG_FUNCTION(import) { - if(!ctx) { + if (!ctx) { LOG_RUNTIME("No access to context!"); } return ctx->CreateNative(in.at(1).second->GetValueAsString().c_str(), @@ -66,19 +68,28 @@ namespace newlang { } NEWLANG_FUNCTION(eval) { - if(!ctx) { + if (!ctx) { LOG_RUNTIME("No access to context!"); } return ctx->ExecStr(in.at(1).second->GetValueAsString().c_str()); } NEWLANG_FUNCTION(exec) { - if(!ctx) { + if (!ctx) { LOG_RUNTIME("No access to context!"); } return ctx->ExecFile(in.at(1).second->GetValueAsString().c_str()); } + NEWLANG_TRANSPARENT(help) { + + std::string help_str; + for (int i = 0; i < newlang_syntax_help_size; i++) { + help_str.append(newlang_syntax_help_arr[i]); + help_str.append("\n\r"); + } + return Obj::CreateString(help_str); + } #undef NEWLANG_FUNCTION @@ -86,24 +97,19 @@ namespace newlang { } - - - - - bool BuiltInTorchDirect::CheckDirect(CompileInfo &ci, TermPtr &term, std::string &output) { - if(term->size() == 0 && m_tensor_noarg.find(term->getText()) != m_tensor_noarg.end()) { + if (term->size() == 0 && m_tensor_noarg.find(term->getText()) != m_tensor_noarg.end()) { output += "->asTensor_()." + term->getText() + "(), " + output; return true; - } else if(term->size() == 1) { + } else if (term->size() == 1) { - if((*term)[0]->IsScalar() && m_tensor_scalar.find(term->getText()) != m_tensor_scalar.end()) { + if ((*term)[0]->IsScalar() && m_tensor_scalar.find(term->getText()) != m_tensor_scalar.end()) { output += "->asTensor_()." + term->getText() + "(" + (*term)[0]->getText() + "), " + output; return true; - } else if((*term)[0]->getTermID() == TermID::TERM) { + } else if ((*term)[0]->getTermID() == TermID::TERM) { std::string temp; NewLang::GetImpl(ci, (*term)[0], temp); output += "->asTensor_()." + term->getText() + "(" + temp + "->asTensor_()), " + output; diff --git a/core/builtin.h b/core/builtin.h index ff76beb9..52d3e848 100644 --- a/core/builtin.h +++ b/core/builtin.h @@ -51,6 +51,7 @@ FUNC_DIRECT(newlang_print, print_); FUNC_DIRECT(newlang_eval, eval); FUNC_DIRECT(newlang_exec, exec); +FUNC_TRANSPARENT(newlang_help, help); /* * * diff --git a/core/context.cpp b/core/context.cpp index 0f0a406d..9ae06c7c 100644 --- a/core/context.cpp +++ b/core/context.cpp @@ -52,11 +52,11 @@ Context::Context(RuntimePtr global) { Context::m_funcs["max"] = CreateBuiltin("max(arg, ...)", (void *) &max, ObjType::TRANSPARENT); Context::m_funcs["макс"] = Context::m_funcs["max"]; - Context::m_funcs["import"] = - CreateBuiltin("import(arg, module='', lazzy=0)", (void *) &import, ObjType::FUNCTION); + Context::m_funcs["import"] = CreateBuiltin("import(arg, module='', lazzy=0)", (void *) &import, ObjType::FUNCTION); Context::m_funcs["eval"] = CreateBuiltin("eval(string:String)", (void *) &eval, ObjType::FUNCTION); Context::m_funcs["exec"] = CreateBuiltin("exec(filename:String)", (void *) &exec, ObjType::FUNCTION); + Context::m_funcs["help"] = CreateBuiltin("help(...)", (void *) &help, ObjType::TRANSPARENT); } @@ -167,6 +167,7 @@ ObjPtr Context::CreateBuiltin(const char *prototype, void *func, ObjType type) { Obj::CreateFunc(this, proto->Left(), type, proto->Left()->getName().empty() ? proto->Left()->getText() : proto->Left()->getName()); obj->m_func_ptr = func; + obj->m_var_is_init = true; return obj; } diff --git a/core/nbproject/Makefile-Debug.mk b/core/nbproject/Makefile-Debug.mk index 63ee3548..316abe27 100644 --- a/core/nbproject/Makefile-Debug.mk +++ b/core/nbproject/Makefile-Debug.mk @@ -45,6 +45,7 @@ OBJECTFILES= \ ${OBJECTDIR}/object.o \ ${OBJECTDIR}/parser.o \ ${OBJECTDIR}/parser.yy.o \ + ${OBJECTDIR}/syntax_help.o \ ${OBJECTDIR}/term.o \ ${OBJECTDIR}/test/alg_test.o \ ${OBJECTDIR}/test/eval_test.o \ @@ -54,7 +55,8 @@ OBJECTFILES= \ ${OBJECTDIR}/test/nlc_test.o \ ${OBJECTDIR}/test/object_test.o \ ${OBJECTDIR}/test/parser_test.o \ - ${OBJECTDIR}/variable.o + ${OBJECTDIR}/variable.o \ + ${OBJECTDIR}/version.o # C Compiler Flags @@ -87,6 +89,11 @@ ${OBJECTDIR}/_ext/e16507f5/logger.o: ../contrib/logger/logger.cpp ${RM} "$@.d" $(COMPILE.cc) -g -DDEBUG -DLOG_LEVEL_NORMAL=LOG_LEVEL_DEBUG -DPDC_WIDE -I.. -I../contrib/googletest/googletest -I../contrib/googletest/googletest/include -I../contrib/Lyra/include -I../contrib/libtorch/include/torch/csrc/api/include -I../contrib/libtorch/include -I../contrib/tensorboard_logger/include -std=c++14 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e16507f5/logger.o ../contrib/logger/logger.cpp +temp/syntax.temp.txt: ../docs/syntax.md ../docs/syntax.md + ${MKDIR} -p temp + @echo Выполнение шага пользовательского сборки + mkdir temp || pandoc -t plain ../docs/syntax.md > temp/syntax.temp.txt + ${OBJECTDIR}/builtin.o: builtin.cpp parser.h parser.yy.h pch.h.gch location.hh ${MKDIR} -p ${OBJECTDIR} ${RM} "$@.d" @@ -178,6 +185,11 @@ pch.h.gch: pch.h @echo Выполнение шага пользовательского сборки g++ -o pch.h.gch -c pch.h -g -I.. -I../contrib/libtorch/include/torch/csrc/api/include -I../contrib/libtorch/include --no-gnu-unique -Wno-trigraphs -Winvalid-pch -Werror=return-type -g -DDEBUG -DLOG_LEVEL_NORMAL=LOG_LEVEL_DEBUG -DPDC_WIDE -I../contrib/googletest/googletest -I../contrib/googletest/googletest/include -I../contrib/Lyra/include -I../contrib/libtorch/include/torch/csrc/api/include -I../contrib/libtorch/include -I.. -I../contrib/tensorboard_logger/include -I/usr/lib/llvm-13/include -std=c++17 +${OBJECTDIR}/syntax_help.o: syntax_help.cpp + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.cc) -g -DDEBUG -DLOG_LEVEL_NORMAL=LOG_LEVEL_DEBUG -DPDC_WIDE -I.. -I../contrib/googletest/googletest -I../contrib/googletest/googletest/include -I../contrib/Lyra/include -I../contrib/libtorch/include/torch/csrc/api/include -I../contrib/libtorch/include -I../contrib/tensorboard_logger/include -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/syntax_help.o syntax_help.cpp + ${OBJECTDIR}/term.o: term.cpp parser.h parser.yy.h pch.h.gch location.hh ${MKDIR} -p ${OBJECTDIR} ${RM} "$@.d" @@ -240,6 +252,11 @@ ${OBJECTDIR}/variable.o: variable.cpp pch.h.gch @echo Выполнение шага пользовательского сборки +${OBJECTDIR}/version.o: version.c + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.c) -g -s -DDEBUG -DLOG_LEVEL_NORMAL=LOG_LEVEL_DUMP -I../contrib/googletest/googletest -I../contrib/googletest/googletest/include -I.. -std=c11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/version.o version.c + : warning_pop.h parser.yy.cpp location.hh @echo Выполнение шага пользовательского сборки @@ -254,6 +271,7 @@ ${OBJECTDIR}/variable.o: variable.cpp pch.h.gch # Clean Targets .clean-conf: ${CLEAN_SUBPROJECTS} ${RM} -r ${CND_BUILDDIR}/${CND_CONF} + ${RM} temp/syntax.temp.txt ${RM} ${RM} ${RM} diff --git a/core/nbproject/Makefile-GCOV.mk b/core/nbproject/Makefile-GCOV.mk index 274f540f..2943cc53 100644 --- a/core/nbproject/Makefile-GCOV.mk +++ b/core/nbproject/Makefile-GCOV.mk @@ -47,6 +47,7 @@ OBJECTFILES= \ ${OBJECTDIR}/object.o \ ${OBJECTDIR}/parser.o \ ${OBJECTDIR}/parser.yy.o \ + ${OBJECTDIR}/syntax_help.o \ ${OBJECTDIR}/term.o \ ${OBJECTDIR}/test/alg_test.o \ ${OBJECTDIR}/test/eval_test.o \ @@ -56,7 +57,8 @@ OBJECTFILES= \ ${OBJECTDIR}/test/nlc_test.o \ ${OBJECTDIR}/test/object_test.o \ ${OBJECTDIR}/test/parser_test.o \ - ${OBJECTDIR}/variable.o + ${OBJECTDIR}/variable.o \ + ${OBJECTDIR}/version.o # C Compiler Flags @@ -163,6 +165,11 @@ ${OBJECTDIR}/parser.yy.o: parser.yy.cpp parser.y @echo Выполнение шага пользовательского сборки +${OBJECTDIR}/syntax_help.o: syntax_help.cpp + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.cc) -g -DDEBUG -DLOG_LEVEL_NORMAL=LOG_LEVEL_DEBUG -DPDC_WIDE -DUNITTEST -I.. -I../contrib/googletest/googletest -I../contrib/googletest/googletest/include -I../contrib/Tensorflow/bazel-bin/tensorflow/include -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/syntax_help.o syntax_help.cpp + ${OBJECTDIR}/term.o: term.cpp ${MKDIR} -p ${OBJECTDIR} ${RM} "$@.d" @@ -217,6 +224,11 @@ ${OBJECTDIR}/variable.o: variable.cpp ${RM} "$@.d" $(COMPILE.cc) -g -DDEBUG -DLOG_LEVEL_NORMAL=LOG_LEVEL_DEBUG -DPDC_WIDE -DUNITTEST -I.. -I../contrib/googletest/googletest -I../contrib/googletest/googletest/include -I../contrib/Tensorflow/bazel-bin/tensorflow/include -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/variable.o variable.cpp +${OBJECTDIR}/version.o: version.c + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.c) -g -s -DDEBUG -DLOG_LEVEL_NORMAL=LOG_LEVEL_DUMP -DUNITTEST -I.. -I../contrib/googletest/googletest -I../contrib/googletest/googletest/include -std=c11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/version.o version.c + : warning_pop.h parser.yy.cpp location.hh @echo Выполнение шага пользовательского сборки diff --git a/core/nbproject/Makefile-LLVM_GCC.mk b/core/nbproject/Makefile-LLVM_GCC.mk index d287607f..04602d2b 100644 --- a/core/nbproject/Makefile-LLVM_GCC.mk +++ b/core/nbproject/Makefile-LLVM_GCC.mk @@ -46,6 +46,7 @@ OBJECTFILES= \ ${OBJECTDIR}/object.o \ ${OBJECTDIR}/parser.o \ ${OBJECTDIR}/parser.yy.o \ + ${OBJECTDIR}/syntax_help.o \ ${OBJECTDIR}/term.o \ ${OBJECTDIR}/test/alg_test.o \ ${OBJECTDIR}/test/eval_test.o \ @@ -55,7 +56,8 @@ OBJECTFILES= \ ${OBJECTDIR}/test/nlc_test.o \ ${OBJECTDIR}/test/object_test.o \ ${OBJECTDIR}/test/parser_test.o \ - ${OBJECTDIR}/variable.o + ${OBJECTDIR}/variable.o \ + ${OBJECTDIR}/version.o # C Compiler Flags @@ -157,6 +159,11 @@ ${OBJECTDIR}/parser.yy.o: parser.yy.cpp parser.y @echo Выполнение шага пользовательского сборки +${OBJECTDIR}/syntax_help.o: syntax_help.cpp + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.cc) -g -DDEBUG -DLOG_LEVEL_NORMAL=LOG_LEVEL_DEBUG -DPDC_WIDE -I../contrib/googletest/googletest -I../contrib/googletest/googletest/include -I../contrib/Tensorflow/bazel-bin/tensorflow/include -I../contrib/Lyra/include -I.. -std=c++14 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/syntax_help.o syntax_help.cpp + ${OBJECTDIR}/term.o: term.cpp ${MKDIR} -p ${OBJECTDIR} ${RM} "$@.d" @@ -211,6 +218,11 @@ ${OBJECTDIR}/variable.o: variable.cpp ${RM} "$@.d" $(COMPILE.cc) -g -DDEBUG -DLOG_LEVEL_NORMAL=LOG_LEVEL_DEBUG -DPDC_WIDE -I../contrib/googletest/googletest -I../contrib/googletest/googletest/include -I../contrib/Tensorflow/bazel-bin/tensorflow/include -I../contrib/Lyra/include -I.. -std=c++14 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/variable.o variable.cpp +${OBJECTDIR}/version.o: version.c + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.c) -g -s -DDEBUG -DLOG_LEVEL_NORMAL=LOG_LEVEL_DUMP -DUNITTEST -I../contrib/googletest/googletest -I../contrib/googletest/googletest/include -I.. -std=c11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/version.o version.c + : warning_pop.h parser.yy.cpp location.hh @echo Выполнение шага пользовательского сборки diff --git a/core/nbproject/Makefile-Release.mk b/core/nbproject/Makefile-Release.mk index 71b43930..df796044 100644 --- a/core/nbproject/Makefile-Release.mk +++ b/core/nbproject/Makefile-Release.mk @@ -46,6 +46,7 @@ OBJECTFILES= \ ${OBJECTDIR}/object.o \ ${OBJECTDIR}/parser.o \ ${OBJECTDIR}/parser.yy.o \ + ${OBJECTDIR}/syntax_help.o \ ${OBJECTDIR}/term.o \ ${OBJECTDIR}/test/alg_test.o \ ${OBJECTDIR}/test/eval_test.o \ @@ -55,7 +56,8 @@ OBJECTFILES= \ ${OBJECTDIR}/test/nlc_test.o \ ${OBJECTDIR}/test/object_test.o \ ${OBJECTDIR}/test/parser_test.o \ - ${OBJECTDIR}/variable.o + ${OBJECTDIR}/variable.o \ + ${OBJECTDIR}/version.o # C Compiler Flags @@ -147,6 +149,11 @@ ${OBJECTDIR}/parser.yy.o: parser.yy.cpp ${RM} "$@.d" $(COMPILE.cc) -O3 -Werror -I.. -std=c++14 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/parser.yy.o parser.yy.cpp +${OBJECTDIR}/syntax_help.o: syntax_help.cpp + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.cc) -O3 -Werror -I.. -std=c++14 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/syntax_help.o syntax_help.cpp + ${OBJECTDIR}/term.o: term.cpp ${MKDIR} -p ${OBJECTDIR} ${RM} "$@.d" @@ -197,6 +204,11 @@ ${OBJECTDIR}/variable.o: variable.cpp ${RM} "$@.d" $(COMPILE.cc) -O3 -Werror -I.. -std=c++14 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/variable.o variable.cpp +${OBJECTDIR}/version.o: version.c + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.c) -O3 -Werror -s -I.. -std=c11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/version.o version.c + # Subprojects .build-subprojects: diff --git a/core/nbproject/Makefile-UnitTest.mk b/core/nbproject/Makefile-UnitTest.mk index 5890475d..3496ffda 100644 --- a/core/nbproject/Makefile-UnitTest.mk +++ b/core/nbproject/Makefile-UnitTest.mk @@ -47,6 +47,7 @@ OBJECTFILES= \ ${OBJECTDIR}/object.o \ ${OBJECTDIR}/parser.o \ ${OBJECTDIR}/parser.yy.o \ + ${OBJECTDIR}/syntax_help.o \ ${OBJECTDIR}/term.o \ ${OBJECTDIR}/test/alg_test.o \ ${OBJECTDIR}/test/eval_test.o \ @@ -56,7 +57,8 @@ OBJECTFILES= \ ${OBJECTDIR}/test/nlc_test.o \ ${OBJECTDIR}/test/object_test.o \ ${OBJECTDIR}/test/parser_test.o \ - ${OBJECTDIR}/variable.o + ${OBJECTDIR}/variable.o \ + ${OBJECTDIR}/version.o # C Compiler Flags @@ -190,6 +192,11 @@ pch.h.gch: pch.h @echo Выполнение шага пользовательского сборки g++ -o pch.h.gch -c pch.h -g -I.. -I../contrib/libtorch/include/torch/csrc/api/include -I../contrib/libtorch/include --no-gnu-unique -Wno-trigraphs -Winvalid-pch -Werror=return-type -Wmaybe-uninitialized -Wuninitialized -Wformat -Wmaybe-uninitialized -g -DDEBUG -DLOG_LEVEL_NORMAL=LOG_LEVEL_DEBUG -DPDC_WIDE -DUNITTEST -I../contrib/googletest/googletest -I../contrib/googletest/googletest/include -I../contrib/Lyra/include -I../contrib/libtorch/include/torch/csrc/api/include -I../contrib/libtorch/include -I.. -I../contrib/tensorboard_logger/include -I/usr/lib/llvm-13/include -std=c++17 +${OBJECTDIR}/syntax_help.o: syntax_help.cpp + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.cc) -g -DDEBUG -DLOG_LEVEL_NORMAL=LOG_LEVEL_DEBUG -DPDC_WIDE -DUNITTEST -I.. -I../contrib/googletest/googletest -I../contrib/googletest/googletest/include -I../contrib/Lyra/include -I../contrib/libtorch/include/torch/csrc/api/include -I../contrib/libtorch/include -I../contrib/tensorboard_logger/include -I/usr/lib/llvm-13/include -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/syntax_help.o syntax_help.cpp + ${OBJECTDIR}/term.o: term.cpp parser.h parser.yy.h pch.h.gch location.hh ${MKDIR} -p ${OBJECTDIR} ${RM} "$@.d" @@ -252,6 +259,11 @@ ${OBJECTDIR}/variable.o: variable.cpp pch.h.gch @echo Выполнение шага пользовательского сборки +${OBJECTDIR}/version.o: version.c + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.c) -g -s -DDEBUG -DLOG_LEVEL_NORMAL=LOG_LEVEL_DUMP -DUNITTEST -I.. -I../contrib/googletest/googletest -I../contrib/googletest/googletest/include -std=c11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/version.o version.c + : warning_pop.h parser.yy.cpp location.hh @echo Выполнение шага пользовательского сборки diff --git a/core/nbproject/configurations.xml b/core/nbproject/configurations.xml index 1604d44b..89280023 100644 --- a/core/nbproject/configurations.xml +++ b/core/nbproject/configurations.xml @@ -4,7 +4,6 @@ ../docs/CNAME ../docs/_config.yml - ../docs/algs.md ../docs/index.md ../docs/syntax.md @@ -66,6 +65,10 @@ parser.yy.cpp parser.yy.h pch.h.gch + ../docs/syntax.txt + syntax_help.cpp + version.c + version.h - - + + mkdir temp || pandoc -t plain ../docs/syntax.md > temp/syntax.temp.txt + temp/syntax.temp.txt + ../docs/syntax.md + + + @@ -297,6 +305,8 @@ + + parser.h parser.yy.h pch.h.gch location.hh @@ -359,6 +369,10 @@ pch.h.gch + + + + parser.yy.cpp location.hh @@ -420,12 +434,12 @@ - - + + @@ -489,6 +503,8 @@ + + @@ -515,6 +531,10 @@ + + + + @@ -610,12 +630,12 @@ - - + + @@ -735,6 +755,8 @@ + + parser.h parser.yy.h pch.h.gch location.hh @@ -797,6 +819,10 @@ pch.h.gch + + + + parser.yy.cpp location.hh @@ -916,12 +942,12 @@ - - + + @@ -1006,6 +1032,8 @@ + + @@ -1041,6 +1069,10 @@ + + + + parser.yy.cpp location.hh @@ -1125,12 +1157,12 @@ - - + + @@ -1215,6 +1247,8 @@ + + @@ -1250,6 +1284,10 @@ + + + + parser.yy.cpp location.hh @@ -1362,12 +1400,12 @@ - - + + @@ -1452,6 +1490,8 @@ + + @@ -1487,6 +1527,10 @@ + + + + parser.yy.cpp location.hh @@ -1595,12 +1639,12 @@ - - + + @@ -1685,6 +1729,8 @@ + + @@ -1720,6 +1766,10 @@ + + + + parser.yy.cpp location.hh diff --git a/core/nbproject/project.xml b/core/nbproject/project.xml index 7bbaa0ed..0c860edf 100644 --- a/core/nbproject/project.xml +++ b/core/nbproject/project.xml @@ -4,7 +4,7 @@ NewLang - + c cc,cpp h,hh,y UTF-8