Class TokenStack
Extends: System.Object
Public Properties | Gets the number of items in the stack.
|
Public Methods | Removes all tokens from the stack.
|
| Returns an IEnumerator for the tokens on the stack.
|
| Returns the token at the specified position from the top.
|
| Returns the token on top of the stack.
|
| Pops a token from the stack.
|
| Pops the specified number of tokens from the stack and adds them
to the specified Reduction.
|
| Pushes the specified token on the stack.
|
Property Detail
Count
public int Count
{ get; }
Gets the number of items in the stack.
Method Detail
Clear
public void Clear()Removes all tokens from the stack.
GetEnumerator
public System.Collections.IEnumerator GetEnumerator()Returns an IEnumerator for the tokens on the stack.
GetToken
public GoldParser.Token GetToken(int p_index)Returns the token at the specified position from the top.
ExampleGetToken(0) returns the token on top off the stack, GetToken(1)
the next one, etc.
PeekToken
public GoldParser.Token PeekToken()Returns the token on top of the stack.
PopToken
public GoldParser.Token PopToken()Pops a token from the stack.
RemarksThe token on top of the stack will be removed and returned
by the method.
PopTokensInto
public void PopTokensInto(GoldParser.Reduction p_reduction, int p_count)Pops the specified number of tokens from the stack and adds them
to the specified Reduction.
PushToken
public void PushToken(GoldParser.Token p_token)Pushes the specified token on the stack.