f
This commit is contained in:
parent
18fd06d4dc
commit
39c9dc1c5a
4 changed files with 101 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
# and include sub-projects here.
|
||||
#
|
||||
cmake_minimum_required (VERSION 3.8)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
project ("NouVeL")
|
||||
|
||||
|
|
38
NouVeL/NVL.cpp
Normal file
38
NouVeL/NVL.cpp
Normal file
|
@ -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<char>(nvl), std::istreambuf_iterator<char>());
|
||||
|
||||
parse_Sequence(root, out);
|
||||
|
||||
nvl.close();
|
||||
return 0;
|
||||
} else {
|
||||
std::cerr << "Unable to read file " << path << std::endl;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
54
NouVeL/NVL.h
Normal file
54
NouVeL/NVL.h
Normal file
|
@ -0,0 +1,54 @@
|
|||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <regex>
|
||||
#include <variant>
|
||||
#include <optional>
|
||||
#include <functional>
|
||||
|
||||
namespace NVL
|
||||
{
|
||||
struct Symbol
|
||||
{
|
||||
std::string Identifier;
|
||||
};
|
||||
|
||||
struct Object
|
||||
{
|
||||
std::variant<
|
||||
Symbol,
|
||||
float,
|
||||
std::string,
|
||||
bool,
|
||||
std::vector<Object>
|
||||
> Value;
|
||||
};
|
||||
|
||||
struct Call
|
||||
{
|
||||
std::vector<Object> Objects;
|
||||
};
|
||||
|
||||
struct Sequence
|
||||
{
|
||||
std::string Name;
|
||||
std::vector<Call> Calls;
|
||||
};
|
||||
|
||||
struct Tree
|
||||
{
|
||||
std::vector<Sequence> 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);
|
||||
}
|
8
myfile.txt
Normal file
8
myfile.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
asdasda sdsd
|
||||
asdaskmds
|
||||
ada
|
||||
da
|
||||
ds
|
||||
sad
|
||||
a
|
||||
fagjkdlfngioesjf
|
Loading…
Add table
Reference in a new issue