diff --git a/CMakeLists.txt b/CMakeLists.txt index e198715..94c1b9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ # and include sub-projects here. # cmake_minimum_required (VERSION 3.8) +set(CMAKE_CXX_STANDARD 17) project ("NouVeL") diff --git a/NouVeL/NVL.cpp b/NouVeL/NVL.cpp new file mode 100644 index 0000000..13e48a0 --- /dev/null +++ b/NouVeL/NVL.cpp @@ -0,0 +1,38 @@ +#include "NVL.h" + +namespace NVL +{ + void preprocess_subblocks(std::string calls) + { + + } + + void collapse_Call(Call& call, std::string nvl) + { + + } + + void parse_Sequence(Tree& root, std::string nvl) + { + + } + + int parse_NVL(Tree& root, std::string path) + { + std::ifstream nvl; + nvl.open(path); + + if (nvl.is_open()) { + + std::string out = std::string(std::istreambuf_iterator(nvl), std::istreambuf_iterator()); + + parse_Sequence(root, out); + + nvl.close(); + return 0; + } else { + std::cerr << "Unable to read file " << path << std::endl; + return 1; + } + } +} \ No newline at end of file diff --git a/NouVeL/NVL.h b/NouVeL/NVL.h new file mode 100644 index 0000000..ddc10c8 --- /dev/null +++ b/NouVeL/NVL.h @@ -0,0 +1,54 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NVL +{ + struct Symbol + { + std::string Identifier; + }; + + struct Object + { + std::variant< + Symbol, + float, + std::string, + bool, + std::vector + > Value; + }; + + struct Call + { + std::vector Objects; + }; + + struct Sequence + { + std::string Name; + std::vector Calls; + }; + + struct Tree + { + std::vector Sequences; + void Print_Tree(int indent); + }; + + int parse_NVL(Tree& root, std::string path); + + void parse_Sequence(Tree& root, std::string nvl); + + void preprocess_subblocks(std::string calls); + + void collapse_Call(Call& call, std::string nvl); +} \ No newline at end of file diff --git a/myfile.txt b/myfile.txt new file mode 100644 index 0000000..9010119 --- /dev/null +++ b/myfile.txt @@ -0,0 +1,8 @@ +asdasda sdsd +asdaskmds +ada +da +ds +sad +a +fagjkdlfngioesjf