Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
DfaState.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 //
4 // ----------------------------------------------------------------------
5 // Gold Parser engine.
6 // See more details on http://www.devincook.com/goldparser/
7 //
8 // Original code is written in VB by Devin Cook (GOLDParser@DevinCook.com)
9 //
10 // This translation is done by Vladimir Morozov (vmoroz@hotmail.com)
11 //
12 // The translation is based on the other engine translations:
13 // Delphi engine by Alexandre Rai (riccio@gmx.at)
14 // C# engine by Marcus Klimstra (klimstra@home.nl)
15 // ----------------------------------------------------------------------
16 #region Using directives
17 
18 using System;
19 using System.Collections;
20 
21 #endregion
22 
23 namespace GoldParser
24 {
25  /// <summary>
26  /// State in the Deterministic Finite Automata
27  /// which is used by the tokenizer.
28  /// </summary>
29  internal class DfaState
30  {
31  private int m_index;
32  internal Symbol m_acceptSymbol;
33  internal ObjectMap m_transitionVector;
34 
35  /// <summary>
36  /// Creates a new instance of the <c>DfaState</c> class.
37  /// </summary>
38  /// <param name="index">Index in the DFA state table.</param>
39  /// <param name="acceptSymbol">Symbol to accept.</param>
40  /// <param name="transitionVector">Transition vector.</param>
41  public DfaState(int index, Symbol acceptSymbol, ObjectMap transitionVector)
42  {
43  m_index = index;
44  m_acceptSymbol = acceptSymbol;
45  m_transitionVector = transitionVector;
46  }
47 
48  /// <summary>
49  /// Gets index of the state in DFA state table.
50  /// </summary>
51  public int Index
52  {
53  get { return m_index; }
54  }
55 
56  /// <summary>
57  /// Gets the symbol which can be accepted in this DFA state.
58  /// </summary>
59  public Symbol AcceptSymbol
60  {
61  get { return m_acceptSymbol; }
62  }
63  }
64 }