-
Notifications
You must be signed in to change notification settings - Fork 1
/
w3StackBase.h
56 lines (46 loc) · 1.43 KB
/
w3StackBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// A WebAssembly codebase by Jay Krell
//
// https://webassembly.github.io/spec/core/binary/index.html
// https://webassembly.github.io/spec/core/_download/WebAssembly.pdf
#pragma once
#include "w3StackBaseBase.h"
#include "w3StackValue.h"
struct w3StackBase : private w3StackBaseBase
{
typedef w3StackBaseBase base;
typedef base::iterator iterator;
w3StackValue& back () { return base::back (); }
w3StackValue& front () { return base::front (); }
iterator begin () { return base::begin (); }
iterator end () { return base::end (); }
bool empty () const { return base::empty (); }
void resize (size_t newsize) { base::resize (newsize); }
size_t size () { return base::size (); }
w3StackValue& operator [ ] (size_t index) { return base::operator [ ] (index); }
void push (const w3StackValue& a)
{ // While ultimately a stack of values, labels, and frames, values dominate,
// so the usage is made convenient for them.
push_back (a);
}
void push_i32(...) // todo
{
}
void push_i64(...) // todo
{
}
void push_f32(...) // todo
{
}
void push_f64(...) // todo
{
}
void pop ()
{
pop_back ();
}
w3StackValue& top ()
{ // While ultimately a stack of values, labels, and frames, values dominate,
// so the usage is made convenient for them.
return back ();
}
};