Class CallStack
Represents the call stack for managing function calls and returns.
Inherited Members
Namespace: VM.Core.Instructions
Assembly: VM.dll
Syntax
public class CallStack
Properties
Count
Gets the number of return addresses on stack
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
IsEmpty
Indicates whether the stack is empty
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
Clear()
Clears all return addresses from the stack
Declaration
public void Clear()
Peek()
Peeks at the top return address without removing it
Declaration
public int Peek()
Returns
Type | Description |
---|---|
int |
Exceptions
Type | Condition |
---|---|
VmStackException | Thrown when stack is empty |
Pop()
Pops a return address from the stack
Declaration
public int Pop()
Returns
Type | Description |
---|---|
int |
Exceptions
Type | Condition |
---|---|
VmStackException | Thrown when stack is empty |
Push(int)
Pushes a return address onto the stack
Declaration
public void Push(int value)
Parameters
Type | Name | Description |
---|---|---|
int | value |
ToString()
Returns string representation of call stack
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |