| 1 | #Region "Microsoft.VisualBasic::350bdfa9f8726bf8e358e4f5ee194d4f, Microsoft.VisualBasic.Core\Scripting\TokenIcer\LangModels\PeekToken.vb" |
| 2 | |
| 3 | ' Author: |
| 4 | ' |
| 5 | ' asuka (amethyst.asuka@gcmodeller.org) |
| 6 | ' xie (genetics@smrucc.org) |
| 7 | ' xieguigang (xie.guigang@live.com) |
| 8 | ' |
| 9 | ' Copyright (c) 2018 GPL3 Licensed |
| 10 | ' |
| 11 | ' |
| 12 | ' GNU GENERAL PUBLIC LICENSE (GPL3) |
| 13 | ' |
| 14 | ' |
| 15 | ' This program is free software: you can redistribute it and/or modify |
| 16 | ' it under the terms of the GNU General Public License as published by |
| 17 | ' the Free Software Foundation, either version 3 of the License, or |
| 18 | ' (at your option) any later version. |
| 19 | ' |
| 20 | ' This program is distributed in the hope that it will be useful, |
| 21 | ' but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 | ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 23 | ' GNU General Public License for more details. |
| 24 | ' |
| 25 | ' You should have received a copy of the GNU General Public License |
| 26 | ' along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 27 | |
| 28 | |
| 29 | |
| 30 | ' /********************************************************************************/ |
| 31 | |
| 32 | ' Summaries: |
| 33 | |
| 34 | ' Class PeekToken |
| 35 | ' |
| 36 | ' Properties: TokenIndex, TokenPeek |
| 37 | ' |
| 38 | ' Constructor: (+1 Overloads) Sub New |
| 39 | ' Function: ToString |
| 40 | ' |
| 41 | ' |
| 42 | ' /********************************************************************************/ |
| 43 | |
| 44 | #End Region |
| 45 | |
| 46 | Namespace Scripting.TokenIcer |
| 47 | |
| 48 | ''' <summary> |
| 49 | ''' A PeekToken object class, This defines the PeekToken object |
| 50 | ''' </summary> |
| 51 | ''' <remarks> |
| 52 | ''' A PeekToken is a special pointer object that can be used to Peek() several |
| 53 | ''' tokens ahead in the GetToken() queue. |
| 54 | ''' </remarks> |
| 55 | Public Class PeekToken(Of Tokens As IComparable) |
| 56 | |
| 57 | Public Property TokenIndex As Integer |
| 58 | Public Property TokenPeek As Token(Of Tokens) |
| 59 | |
| 60 | Public Sub New(index As Integer, value As Token(Of Tokens)) |
| 61 | TokenIndex = index |
| 62 | TokenPeek = value |
| 63 | End Sub |
| 64 | |
| 65 | Public Overrides Function ToString() As String |
| 66 | Return $"[{TokenIndex}] {TokenPeek.ToString}" |
| 67 | End Function |
| 68 | End Class |
| 69 | End Namespace |