Example #1
0
 public DFAStateRecord(Record record)
 {
     if (record.Entries.Count < 5)
         throw new CGTContentException("Invalid number of entries for DFA state");
     byte header = record.Entries[0].ToByteValue();
     if (header != 68) //'D'
         throw new CGTContentException("Invalid DFA state header");
     this.index = record.Entries[1].ToIntValue();
     this.acceptState = record.Entries[2].ToBoolValue();
     this.acceptIndex = record.Entries[3].ToIntValue();
     //skip empty reserved entry
     edgeSubRecords = new EdgeSubRecordCollection(record,5);
 }
        public DFAStateRecord(Record record)
        {
            if (record.Entries.Count < 5)
            {
                throw new CGTContentException("Invalid number of entries for DFA state");
            }
            byte header = record.Entries[0].ToByteValue();

            if (header != 68)             //'D'
            {
                throw new CGTContentException("Invalid DFA state header");
            }
            this.index       = record.Entries[1].ToIntValue();
            this.acceptState = record.Entries[2].ToBoolValue();
            this.acceptIndex = record.Entries[3].ToIntValue();
            //skip empty reserved entry
            edgeSubRecords = new EdgeSubRecordCollection(record, 5);
        }