Skip to content

Instantly share code, notes, and snippets.

@stryku
Created March 5, 2017 20:31
Show Gist options
  • Select an option

  • Save stryku/347bf1e61976e2b9cd2fda630dcabdeb to your computer and use it in GitHub Desktop.

Select an option

Save stryku/347bf1e61976e2b9cd2fda630dcabdeb to your computer and use it in GitHub Desktop.
template <typename code>
struct prepare_and_execute
{
using tokens = tokenize<code>;
using extract_labels_result = extract_labels<tokens>;
using tokens_without_labels = typename extract_labels_result::tokens;
using labels_metadata = typename extract_labels_result::labels;
using tokens_after_labels_substitution = substutite_labels<tokens_without_labels, labels_metadata>;
using opcodes = assemble<tokens_after_labels_substitution>;
using machine_state = startup_machine_state;
static constexpr auto ret_val = execute_impl<machine_state, opcodes>::ret_val;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment