|
@ -31,7 +31,10 @@ constexpr size_t architecture_ptr_size = 4; |
|
|
|
|
|
|
|
|
namespace molasses { |
|
|
namespace molasses { |
|
|
std::vector<std::string> operator>>(std::vector<std::string> current_stack, const operation& next_op); |
|
|
std::vector<std::string> operator>>(std::vector<std::string> current_stack, const operation& next_op); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::optional<int32_t> try_parse_int32(const std::string& str); |
|
|
|
|
|
std::optional<int64_t> try_parse_int64(const std::string& str); |
|
|
|
|
|
|
|
|
struct parser_context { |
|
|
struct parser_context { |
|
|
std::vector<std::shared_ptr<type>> types; |
|
|
std::vector<std::shared_ptr<type>> types; |
|
|
std::vector<std::shared_ptr<operation>> operations; |
|
|
std::vector<std::shared_ptr<operation>> operations; |
|
@ -47,8 +50,11 @@ namespace molasses { |
|
|
std::vector<std::shared_ptr<procedure_operation>> procedures; |
|
|
std::vector<std::shared_ptr<procedure_operation>> procedures; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
using success_t = bool; |
|
|
|
|
|
|
|
|
|
|
|
std::tuple<interpreter_stack, generate_context, std::optional<std::shared_ptr<std::runtime_error>>> interpret(interpreter_stack, generate_context, std::string ); |
|
|
|
|
|
|
|
|
std::optional<int32_t> try_parse_int32(const std::string& str); |
|
|
std::optional<int32_t> try_parse_int32(const std::string& str); |
|
|
|
|
|
|
|
|
generate_context parse(parser_context, const lexed_output&); |
|
|
generate_context parse(parser_context, const lexed_output&); |
|
|
std::vector<std::string> generate(const generate_context&); |
|
|
std::vector<std::string> generate(const generate_context&); |
|
|
|
|
|
|
|
|