Class TokenStack

Extends: System.Object

Public Properties
Count
Gets the number of items in the stack. 

Public Methods
Clear
Removes all tokens from the stack. 
GetEnumerator
Returns an IEnumerator for the tokens on the stack. 
GetToken
Returns the token at the specified position from the top. 
PeekToken
Returns the token on top of the stack. 
PopToken
Pops a token from the stack. 
PopTokensInto
Pops the specified number of tokens from the stack and adds them to the specified Reduction
PushToken
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.
Example
GetToken(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.
Remarks
The 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.