14 using System.Collections.Generic;
18 namespace Irony.Interpreter {
21 List<object> _data =
new List<object>(16);
22 object _lastPushedItem;
25 public void Init(
object unassigned) {
26 _unassigned = unassigned;
27 _lastPushedItem = unassigned;
32 get {
return _data.Count;}
34 public object this[
int index] {
35 get {
return _data[_data.Count - 1 - index]; }
38 get {
return _data[_data.Count - 1]; }
44 _data.RemoveAt(_data.Count - 1);
51 if (toCount >= _data.Count)
return;
52 Pop(_data.Count - toCount);
54 public void Push(
object item) {
55 _lastPushedItem = item;
58 public void Replace(
int removeCount,
object item) {
62 public object LastPushedItem {
63 get {
return _lastPushedItem; }
66 return this.GetType().Name +
"(Count=" + Count +
")";
A strongly-typed resource class, for looking up localized strings, etc.
static string ErrInternalErrDataPopFailed
Looks up a localized string similar to Interpreter error, DataStack.Pop() operation failed - stack is...
void Init(object unassigned)
void Replace(int removeCount, object item)
void PopUntil(int toCount)
override string ToString()