|
'----------------------------------------------------------------------
' Gold Parser engine.
' See more details on http:'www.devincook.com/goldparser/
'
' Original code is written in VB by Devin Cook (GOLDParser@DevinCook.com)
'
' This translation is done by Vladimir Morozov (vmoroz@hotmail.com)
'
' The translation is based on the other engine translations:
' Delphi engine by Alexandre Rai (riccio@gmx.at)
' C# engine by Marcus Klimstra (klimstra@home.nl)
'----------------------------------------------------------------------
Imports System
Imports System.Collections
Namespace GoldParser
''' <summary>
''' Contains read only collection of LALR states.
''' </summary>
Class LalrStateCollection
Implements IEnumerable
Private m_lalrStateTable() As LalrState
''' <summary>
''' Creates a new instance of <c>LalrStateCollection</c> class.
''' </summary>
''' <param name="lalrStateTable">
''' Array of LALR states to initialize the collection.
''' </param>
Public Sub New(ByVal lalrStateTable() As LalrState)
m_lalrStateTable = lalrStateTable
End Sub
''' <summary>
''' Gets LALR state by its index.
''' </summary>
Default Public ReadOnly Property Item(ByVal index As Integer) As LalrState
Get
Return m_lalrStateTable(index)
End Get
End Property
''' <summary>
''' Gets number of LALR states.
''' </summary>
Public ReadOnly Property Count() As Integer
Get
Return m_lalrStateTable.Length
End Get
End Property
#Region "IEnumerable Members"
''' <summary>
''' Creates a new IEnumerator for the collection.
''' </summary>
''' <returns>New instance of IEnumerator.</returns>
Public Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
Return m_lalrStateTable.GetEnumerator()
End Function
#End Region
End Class
End Namespace
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
Adrian Moore is the Development Manager for the SCADA Vision system developed by ABB Inc in Calgary, Alberta.
He has been interested in compilers, parsers, real-time database systems and peer-to-peer solutions since the early 90's. In his spare time, he is currently working on a SQL parser for querying .NET DataSets (http://www.queryadataset.com).
Adrian is a Microsoft MVP for Windows Networking.