lxsh/include/parse.hpp
zawz c971b4e424 Major rework
~ Altered internal structure
~ Changed processing method to recursive function
~ Changed %include/%resolve
+ Output mode now reads multiple arguments
+ Toggleable include/resolve
+ Added variable and function processing (list/minimize)
- Remove some options for %include/%resolve
~ Many minor behaviour changes
2020-11-06 16:35:36 +01:00

30 lines
936 B
C++

#ifndef PARSE_HPP
#define PARSE_HPP
#include "struc.hpp"
#include <string>
#include <ztd/filedat.hpp>
#define SPACES " \t"
#define SEPARATORS " \t\n"
#define ARG_END " \t\n;#()&|"
#define VARNAME_END " \t\n;#()&|=\"'\\{}"
#define BLOCK_TOKEN_END " \t\n;#()&|=\"'\\"
#define COMMAND_SEPARATOR "\n;"
#define CONTROL_END "#)"
#define PIPELINE_END "\n;#()&"
#define ARGLIST_END "\n;#()&|"
#define SPECIAL_TOKENS "\n;#()&|"
#define ALL_TOKENS "\n;#()&|{}"
#define SPECIAL_VARS "!#*@$?"
std::string import_file(std::string const& path);
shmain* parse_text(const char* in, uint32_t size, std::string const& filename="");
inline shmain* parse_text(std::string const& in, std::string const& filename="") { return parse_text(in.c_str(), in.size(), filename); }
inline shmain* parse(std::string const& file) { return parse_text(import_file(file), file); }
#endif //PARSE_HPP