view Implab/Automaton/RegularExpressions/DFAStateDescriptorT.cs @ 173:ecfece82ca11 ref20160224

Working on text scanner
author cin
date Tue, 15 Mar 2016 02:11:06 +0300
parents 92d5278d1b10
children
line wrap: on
line source

using System;

namespace Implab.Automaton.RegularExpressions {
    public struct DFAStateDescriptor<T> {
        public readonly bool final;

        public readonly int[] transitions;

        public readonly T[] tags;

        public DFAStateDescriptor(int size, bool final, T[] tags) {
            Safe.ArgumentAssert(size >= 0, "size");
            this.final = final;
            this.tags = tags;

            transitions = new int[size];

            for (int i = 0; i < size; i++)
                transitions[i] = DFAConst.UNREACHABLE_STATE;
        }
    }
}