Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(TokenStack) | :: | stack |
type(Token) function TopToken(stack)
class(TokenStack) :: stack
if(stack%top_index > 0) then
TopToken%tokenString = stack%tokens(stack%top_index)%tokenString
TopToken%tokenType = stack%tokens(stack%top_index)%tokenType
TopToken%tokenIndex = stack%tokens(stack%top_index)%tokenIndex
else
TopToken%tokenString = ''
endif
endfunction TopToken