#pragma once
#include <cstdint>
#include <functional>
#include <iostream>
#include <vector>

struct _vinstr_meta
{
    std::string name;
    bool has_imm;
    std::uintptr_t imm;
};

struct _vlabel_meta
{
    std::string label_name;
    std::vector< _vinstr_meta > vinstrs;
};

using callback_t = std::function< bool( _vlabel_meta * ) >;

// this singleton class contains all the
// information for parsed virtual instructions...
class parse_t
{
  public:
    static auto get_instance() -> parse_t *;
    void add_label( std::string label_name );
    void add_vinstr( std::string vinstr_name );
    void add_vinstr( std::string vinstr_name, std::uintptr_t imm_val );
    bool for_each( callback_t callback );
    std::vector< _vlabel_meta > virt_labels;
  private:
    parse_t();
};